feat(payment): PaymentCollection CRUD (#6124)

This commit is contained in:
Frane Polić
2024-01-22 11:04:46 +01:00
committed by GitHub
parent 3f41d818b6
commit d47e946496
11 changed files with 606 additions and 10 deletions
+28
View File
@@ -3,6 +3,34 @@ import { OperatorMap } from "../dal/utils"
/* ********** PAYMENT COLLECTION ********** */
/**
* @enum
*
* The payment collection's status.
*/
export enum PaymentCollectionStatus {
/**
* The payment collection isn't paid.
*/
NOT_PAID = "not_paid",
/**
* The payment collection is awaiting payment.
*/
AWAITING = "awaiting",
/**
* The payment collection is authorized.
*/
AUTHORIZED = "authorized",
/**
* Some of the payments in the payment collection are authorized.
*/
PARTIALLY_AUTHORIZED = "partially_authorized",
/**
* The payment collection is canceled.
*/
CANCELED = "canceled",
}
export interface PaymentCollectionDTO {
/**
* The ID of the Payment Collection
+22 -4
View File
@@ -1,15 +1,29 @@
/**
* TODO
*/
import { PaymentCollectionStatus } from "./common"
/**
* Payment Collection
*/
export interface CreatePaymentCollectionDTO {
region_id: string
currency_code: string
amount: number
metadata?: Record<string, unknown>
}
export interface UpdatePaymentCollectionDTO
extends Partial<CreatePaymentCollectionDTO> {}
extends Partial<CreatePaymentCollectionDTO> {
id: string
authorized_amount?: number
refunded_amount?: number
completed_at?: number
status?: PaymentCollectionStatus
}
/**
* Payment
*/
export interface CreatePaymentDTO {
amount: number
@@ -30,6 +44,10 @@ export interface UpdatePaymentDTO {
customer_id?: string
}
/**
* Payment Session
*/
export interface CreatePaymentSessionDTO {
amount: number
currency_code: string