mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 07:22:53 +00:00
Gates the previously open support-agent, procurement, compliance, facilities, list-users and trade-access controllers, separates customer from staff routes across bookings, contracts, companies, billing, warehouses, files and train scheduling, and moves billing, overview, reports and the settings controllers onto their own keys instead of the blanket admin key. Drops the demo-permissions module and the untested notification test route.
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { Body, Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
|
|
import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
|
|
import { BookingStaff } from '../../common/booking-guards';
|
|
import { AiBookingRequestDto } from './dto/ai-booking-request.dto';
|
|
import { AiBookingResult } from './types/ai-booking-result.type';
|
|
import { MockAiService } from './mock-ai.service';
|
|
import { FREIGHT_PERMS } from '../../seed/freight-permissions.registry';
|
|
|
|
@BookingStaff(FREIGHT_PERMS.bookings.view)
|
|
@ApiTags('AI Assistant (mock)')
|
|
@Controller('ai')
|
|
export class AiController {
|
|
constructor(private readonly mockAiService: MockAiService) {}
|
|
|
|
@Post('booking/extract')
|
|
@HttpCode(HttpStatus.OK)
|
|
@ApiOperation({
|
|
summary:
|
|
'Mock AI: extract structured booking fields from free-text request',
|
|
})
|
|
@ApiOkResponse({
|
|
description:
|
|
'Extracted fields, validation result, and next-step recommendation',
|
|
})
|
|
extractBooking(@Body() dto: AiBookingRequestDto): AiBookingResult {
|
|
return this.mockAiService.extractBooking(dto.text);
|
|
}
|
|
}
|