Add TejaratNo notifier review and submission validation

This commit is contained in:
SepehrYahyaee
2026-10-10 12:51:11 +03:30
parent a410655faa
commit 8f568f379c
14 changed files with 588 additions and 34 deletions
+2 -1
View File
@@ -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",
+8
View File
@@ -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)