fanavaran V15 tejaratno

This commit is contained in:
2026-10-10 16:04:07 +03:30
parent 22ffeed75c
commit 64d5aa691f
12 changed files with 279 additions and 33 deletions
+1 -1
View File
@@ -671,7 +671,7 @@ export class LookupsController {
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}. " +
"TejaratNo notifier-type and notifier-relation use the supplied local tenant codebooks without a remote fetch.",
"TejaratNo notifier-type and notifier-relation are read from the lookups collection and are not fetched from Fanavaran.",
})
@ApiParam({
name: "lookupName",
+7 -4
View File
@@ -1,4 +1,4 @@
import { tejaratNotifierLookup } from "src/fanavaran/tejarat-notifier";
import { isTejaratNotifierLookup } from "src/fanavaran/tejarat-notifier";
import {
BadRequestException,
Injectable,
@@ -126,12 +126,15 @@ export class LookupsService implements OnModuleInit, OnModuleDestroy {
async getClientRemoteLookup(lookupName: string): Promise<unknown> {
const clientKey = this.activeClientKey();
const notifier = tejaratNotifierLookup(lookupName);
if (notifier) {
if (isTejaratNotifierLookup(lookupName)) {
if (clientKey !== "tejaratno") {
throw new BadRequestException("Notifier lookups apply only to TejaratNo.");
}
return notifier;
const stored = await this.fanavaranLookupService.readStoredLookup(lookupName);
if (stored == null) {
throw new NotFoundException(`Lookup "${lookupName}" not found`);
}
return stored;
}
const definition = this.findRemoteLookup(lookupName);