Multi-environment and multi-user construction
This commit is contained in:
@@ -35,6 +35,7 @@ export interface AuthUserDto {
|
||||
fullName: string;
|
||||
role: UserRole;
|
||||
organizationId: string;
|
||||
organizationName?: string;
|
||||
hasAvatar?: boolean;
|
||||
}
|
||||
|
||||
@@ -110,7 +111,7 @@ export interface UpdateOrgRoleRequest {
|
||||
export interface InviteUserRequest {
|
||||
mobile: string;
|
||||
fullName: string;
|
||||
password: string;
|
||||
password?: string;
|
||||
role?: Exclude<UserRole, "owner">;
|
||||
orgRoleId?: string;
|
||||
}
|
||||
@@ -196,6 +197,46 @@ export interface LoginResponse {
|
||||
user: AuthUserDto;
|
||||
}
|
||||
|
||||
export interface OrganizationMembershipDto {
|
||||
id: string;
|
||||
name: string;
|
||||
role: UserRole;
|
||||
orgRoleName?: string;
|
||||
}
|
||||
|
||||
export interface LoginOrganizationChoiceResponse {
|
||||
requiresOrganizationChoice: true;
|
||||
selectionToken: string;
|
||||
organizations: OrganizationMembershipDto[];
|
||||
}
|
||||
|
||||
export type LoginResult = LoginResponse | LoginOrganizationChoiceResponse;
|
||||
|
||||
export function isLoginOrganizationChoice(
|
||||
data: LoginResult,
|
||||
): data is LoginOrganizationChoiceResponse {
|
||||
return (
|
||||
typeof data === "object" &&
|
||||
data !== null &&
|
||||
"requiresOrganizationChoice" in data &&
|
||||
data.requiresOrganizationChoice === true
|
||||
);
|
||||
}
|
||||
|
||||
export interface SelectOrganizationRequest {
|
||||
selectionToken: string;
|
||||
organizationId: string;
|
||||
}
|
||||
|
||||
export interface SwitchOrganizationRequest {
|
||||
organizationId: string;
|
||||
}
|
||||
|
||||
export interface CreateOrganizationRequest {
|
||||
name: string;
|
||||
businessField?: BusinessField;
|
||||
}
|
||||
|
||||
export interface OrganizationDto {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user