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
@@ -13,7 +13,7 @@ export const fromCreateRoleInputToFlatRoleToCreate = ({
workspaceId: string;
applicationId: string;
}): FlatRole => {
const now = new Date();
const now = new Date().toISOString();
const {
label,
@@ -20,8 +20,8 @@ export const fromRoleEntityToFlatRole = (role: RoleEntity): FlatRole => {
canBeAssignedToApiKeys: role.canBeAssignedToApiKeys,
canBeAssignedToApplications: role.canBeAssignedToApplications,
workspaceId: role.workspaceId,
createdAt: role.createdAt,
updatedAt: role.updatedAt,
createdAt: role.createdAt.toISOString(),
updatedAt: role.updatedAt.toISOString(),
universalIdentifier: role.universalIdentifier ?? role.standardId ?? role.id,
applicationId: role.applicationId ?? null,
roleTargetIds: role.roleTargets.map((rt) => rt.id),
@@ -7,7 +7,7 @@ export const fromStandardRoleDefinitionToFlatRole = (
standardRoleDefinition: StandardRoleDefinition,
workspaceId: string,
): FlatRole => {
const createdAt = new Date();
const createdAt = new Date().toISOString();
return {
...standardRoleDefinition,