forked from Yara724/api
Add TejaratNo notifier review and submission validation
This commit is contained in:
@@ -670,7 +670,8 @@ export class LookupsController {
|
||||
summary: "Fetch a Fanavaran remote lookup by name",
|
||||
description:
|
||||
"Generic cached Fanavaran lookup fetcher. Configured names use their catalogue URL; " +
|
||||
"unlisted slugs (e.g. vehicle-groups) fall back to car/base-info/{lookupName}.",
|
||||
"unlisted slugs (e.g. vehicle-groups) fall back to car/base-info/{lookupName}. " +
|
||||
"TejaratNo notifier-type and notifier-relation use the supplied local tenant codebooks without a remote fetch.",
|
||||
})
|
||||
@ApiParam({
|
||||
name: "lookupName",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { tejaratNotifierLookup } from "src/fanavaran/tejarat-notifier";
|
||||
import {
|
||||
BadRequestException,
|
||||
Injectable,
|
||||
@@ -125,6 +126,13 @@ export class LookupsService implements OnModuleInit, OnModuleDestroy {
|
||||
|
||||
async getClientRemoteLookup(lookupName: string): Promise<unknown> {
|
||||
const clientKey = this.activeClientKey();
|
||||
const notifier = tejaratNotifierLookup(lookupName);
|
||||
if (notifier) {
|
||||
if (clientKey !== "tejaratno") {
|
||||
throw new BadRequestException("Notifier lookups apply only to TejaratNo.");
|
||||
}
|
||||
return notifier;
|
||||
}
|
||||
const definition = this.findRemoteLookup(lookupName);
|
||||
|
||||
// Parsian: file → lookups collection → Fanavaran (default inside FanavaranLookupService)
|
||||
|
||||
Reference in New Issue
Block a user