From fe8a25610783c3c4ab47f3e5daca9d58a7aaa8c0 Mon Sep 17 00:00:00 2001 From: leemhoon00 Date: Wed, 13 Nov 2024 17:57:25 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9E=A5=EC=95=A0=EC=9C=A0=ED=98=95=20?= =?UTF-8?q?=EB=9E=9C=EB=8D=A4=ED=95=98=EA=B2=8C=20=ED=95=98=EB=82=98=20?= =?UTF-8?q?=EC=82=BD=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prisma/schema.prisma | 1 + src/course/special-course.service.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 572c42f..7b1a5a0 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -48,6 +48,7 @@ model SpecialCourse { endTime String workday String price Int + type String @@id([businessId, courseId]) } diff --git a/src/course/special-course.service.ts b/src/course/special-course.service.ts index ebd224b..7396aa9 100644 --- a/src/course/special-course.service.ts +++ b/src/course/special-course.service.ts @@ -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, @@ -85,6 +97,7 @@ export class SpecialCourseService { endTime: item.end_time, workday: workday.join(','), price: Number(item.settl_amt), + type: disableType, }); }