perf: 移除秒杀相关功能

This commit is contained in:
richarjiang
2026-09-10 11:33:19 +08:00
parent 51dea488f6
commit 57edd8dcc0
32 changed files with 131 additions and 2880 deletions

View File

@@ -46,19 +46,6 @@ export enum OrderStatus {
REFUNDED = 'REFUNDED',
}
// ===== FlashSale =====
export enum FlashSaleStatus {
DRAFT = 'DRAFT',
ACTIVE = 'ACTIVE',
ENDED = 'ENDED',
}
export enum FlashSaleOrderStatus {
RESERVED = 'RESERVED',
PAID = 'PAID',
EXPIRED = 'EXPIRED',
}
// ===== Invite =====
export enum InviteReferralStatus {
REGISTERED = 'REGISTERED',

View File

@@ -7,8 +7,6 @@ export {
TimeSlotSource,
BookingStatus,
OrderStatus,
FlashSaleStatus,
FlashSaleOrderStatus,
InviteReferralStatus,
SubscriptionMessageScene,
} from './enums'
@@ -104,13 +102,6 @@ export type {
PaginatedData,
PaginatedResponse,
PaginationQuery,
FlashSale,
FlashSaleListItem,
FlashSaleDetail,
FlashSaleAdminItem,
CreateFlashSaleDto,
UpdateFlashSaleDto,
FlashSalePurchaseResponse,
InviteActivityReferral,
InviteRewardGrantRecord,
InviteActivitySummary,
@@ -122,6 +113,4 @@ export type {
SubscriptionMessageConsentSummary,
} from './types/index'
export { FlashSalePhase } from './types/index'
export * from './types/member-care'

View File

@@ -1,97 +0,0 @@
import { FlashSaleStatus, FlashSaleOrderStatus, CardTypeCategory } from '../enums'
// ── Computed sale phase (derived from server time) ──────────
export enum FlashSalePhase {
UPCOMING = 'UPCOMING',
ONGOING = 'ONGOING',
SOLD_OUT = 'SOLD_OUT',
ENDED = 'ENDED',
}
// ── Core entity ─────────────────────────────────────────────
export interface FlashSale {
readonly id: string
readonly cardTypeId: string
readonly title: string
readonly originalPrice: number
readonly flashPrice: number
readonly totalStock: number
readonly soldCount: number
readonly startTime: string
readonly endTime: string
readonly status: FlashSaleStatus
readonly description: string | null
readonly sortOrder: number
readonly createdAt: string
readonly updatedAt: string
}
// ── User-facing list item (home page) ───────────────────────
export interface FlashSaleListItem extends FlashSale {
readonly phase: FlashSalePhase
readonly remainingStock: number
readonly cardType: {
readonly name: string
readonly type: CardTypeCategory
readonly totalTimes: number | null
readonly durationDays: number
}
}
// ── Detail (includes user participation status) ─────────────
export interface FlashSaleDetail extends FlashSaleListItem {
readonly hasParticipated: boolean
readonly userOrderStatus: FlashSaleOrderStatus | null
readonly serverTime: string
}
// ── Admin DTOs ──────────────────────────────────────────────
export interface CreateFlashSaleDto {
readonly cardTypeId: string
readonly title: string
readonly originalPrice: number
readonly flashPrice: number
readonly totalStock: number
readonly startTime: string
readonly endTime: string
readonly description?: string
readonly sortOrder?: number
}
export interface UpdateFlashSaleDto {
readonly title?: string
readonly originalPrice?: number
readonly flashPrice?: number
readonly totalStock?: number
readonly startTime?: string
readonly endTime?: string
readonly description?: string
readonly status?: FlashSaleStatus
readonly sortOrder?: number
}
// ── Purchase response ───────────────────────────────────────
export interface FlashSalePurchaseResponse {
readonly flashSaleOrderId: string
readonly order: {
readonly id: string
readonly orderNo: string
readonly amount: number
}
readonly paymentParams: {
readonly timeStamp: string
readonly nonceStr: string
readonly package: string
readonly signType: string
readonly paySign: string
}
}
// ── Admin list item ─────────────────────────────────────────
export interface FlashSaleAdminItem extends FlashSale {
readonly phase: FlashSalePhase
readonly cardType: {
readonly name: string
readonly type: CardTypeCategory
}
}

View File

@@ -44,20 +44,10 @@ export type {
StudioUploadCredential,
} from './studio'
export type { ApiResponse, PaginatedData, PaginatedResponse, PaginationQuery } from './api'
export type {
FlashSale,
FlashSaleListItem,
FlashSaleDetail,
FlashSaleAdminItem,
CreateFlashSaleDto,
UpdateFlashSaleDto,
FlashSalePurchaseResponse,
} from './flash-sale'
export type {
InviteActivityReferral,
InviteRewardGrantRecord,
InviteActivitySummary,
} from './invite'
export { FlashSalePhase } from './flash-sale'
export type { TeachingAnalytics, TeachingAnalyticsRecord, TeachingAnalyticsSummary } from './teaching-analytics'