Refactor WorkspaceMemberDto transpilation (#12110)

# Introduction

In a nutshell this PR introduces a `workspaceMemberEntity` to
`workspaceMemberDto` transpilation which was not done but commented as
`// TODO` across the `user resolver`.
Also passed on the `Roles` and `UserWorkspacePermissions` transpilation
We now also compute the roles for the `workspaceMember` resolver ( not
only the `workspaceMembers` )
Some refactor

In the following days about to create a PR that introduces integration
testing on the user resolver

## Conclusion
As always any suggestions are more than welcomed ! Please let me know !

## Misc

Following https://github.com/twentyhq/twenty/pull/11914

closing https://github.com/twentyhq/core-team-issues/issues/1011
This commit is contained in:
Paul Rastoin
2025-06-13 11:01:25 +02:00
committed by GitHub
parent 7c4ddb9448
commit 4182a3d306
11 changed files with 407 additions and 252 deletions

View File

@ -1,8 +1,7 @@
export type ObjectRecordsPermissions = {
[objectMetadataId: string]: {
type ObjectMetadataId = string;
export type ObjectRecordsPermissions = Record<ObjectMetadataId, {
canRead: boolean;
canUpdate: boolean;
canSoftDelete: boolean;
canDestroy: boolean;
};
};
}>;

View File

@ -1,5 +1,7 @@
import { ObjectRecordsPermissions } from '@/types';
import { ObjectRecordsPermissions } from "@/types/ObjectRecordsPermissions";
export type ObjectRecordsPermissionsByRoleId = {
[roleId: string]: ObjectRecordsPermissions;
};
type RoleId = string;
export type ObjectRecordsPermissionsByRoleId = Record<
RoleId,
ObjectRecordsPermissions
>;