Add migration to enhance session_payments table with payment_method_uuid and reference fields for split-payment details

This commit is contained in:
hamed
2026-07-23 15:37:58 +03:30
parent 1d1c3d5f30
commit a0a2eb1799
23 changed files with 2257 additions and 1432 deletions
+5 -1
View File
@@ -596,6 +596,8 @@ class PatientService
int $amountRials,
?int $paidAt = null,
?User $actor = null,
?string $paymentMethodUuid = null,
?string $reference = null,
): SessionPayment {
if (!in_array($method, SessionPayment::METHODS, true)) {
throw new AppException(ErrorCodes::ERR_SESSION_PAYMENT_INVALID, null, 422, 'method');
@@ -627,7 +629,9 @@ class PatientService
$payment = new SessionPayment($session, $method, $amountRials, $paidAt);
$payment->setCreatedBy($actor)
->setCreatedByName($this->walletService->resolveActorName($actor));
->setCreatedByName($this->walletService->resolveActorName($actor))
->setPaymentMethodUuid($paymentMethodUuid !== null && $paymentMethodUuid !== '' ? $paymentMethodUuid : null)
->setReference($reference !== null && $reference !== '' ? $reference : null);
$this->sessionPaymentRepo->save($payment);
$session->addPayment($payment);