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,37 @@
import { Injectable } from "@nestjs/common";
import { InjectModel } from "@nestjs/mongoose";
import { FilterQuery, Model, UpdateQuery } from "mongoose";
import { LookupModel } from "../schema/lookup.schema";
@Injectable()
export class LookupDbService {
constructor(
@InjectModel(LookupModel.name)
private readonly lookupModel: Model<LookupModel>,
) {}
async create(lookupData: Partial<LookupModel>): Promise<LookupModel> {
return await this.lookupModel.create(lookupData);
}
async findOne(
filter: FilterQuery<LookupModel>,
): Promise<LookupModel | null> {
return await this.lookupModel.findOne(filter).lean();
}
async findOneAndUpdate(
filter: FilterQuery<LookupModel>,
update: UpdateQuery<LookupModel>,
): Promise<LookupModel | null> {
return await this.lookupModel.findOneAndUpdate(filter, update, {
new: true,
upsert: true,
});
}
async findById(id: string): Promise<LookupModel | null> {
return await this.lookupModel.findById(id).lean();
}
}