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
+20
View File
@@ -4025,6 +4025,25 @@ export class ExpertClaimService {
return [];
}
private async tejaratNotifierAllowedIds(): Promise<
{ types: number[]; relations: number[] } | undefined
> {
if (resolveFanavaranClientKey() !== "tejaratno") return undefined;
const ids = (raw: unknown) =>
this.asFanavaranLookupRows(raw)
.map((row) => Number(row.Id))
.filter((id) => Number.isInteger(id) && id > 0);
try {
const [typesRaw, relationsRaw] = await Promise.all([
this.lookupsService.getClientRemoteLookup("notifier-type"),
this.lookupsService.getClientRemoteLookup("notifier-relation"),
]);
return { types: ids(typesRaw), relations: ids(relationsRaw) };
} catch {
return { types: [], relations: [] };
}
}
private activeFanavaranLookupRows(value: unknown) {
return this.asFanavaranLookupRows(value)
.filter((row) => row.IsActive !== 0 && Number(row.Id) > 0)
@@ -4111,6 +4130,7 @@ export class ExpertClaimService {
!hasReviewedTejaratNotifier(
fields?.review.values ?? claim.fanavaranFieldReview?.values,
resolveFanavaranClientKey(),
await this.tejaratNotifierAllowedIds(),
)
) {
throw new BadRequestException(