feat: 支持商品管理
This commit is contained in:
@@ -138,3 +138,5 @@ export type {
|
||||
|
||||
export * from './types/member-care'
|
||||
export * from './types/body-portrait'
|
||||
|
||||
export * from './types/shop'
|
||||
|
||||
53
packages/shared/src/types/shop.ts
Normal file
53
packages/shared/src/types/shop.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/** All money values are integer fen. Stock excludes pending reservations. */
|
||||
export interface ShopProduct {
|
||||
id: string
|
||||
title: string
|
||||
description: string
|
||||
coverUrl: string
|
||||
price: number
|
||||
stock: number
|
||||
sold: number
|
||||
isActive: boolean
|
||||
sortOrder: number
|
||||
version: number
|
||||
}
|
||||
export type ShopOrderStatus = 'PENDING' | 'PAID' | 'COMPLETED' | 'CANCELLED'
|
||||
export interface ShopOrder {
|
||||
id: string
|
||||
orderNo: string
|
||||
productId: string
|
||||
title: string
|
||||
coverUrl: string
|
||||
unitPrice: number
|
||||
quantity: number
|
||||
amount: number
|
||||
contactName: string
|
||||
contactPhone: string
|
||||
status: ShopOrderStatus
|
||||
pickupCode: string
|
||||
expiresAt: string
|
||||
createdAt: string
|
||||
paidAt: string | null
|
||||
completedAt: string | null
|
||||
}
|
||||
export interface ShopPage<T> {
|
||||
items: T[]
|
||||
total: number
|
||||
page: number
|
||||
limit: number
|
||||
}
|
||||
export interface ShopSummary {
|
||||
revenue: number
|
||||
quantity: number
|
||||
orders: number
|
||||
pendingPickup: number
|
||||
activeProducts: number
|
||||
lowStock: number
|
||||
}
|
||||
export interface ShopStockChange {
|
||||
id: string
|
||||
delta: number
|
||||
reason: string
|
||||
operatorId: string
|
||||
createdAt: string
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export interface StudioConfig {
|
||||
readonly updatedAt: string
|
||||
}
|
||||
|
||||
export type StudioAssetType = 'gallery' | 'logo' | 'banner' | 'card-cover'
|
||||
export type StudioAssetType = 'gallery' | 'logo' | 'banner' | 'product-cover' | 'card-cover'
|
||||
|
||||
export interface UpdateStudioConfigDto {
|
||||
readonly name?: string
|
||||
|
||||
Reference in New Issue
Block a user