80 lines
2.3 KiB
JSON
80 lines
2.3 KiB
JSON
{
|
|
"entity": "Equipment",
|
|
"files": {
|
|
"controller": {
|
|
"path": "server/src/modules/equipment/equipment.controller.ts",
|
|
"must_contain": [
|
|
"@Controller('equipments')",
|
|
"@UseGuards(",
|
|
"JwtAuthGuard",
|
|
"@Get()",
|
|
"@Post()",
|
|
"@Get(':id')",
|
|
"@Patch(':id')",
|
|
"@Delete(':id')"
|
|
],
|
|
"must_not_contain": [
|
|
"@Put(':id')",
|
|
"@Post(':id')"
|
|
],
|
|
"must_match_regex": [
|
|
"@Delete\\(':id'\\)[\\s\\S]{0,80}@Roles\\('admin'\\)|@Roles\\('admin'\\)[\\s\\S]{0,80}@Delete\\(':id'\\)"
|
|
],
|
|
"comment": "Equipment controller must expose the CRUD verbs expected by the DSL-compatible React Admin contract."
|
|
},
|
|
"service": {
|
|
"path": "server/src/modules/equipment/equipment.service.ts",
|
|
"must_contain": [
|
|
"setListHeaders(response",
|
|
"_start",
|
|
"_end",
|
|
"_sort",
|
|
"_order"
|
|
],
|
|
"must_match_regex": [
|
|
"mode.*insensitive|insensitive.*mode",
|
|
"status.*in\\b|\\bin\\b.*status"
|
|
],
|
|
"comment": "Service must translate React Admin list params into Prisma filters and delegate header wiring through the shared helper."
|
|
},
|
|
"create_dto": {
|
|
"path": "server/src/modules/equipment/dto/create-equipment.dto.ts",
|
|
"must_contain": [
|
|
"from 'class-validator'",
|
|
"inventoryNumber!:",
|
|
"name!:",
|
|
"equipmentType!:",
|
|
"periodicityTO!:",
|
|
"status!:",
|
|
"@IsString(",
|
|
"@IsOptional(",
|
|
"@IsEnum("
|
|
],
|
|
"must_not_contain": [
|
|
"id?:",
|
|
"id!:"
|
|
],
|
|
"comment": "Required fields use '!' suffix; optional fields use '?' with @IsOptional(); enum fields use @IsEnum(); class-validator must be imported."
|
|
},
|
|
"update_dto": {
|
|
"path": "server/src/modules/equipment/dto/update-equipment.dto.ts",
|
|
"must_contain": [
|
|
"from 'class-validator'",
|
|
"inventoryNumber?:",
|
|
"name?:",
|
|
"equipmentType?:",
|
|
"status?:",
|
|
"@IsOptional(",
|
|
"@IsString(",
|
|
"@IsEnum("
|
|
],
|
|
"must_not_contain": [
|
|
"inventoryNumber!:",
|
|
"name!:",
|
|
"status!:"
|
|
],
|
|
"comment": "Update DTO: all fields are optional ('?' suffix with @IsOptional())."
|
|
}
|
|
}
|
|
}
|