fix: missing files
This commit is contained in:
7
.changeset/wicked-months-greet.md
Normal file
7
.changeset/wicked-months-greet.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@medusajs/modules-sdk": patch
|
||||
"@medusajs/payment": patch
|
||||
"@medusajs/types": patch
|
||||
---
|
||||
|
||||
feat: add Payment module package
|
||||
@@ -3,4 +3,4 @@ if (typeof process.env.DB_TEMP_NAME === "undefined") {
|
||||
process.env.DB_TEMP_NAME = `medusa-payment-integration-${tempName}`
|
||||
}
|
||||
|
||||
process.env.MEDUSA_CART_DB_SCHEMA = "public"
|
||||
process.env.MEDUSA_PAYMENT_DB_SCHEMA = "public"
|
||||
|
||||
40
packages/payment/src/models/payment.ts
Normal file
40
packages/payment/src/models/payment.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import {
|
||||
BeforeCreate,
|
||||
Entity,
|
||||
OnInit,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
} from "@mikro-orm/core"
|
||||
|
||||
import { generateEntityId } from "@medusajs/utils"
|
||||
|
||||
@Entity({ tableName: "payment" })
|
||||
export default class Payment {
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
id: string
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
columnType: "timestamptz",
|
||||
defaultRaw: "now()",
|
||||
})
|
||||
created_at: Date
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
onUpdate: () => new Date(),
|
||||
columnType: "timestamptz",
|
||||
defaultRaw: "now()",
|
||||
})
|
||||
updated_at: Date
|
||||
|
||||
@BeforeCreate()
|
||||
onCreate() {
|
||||
this.id = generateEntityId(this.id, "pay")
|
||||
}
|
||||
|
||||
@OnInit()
|
||||
onInit() {
|
||||
this.id = generateEntityId(this.id, "pay")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user