This commit is contained in:
admin
2026-09-03 22:02:52 +09:00
commit 659725de15
90 changed files with 2840 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
{
"name": "@orderops/shared",
"version": "0.0.0",
"type": "module",
"exports": {
".": "./src/index.ts",
"./*": "./src/*.ts"
}
}
+9
View File
@@ -0,0 +1,9 @@
export interface Address {
fullName: string;
line1: string;
line2: string | null;
city: string;
state: string;
postalCode: string;
country: string;
}
+8
View File
@@ -0,0 +1,8 @@
export interface AuditEvent {
id: string;
orderId: string;
type: string;
message: string;
createdAt: string;
actor: string;
}
+8
View File
@@ -0,0 +1,8 @@
import type { UserRole } from "./user-role";
export interface AuthUser {
id: string;
username: string;
name: string;
role: UserRole;
}
+5
View File
@@ -0,0 +1,5 @@
export interface CustomerSummary {
id: string;
name: string;
email: string;
}
+9
View File
@@ -0,0 +1,9 @@
export * from "./address";
export * from "./audit-event";
export * from "./auth-user";
export * from "./customer";
export * from "./money";
export * from "./order-detail";
export * from "./order-status";
export * from "./order-summary";
export * from "./user-role";
+4
View File
@@ -0,0 +1,4 @@
export interface Money {
amountCents: number;
currency: "USD";
}
+25
View File
@@ -0,0 +1,25 @@
import type { Address } from "./address";
import type { CustomerSummary } from "./customer";
import type { Money } from "./money";
import type { OrderStatus } from "./order-status";
export interface OrderItemDetail {
id: string;
productId: string;
sku: string;
productName: string;
quantity: number;
unitPrice: Money;
availableQuantity: number;
}
export interface OrderDetail {
id: string;
orderNumber: string;
status: OrderStatus;
createdAt: string;
updatedAt: string;
customer: CustomerSummary;
shippingAddress: Address;
items: OrderItemDetail[];
}
+3
View File
@@ -0,0 +1,3 @@
export const orderStatuses = ["pending", "processing", "shipped", "cancelled", "refunded"] as const;
export type OrderStatus = (typeof orderStatuses)[number];
+11
View File
@@ -0,0 +1,11 @@
import type { CustomerSummary } from "./customer";
import type { OrderStatus } from "./order-status";
export interface OrderSummary {
id: string;
orderNumber: string;
status: OrderStatus;
customer: CustomerSummary;
itemCount: number;
createdAt: string;
}
+3
View File
@@ -0,0 +1,3 @@
export const userRoles = ["customer", "employee"] as const;
export type UserRole = (typeof userRoles)[number];
+7
View File
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": []
},
"include": ["src/**/*.ts"]
}