Fix flat entity maps date serialization (#16420)

Changes:
- as we store date in redis as serialized, let's make all flatEntity
dates as string. This requires changing FlatEntity types and making sure
that entity are converted to flatEntity and flatEntity to dtos
This commit is contained in:
Charles Bochet
2025-12-09 16:41:50 +01:00
committed by GitHub
parent 608e5751a9
commit a18203934c
94 changed files with 357 additions and 204 deletions
@@ -179,7 +179,7 @@ export class ServerlessFunctionV2Service {
const optimisticallyUpdatedFlatServerlessFunctionWithDeletedAt = {
...existingFlatServerlessFunction,
deletedAt: new Date(),
deletedAt: new Date().toISOString(),
};
const validateAndBuildResult =
@@ -38,8 +38,8 @@ export const fromCreateServerlessFunctionInputToFlatServerlessFunction = ({
rawCreateServerlessFunctionInput.handlerName ?? DEFAULT_HANDLER_NAME,
universalIdentifier:
rawCreateServerlessFunctionInput.universalIdentifier ?? id,
createdAt: currentDate,
updatedAt: currentDate,
createdAt: currentDate.toISOString(),
updatedAt: currentDate.toISOString(),
deletedAt: null,
latestVersion: null,
publishedVersions: [],
@@ -19,6 +19,9 @@ export const fromServerlessFunctionEntityToFlatServerlessFunction = (
return {
...serverlessFunctionWithoutRelations,
createdAt: serverlessFunctionEntity.createdAt.toISOString(),
updatedAt: serverlessFunctionEntity.updatedAt.toISOString(),
deletedAt: serverlessFunctionEntity.deletedAt?.toISOString() ?? null,
cronTriggerIds:
serverlessFunctionEntity.cronTriggers.map((el) => el.id) ?? [],
routeTriggerIds: