add 4 new fields for expert approval

This commit is contained in:
SepehrYahyaee
2026-09-29 15:34:11 +03:30
parent b7a64596dd
commit 05e3e6a4d3
15 changed files with 1271 additions and 74 deletions
+15
View File
@@ -232,6 +232,8 @@ export class LookupsService implements OnModuleInit, OnModuleDestroy {
async searchVehicleKindsList(input: {
q?: string | null;
limit?: number | null;
vehicleGroupId?: number | null;
vehicleSystemId?: number | null;
}): Promise<{
q: string;
count: number;
@@ -252,6 +254,14 @@ export class LookupsService implements OnModuleInit, OnModuleDestroy {
const items = await this.vehicleKindDbService.searchActiveByCaption(
q,
limit,
{
...(input.vehicleGroupId != null
? { vehicleGroupId: Number(input.vehicleGroupId) }
: {}),
...(input.vehicleSystemId != null
? { vehicleSystemId: Number(input.vehicleSystemId) }
: {}),
},
);
return {
q,
@@ -260,6 +270,11 @@ export class LookupsService implements OnModuleInit, OnModuleDestroy {
};
}
async getActiveVehicleKindById(id: number) {
await this.ensureVehicleKindsSynced(false);
return this.vehicleKindDbService.findActiveById(id);
}
/**
* Ensure `vehicle-kinds` Mongo collection is populated and not older than 1 week.
* Concurrent callers share one in-flight sync.