fix: serializer
This commit is contained in:
@@ -17,6 +17,7 @@ import { DAL } from "@medusajs/types"
|
||||
import {
|
||||
DALUtils,
|
||||
generateEntityId,
|
||||
optionalNumericSerializer,
|
||||
PaymentCollectionStatus,
|
||||
} from "@medusajs/utils"
|
||||
import PaymentProvider from "./payment-provider"
|
||||
@@ -45,14 +46,14 @@ export default class PaymentCollection {
|
||||
@Property({
|
||||
columnType: "numeric",
|
||||
nullable: true,
|
||||
serializer: Number,
|
||||
serializer: optionalNumericSerializer,
|
||||
})
|
||||
authorized_amount?: number | null
|
||||
|
||||
@Property({
|
||||
columnType: "numeric",
|
||||
nullable: true,
|
||||
serializer: Number,
|
||||
serializer: optionalNumericSerializer,
|
||||
})
|
||||
refunded_amount?: number | null
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ export default class PaymentMethodToken {
|
||||
|
||||
@BeforeCreate()
|
||||
onCreate() {
|
||||
this.id = generateEntityId(this.id, "paymt")
|
||||
this.id = generateEntityId(this.id, "paymttok")
|
||||
}
|
||||
|
||||
@OnInit()
|
||||
onInit() {
|
||||
this.id = generateEntityId(this.id, "paymt")
|
||||
this.id = generateEntityId(this.id, "paymttok")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,11 @@ import {
|
||||
} from "@mikro-orm/core"
|
||||
import { DAL } from "@medusajs/types"
|
||||
|
||||
import { DALUtils, generateEntityId } from "@medusajs/utils"
|
||||
import {
|
||||
DALUtils,
|
||||
generateEntityId,
|
||||
optionalNumericSerializer,
|
||||
} from "@medusajs/utils"
|
||||
import Refund from "./refund"
|
||||
import Capture from "./capture"
|
||||
import PaymentSession from "./payment-session"
|
||||
@@ -39,7 +43,7 @@ export default class Payment {
|
||||
@Property({
|
||||
columnType: "numeric",
|
||||
nullable: true,
|
||||
serializer: Number,
|
||||
serializer: optionalNumericSerializer,
|
||||
})
|
||||
authorized_amount?: number | null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user