<?php

namespace App\Billing\Contract;

final readonly class ClaimSubmissionResult
{
    public function __construct(
        public bool $success,
        public ?string $referenceCode = null,
        public ?string $errorMessage = null,
    ) {}

    public static function ok(?string $referenceCode = null): self
    {
        return new self(true, $referenceCode, null);
    }

    public static function fail(string $errorMessage): self
    {
        return new self(false, null, $errorMessage);
    }
}
