alepha
Version:
Easy-to-use modern TypeScript framework for building many kind of applications.
23 lines (20 loc) • 671 B
text/typescript
import { type Static, z } from "alepha";
import { $entity, db } from "alepha/orm";
export const refunds = $entity({
name: "refunds",
schema: z.object({
id: db.primaryKey(z.uuid()),
version: db.version(),
createdAt: db.createdAt(),
updatedAt: db.updatedAt(),
organizationId: db.organization(),
intentId: z.uuid(),
amount: z.integer(),
currency: z.text({ size: "short" }),
status: z.enum(["pending", "processing", "completed", "failed"]),
reason: z.text().optional(),
providerRef: z.text().optional(),
}),
indexes: ["intentId", "organizationId", "status"],
});
export type RefundEntity = Static<typeof refunds.schema>;