Initial commit after migration to gitea

This commit is contained in:
2026-01-18 11:27:43 +03:30
parent a21039410c
commit ea4b8eb543
196 changed files with 45567 additions and 9 deletions

View File

@@ -0,0 +1,34 @@
import { Injectable } from "@nestjs/common";
import { InjectModel } from "@nestjs/mongoose";
import { FilterQuery, Model, Types } from "mongoose";
import { BranchModel, BranchDocument } from "../schema/branch.schema";
@Injectable()
export class BranchDbService {
constructor(
@InjectModel(BranchModel.name)
private readonly branchModel: Model<BranchModel>,
) {}
async create(branch: BranchModel): Promise<BranchModel> {
return await this.branchModel.create(branch);
}
async find(branch: FilterQuery<BranchModel>): Promise<BranchDocument> {
return await this.branchModel.findOne(branch);
}
async findOne(branch: FilterQuery<BranchModel>) {
return this.branchModel.findOne(branch);
}
async findAll(insuranceId: string): Promise<BranchModel[]> {
return await this.branchModel.find({
clientKey: new Types.ObjectId(insuranceId),
});
}
async findById(id: string): Promise<BranchModel | null> {
return this.branchModel.findById(id).lean();
}
}