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