Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#3) Update db #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions src/business/dto/createApplication.dto.ts
Original file line number Diff line number Diff line change
@@ -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;
}
16 changes: 12 additions & 4 deletions src/domain/entity/achievementStatus.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 3 additions & 1 deletion src/domain/entity/budgetResult.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export class BudgetResult {
burden: number;

@Column({
type: 'varchar'
type: 'enum',
enum: Key,
default: Key.budgetSum
})
key: Key;
}
4 changes: 3 additions & 1 deletion src/domain/entity/business.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export class Business {
businessPlan: BusinessPlan;

@Column({
type: 'varchar'
type: 'enum',
enum: BuisnessType,
default: BuisnessType.yuseongMagic
})
businessType: BuisnessType;

Expand Down
7 changes: 5 additions & 2 deletions src/domain/entity/localResource.entity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
import { Type } from "../enums/type.enum";
import { BusinessPlan } from "./businessPlan.entity";

@Entity()
Expand All @@ -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'
Expand Down
4 changes: 3 additions & 1 deletion src/domain/entity/performanceDetail.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export class PerformanceDetail {
etc: number;

@Column({
type: 'varchar'
type: 'enum',
enum: Total,
default: Total.num
})
total: Total;
}
4 changes: 3 additions & 1 deletion src/domain/entity/resident.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export class Resident {
name: string;

@Column({
type: 'varchar'
type: 'enum',
enum: Sex,
default: Sex.male
})
sex: Sex;

Expand Down
9 changes: 8 additions & 1 deletion src/domain/enums/buisnessType.enum.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
export enum BuisnessType {

yuseongMagic = '유성매직 네트워크',
recordImage = '기록 영상',
publicOpinion = '공론',
alleyEconomy = '골목경제',
careSystem = '돌봄체계 구축',
olderLeisure = '노년층 여가활동',
sharePlace = '공유공간 활성화',
livinglab = '리빙랩'
}
4 changes: 3 additions & 1 deletion src/domain/enums/clubType.enum.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export enum ClubType {

residentMeeting = '주민 모임',
npPrivateOrg = '비영리민간단체',
npCorporation = '비영리법인'
}