Spaces:
Sleeping
Sleeping
Download src/libs/shared/infrastructure/postgres/schema/webhookEvents.ts from fouadkhalid123/asd: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/infrastructure/postgres/schema/webhookEvents.ts
- Command line
-
hf download hf://spaces/fouadkhalid123/asd/src/libs/shared/infrastructure/postgres/schema/webhookEvents.ts
-
curl -L -o webhookEvents.ts https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/infrastructure/postgres/schema/webhookEvents.ts
1.05 kB
| import { pgTable, uuid, text, jsonb, timestamp, index } from "drizzle-orm/pg-core"; | |
| import { stores } from "../../../../../modules/shopify/infrastructure/postgres/schema/stores"; | |
| export const webhookEvents = pgTable("webhook_events", { | |
| id: uuid("id").primaryKey().defaultRandom(), | |
| storeId: uuid("store_id").notNull().references(() => stores.id, { onDelete: "cascade" }), | |
| topic: text("topic").notNull(), | |
| externalId: text("external_id").notNull(), | |
| payload: jsonb("payload").notNull(), | |
| status: text("status").notNull().default("pending"), // pending | processed | failed | |
| error: text("error"), | |
| processedAt: timestamp("processed_at"), | |
| createdAt: timestamp("created_at").defaultNow().notNull(), | |
| }, (t) => ({ | |
| storeIdx: index("idx_webhooks_store").on(t.storeId), | |
| topicIdx: index("idx_webhooks_topic").on(t.topic), | |
| extIdx: index("idx_webhooks_external").on(t.externalId), | |
| })); | |
| export type WebhookEvent = typeof webhookEvents.$inferSelect; | |
| export type NewWebhookEvent = typeof webhookEvents.$inferInsert; | |