feat(pricing): pricing uses big number (#7075)

what:

- pricing model price#amount uses big number.

blocker:

- upsertWithReplace decoration fix
This commit is contained in:
Riqwan Thamir
2024-04-17 15:57:41 +00:00
committed by GitHub
parent 8d356217bd
commit 2a835cae13
3 changed files with 172 additions and 54 deletions
+7 -2
View File
@@ -1,8 +1,10 @@
import { DAL } from "@medusajs/types"
import {
BigNumber,
createPsqlIndexStatementHelper,
DALUtils,
generateEntityId,
MikroOrmBigNumberProperty,
} from "@medusajs/utils"
import {
BeforeCreate,
@@ -63,8 +65,11 @@ export default class Price {
@Property({ columnType: "text" })
currency_code: string
@Property({ columnType: "numeric", serializer: Number })
amount: number
@MikroOrmBigNumberProperty()
amount: BigNumber | number
@Property({ columnType: "jsonb" })
raw_amount: Record<string, unknown>
@Property({ columnType: "numeric", nullable: true })
min_quantity: number | null = null