first commit

This commit is contained in:
2026-07-16 20:48:43 -03:00
commit 5696cee264
1111 changed files with 322270 additions and 0 deletions
@@ -0,0 +1,40 @@
import { Document, Model, Schema, model } from "mongoose";
import {
CreateSchedulesDisabledParams,
FindSchedulesDisabledParams,
ISchedulesDisabled,
ISchedulesDisabledAdapter,
} from "./SchedulesDisabled.Interface";
export interface ISchedulesDisabledDocument extends Omit<ISchedulesDisabled, "id ">, Document {}
export class SchedulesDisabledAdapterMongoose implements ISchedulesDisabledAdapter {
schema: Schema;
schedulesDisabledList: Model<ISchedulesDisabledDocument>;
constructor() {
this.schema = new Schema({
employeeId: { type: Schema.Types.ObjectId, required: true, ref: "Employee" },
companyId: { type: Schema.Types.ObjectId, required: true, ref: "Companie" },
startDate: { type: Date, required: true },
endDate: { type: Date, required: true },
creationDate: { type: Date, required: true, default: Date.now },
});
this.schedulesDisabledList = model<ISchedulesDisabledDocument>("SchedulesDisabled", this.schema);
}
public async create(data: CreateSchedulesDisabledParams): Promise<ISchedulesDisabled> {
return await this.schedulesDisabledList.create(data);
}
public async delete(id: string): Promise<void> {
await this.schedulesDisabledList.deleteOne({ _id: id }).exec();
}
public async findOne(
filters: Omit<FindSchedulesDisabledParams, "sessionUser">
): Promise<ISchedulesDisabledDocument | null> {
return this.schedulesDisabledList.findOne(filters).exec();
}
}