simple-kiosk-app/lib/types.ts

34 lines
791 B
TypeScript
Raw Permalink Normal View History

2024-04-20 19:58:18 +09:00
import {
ColumnType,
Generated,
Insertable,
JSONColumnType,
Selectable,
Updateable
} from 'kysely';
import { Order } from "@/hooks/useOrder";
export interface OrderState {
id: string;
orders: JSONColumnType<Order[]>;
completed: 0 | 1;
payment: string;
}
export type NewOrderState = Insertable<OrderState>;
export type OrderStateColumns = Selectable<OrderState>;
export type OrderStateUpdate = Updateable<OrderState>;
export interface OrderNumber {
id: string;
number: number;
}
export type NewOrderNumber = Insertable<OrderNumber>;
export type OrderNumberColumns = Selectable<OrderNumber>;
export type OrderNumberUpdate = Updateable<OrderNumber>;
export interface Database {
Order_State: OrderState;
Order_Number: OrderNumber;
}