diff --git a/lib/packages/shared-types/opensearch/main/transforms/seatool.ts b/lib/packages/shared-types/opensearch/main/transforms/seatool.ts index 94a4e9265c..bada36dfcd 100644 --- a/lib/packages/shared-types/opensearch/main/transforms/seatool.ts +++ b/lib/packages/shared-types/opensearch/main/transforms/seatool.ts @@ -74,15 +74,15 @@ const getRaiDate = (data: SeaTool) => { const getDateStringOrNullFromEpoc = (epocDate: number | null | undefined) => epocDate !== null && epocDate !== undefined ? new Date(epocDate).toISOString() : null; -const compileSrtList = ( - officers: SeatoolOfficer[] | null | undefined, -): { name: string; email: string }[] => - officers?.length - ? officers.map((o) => ({ - name: `${o.FIRST_NAME || ""} ${o.LAST_NAME || ""}`, - email: o.EMAIL || "", - })) - : []; + const compileSrtList = ( + officers: SeatoolOfficer[] | null | undefined, + ): { name: string; email: string }[] => + officers?.length + ? officers.map((o) => ({ + name: `${o.FIRST_NAME || ""} ${o.LAST_NAME || ""}`, + email: o.EMAIL || "", + })) + : []; const getFinalDispositionDate = (status: string, record: SeaTool) => { return status && finalDispositionStatuses.includes(status) @@ -124,11 +124,13 @@ export const transform = (id: string) => { : null; const { stateStatus, cmsStatus } = getStatus(seatoolStatus); + const resp = { - id, + id: id.toUpperCase(), actionType: data.ACTIONTYPES?.[0].ACTION_NAME, approvedEffectiveDate: getDateStringOrNullFromEpoc( - data.STATE_PLAN.APPROVED_EFFECTIVE_DATE || data.STATE_PLAN.ACTUAL_EFFECTIVE_DATE, + data.STATE_PLAN.APPROVED_EFFECTIVE_DATE || + data.STATE_PLAN.ACTUAL_EFFECTIVE_DATE, ), changed_date: data.STATE_PLAN.CHANGED_DATE, description: data.STATE_PLAN.SUMMARY_MEMO,