feat : add slipok and switcher to switch between slip2go and slipok
CI / Verify (push) Successful in 1m56s
CI / Build immutable images and deploy (push) Successful in 3m26s

This commit is contained in:
2026-10-10 00:31:12 +07:00 Unverified
parent 4e2de1a89c
commit 7ba513c2bb
18 changed files with 5722 additions and 10 deletions
+4 -1
View File
@@ -170,8 +170,9 @@ export const commissionSettings = commissionSchema.table("settings", {
id: integer("id").primaryKey(),
isOpen: boolean("is_open").default(true).notNull(),
closureMessage: text("closure_message").default("").notNull(),
slipProvider: varchar("slip_provider", { length: 16 }).$type<"slip2go" | "slipok">().default("slip2go").notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
});
}, (table) => [check("commission_settings_slip_provider_check", sql`${table.slipProvider} in ('slip2go', 'slipok')`)]);
export const commissionTickets = commissionSchema.table("ticket", {
id: uuid("id").defaultRandom().primaryKey(),
@@ -191,6 +192,7 @@ export const commissionPayments = commissionSchema.table("payment", {
id: uuid("id").defaultRandom().primaryKey(),
checkoutId: uuid("checkout_id").notNull().references(() => commissionCheckouts.id),
ticketId: uuid("ticket_id").notNull().references(() => commissionTickets.id),
provider: varchar("provider", { length: 16 }).$type<"slip2go" | "slipok">().default("slip2go").notNull(),
referenceId: text("reference_id").notNull(),
transRef: text("trans_ref").notNull(),
amountBaht: integer("amount_baht").notNull(),
@@ -200,6 +202,7 @@ export const commissionPayments = commissionSchema.table("payment", {
providerData: jsonb("provider_data").$type<Record<string, unknown>>().notNull(),
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
}, (table) => [
check("commission_payment_provider_check", sql`${table.provider} in ('slip2go', 'slipok')`),
uniqueIndex("commission_payment_checkout_unique").on(table.checkoutId),
uniqueIndex("commission_payment_reference_unique").on(table.referenceId),
uniqueIndex("commission_payment_trans_ref_unique").on(table.transRef),