Initial commit: backend, storefront, vendor-panel added
This commit is contained in:
10
backend/packages/modules/split-order-payment/src/index.ts
Normal file
10
backend/packages/modules/split-order-payment/src/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Module } from "@medusajs/framework/utils";
|
||||
|
||||
import SplitOrderPaymentModuleService from "./service";
|
||||
|
||||
export const SPLIT_ORDER_PAYMENT_MODULE = "split_order_payment";
|
||||
export { SplitOrderPaymentModuleService };
|
||||
|
||||
export default Module(SPLIT_ORDER_PAYMENT_MODULE, {
|
||||
service: SplitOrderPaymentModuleService,
|
||||
});
|
||||
@@ -0,0 +1,161 @@
|
||||
{
|
||||
"namespaces": [
|
||||
"public"
|
||||
],
|
||||
"name": "public",
|
||||
"tables": [
|
||||
{
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"status": {
|
||||
"name": "status",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"currency_code": {
|
||||
"name": "currency_code",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"authorized_amount": {
|
||||
"name": "authorized_amount",
|
||||
"type": "numeric",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "decimal"
|
||||
},
|
||||
"captured_amount": {
|
||||
"name": "captured_amount",
|
||||
"type": "numeric",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "decimal"
|
||||
},
|
||||
"refunded_amount": {
|
||||
"name": "refunded_amount",
|
||||
"type": "numeric",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "decimal"
|
||||
},
|
||||
"payment_collection_id": {
|
||||
"name": "payment_collection_id",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"raw_authorized_amount": {
|
||||
"name": "raw_authorized_amount",
|
||||
"type": "jsonb",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "json"
|
||||
},
|
||||
"raw_captured_amount": {
|
||||
"name": "raw_captured_amount",
|
||||
"type": "jsonb",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "json"
|
||||
},
|
||||
"raw_refunded_amount": {
|
||||
"name": "raw_refunded_amount",
|
||||
"type": "jsonb",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"mappedType": "json"
|
||||
},
|
||||
"created_at": {
|
||||
"name": "created_at",
|
||||
"type": "timestamptz",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"length": 6,
|
||||
"default": "now()",
|
||||
"mappedType": "datetime"
|
||||
},
|
||||
"updated_at": {
|
||||
"name": "updated_at",
|
||||
"type": "timestamptz",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"length": 6,
|
||||
"default": "now()",
|
||||
"mappedType": "datetime"
|
||||
},
|
||||
"deleted_at": {
|
||||
"name": "deleted_at",
|
||||
"type": "timestamptz",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"length": 6,
|
||||
"mappedType": "datetime"
|
||||
}
|
||||
},
|
||||
"name": "split_order_payment",
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "IDX_split_order_payment_deleted_at",
|
||||
"columnNames": [],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_split_order_payment_deleted_at\" ON \"split_order_payment\" (deleted_at) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "split_order_payment_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"composite": false,
|
||||
"constraint": true,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
}
|
||||
],
|
||||
"checks": [],
|
||||
"foreignKeys": {},
|
||||
"nativeEnums": {}
|
||||
}
|
||||
],
|
||||
"nativeEnums": {}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Migration } from '@mikro-orm/migrations';
|
||||
|
||||
export class Migration20250516075429 extends Migration {
|
||||
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(`create table if not exists "split_order_payment" ("id" text not null, "status" text not null, "currency_code" text not null, "authorized_amount" numeric not null, "captured_amount" numeric not null, "refunded_amount" numeric not null, "payment_collection_id" text not null, "raw_authorized_amount" jsonb not null, "raw_captured_amount" jsonb not null, "raw_refunded_amount" jsonb not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "split_order_payment_pkey" primary key ("id"));`);
|
||||
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_split_order_payment_deleted_at" ON "split_order_payment" (deleted_at) WHERE deleted_at IS NULL;`);
|
||||
}
|
||||
|
||||
override async down(): Promise<void> {
|
||||
this.addSql(`drop table if exists "split_order_payment" cascade;`);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import { model } from '@medusajs/framework/utils'
|
||||
|
||||
export const SplitOrderPayment = model.define('split_order_payment', {
|
||||
id: model.id({ prefix: 'sp_ord_pay' }).primaryKey(),
|
||||
status: model.text(),
|
||||
currency_code: model.text(),
|
||||
authorized_amount: model.bigNumber(),
|
||||
captured_amount: model.bigNumber().default(0),
|
||||
refunded_amount: model.bigNumber().default(0),
|
||||
payment_collection_id: model.text()
|
||||
})
|
||||
@@ -0,0 +1,9 @@
|
||||
import { MedusaService } from '@medusajs/framework/utils'
|
||||
|
||||
import { SplitOrderPayment } from './models/split-order-payment'
|
||||
|
||||
class SplitOrderPaymentModuleService extends MedusaService({
|
||||
SplitOrderPayment
|
||||
}) {}
|
||||
|
||||
export default SplitOrderPaymentModuleService
|
||||
Reference in New Issue
Block a user