import { TextObjectFilterResult } from "../../Models/TextObjectFilter.model"; import { IEmployeeDocument } from "./Employees.Adapter.Mongoose"; export type FindEmployeesParams = { _id?: string; name?: string; companyId?: string; userId?: string; }; export type PaginateEmployeesParams = FindEmployeesParams & { page: number; limit: number; }; export type PaginateEmployeesResults = { data: IEmployee[]; page: number; pages: number; }; export enum EmployeeRoles { ADMIN = "admin", OWNER = "owner", EMPLOYEE = "employee", } export type CreateEmployeeParams = { companyId: string; userId: string; roles?: EmployeeRoles[]; calendarColor?: string; limit?: number; hostOk?: boolean; sessionUser: string; }; export type UpdateEmployeeParams = { id: string; calendarColor?: string; limit?: number; sessionUser: string; }; export type UpdateEmployeeRolesParams = { employeeId: string; companyId: string; roles: EmployeeRoles[]; calendarColor?: string; limit?: number; sessionUser: string; }; export type FindEmployeesByIdParams = { id?: string; }; export type ValidateEmployeeParams = { employeeId: string; sessionUser: string; }; export type DeleteEmployeesByCompany = { companyId: string; }; export type DeleteEmployeeParams = { employeeId: string; }; export type RemoveCollaboratorParams = { employeeId: string; companyId: string; replacementEmployeeId?: string; sessionUser: string; }; export interface IEmployee { id?: string; companyId: string; userId: string; roles?: EmployeeRoles[]; calendarColor?: string; limit?: number; guestOk?: boolean; hostOk?: boolean; removed?: boolean; removedAt?: Date; removedBy?: string; profileSnapshot?: { firstName?: string; lastName?: string; email?: string; avatar?: string; }; } export interface CompanyEmployeesView { id: string; companyId: string; userId: string; firstName: string; lastName: string; fullName: string; avatar: string; email: string; roles: EmployeeRoles[]; guestOk: boolean; hostOk: boolean; fullOk: boolean; calendarColor: string; removed?: boolean; removedAt?: Date; profileSnapshot?: { firstName?: string; lastName?: string; email?: string; avatar?: string; }; } export interface PublicCompanyEmployeeView { employeeId: string; userId: string; firstName: string; lastName: string; avatarUrl: string; } export interface FindPublicEmployeeParams { employeeId: string; } export interface PublicEmployeeView { employeeId: string; firstName: string; lastName: string; avatarUrl: string; } export interface IncompleteCollaboratorView { employeeId: string; companyId: string; companyName: string; name: string; missingServices: boolean; missingSchedules: boolean; } export interface IEmployeesAdapter { create(data: CreateEmployeeParams): Promise; delete(id: string): Promise; find(filters: FindEmployeesParams): Promise; findOne(filters: FindEmployeesParams): Promise; paginate(filters: PaginateEmployeesParams): Promise; } export interface IEmployeesManager { employees: IEmployeesAdapter; checkRoleById(companyId: string, employeeId: string, role: EmployeeRoles): Promise; createEmployee(data: CreateEmployeeParams): Promise; updateEmployeeRoles(data: UpdateEmployeeRolesParams): Promise; update(data: UpdateEmployeeParams): Promise; findByCompanyId(data: FindEmployeesParams): Promise; findPublicByCompanyId(data: FindEmployeesParams): Promise; findPublicByEmployeeId(data: FindPublicEmployeeParams): Promise; findById(data: FindEmployeesByIdParams): Promise; textObjectFilter(data: FindEmployeesParams): Promise; deleteEmployeesByCompany(data: DeleteEmployeesByCompany): Promise; deleteEmployee(data: DeleteEmployeeParams): Promise; rejectGuest(data: ValidateEmployeeParams): Promise; getIncompleteSetup(sessionUser: string): Promise; removeCollaboratorFromCompany(data: RemoveCollaboratorParams): Promise; }