feat(payment): update payment collection status (#7335)

This commit is contained in:
Carlos R. L. Rodrigues
2024-05-15 12:11:40 -03:00
committed by GitHub
parent 774696845c
commit 7c4f4d7388
8 changed files with 384 additions and 33 deletions

View File

@@ -43,6 +43,24 @@ export default class PaymentCollection {
@Property({ columnType: "jsonb" })
raw_amount: BigNumberRawValue
@MikroOrmBigNumberProperty({ nullable: true })
authorized_amount: BigNumber | number | null = null
@Property({ columnType: "jsonb", nullable: true })
raw_authorized_amount: BigNumberRawValue | null = null
@MikroOrmBigNumberProperty({ nullable: true })
captured_amount: BigNumber | number | null = null
@Property({ columnType: "jsonb", nullable: true })
raw_captured_amount: BigNumberRawValue | null = null
@MikroOrmBigNumberProperty({ nullable: true })
refunded_amount: BigNumber | number | null = null
@Property({ columnType: "jsonb", nullable: true })
raw_refunded_amount: BigNumberRawValue | null = null
@Property({ columnType: "text", index: "IDX_payment_collection_region_id" })
region_id: string

View File

@@ -131,13 +131,6 @@ export default class Payment {
})
payment_session: PaymentSession
/** COMPUTED PROPERTIES START **/
captured_amount: number // sum of the associated captures
refunded_amount: number // sum of the associated refunds
/** COMPUTED PROPERTIES END **/
@BeforeCreate()
onCreate() {
this.id = generateEntityId(this.id, "pay")