Skip to content

Commit

Permalink
feat: 장애유형 랜덤하게 하나 삽입
Browse files Browse the repository at this point in the history
  • Loading branch information
leemhoon00 committed Nov 13, 2024
1 parent c927b65 commit fe8a256
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ model SpecialCourse {
endTime String
workday String
price Int
type String
@@id([businessId, courseId])
}
13 changes: 13 additions & 0 deletions src/course/special-course.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ export class SpecialCourseService {
}
});

const allTypes = [
'지체',
'시각',
'청각/언어',
'지적/자폐',
'뇌병변',
'기타',
] as const;

const disableType =
allTypes[Math.floor(Math.random() * allTypes.length)]!;

courses.push({
businessId: item.busi_reg_no,
courseId: item.course_num,
Expand All @@ -85,6 +97,7 @@ export class SpecialCourseService {
endTime: item.end_time,
workday: workday.join(','),
price: Number(item.settl_amt),
type: disableType,
});
}

Expand Down

0 comments on commit fe8a256

Please sign in to comment.