feat: 完善课程订阅
This commit is contained in:
@@ -62,6 +62,18 @@ export class BookingController {
|
||||
)
|
||||
}
|
||||
|
||||
@Get('booking/:id/history')
|
||||
@UseGuards(JwtAuthGuard)
|
||||
async getBookingStatusHistory(@Param('id') id: string) {
|
||||
return this.bookingService.getBookingStatusHistory(id)
|
||||
}
|
||||
|
||||
@Get('booking/:id')
|
||||
@UseGuards(JwtAuthGuard)
|
||||
async getBookingById(@Param('id') id: string) {
|
||||
return this.bookingService.getBookingById(id)
|
||||
}
|
||||
|
||||
// ─── Admin Endpoints ──────────────────────────────────────────────────────
|
||||
|
||||
@Get('admin/bookings')
|
||||
@@ -78,4 +90,37 @@ export class BookingController {
|
||||
status,
|
||||
)
|
||||
}
|
||||
|
||||
@Put('booking/:id/confirm')
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(UserRole.ADMIN)
|
||||
async confirmBooking(
|
||||
@CurrentUser('sub') operatorId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() body: { remark?: string },
|
||||
) {
|
||||
return this.bookingService.confirmBooking(id, operatorId, body.remark)
|
||||
}
|
||||
|
||||
@Put('booking/:id/complete')
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(UserRole.ADMIN)
|
||||
async completeBooking(
|
||||
@CurrentUser('sub') operatorId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() body: { remark?: string },
|
||||
) {
|
||||
return this.bookingService.completeBooking(id, operatorId, body.remark)
|
||||
}
|
||||
|
||||
@Put('booking/:id/noshow')
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(UserRole.ADMIN)
|
||||
async markNoShow(
|
||||
@CurrentUser('sub') operatorId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() body: { remark?: string },
|
||||
) {
|
||||
return this.bookingService.markNoShow(id, operatorId, body.remark)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user