Skip to content

Commit

Permalink
feat(unidirectional-camel-case): Make seatool non-case sensitive when…
Browse files Browse the repository at this point in the history
… writing to opensearch (#958)

* testing capitlized code

* passing id to function

* Setting the ID  key in the object

* removing console.log

* updating cap function

* final requested change

---------

Co-authored-by: asharonbaltazar <[email protected]>
Co-authored-by: 13bfrancis <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2025
1 parent a6f4168 commit 8982d92
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions lib/packages/shared-types/opensearch/main/transforms/seatool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8982d92

Please sign in to comment.