Spaces:
Sleeping
Sleeping
Download src/libs/shared/infrastructure/postgres/schema/refunds.ts from fouadkhalid123/asd: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/infrastructure/postgres/schema/refunds.ts
- Command line
-
hf download hf://spaces/fouadkhalid123/asd/src/libs/shared/infrastructure/postgres/schema/refunds.ts
-
curl -L -o refunds.ts https://huggingface.co/spaces/fouadkhalid123/asd/resolve/main/src/libs/shared/infrastructure/postgres/schema/refunds.ts
1.06 kB
| import { pgTable, uuid, text, jsonb, timestamp, numeric, index, unique } from "drizzle-orm/pg-core"; | |
| import { stores } from "../../../../../modules/shopify/infrastructure/postgres/schema/stores"; | |
| import { orders } from "./orders"; | |
| export const refunds = pgTable("refunds", { | |
| id: uuid("id").primaryKey().defaultRandom(), | |
| storeId: uuid("store_id").notNull().references(() => stores.id, { onDelete: "cascade" }), | |
| orderId: uuid("order_id").notNull().references(() => orders.id, { onDelete: "cascade" }), | |
| shopifyId: text("shopify_id").notNull(), | |
| totalRefunded: numeric("total_refunded", { precision: 15, scale: 2 }).notNull(), | |
| currency: text("currency"), | |
| data: jsonb("data").notNull(), | |
| shopifyCreatedAt: timestamp("shopify_created_at"), | |
| createdAt: timestamp("created_at").defaultNow().notNull(), | |
| }, (t) => ({ | |
| storeIdx: index("idx_refunds_store").on(t.storeId), | |
| orderIdx: index("idx_refunds_order").on(t.orderId), | |
| })); | |
| export type Refund = typeof refunds.$inferSelect; | |
| export type NewRefund = typeof refunds.$inferInsert; | |