fix: missing files

This commit is contained in:
fPolic
2024-01-11 11:35:01 +01:00
parent 824bcce3dd
commit c9f1858649
3 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
---
"@medusajs/modules-sdk": patch
"@medusajs/payment": patch
"@medusajs/types": patch
---
feat: add Payment module package

View File

@@ -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"

View 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")
}
}