forked from Yara724/api
add 4 new fields for expert approval
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user