171 lines
3.3 KiB
TypeScript
171 lines
3.3 KiB
TypeScript
export type FindEmployeesParams = {
|
|
_id?: string;
|
|
name?: string;
|
|
companyId?: string;
|
|
userId?: string;
|
|
};
|
|
|
|
export type FindEmployeesByServiceParams = {
|
|
serviceId?: string;
|
|
};
|
|
|
|
export enum EmployeeRoles {
|
|
ADMIN = "admin",
|
|
OWNER = "owner",
|
|
EMPLOYEE = "employee",
|
|
}
|
|
|
|
export interface IEmployee {
|
|
id?: string;
|
|
companyId: string;
|
|
userId: string;
|
|
roles?: EmployeeRoles[];
|
|
guestOk?: boolean;
|
|
hostOk?: boolean;
|
|
removed?: boolean;
|
|
removedAt?: Date;
|
|
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 type CreateEmployeeParams = {
|
|
companyId: string;
|
|
userId: string;
|
|
roles?: EmployeeRoles[];
|
|
sessionUser: string;
|
|
};
|
|
|
|
export type UpdateEmployeeParams = {
|
|
id: string;
|
|
calendarColor?: string;
|
|
limit?: number;
|
|
sessionUser: string;
|
|
};
|
|
|
|
export type UpdateEmployeeRolesParams = {
|
|
employeeId: string;
|
|
companyId: string;
|
|
roles: EmployeeRoles[];
|
|
sessionUser: string;
|
|
};
|
|
|
|
export type ValidateEmployeeParams = {
|
|
employeeId: string;
|
|
sessionUser: string;
|
|
};
|
|
|
|
export type RemoveCollaboratorParams = {
|
|
employeeId: string;
|
|
companyId: string;
|
|
replacementEmployeeId?: string;
|
|
sessionUser: string;
|
|
};
|
|
|
|
export type FindEmployeesByIdParams = {
|
|
id?: string;
|
|
};
|
|
|
|
export type FindCollaboratorServicesParams = {
|
|
companyId: string;
|
|
employeeId: string;
|
|
sessionUser: string;
|
|
};
|
|
|
|
export type FindEmployeesServicesParams = {
|
|
_id?: string;
|
|
companyId?: string;
|
|
employeeId?: string;
|
|
serviceId?: string;
|
|
};
|
|
|
|
export type UpdateCollaboratorServicesParams = {
|
|
companyId: string;
|
|
employeeId: string;
|
|
services: ServiceStatusItem[];
|
|
sessionUser: string;
|
|
};
|
|
|
|
export interface CollaboratorServiceItems {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
length: number;
|
|
price: number;
|
|
limit: number;
|
|
active: boolean;
|
|
}
|
|
|
|
export interface CollaboratorServiceView {
|
|
companyId: string;
|
|
employeeId: string;
|
|
fullName: string;
|
|
avatar: string;
|
|
services: CollaboratorServiceItems[];
|
|
}
|
|
|
|
export interface ServiceStatusItem {
|
|
serviceId: string;
|
|
active: boolean;
|
|
}
|
|
|
|
export type ScheduleItem = {
|
|
from: string;
|
|
to: string;
|
|
disabled: boolean;
|
|
serviceScope?: "all" | "specific";
|
|
serviceIds?: string[];
|
|
};
|
|
|
|
export type FindSchedulesParams = {
|
|
_id?: string;
|
|
companyId?: string;
|
|
employeeId?: string;
|
|
weekDay?: number;
|
|
};
|
|
|
|
export interface CollaboratorSchedulesView {
|
|
companyId: string;
|
|
employeeId: string;
|
|
scheduleId: string;
|
|
weekDay: number;
|
|
fullName: string;
|
|
avatar: string;
|
|
schedules: ScheduleItem[];
|
|
}
|
|
|
|
export type UpdateScheduleParams = {
|
|
companyId: string;
|
|
employeeId: string;
|
|
schedules: Array<ScheduleItem>;
|
|
weekDay: number;
|
|
sessionUser: string;
|
|
};
|