Skip to content

Commit

Permalink
Updating the evens transform
Browse files Browse the repository at this point in the history
  • Loading branch information
rmuntaqim committed Oct 9, 2024
1 parent 630c00e commit ce0429e
Showing 1 changed file with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { raiResponseSchema } from "../../..";

export const transform = (id: string) => {
return raiResponseSchema.transform((data) => ({
id,
makoChangedDate: data.timestamp
? new Date(data.timestamp).toISOString()
: null,
}));
import { events, getStatus, SEATOOL_STATUS } from "shared-types";
export const transform = () => {
return events["respond-to-rai"].schema.transform((data) => {
const { stateStatus, cmsStatus } = getStatus(SEATOOL_STATUS.PENDING_RAI);
return {
id: data.id,
raiWithdrawEnabled: false,
makoChangedDate: data.timestamp
? new Date(data.timestamp).toISOString()
: null,
cmsStatus,
stateStatus,
seatoolStatus: SEATOOL_STATUS.PENDING_RAI,
locked: true,
};
});
};

export type Schema = ReturnType<typeof transform>;

0 comments on commit ce0429e

Please sign in to comment.