Continued creating the entity system
This commit is contained in:
@@ -3,14 +3,17 @@ export interface Entity {
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface Roles {
|
||||
export interface Role {
|
||||
id: string;
|
||||
entityID: string;
|
||||
permissions: string[];
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface EntityWithPermissions extends Entity {
|
||||
roles: Roles[];
|
||||
export interface EntityWithRoles extends Entity {
|
||||
roles: Role[];
|
||||
}
|
||||
|
||||
export type WithEntity<T> = T extends {entities: string[]} ? T & {entities: Entity[]} : T;
|
||||
export type WithEntity<T> = T extends {entities: {id: string; role: string}[]}
|
||||
? Omit<T, "entities"> & {entities: {entity?: Entity; role?: Role}[]}
|
||||
: T;
|
||||
|
||||
@@ -8,5 +8,6 @@ export interface Step {
|
||||
|
||||
export interface Grading {
|
||||
user: string;
|
||||
entity?: string;
|
||||
steps: Step[];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import {User} from "./user";
|
||||
|
||||
export interface Invite {
|
||||
id: string;
|
||||
from: string;
|
||||
to: string;
|
||||
id: string;
|
||||
from: string;
|
||||
to: string;
|
||||
}
|
||||
|
||||
export interface InviteWithUsers extends Omit<Invite, "from"> {
|
||||
from?: User;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ export interface Assignment {
|
||||
start?: boolean;
|
||||
autoStartDate?: Date;
|
||||
autoStart?: boolean;
|
||||
entity?: string;
|
||||
}
|
||||
|
||||
export type AssignmentWithCorporateId = Assignment & {corporateId: string};
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface BasicUser {
|
||||
status: UserStatus;
|
||||
permissions: PermissionType[];
|
||||
lastLogin?: Date;
|
||||
entities: string[];
|
||||
entities: {id: string; role: string}[];
|
||||
}
|
||||
|
||||
export interface StudentUser extends BasicUser {
|
||||
@@ -150,6 +150,7 @@ export interface Group {
|
||||
participants: string[];
|
||||
id: string;
|
||||
disableEditing?: boolean;
|
||||
entity?: string;
|
||||
}
|
||||
|
||||
export interface GroupWithUsers extends Omit<Group, "participants" | "admin"> {
|
||||
|
||||
Reference in New Issue
Block a user