ApiariesModule: CRUD + Deactivate. Lesen fuer alle authentifizierten Rollen offen, Schreiben (Anlegen/Aendern/Deaktivieren) auf ADMIN und BEEKEEPER beschraenkt (Lastenheft §3.2: Imker verwaltet Bienenstaende). Audit-Log-Eintraege bei Create/Update/Deactivate ueber AuditLogService. 4 Unit-Tests + 4 e2e-Tests (inkl. Rollenpruefung READONLY vs. BEEKEEPER), Lint, Typecheck und Build gruen.
39 lines
698 B
TypeScript
39 lines
698 B
TypeScript
import { ApiPropertyOptional, ApiProperty } from '@nestjs/swagger';
|
|
import { IsLatitude, IsLongitude, IsOptional, IsString } from 'class-validator';
|
|
|
|
export class CreateApiaryDto {
|
|
@ApiProperty()
|
|
@IsString()
|
|
name!: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
location?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsLatitude()
|
|
latitude?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsLongitude()
|
|
longitude?: number;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
address?: string;
|
|
|
|
@ApiPropertyOptional()
|
|
@IsOptional()
|
|
@IsString()
|
|
notes?: string;
|
|
}
|