feat(payment): provider service (#6308)

This commit is contained in:
Frane Polić
2024-02-12 20:57:41 +01:00
committed by GitHub
parent 869dc751a0
commit a6a4b3f01a
21 changed files with 1511 additions and 637 deletions
@@ -43,19 +43,21 @@ export default class PaymentCollection {
})
amount: number
@Property({
columnType: "numeric",
nullable: true,
serializer: optionalNumericSerializer,
})
authorized_amount: number | null = null
// TODO: make this computed properties
@Property({
columnType: "numeric",
nullable: true,
serializer: optionalNumericSerializer,
})
refunded_amount: number | null = null
// @Property({
// columnType: "numeric",
// nullable: true,
// serializer: optionalNumericSerializer,
// })
// authorized_amount: number | null = null
//
// @Property({
// columnType: "numeric",
// nullable: true,
// serializer: optionalNumericSerializer,
// })
// refunded_amount: number | null = null
@Property({ columnType: "text", index: "IDX_payment_collection_region_id" })
region_id: string
@@ -16,7 +16,7 @@ import Payment from "./payment"
@Entity({ tableName: "payment_session" })
export default class PaymentSession {
[OptionalProps]?: "status"
[OptionalProps]?: "status" | "data"
@PrimaryKey({ columnType: "text" })
id: string
@@ -33,8 +33,8 @@ export default class PaymentSession {
@Property({ columnType: "text" })
provider_id: string
@Property({ columnType: "jsonb", nullable: true })
data: Record<string, unknown> | null = null
@Property({ columnType: "jsonb" })
data: Record<string, unknown> = {}
@Enum({
items: () => PaymentSessionStatus,