2022-10-11 10:18:12 +00:00
|
|
|
import { EntityInfo } from './entity';
|
2022-09-23 22:14:51 +00:00
|
|
|
|
2022-10-16 13:28:42 +00:00
|
|
|
export enum UserRoles {
|
|
|
|
ADMIN = 'ADMIN',
|
|
|
|
USER = 'USER',
|
|
|
|
}
|
|
|
|
|
2022-10-10 10:11:11 +00:00
|
|
|
export type UserInfo = {
|
2022-10-14 16:49:09 +00:00
|
|
|
uuid: string;
|
2022-10-15 20:04:27 +00:00
|
|
|
username: string;
|
2022-10-16 13:28:42 +00:00
|
|
|
role: keyof typeof UserRoles;
|
2022-10-10 15:01:31 +00:00
|
|
|
};
|
2022-09-23 22:14:51 +00:00
|
|
|
|
2022-10-16 13:28:42 +00:00
|
|
|
export type User = UserInfo & EntityInfo;
|
|
|
|
|
|
|
|
export type UserCtor = Partial<User>;
|
|
|
|
|
2022-10-14 16:49:09 +00:00
|
|
|
export type UserInfoWithPassword = {
|
2022-10-14 17:18:28 +00:00
|
|
|
password: string;
|
2022-10-14 16:49:09 +00:00
|
|
|
} & UserInfo;
|
|
|
|
|
|
|
|
export type UserWithPassword = UserInfoWithPassword & EntityInfo;
|
|
|
|
|
2022-10-16 13:28:42 +00:00
|
|
|
export type UserWithPasswordCtor = Partial<UserWithPassword>;
|
|
|
|
|
2022-10-10 10:11:11 +00:00
|
|
|
export type CreateUserBody = {
|
2022-10-15 20:04:27 +00:00
|
|
|
username: string;
|
2022-09-23 22:14:51 +00:00
|
|
|
password: string;
|
2022-10-16 13:28:42 +00:00
|
|
|
role: keyof typeof UserRoles;
|
2022-09-23 22:14:51 +00:00
|
|
|
};
|
|
|
|
|
2022-10-15 20:04:27 +00:00
|
|
|
export type LoginUserBody = {
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
};
|