first commit
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import { IMetricsDocument } from "./Metrics.Adapter.Mongoose";
|
||||
|
||||
export type MetricsParams = {
|
||||
userId?: string;
|
||||
quantity?: number;
|
||||
};
|
||||
|
||||
export type DeleteMetricsByCompany = {
|
||||
companyId: string;
|
||||
};
|
||||
|
||||
export type CalculateMetricsParams = {
|
||||
userId: string;
|
||||
};
|
||||
|
||||
export interface IMetrics {
|
||||
id?: string;
|
||||
userId: string;
|
||||
organizationsCount: number;
|
||||
employeesCount: number;
|
||||
servicesCount: number;
|
||||
appointmentsCount: number;
|
||||
clientsCount: number;
|
||||
repeatsCount: number;
|
||||
month: number;
|
||||
year: number;
|
||||
}
|
||||
|
||||
export interface IMetricsAdapter {
|
||||
create(userId: string): Promise<IMetricsDocument>;
|
||||
reset(userId: string): Promise<IMetricsDocument>;
|
||||
getMetrics(userId: string): Promise<IMetricsDocument>;
|
||||
addOrganization(data: MetricsParams): Promise<void>;
|
||||
addEmployee(data: MetricsParams): Promise<void>;
|
||||
addService(data: MetricsParams): Promise<void>;
|
||||
addAppointment(data: MetricsParams): Promise<void>;
|
||||
addClient(data: MetricsParams): Promise<void>;
|
||||
}
|
||||
|
||||
export interface IMetricsManager {
|
||||
metrics: IMetricsAdapter;
|
||||
reset(userId: string): Promise<void>;
|
||||
getMetrics(userId: string): Promise<IMetricsDocument>;
|
||||
addOrganization(data: MetricsParams): Promise<void>;
|
||||
addEmployee(data: MetricsParams): Promise<void>;
|
||||
addService(data: MetricsParams): Promise<void>;
|
||||
addAppointment(data: MetricsParams): Promise<void>;
|
||||
addClient(data: MetricsParams): Promise<void>;
|
||||
canAddOrganization(userId: string): Promise<boolean>;
|
||||
canAddEmployee(userId: string): Promise<boolean>;
|
||||
canAddService(userId: string): Promise<boolean>;
|
||||
canAddAppointment(userId: string): Promise<boolean>;
|
||||
canAddClient(userId: string): Promise<boolean>;
|
||||
deleteMetricsByCompany(data: DeleteMetricsByCompany): Promise<void>;
|
||||
calculateMetrics(data: CalculateMetricsParams): Promise<void>;
|
||||
}
|
||||
Reference in New Issue
Block a user