From f00c0d289ec354238bffd4698f5d59b33809bddc Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 5 Apr 2024 10:24:19 +0700 Subject: [PATCH] map DEV_015 --- .../DevelopmentScholarshipController.ts | 54 ++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/src/controllers/DevelopmentScholarshipController.ts b/src/controllers/DevelopmentScholarshipController.ts index 7f7abe9..07f128a 100644 --- a/src/controllers/DevelopmentScholarshipController.ts +++ b/src/controllers/DevelopmentScholarshipController.ts @@ -229,7 +229,57 @@ export class DevelopmentScholarshipController extends Controller { if (!getDevelopment) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทุนการศึกษา/ฝึกอบรมนี้"); } - - return new HttpSuccess(getDevelopment); + const formattedData = { + rank: getDevelopment.rank ? getDevelopment.rank : null, + prefix: getDevelopment.prefix ? getDevelopment.prefix : null, + firstName: getDevelopment.firstName ? getDevelopment.firstName : null, + lastName: getDevelopment.lastName ? getDevelopment.lastName : null, + citizenId: getDevelopment.citizenId ? getDevelopment.citizenId : null, + position: getDevelopment.position ? getDevelopment.position : null, + posExecutive: getDevelopment.posExecutive ? getDevelopment.posExecutive : null, + posLevelId: getDevelopment.posLevelId ? getDevelopment.posLevelId : null, + posTypeId: getDevelopment.posTypeId ? getDevelopment.posTypeId : null, + guarantorRank: getDevelopment.guarantorRank ? getDevelopment.guarantorRank : null, + guarantorPrefix: getDevelopment.guarantorPrefix ? getDevelopment.guarantorPrefix : null, + guarantorFirstName: getDevelopment.guarantorFirstName ? getDevelopment.guarantorFirstName : null, + guarantorLastName: getDevelopment.guarantorLastName ? getDevelopment.guarantorLastName : null, + guarantorCitizenId: getDevelopment.guarantorCitizenId ? getDevelopment.guarantorCitizenId : null, + guarantorPosition: getDevelopment.guarantorPosition ? getDevelopment.guarantorPosition : null, + guarantorPosExecutive: getDevelopment.guarantorPosExecutive ? getDevelopment.guarantorPosExecutive : null, + posLevelguarantorId: getDevelopment.posLevelguarantorId ? getDevelopment.posLevelguarantorId : null, + posTypeguarantorId: getDevelopment.posTypeguarantorId ? getDevelopment.posTypeguarantorId : null, + scholarshipYear: getDevelopment.scholarshipYear ? getDevelopment.scholarshipYear : null, + budgetSource: getDevelopment.budgetSource ? getDevelopment.budgetSource : null, + budgetApprove: getDevelopment.budgetApprove ? getDevelopment.budgetApprove : null, + bookNo: getDevelopment.bookNo ? getDevelopment.bookNo : null, + bookNoDate: getDevelopment.bookNoDate ? getDevelopment.bookNoDate : null, + bookApproveDate: getDevelopment.bookApproveDate ? getDevelopment.bookApproveDate : null, + useOfficialTime: getDevelopment.useOfficialTime ? getDevelopment.useOfficialTime : null, + changeDetail: getDevelopment.changeDetail ? getDevelopment.changeDetail : null, + scholarshipType: getDevelopment.scholarshipType ? getDevelopment.scholarshipType : null, + fundType: getDevelopment.fundType ? getDevelopment.fundType : null, + contractNo: getDevelopment.contractNo ? getDevelopment.contractNo : null, + contractDate: getDevelopment.contractDate ? getDevelopment.contractDate : null, + reportBackNo: getDevelopment.reportBackNo ? getDevelopment.reportBackNo : null, + reportBackNoDate: getDevelopment.reportBackNoDate ? getDevelopment.reportBackNoDate : null, + reportBackDate: getDevelopment.reportBackDate ? getDevelopment.reportBackDate : null, + degreeLevel: getDevelopment.degreeLevel ? getDevelopment.degreeLevel : null, + course: getDevelopment.course ? getDevelopment.course : null, + field: getDevelopment.field ? getDevelopment.field : null, + faculty: getDevelopment.faculty ? getDevelopment.faculty : null, + educationalInstitution: getDevelopment.educationalInstitution ? getDevelopment.educationalInstitution : null, + startDate: getDevelopment.startDate ? getDevelopment.startDate : null, + endDate: getDevelopment.endDate ? getDevelopment.endDate : null, + studyPlace: getDevelopment.studyPlace ? getDevelopment.studyPlace : null, + studyTopic: getDevelopment.studyTopic ? getDevelopment.studyTopic : null, + studyStartDate: getDevelopment.studyStartDate ? getDevelopment.studyStartDate : null, + studyEndDate: getDevelopment.studyEndDate ? getDevelopment.studyEndDate : null, + studyCountry: getDevelopment.studyCountry ? getDevelopment.studyCountry : null, + studyAbroadTopic: getDevelopment.studyAbroadTopic ? getDevelopment.studyAbroadTopic : null, + studyAbroadStartDate: getDevelopment.studyAbroadStartDate ? getDevelopment.studyAbroadStartDate : null, + studyAbroadEndDate: getDevelopment.studyAbroadEndDate ? getDevelopment.studyAbroadEndDate : null, + totalPeriod: getDevelopment.totalPeriod ? getDevelopment.totalPeriod : null + }; + return new HttpSuccess(formattedData); } }