argos/dmp-frontend/src/app/core/model/user/user.ts

73 lines
1.5 KiB
TypeScript
Raw Normal View History

2023-11-24 17:42:23 +01:00
import { ContactInfoType } from "@app/core/common/enum/contact-info-type";
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
import { Guid } from "@common/types/guid";
2019-01-18 18:03:45 +01:00
import { AppRole } from "../../common/enum/app-role";
2023-11-24 17:42:23 +01:00
import { Reference } from "../reference/reference";
2019-01-18 18:03:45 +01:00
2023-11-24 17:42:23 +01:00
export interface UserModel { //TODO: Delete after refactor, since its old model.
2019-01-18 18:03:45 +01:00
id: String;
name: String;
appRoles: AppRole[];
2019-05-28 09:49:09 +02:00
email: String;
2019-01-18 18:03:45 +01:00
}
2023-11-24 17:42:23 +01:00
export interface User extends BaseEntity {
name: string;
additionalInfo: UserAdditionalInfo;
contacts: UserContactInfo[];
roles: UserRole[];
credentials: UserCredential[];
}
export interface UserPersist extends BaseEntityPersist {
name: String;
additionalInfo: UserAdditionalInfoPersist;
}
export interface UserAdditionalInfoPersist {
avatarUrl: String;
timezone: String;
culture: String;
language: String;
roleOrganization: String;
organizationId: Guid;
}
export interface UserAdditionalInfo {
avatarUrl: String;
timezone: String;
culture: String;
language: String;
roleOrganization: String;
organization: Reference;
}
export interface UserContactInfo {
id: Guid;
value: String;
type: ContactInfoType;
ordinal: number;
user: User;
createdAt: Date;
}
export interface UserRole {
id: Guid;
role: String;
user: User;
createdAt: Date;
}
export interface UserRolePatchPersist {
id: Guid;
roles: String[];
hash: string;
}
export interface UserCredential {
id: Guid;
externalId: String;
user: User;
createdAt: Date;
}