From 862e5877971be464f14c5c67775ff02863c72ad5 Mon Sep 17 00:00:00 2001 From: Wolfgang Date: Thu, 28 Sep 2023 11:50:19 +0200 Subject: [PATCH] antaresKey is optional now --- .../federal-state/controller/dto/county.response.ts | 6 +++--- .../controller/dto/create-county.body.params.ts | 7 +++---- .../modules/federal-state/domainobject/federal-state.do.ts | 2 +- .../modules/federal-state/entity/federal-state.entity.ts | 2 +- .../modules/federal-state/interface/IFederalStateCreate.ts | 2 +- .../modules/federal-state/service/federal-state.service.ts | 4 ++-- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/apps/server/src/modules/federal-state/controller/dto/county.response.ts b/apps/server/src/modules/federal-state/controller/dto/county.response.ts index c32a2e3ccec..1eb388eb601 100644 --- a/apps/server/src/modules/federal-state/controller/dto/county.response.ts +++ b/apps/server/src/modules/federal-state/controller/dto/county.response.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from '@nestjs/swagger'; +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { DecodeHtmlEntities } from '@shared/controller'; import { IsNumber, IsString } from 'class-validator'; @@ -17,8 +17,8 @@ export class CountyResponse { @IsNumber() countyId: number; - @ApiProperty() + @ApiPropertyOptional() @IsString() @DecodeHtmlEntities() - antaresKey: string; + antaresKey?: string; } diff --git a/apps/server/src/modules/federal-state/controller/dto/create-county.body.params.ts b/apps/server/src/modules/federal-state/controller/dto/create-county.body.params.ts index 7aaee3fe57d..df3a2f611c6 100644 --- a/apps/server/src/modules/federal-state/controller/dto/create-county.body.params.ts +++ b/apps/server/src/modules/federal-state/controller/dto/create-county.body.params.ts @@ -1,4 +1,4 @@ -import { ApiProperty } from '@nestjs/swagger'; +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { DecodeHtmlEntities } from '@shared/controller'; import { IsNumber, IsString } from 'class-validator'; @@ -18,10 +18,9 @@ export class CreateCountyBodyParams { @IsString() @DecodeHtmlEntities() - @ApiProperty({ + @ApiPropertyOptional({ description: 'Antares key of the county', - required: true, type: String, }) - antaresKey!: string; + antaresKey?: string; } diff --git a/apps/server/src/modules/federal-state/domainobject/federal-state.do.ts b/apps/server/src/modules/federal-state/domainobject/federal-state.do.ts index 27b50c7537b..de1678b8b91 100644 --- a/apps/server/src/modules/federal-state/domainobject/federal-state.do.ts +++ b/apps/server/src/modules/federal-state/domainobject/federal-state.do.ts @@ -3,7 +3,7 @@ import { AuthorizableObject, DomainObject } from '@shared/domain/domain-object'; export interface ICounty { countyId: number; name: string; - antaresKey: string; + antaresKey?: string; } export interface FederalStateProps extends AuthorizableObject { name: string; diff --git a/apps/server/src/modules/federal-state/entity/federal-state.entity.ts b/apps/server/src/modules/federal-state/entity/federal-state.entity.ts index d9cb9eb14a9..69a36a9fc5d 100644 --- a/apps/server/src/modules/federal-state/entity/federal-state.entity.ts +++ b/apps/server/src/modules/federal-state/entity/federal-state.entity.ts @@ -25,7 +25,7 @@ export class County { countyId: number; @Property() - antaresKey: string; + antaresKey?: string; } @Entity({ tableName: 'federalstates' }) diff --git a/apps/server/src/modules/federal-state/interface/IFederalStateCreate.ts b/apps/server/src/modules/federal-state/interface/IFederalStateCreate.ts index 6d6254566d9..3f00f365545 100644 --- a/apps/server/src/modules/federal-state/interface/IFederalStateCreate.ts +++ b/apps/server/src/modules/federal-state/interface/IFederalStateCreate.ts @@ -1,7 +1,7 @@ export interface ICountyCreate { name: string; countyId: number; - antaresKey: string; + antaresKey?: string; } export interface IFederalStateCreate { diff --git a/apps/server/src/modules/federal-state/service/federal-state.service.ts b/apps/server/src/modules/federal-state/service/federal-state.service.ts index 7c4ff94c7c6..93b900325b7 100644 --- a/apps/server/src/modules/federal-state/service/federal-state.service.ts +++ b/apps/server/src/modules/federal-state/service/federal-state.service.ts @@ -13,8 +13,8 @@ export class FederalStateService { return federalState; } - async findAll() { - const federalStates: FederalStateDO[] = await this.federalStateRepo.findAll(); + async findAll(): Promise { + const federalStates = await this.federalStateRepo.findAll(); return federalStates; }