ENCOA-273
This commit is contained in:
@@ -1,31 +1,32 @@
|
||||
import { RolePermission } from "@/resources/entityPermissions";
|
||||
|
||||
export interface Entity {
|
||||
id: string;
|
||||
label: string;
|
||||
id: string;
|
||||
label: string;
|
||||
licenses: number
|
||||
}
|
||||
|
||||
export interface Role {
|
||||
id: string;
|
||||
entityID: string;
|
||||
permissions: RolePermission[];
|
||||
label: string;
|
||||
isDefault?: boolean
|
||||
id: string;
|
||||
entityID: string;
|
||||
permissions: RolePermission[];
|
||||
label: string;
|
||||
isDefault?: boolean
|
||||
}
|
||||
|
||||
export interface EntityWithRoles extends Entity {
|
||||
roles: Role[];
|
||||
roles: Role[];
|
||||
};
|
||||
|
||||
export type WithLabeledEntities<T> = T extends { entities: { id: string; role: string }[] }
|
||||
? Omit<T, "entities"> & { entities: { id: string; label?: string; role: string, roleLabel?: string }[] }
|
||||
: T;
|
||||
? Omit<T, "entities"> & { entities: { id: string; label?: string; role: string, roleLabel?: string }[] }
|
||||
: T;
|
||||
|
||||
|
||||
export type WithEntity<T> = T extends { entity?: string }
|
||||
? Omit<T, "entity"> & { entity: Entity }
|
||||
: T;
|
||||
? Omit<T, "entity"> & { entity: Entity }
|
||||
: T;
|
||||
|
||||
export type WithEntities<T> = T extends { entities: { id: string; role: string }[] }
|
||||
? Omit<T, "entities"> & { entities: { entity?: Entity; role?: Role }[] }
|
||||
: T;
|
||||
? Omit<T, "entities"> & { entities: { entity?: Entity; role?: Role }[] }
|
||||
: T;
|
||||
|
||||
Reference in New Issue
Block a user