690517:1449 204 and 302 refactor #03
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
---
|
||||
trigger: glob
|
||||
globs:
|
||||
- "backend/**/*.service.ts"
|
||||
- "backend/**/*.controller.ts"
|
||||
- "backend/**/*.dto.ts"
|
||||
- "backend/**/*.entity.ts"
|
||||
- 'backend/**/*.service.ts'
|
||||
- 'backend/**/*.controller.ts'
|
||||
- 'backend/**/*.dto.ts'
|
||||
- 'backend/**/*.entity.ts'
|
||||
---
|
||||
|
||||
# Backend Patterns (NestJS)
|
||||
@@ -25,7 +25,7 @@ async create(@Body() dto: CreateCorrespondenceDto) {
|
||||
// Resolve UUID to internal ID
|
||||
const contract = await this.contractService.findOneByUuid(dto.contractUuid);
|
||||
const contractId = contract.id; // Internal INT for DB queries
|
||||
|
||||
|
||||
return this.service.create(dto, contractId);
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ async create(dto: CreateCorrespondenceDto, contractId: number) {
|
||||
class Contract extends UuidBaseEntity {
|
||||
@Column({ type: 'uuid' })
|
||||
publicId: string;
|
||||
|
||||
@PrimaryKey()
|
||||
|
||||
@PrimaryGeneratedColumn()
|
||||
@Exclude()
|
||||
id: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user