feat: implement collaborator reactivation logic, add access denied handling, and improve metric filtering

This commit is contained in:
2026-07-19 18:56:39 -03:00
parent af6c87acb6
commit 74d6ee6706
27 changed files with 3148 additions and 37 deletions
@@ -68,6 +68,13 @@ export type DeleteEmployeeParams = {
employeeId: string;
};
export type RemoveCollaboratorParams = {
employeeId: string;
companyId: string;
replacementEmployeeId?: string;
sessionUser: string;
};
export interface IEmployee {
id?: string;
companyId: string;
@@ -77,6 +84,15 @@ export interface IEmployee {
limit?: number;
guestOk?: boolean;
hostOk?: boolean;
removed?: boolean;
removedAt?: Date;
removedBy?: string;
profileSnapshot?: {
firstName?: string;
lastName?: string;
email?: string;
avatar?: string;
};
}
export interface CompanyEmployeesView {
@@ -93,6 +109,14 @@ export interface CompanyEmployeesView {
hostOk: boolean;
fullOk: boolean;
calendarColor: string;
removed?: boolean;
removedAt?: Date;
profileSnapshot?: {
firstName?: string;
lastName?: string;
email?: string;
avatar?: string;
};
}
export interface IncompleteCollaboratorView {
@@ -125,4 +149,5 @@ export interface IEmployeesManager {
deleteEmployee(data: DeleteEmployeeParams): Promise<void>;
rejectGuest(data: ValidateEmployeeParams): Promise<void>;
getIncompleteSetup(sessionUser: string): Promise<IncompleteCollaboratorView[]>;
removeCollaboratorFromCompany(data: RemoveCollaboratorParams): Promise<void>;
}