This commit is contained in:
marshal
2026-06-14 15:59:52 +03:00
parent c03d0ef3ab
commit 484151d909
25 changed files with 1097 additions and 2952 deletions

View File

@@ -5,6 +5,7 @@ import { assertBookingStatus } from './booking-status.util';
import { InAppPaymentReceiptDto } from './dto/pay-booking.dto';
import { PaymentService } from '../payment/payment.service';
import { PaymentStatus } from '../payment/entities/payment.entity';
import { PaymentMethodTypeEnum } from '../payment/payments.dto';
export interface InAppPaymentReceipt extends InAppPaymentReceiptDto { }
const NON_TERMINAL_STATUSES: PaymentStatus[] = [
@@ -34,11 +35,15 @@ export class BookingPaymentService {
}
}
const resp = await this.paymentService.initBookingTelebirr(bookingId, "web");
const resp = await this.paymentService.initiatePayment({
bookingId,
method: PaymentMethodTypeEnum.TELEBIRR,
platform: "web",
});
const action = resp.clientAction as { type?: string; url?: string } | undefined;
return {
redirectUrl:
resp.redirectUrl ?? "",
redirectUrl: action?.type === "REDIRECT" ? (action.url ?? "") : "",
};
}

View File

@@ -272,6 +272,7 @@ export class Booking extends BaseEntity {
@Column({ name: 'hold_expires_at', type: 'timestamptz', nullable: true })
holdExpiresAt?: Date | null;
@Column({ name: 'scheduled_at', type: 'timestamptz', nullable: true })
scheduledAt?: Date | null;