summaryrefslogtreecommitdiff
path: root/db/schema/SOAP/soap.ts
blob: 7a16b50a2cd4429042275336fd1fdbc40563586f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { serial, varchar, timestamp, text, boolean } from "drizzle-orm/pg-core";
import { pgSchema } from "drizzle-orm/pg-core";

export const soapSchema = pgSchema("soap");

export const soapLogs = soapSchema.table("soap_logs", {
  id: serial().primaryKey(),
  direction: varchar({ length: 20 }).notNull(),
  system: varchar({ length: 50 }).notNull(),
  interface: varchar({ length: 100 }).notNull(),
  startedAt: timestamp().notNull(),
  endedAt: timestamp(),
  isSuccess: boolean().default(false).notNull(),
  requestData: text(),
  responseData: text(),
  errorMessage: text(),
});

export type LogDirection = 'INBOUND' | 'OUTBOUND';

export type SoapLogInsert = typeof soapLogs.$inferInsert;
export type SoapLogSelect = typeof soapLogs.$inferSelect;