feat: Full petmaster CRM with NestJS API and React frontend
- Client management (CRUD with JSONB custom fields) - Pet profiles - Service catalog with per-client pricing - Booking calendar with recurring appointments - Invoicing with Stripe integration - Real-time messaging (WebSocket) - Self-booking portal - Staff assignment - Docker multi-stage builds - Prisma schema + seed
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import {
|
||||
Controller, Get, Post, Put, Delete, Param, Body, Query, ParseUUIDPipe,
|
||||
} from '@nestjs/common';
|
||||
import { BookingsService } from './bookings.service';
|
||||
import { CreateBookingDto, UpdateBookingDto, ListBookingsQueryDto } from './dto/booking.dto';
|
||||
|
||||
@Controller('bookings')
|
||||
export class BookingsController {
|
||||
constructor(private readonly bookingsService: BookingsService) {}
|
||||
|
||||
@Post()
|
||||
async create(@Body() dto: CreateBookingDto) {
|
||||
return this.bookingsService.create(dto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
async findAll(@Query() query: ListBookingsQueryDto) {
|
||||
return this.bookingsService.findAll(query);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
async findOne(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.bookingsService.findOne(id);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
async update(@Param('id', ParseUUIDPipe) id: string, @Body() dto: UpdateBookingDto) {
|
||||
return this.bookingsService.update(id, dto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
async remove(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.bookingsService.remove(id);
|
||||
}
|
||||
|
||||
@Put(':id/assign')
|
||||
async assignStaff(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body('staffId') staffId: string,
|
||||
) {
|
||||
return this.bookingsService.assignStaff(id, staffId);
|
||||
}
|
||||
|
||||
@Put(':id/status')
|
||||
async updateStatus(
|
||||
@Param('id', ParseUUIDPipe) id: string,
|
||||
@Body('status') status: string,
|
||||
) {
|
||||
return this.bookingsService.updateStatus(id, status);
|
||||
}
|
||||
|
||||
@Post(':id/recurring')
|
||||
async generateRecurring(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.bookingsService.generateRecurring(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user