diff --git a/src/core/components/profile/stepCard.component.tsx b/src/core/components/profile/stepCard.component.tsx index 1dff085..97967a0 100644 --- a/src/core/components/profile/stepCard.component.tsx +++ b/src/core/components/profile/stepCard.component.tsx @@ -371,9 +371,29 @@ const StepCard: React.FC = ({ step, status, isApproved }) => { {step === 5 && application.payment.updatedAt && ( - Last uploaded at: {(new Date(application.payment.updatedAt)).toLocaleString()} + Last uploaded at: {new Date(application.payment.updatedAt).toLocaleString()} )} + {step === 6 && application.state === "PASSED_THE_CAMP" && ( + <> + {application.certificateDownloadLink && ( + + + + )} + {!application.certificateDownloadLink && ( + + ขอแสดงความเสียใจ น้องไม่ได้รับเกียรติบัตรในการเข้าร่วมค่ายลานเกียร์ครั้งนี้ + + )} + + )} )} diff --git a/src/core/components/profile/stepCardList.component.tsx b/src/core/components/profile/stepCardList.component.tsx index 4bbec15..abb46e9 100644 --- a/src/core/components/profile/stepCardList.component.tsx +++ b/src/core/components/profile/stepCardList.component.tsx @@ -86,6 +86,14 @@ const StepCardList: React.FC = ({ status, lgCode, firstname, props[5] = { step: 5, status: "complete", isApproved: "true" } props[6] = { step: 6, status: "inProgress", isApproved: "true" } break + case ProfileStatus.passedTheCamp: + props[1] = { step: 1, status: "complete", isApproved: "true" } + props[2] = { step: 2, status: "complete", isApproved: "true" } + props[3] = { step: 3, status: "complete", isApproved: "true" } + props[4] = { step: 4, status: "complete", isApproved: "true" } + props[5] = { step: 5, status: "complete", isApproved: "true" } + props[6] = { step: 6, status: "complete", isApproved: "true" } + break case ProfileStatus.paymentFailed: props[1] = { step: 1, status: "complete", isApproved: "true" } props[2] = { step: 2, status: "complete", isApproved: "true" } diff --git a/src/core/models/dto/application.dto.tsx b/src/core/models/dto/application.dto.tsx index 7274749..7c3d357 100644 --- a/src/core/models/dto/application.dto.tsx +++ b/src/core/models/dto/application.dto.tsx @@ -14,6 +14,7 @@ export type ApplicationState = | "REJECTED_FAILED_THE_INTERVIEW" | "PAYMENT_ACCEPTED" | "REJECTED_FAIL_TO_PAY" + | "PASSED_THE_CAMP" export type FileStatus = "EMPTY" | "UPLOADED" | "CHANGE_REQUIRED" | "PASSED" diff --git a/src/core/models/dto/profile.dto.tsx b/src/core/models/dto/profile.dto.tsx index bbbf215..663adf1 100644 --- a/src/core/models/dto/profile.dto.tsx +++ b/src/core/models/dto/profile.dto.tsx @@ -52,6 +52,8 @@ interface ProfileDTO { interviewAvailability: string unavailableReason: string | null interviewRoom?: string + certificatePreviewLink?: string + certificateDownloadLink?: string } export default ProfileDTO diff --git a/src/core/models/profileStatus.model.tsx b/src/core/models/profileStatus.model.tsx index 529d9e9..208bff2 100644 --- a/src/core/models/profileStatus.model.tsx +++ b/src/core/models/profileStatus.model.tsx @@ -10,5 +10,6 @@ export enum ProfileStatus { passedInterview = "passedInterview", failedInterview = "failedInterview", paymentAccepted = "paymentAccepted", - paymentFailed = "paymentFailed" + paymentFailed = "paymentFailed", + passedTheCamp = "passedTheCamp" } diff --git a/src/modules/profile.module.tsx b/src/modules/profile.module.tsx index 7b71154..ae951c1 100644 --- a/src/modules/profile.module.tsx +++ b/src/modules/profile.module.tsx @@ -65,7 +65,8 @@ const ProfileModule = () => { PASSED_INTERVIEW: ProfileStatus.passedInterview, REJECTED_FAILED_THE_INTERVIEW: ProfileStatus.failedInterview, PAYMENT_ACCEPTED: ProfileStatus.paymentAccepted, - REJECTED_FAIL_TO_PAY: ProfileStatus.paymentFailed + REJECTED_FAIL_TO_PAY: ProfileStatus.paymentFailed, + PASSED_THE_CAMP: ProfileStatus.passedTheCamp } const profileStatus = applicationState === "SUBMITTED" ? profileStatusMap[applicationState][fileStatus] : profileStatusMap[applicationState]