Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release to val #457

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/packages/shared-types/opensearch/main/transforms/seatool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function getLeadAnalyst(eventData: SeaTool) {
eventData.STATE_PLAN.LEAD_ANALYST_ID
) {
const leadAnalyst = eventData.LEAD_ANALYST.find(
(analyst) => analyst.OFFICER_ID === eventData.STATE_PLAN.LEAD_ANALYST_ID
(analyst) => analyst.OFFICER_ID === eventData.STATE_PLAN.LEAD_ANALYST_ID,
);

if (leadAnalyst) {
Expand Down Expand Up @@ -90,7 +90,7 @@ const getDateStringOrNullFromEpoc = (epocDate: number | null | undefined) =>
: null;

const compileSrtList = (
officers: SeatoolOfficer[] | null | undefined
officers: SeatoolOfficer[] | null | undefined,
): string[] =>
officers?.length ? officers.map((o) => `${o.FIRST_NAME} ${o.LAST_NAME}`) : [];

Expand All @@ -104,7 +104,7 @@ const isInSecondClock = (
raiReceivedDate: any,
raiWithdrawnDate: any,
seatoolStatus: any,
authority: any
authority: any,
) => {
if (
authority != "CHIP" && // if it's not a chip
Expand Down Expand Up @@ -149,19 +149,19 @@ export const transform = (id: string) => {
actionTypeId: data.ACTIONTYPES?.[0].ACTION_ID,
approvedEffectiveDate: getDateStringOrNullFromEpoc(
data.STATE_PLAN.APPROVED_EFFECTIVE_DATE ||
data.STATE_PLAN.ACTUAL_EFFECTIVE_DATE
data.STATE_PLAN.ACTUAL_EFFECTIVE_DATE,
),
description: data.STATE_PLAN.SUMMARY_MEMO,
finalDispositionDate: getFinalDispositionDate(seatoolStatus, data),
leadAnalystOfficerId,
initialIntakeNeeded:
!leadAnalystName && seatoolStatus !== SEATOOL_STATUS.WITHDRAWN,
!leadAnalystName && !finalDispositionStatuses.includes(seatoolStatus),
leadAnalystName,
authorityId: authorityId || null,
authority: getAuthority(authorityId, id) as Authority | null,
types:
data.STATE_PLAN_SERVICETYPES?.filter(
(type): type is NonNullable<typeof type> => type != null
(type): type is NonNullable<typeof type> => type != null,
).map((type) => {
return {
SPA_TYPE_ID: type.SPA_TYPE_ID,
Expand All @@ -170,7 +170,7 @@ export const transform = (id: string) => {
}) || null,
subTypes:
data.STATE_PLAN_SERVICE_SUBTYPES?.filter(
(subType): subType is NonNullable<typeof subType> => subType != null
(subType): subType is NonNullable<typeof subType> => subType != null,
).map((subType) => {
return {
TYPE_ID: subType.TYPE_ID,
Expand All @@ -188,14 +188,14 @@ export const transform = (id: string) => {
cmsStatus: cmsStatus || SEATOOL_STATUS.UNKNOWN,
seatoolStatus,
submissionDate: getDateStringOrNullFromEpoc(
data.STATE_PLAN.SUBMISSION_DATE
data.STATE_PLAN.SUBMISSION_DATE,
),
subject: data.STATE_PLAN.TITLE_NAME,
secondClock: isInSecondClock(
raiReceivedDate,
raiWithdrawnDate,
seatoolStatus,
flavorLookup(data.STATE_PLAN.PLAN_TYPE)
flavorLookup(data.STATE_PLAN.PLAN_TYPE),
),
raiWithdrawEnabled: finalDispositionStatuses.includes(seatoolStatus)
? false
Expand Down
1 change: 0 additions & 1 deletion src/services/data/handlers/sinkMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,5 @@ const changed_date = async (
});
}
}
console.log(JSON.stringify(docs, null, 2));
return docs;
};
Loading