From acf06409a733c405b316822932a0f22394cfbce0 Mon Sep 17 00:00:00 2001 From: soyeonkim0227 Date: Thu, 21 Sep 2023 19:49:28 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20::=20db=20::=20add?= =?UTF-8?q?=20ENUM=20type=20DB=20setting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/domain/entity/achievementStatus.entity.ts | 16 ++++++++++++---- src/domain/entity/budgetResult.entity.ts | 4 +++- src/domain/entity/business.entity.ts | 4 +++- src/domain/entity/localResource.entity.ts | 7 +++++-- src/domain/entity/performanceDetail.entity.ts | 4 +++- src/domain/entity/resident.entity.ts | 4 +++- 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/domain/entity/achievementStatus.entity.ts b/src/domain/entity/achievementStatus.entity.ts index 092639f..1b9c672 100644 --- a/src/domain/entity/achievementStatus.entity.ts +++ b/src/domain/entity/achievementStatus.entity.ts @@ -18,22 +18,30 @@ export class AchievementStatus { performanceResult: PerformanceResult; @Column({ - type: 'varchar' + type: 'enum', + enum: Amount, + default: Amount.nothing }) changedMember: Amount; @Column({ - type: 'varchar' + type: 'enum', + enum: Amount, + default: Amount.nothing }) increaseMain: Amount; @Column({ - type: 'varchar' + type: 'enum', + enum: Amount, + default: Amount.nothing }) increaseNew: Amount; @Column({ - type: 'varchar' + type: 'enum', + enum: Related, + default: Related.normal }) changedRelation: Related; } \ No newline at end of file diff --git a/src/domain/entity/budgetResult.entity.ts b/src/domain/entity/budgetResult.entity.ts index 8023f22..95ff412 100644 --- a/src/domain/entity/budgetResult.entity.ts +++ b/src/domain/entity/budgetResult.entity.ts @@ -28,7 +28,9 @@ export class BudgetResult { burden: number; @Column({ - type: 'varchar' + type: 'enum', + enum: Key, + default: Key.budgetSum }) key: Key; } \ No newline at end of file diff --git a/src/domain/entity/business.entity.ts b/src/domain/entity/business.entity.ts index 1ffe00e..3c0ada3 100644 --- a/src/domain/entity/business.entity.ts +++ b/src/domain/entity/business.entity.ts @@ -38,7 +38,9 @@ export class Business { businessPlan: BusinessPlan; @Column({ - type: 'varchar' + type: 'enum', + enum: BuisnessType, + default: BuisnessType.yuseongMagic }) businessType: BuisnessType; diff --git a/src/domain/entity/localResource.entity.ts b/src/domain/entity/localResource.entity.ts index 496096d..a0b4812 100644 --- a/src/domain/entity/localResource.entity.ts +++ b/src/domain/entity/localResource.entity.ts @@ -1,4 +1,5 @@ import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm"; +import { Type } from "../enums/type.enum"; import { BusinessPlan } from "./businessPlan.entity"; @Entity() @@ -18,10 +19,12 @@ export class LocalResource { businessPlan: BusinessPlan; @Column({ - type: 'varchar', + type: 'enum', + enum: Type, + default: Type.judge, nullable: true }) - type: string; + type: Type; @Column({ type: 'varchar' diff --git a/src/domain/entity/performanceDetail.entity.ts b/src/domain/entity/performanceDetail.entity.ts index 015362e..78686ab 100644 --- a/src/domain/entity/performanceDetail.entity.ts +++ b/src/domain/entity/performanceDetail.entity.ts @@ -48,7 +48,9 @@ export class PerformanceDetail { etc: number; @Column({ - type: 'varchar' + type: 'enum', + enum: Total, + default: Total.num }) total: Total; } \ No newline at end of file diff --git a/src/domain/entity/resident.entity.ts b/src/domain/entity/resident.entity.ts index 6a35cc5..e289346 100644 --- a/src/domain/entity/resident.entity.ts +++ b/src/domain/entity/resident.entity.ts @@ -23,7 +23,9 @@ export class Resident { name: string; @Column({ - type: 'varchar' + type: 'enum', + enum: Sex, + default: Sex.male }) sex: Sex; From 38b3aa77b8a1f97eb3c632944944dc7eab254416 Mon Sep 17 00:00:00 2001 From: soyeonkim0227 Date: Thu, 21 Sep 2023 19:50:08 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=92=A1=20::=20setting=20::=20update?= =?UTF-8?q?=20ENUM=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/business/dto/createApplication.dto.ts | 61 +++++++++++++++++++++++ src/domain/enums/buisnessType.enum.ts | 9 +++- src/domain/enums/clubType.enum.ts | 4 +- 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 src/business/dto/createApplication.dto.ts diff --git a/src/business/dto/createApplication.dto.ts b/src/business/dto/createApplication.dto.ts new file mode 100644 index 0000000..3f9253b --- /dev/null +++ b/src/business/dto/createApplication.dto.ts @@ -0,0 +1,61 @@ +import { IsBoolean, IsEnum, IsNumber, IsString } from "class-validator"; +import { BuisnessType } from "src/domain/enums/buisnessType.enum"; +import { ClubType } from "src/domain/enums/clubType.enum"; +import { Loc } from "src/domain/enums/loc.enum"; + +export class CreateApplicationDto { + + @IsEnum(BuisnessType) + businessType: BuisnessType; + + @IsString() + clubName: string; + + @IsBoolean() + isContiguous: boolean; + + @IsString() + contiguousLocation: string; + + @IsString() + businessName: string; + + @IsEnum(Loc) + businessLocation: Loc; + + @IsNumber() + totalBudget: number; + + @IsNumber() + subsidy: number + + @IsNumber() + selfInflicted: number; + + @IsEnum(ClubType) + clubType: ClubType; + + @IsNumber() + countOfManager: number; + + @IsNumber() + countOfMember: number; + + @IsString() + clubAddress: string; + + @IsNumber() + clubRegisterNumber: number; + + @IsBoolean() + isIncludingInfo: boolean; + + @IsBoolean() + isIncludingMemberList: boolean; + + @IsBoolean() + isIncludingPlan: boolean; + + @IsNumber() + year: number; +} \ No newline at end of file diff --git a/src/domain/enums/buisnessType.enum.ts b/src/domain/enums/buisnessType.enum.ts index 5a72427..f7cf6d4 100644 --- a/src/domain/enums/buisnessType.enum.ts +++ b/src/domain/enums/buisnessType.enum.ts @@ -1,3 +1,10 @@ export enum BuisnessType { - + yuseongMagic = '유성매직 네트워크', + recordImage = '기록 영상', + publicOpinion = '공론', + alleyEconomy = '골목경제', + careSystem = '돌봄체계 구축', + olderLeisure = '노년층 여가활동', + sharePlace = '공유공간 활성화', + livinglab = '리빙랩' } \ No newline at end of file diff --git a/src/domain/enums/clubType.enum.ts b/src/domain/enums/clubType.enum.ts index 01a4d11..6db7ac0 100644 --- a/src/domain/enums/clubType.enum.ts +++ b/src/domain/enums/clubType.enum.ts @@ -1,3 +1,5 @@ export enum ClubType { - + residentMeeting = '주민 모임', + npPrivateOrg = '비영리민간단체', + npCorporation = '비영리법인' } \ No newline at end of file