forked from Yara724/api
fanavaran V15 tejaratno
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user