Skip to content

Commit

Permalink
fix: remove logic for determining next business day for submissionDate
Browse files Browse the repository at this point in the history
  • Loading branch information
asharonbaltazar committed Jan 7, 2025
1 parent 097d933 commit d53f561
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 109 deletions.
16 changes: 6 additions & 10 deletions lib/packages/shared-types/opensearch/main/transforms/app-k.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
return events["app-k"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
title: data.title,
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate,
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
actionType: data.actionType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
// any adhoc logic
return events["capitated-amendment"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate, // wish this was proposedEffectiveDate
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
actionType: data.actionType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
// any adhoc logic
return events["capitated-initial"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate, // wish this was proposedEffectiveDate
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
actionType: data.actionType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
// any adhoc logic
return events["capitated-renewal"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate, // wish this was proposedEffectiveDate
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
actionType: data.actionType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
// any adhoc logic
return events["contracting-amendment"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate, // wish this was proposedEffectiveDate
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
actionType: data.actionType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
// any adhoc logic
return events["contracting-initial"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate, // wish this was proposedEffectiveDate
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
actionType: data.actionType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
// any adhoc logic
return events["contracting-renewal"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate?.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate?.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate, // wish this was proposedEffectiveDate
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
actionType: data.actionType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
// any adhoc logic
return events["new-chip-submission"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate, // wish this was proposedEffectiveDate
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
actionType: data.actionType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
import {
getNextBusinessDayTimestamp,
seaToolFriendlyTimestamp,
} from "../../../../shared-utils/seatool-date-helper";
import { seaToolFriendlyTimestamp } from "../../../../shared-utils/seatool-date-helper";

export const transform = () => {
// any adhoc logic
return events["new-medicaid-submission"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING);
const timestampDate = data.timestamp ? new Date(data.timestamp) : undefined;
const timestampDate = new Date(data.timestamp);
const todayEpoch = seaToolFriendlyTimestamp(timestampDate);
const nextBusinessDayEpoch = getNextBusinessDayTimestamp(timestampDate);

return {
additionalInformation: data.additionalInformation,
authority: data.authority,
changedDate: timestampDate?.toISOString() || null,
changedDate: timestampDate.toISOString(),
cmsStatus,
description: null,
id: data.id,
makoChangedDate: timestampDate?.toISOString() || null,
makoChangedDate: timestampDate.toISOString(),
origin: "OneMAC",
raiWithdrawEnabled: false, // Set to false for new submissions
seatoolStatus: SEATOOL_STATUS.PENDING,
state: data.id?.split("-")?.[0],
stateStatus,
statusDate: new Date(todayEpoch).toISOString() || null,
statusDate: new Date(todayEpoch).toISOString(),
proposedDate: data.proposedEffectiveDate, // wish this was proposedEffectiveDate
subject: null,
submissionDate: new Date(nextBusinessDayEpoch).toISOString() || null,
submissionDate: timestampDate.toISOString(),
submitterEmail: data.submitterEmail,
submitterName: data.submitterName,
initialIntakeNeeded: true,
Expand Down
Loading

0 comments on commit d53f561

Please sign in to comment.