feat: 完善课程订阅

This commit is contained in:
richarjiang
2026-04-06 08:38:05 +08:00
parent f71ff968ad
commit 3a9982209f
21 changed files with 2301 additions and 94 deletions

View File

@@ -36,6 +36,7 @@ var TimeSlotSource;
// ===== Booking =====
var BookingStatus;
(function (BookingStatus) {
BookingStatus["PENDING_CONFIRMATION"] = "PENDING_CONFIRMATION";
BookingStatus["CONFIRMED"] = "CONFIRMED";
BookingStatus["CANCELLED"] = "CANCELLED";
BookingStatus["COMPLETED"] = "COMPLETED";

View File

@@ -1 +1 @@
{"version":3,"file":"enums.js","sourceRoot":"","sources":["enums.ts"],"names":[],"mappings":";;;AAAA,mBAAmB;AACnB,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,2BAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED,uBAAuB;AACvB,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,yCAAqB,CAAA;IACrB,mCAAe,CAAA;AACjB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAED,yBAAyB;AACzB,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;AACrB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAED,uBAAuB;AACvB,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;AACnB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,sBAAsB;AACtB,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,wCAAuB,CAAA;IACvB,wCAAuB,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,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,oCAAqB,CAAA;AACvB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}

View File

@@ -32,10 +32,11 @@ export enum TimeSlotSource {
// ===== Booking =====
export enum BookingStatus {
CONFIRMED = 'CONFIRMED',
CANCELLED = 'CANCELLED',
COMPLETED = 'COMPLETED',
NO_SHOW = 'NO_SHOW',
PENDING_CONFIRMATION = 'PENDING_CONFIRMATION', // 待确认
CONFIRMED = 'CONFIRMED', // 已确认
CANCELLED = 'CANCELLED', // 已取消
COMPLETED = 'COMPLETED', // 已完成/已核销
NO_SHOW = 'NO_SHOW', // 未出席
}
// ===== Order =====

View File

@@ -40,6 +40,8 @@ export type {
PublishDaySlotsDto,
Booking,
BookingWithDetails,
BookingWithUser,
BookingStatusHistory,
CreateBookingDto,
Order,
OrderWithDetails,

View File

@@ -7,6 +7,9 @@ export interface Booking {
readonly membershipId: string
readonly status: BookingStatus
readonly cancelledAt: string | null
readonly confirmedAt: string | null
readonly completedAt: string | null
readonly operatorId: string | null
readonly createdAt: string
readonly updatedAt: string
}
@@ -25,6 +28,25 @@ export interface BookingWithDetails extends Booking {
}
}
/** Admin view: booking with user info */
export interface BookingWithUser extends BookingWithDetails {
readonly user: {
readonly id: string
readonly nickname: string
readonly phone: string | null
}
}
export interface BookingStatusHistory {
readonly id: string
readonly bookingId: string
readonly fromStatus: BookingStatus | null
readonly toStatus: BookingStatus
readonly operatorId: string | null
readonly remark: string | null
readonly createdAt: string
}
export interface CreateBookingDto {
readonly timeSlotId: string
readonly membershipId: string

View File

@@ -3,7 +3,7 @@ export type { CardType, CreateCardTypeDto, UpdateCardTypeDto } from './card-type
export type { Membership, MembershipWithCardType } from './membership'
export type { WeekTemplate, WeekTemplateInput } from './week-template'
export type { TimeSlot, TimeSlotWithBookingStatus, CreateManualSlotDto, ScheduleSlotPreview, PublishDaySlotItem, PublishDaySlotsDto } from './time-slot'
export type { Booking, BookingWithDetails, CreateBookingDto } from './booking'
export type { Booking, BookingWithDetails, BookingWithUser, BookingStatusHistory, CreateBookingDto } from './booking'
export type { Order, OrderWithDetails, CreateOrderDto, PaymentParams, CreateOrderResponse } from './order'
export type { StudioConfig, UpdateStudioConfigDto } from './studio'
export type { ApiResponse, PaginatedData, PaginatedResponse, PaginationQuery } from './api'