INSIGHT-MVP/packages/crm-service/src/companies/dto/create-company.dto.ts
Thomas Reitz 0ed1e77844 feat(crm): add company detail overhaul with industries, account types, relationship types
- Backend: new CRUD services/controllers for Industries, AccountTypes,
  RelationshipTypes, CompanyRelationships with Prisma schema migration
- Frontend: new hooks, API functions, and types for all config entities
- CompanyDetailPage redesign with ActivityFeed, RelationshipsCard
- CompanyFormModal extended with industry, account type, owner fields
- Activities service now supports companyId filter + includeContacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 09:21:57 +01:00

109 lines
2.1 KiB
TypeScript

import {
IsString,
IsOptional,
IsBoolean,
IsEmail,
IsUrl,
IsUUID,
IsArray,
MaxLength,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
export class CreateCompanyDto {
@ApiProperty({ maxLength: 200 })
@IsString()
@MaxLength(200)
name!: string;
@ApiPropertyOptional({ maxLength: 100, description: 'Freitext-Branche (Legacy)' })
@IsOptional()
@IsString()
@MaxLength(100)
industry?: string;
@ApiPropertyOptional({ format: 'uuid', description: 'Branchen-ID' })
@IsOptional()
@IsUUID()
industryId?: string;
@ApiPropertyOptional({ format: 'uuid', description: 'Kontotyp-ID' })
@IsOptional()
@IsUUID()
accountTypeId?: string;
@ApiPropertyOptional({ format: 'uuid', description: 'Zustaendiger User (Owner-ID)' })
@IsOptional()
@IsUUID()
ownerId?: string;
@ApiPropertyOptional({ maxLength: 200, description: 'Name des zustaendigen Users' })
@IsOptional()
@IsString()
@MaxLength(200)
ownerName?: string;
@ApiPropertyOptional({ maxLength: 255 })
@IsOptional()
@IsEmail()
@MaxLength(255)
email?: string;
@ApiPropertyOptional({ maxLength: 50 })
@IsOptional()
@IsString()
@MaxLength(50)
phone?: string;
@ApiPropertyOptional({ maxLength: 500 })
@IsOptional()
@IsUrl()
@MaxLength(500)
website?: string;
@ApiPropertyOptional({ maxLength: 200 })
@IsOptional()
@IsString()
@MaxLength(200)
street?: string;
@ApiPropertyOptional({ maxLength: 20 })
@IsOptional()
@IsString()
@MaxLength(20)
zip?: string;
@ApiPropertyOptional({ maxLength: 100 })
@IsOptional()
@IsString()
@MaxLength(100)
city?: string;
@ApiPropertyOptional({ maxLength: 100 })
@IsOptional()
@IsString()
@MaxLength(100)
state?: string;
@ApiPropertyOptional({ maxLength: 2, default: 'DE' })
@IsOptional()
@IsString()
@MaxLength(2)
country?: string;
@ApiPropertyOptional()
@IsOptional()
@IsString()
notes?: string;
@ApiPropertyOptional({ type: [String] })
@IsOptional()
@IsArray()
@IsString({ each: true })
tags?: string[];
@ApiPropertyOptional({ default: true })
@IsOptional()
@IsBoolean()
isActive?: boolean;
}