MVP for API Key authentication

This commit is contained in:
ian
2025-12-03 14:51:59 +07:00
parent 9413c442df
commit 347e0192e2
17 changed files with 733 additions and 49 deletions
+15
View File
@@ -0,0 +1,15 @@
// db/schema.ts
import { pgTable, varchar, timestamp, primaryKey } from 'drizzle-orm/pg-core'
import merchants from './merchants'
export const merchantNonces = pgTable('merchant_nonces', {
merchantId: varchar('merchant_id', { length: 64 })
.notNull()
.references(() => merchants.merchantId, { onDelete: 'cascade' }),
nonce: varchar('nonce', { length: 128 }).notNull(),
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
}, (t) => [
primaryKey({ columns: [t.merchantId, t.nonce] }),
])
export default merchantNonces