feat(settlement): add receipt handling and detail view for settlements
This commit is contained in:
@@ -40,6 +40,9 @@ class Settlement
|
||||
#[ORM\Column(name: 'admin_note', type: 'string', length: 500, nullable: true)]
|
||||
private ?string $adminNote = null;
|
||||
|
||||
#[ORM\Column(name: 'receipt', type: 'string', length: 500, nullable: true)]
|
||||
private ?string $receipt = null;
|
||||
|
||||
#[ORM\Column(name: 'reviewed_by', type: 'integer', nullable: true)]
|
||||
private ?int $reviewedBy = null;
|
||||
|
||||
@@ -69,6 +72,7 @@ class Settlement
|
||||
public function getStatus(): string { return $this->status; }
|
||||
public function getBankAccount(): ?array { return $this->bankAccount; }
|
||||
public function getAdminNote(): ?string { return $this->adminNote; }
|
||||
public function getReceipt(): ?string { return $this->receipt; }
|
||||
|
||||
public function approve(int $adminUserId, ?string $note = null): self
|
||||
{
|
||||
@@ -90,9 +94,10 @@ class Settlement
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function markPaid(): self
|
||||
public function markPaid(?string $receipt = null): self
|
||||
{
|
||||
$this->status = self::STATUS_PAID;
|
||||
if ($receipt !== null) $this->receipt = $receipt;
|
||||
$this->updatedAt = time();
|
||||
return $this;
|
||||
}
|
||||
@@ -105,6 +110,7 @@ class Settlement
|
||||
'status' => $this->status,
|
||||
'bank_account' => $this->bankAccount,
|
||||
'admin_note' => $this->adminNote,
|
||||
'receipt' => $this->receipt,
|
||||
'reviewed_at' => $this->reviewedAt,
|
||||
'created_at' => $this->createdAt,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user