Files
yara724api/docs/fanavaran/request-lookup-fields.md
T

231 lines
14 KiB
Markdown

# Lookup-backed fields by Fanavaran submission request
Code snapshot: 2026-11-11. This describes the current YARA builders and validation,
not a live acceptance test. Older stage-field/audit documents contain historical
defaults; use the validation implementation as the authority for current checks.
Ordinary codebook names below can be read through
`GET /lookups/fanavaran/{lookup-name}`. These routes use the deployment's active
insurer. Use the same insurer/product/contract as the submission being checked.
Use each row's `Id`, not its Caption or a different provider's code. A valid ID
must also represent the intended meaning, be active when IsActive is supplied,
and satisfy policy/vehicle/person relationships.
Validation labels:
- **Live checked:** current hull outbound validation checks membership/activity
using fresh API responses. A failed lookup or invalid selection blocks the write.
- **Gap:** no equivalent comprehensive third-party outbound membership check.
Some UI selections/inquiries are validated, but defaults and saved values can
still be wrong for the target insurer or current contract.
- **Conditional:** currently null/unset; becomes a concern if populated or required
by a vendor rule. Do not guess an endpoint/code when the source is unconfirmed.
## 1. Third-party base claim — GEN.03
`POST /car/third-party-car-financial-claims`
| Request field | Lookup/source | Current concern |
|---|---|---|
| AccidentCityId | cities | Reviewed selection or default 701; gap |
| AccidentReportTypeId | accident-report-type | Reviewed selection or default 155; gap |
| AccidentCauseId | accident-causes | Builder still starts with fixed 6; supplied accident-reason code is not applied as the outbound ID |
| AccidentVehicleUsedId | vehicle-use-types + actual policy/VIN vehicle UsedId | Vehicle group must match; inquiry/group/default fallbacks remain |
| CulpritTypeId | accident-culprit-type | Derived insurer-driver distinction, currently 337/338; no universal live membership guard |
| CulpritLicenceTypeId | driving-licence-types | Tenant default normally 2; must match the driver's actual licence category |
| CulpritLicenceCityId | cities | Conditional; normally null |
| CulpritLicenceCountryId | countries | Conditional; normally null |
| HasOtherCulprit | ans | Currently 0 |
| IsFatalAccident | yes/no flag | Currently 0; no third-party live codebook validation |
| IsAccidentOutOfBorder | ans / yes-no flag | Currently 0 |
| IsPlaqueChanged | yes/no flag | Currently 0 |
| IsLicenseMatchWithVehicleKind | yes/no flag | Currently 1; this does not validate the actual licence/vehicle relationship |
| IsLicenseReplacement | yes/no flag | Currently 0; hull uses a different field name |
| IsOwnerChanged, CostSeparationToDmgSections, IsSurplusArticleEighthLaw | yes/no flags | Conditional; normally null on third-party |
| CompensationReferenceId | Dedicated source not configured in the local lookup catalogue | Default 167; confirm the vendor's codebook/contract rather than inventing a lookup URL |
| PoliceOfficerId | Dedicated source not configured | Fixed 1 on third-party; needs contract confirmation |
| UnknownCulpritCauseId | No source wired | Conditional; currently null |
TejaratNo's current third-party branch additionally sends:
| Request field | Lookup/source | Concern |
|---|---|---|
| DmgNotifications[].NotifierTypeId | notifier-type | Must be an explicitly reviewed allowed choice |
| DmgNotifications[].NotifierRelationId | notifier-relation | Must represent the notifier's actual relationship |
| DmgNotifications[].NotifierPartyId | Person inquiry / GEN.44 response | Person record ID, not a generic codebook; must identify the correct notifier |
| DmgNotifications[].IsInjuredPartyIdentified | yes/no flag | Conditional; currently null |
Do not apply the TejaratNo DmgNotifications shape to other insurers automatically.
## 2. Third-party damage case — GEN.12
`POST /car/third-party-car-financial-claims/{claimId}/dmg-cases`
| Request field | Lookup/source | Current concern |
|---|---|---|
| VehicleKindId | vehicle-kinds / matched vehicle GET | Model and VehicleGroupId must match; expert selection and caption fallbacks need correct catalogue provenance |
| AccidentVehicleUsedId | vehicle-use-types / vehicle UsedId | Must belong to the selected vehicle's group; default remains possible |
| DmgCaseTypeId | dmg-case-type | Tenant default normally 175; gap |
| DmgHistoryStatus | dmg-history-status | Reviewed choice or default 5214; gap |
| InsuranceCorpId | insurance-corp | Actual damaged vehicle insurer, selected by caption; cached/default tenant provenance can be wrong |
| LicenceTypeId | driving-licence-types | Uses tenant CulpritLicenceTypeId, normally 2; gap |
| LicenceCityId | cities | Conditional; currently null |
| LicenceCountryId | countries | Conditional; currently null |
| DriverIsOwner | yes/no flag | Derived 1/0; must represent the actual driver/owner relationship |
| PlaqueKindId | Vehicle inquiry / GET | Must match actual plate kind; national-plate fallback 8 remains |
| PlaqueSampleId | Vehicle inquiry / GET | Must match actual plate sample; fallback 10 remains |
| PlaqueMiddleCodeId | Vehicle response or static plate-letter mapping | Not the visible plate letter or an unrelated provider code; no configured standalone lookup endpoint |
| PlaqueCityId | Vehicle response | Conditional; no independent membership check |
DriverId and OwnerId are person record IDs. Inquiry acceptance currently requires
RoleId 161 or 166; a different role cannot simply be reused as DriverId. Missing
acceptable people can trigger GEN.44 registration before damage submission.
## 3. Third-party attachments — GEN.07
`POST /car/third-party-car-financial-claims/{claimId}/files`
| Request field | Lookup | Current concern |
|---|---|---|
| FileTypeId | file-types | Configured ClaimFileTypeId; must be active and the correct document category for that insurer |
| Files[].FileTypeId, when this repeated metadata is present | file-types | Must agree with the same document type |
The strict hull lookup guard does not cover third-party file uploads. A historical
successful file type from another insurer is not proof of acceptance here.
## 4. Third-party expertise — GEN.08
`POST /car/third-party-car-financial-claims/{claimId}/expertise`
| Request field | Lookup | Current concern |
|---|---|---|
| InspectionPlaceId | inspection-place | Reviewed selection, otherwise 282; gap |
| DropAmountStatus | drop-amount-status | Fixed 5458; the fetched lookup is not used to select a replacement ID |
| DmgSections[].DmgSectionId | car-components | This is the selected catalogue part ID on submission; a local/shared snapshot can be wrong for the insurer |
| DmgSections[].AccidentLevel | accident-level | Numeric typeOfDamage or fallback 5456; must be a severity ID, not a label |
Readiness checks for these fields primarily check presence. They are not the same
as the fresh API membership/activity validation added to hull writes.
## 5. Hull base claim — GEN.03
`POST /car/vehicle-hull-claims`, also checked for base PUT updates.
| Request field | Lookup | Current handling |
|---|---|---|
| AccidentCityId | cities | Live checked; reviewed/configured selection must exist |
| AccidentReportTypeId | accident-report-type | Live checked |
| AccidentCauseId | accident-causes | Live checked; candidate still starts at 6, so check that its meaning is the actual accident cause |
| AccidentTypeId | vehicle-hull-accident-types | Reviewed choice or response row for تصادف(حادثه); live checked, no numeric fallback |
| CulpritTypeId | vehicle-hull-accident-culprit-type | Reviewed choice or response row for بیمه‌گذار; live checked; third-party 337 is not reused |
| AuthorityCulpritId | detection-accident-culprits | Reviewed choice or matching بیمه‌گذار response row; live checked, no first-row/numeric fallback |
| CulpritLicenceTypeId | driving-licence-types | Live checked; membership does not prove it matches the real driver's licence |
| AccidentVehicleUsedId | vehicle-use-types + exact policy vehicle/version UsedId | Inquiry-derived and live checked; vehicle/group relationship still matters |
| IsLicenseReplaced | ans | `1` if licence issue >10y before accident, else `null` |
| IsOwnerChanged | ans | Currently 0; live checked |
| CostSeparationToDmgSections | ans | Currently 0; live checked |
| IsAccidentOutOfBorder | ans | Currently 0; live checked when non-null |
| IsSurplusArticleEighthLaw | ans | Conditional; live checked when non-null |
| CulpritLicenceCityId | cities | Conditional; live checked when non-null |
| CulpritLicenceCountryId | countries | Conditional; live checked when non-null |
| NotifierTypeId, TejaratNo only | notifier-type | Root field for hull, unlike third-party DmgNotifications; live checked when present |
| NotifierRelationId, TejaratNo only | notifier-relation | Root field; live checked when present |
| GlassBreakReasonId | No lookup source currently wired | Conditional; currently null; verify the provider contract if using a glass-break scenario |
PoliceOfficerId is currently null on hull. CompensationReferenceId and the
third-party-only IsLicenseReplacement are stripped from the hull payload.
ActualPremium comes from the policy response, not a lookup list.
## 6. Hull attachments — GEN.05
`POST /car/vehicle-hull-claims/{claimId}/files`
| Request field | Lookup | Current handling |
|---|---|---|
| FileTypeId | file-types | Configured choice, live checked before upload |
| Files[].FileTypeId, when present | file-types | Live checked as well |
A file type being active does not prove the document belongs in that category.
The returned attachment Id is saved as fileId; it is not FileTypeId.
## 7. Hull expertise — GEN.06
`POST /car/vehicle-hull-claims/{claimId}/expertise`
| Request field | Lookup/source | Current handling |
|---|---|---|
| DmgSections[].AccessoryKindId | car-components | Selected part ID, live checked |
| DmgSections[].VehicleHullAccessoryId | Current hull policy dmg-accessories | Exact `AccessoryKindId` (or caption) match on one policy row; Id+kind must stay coherent; no factory-bundle guess; block submit if missing |
| DmgSections[].DmgKindId | vehicle-hull-dmg-kind | Response row caption تخریب; live checked, no numeric fallback |
| DmgSections[].DmgSectionCosts[].DmgCostKindId | vehicle-hull-dmg-cost-kinds | Response row caption مجموع لوازم; live checked, no numeric fallback |
| ColorId | Policy vehicle GET ColorId | Inquiry-derived; not independently checked against a colour lookup |
| PlaqueDesignId | No source wired | Conditional; currently null |
| PlaqueCityId | No source wired on hull expertise | Conditional; currently null |
| IsDestruction | Optional flag | Currently null; no live yes/no membership check in the expertise validator |
Get the policy accessory rows using:
`GET /lookups/vehicle-hull-dmg-accessories/{policyId}`
Upstream source:
`GET /car/vehicle-hull-policies/{policyId}/dmg-accessories`
Use the row's Id for VehicleHullAccessoryId and that same row's AccessoryKindId.
Fanavaran rule `CarDamageBdAsibdideSectionLookupFilterRule` rejects pairing a
local car-components part id with an unrelated policy accessory Id (including
factory-bundle rows). If the policy list has no matching row, refuse submit.
Hull has no damage-case POST. DmgCaseId, InspectionPlaceId and DropAmountStatus
are not hull expertise fields. AccidentPercent is a percentage, not a lookup ID.
## 8. Person registration — GEN.44, when triggered by either product
`POST /common/other-people`
| Request field | Lookup | Current concern |
|---|---|---|
| CityId | cities | Explicit/inquiry/caption selection, else default 9131 remains |
| GenderId | gender | Inquiry/explicit/caption selection; may remain null |
| MaritalStatus | marital-status | Currently normally null |
| IsIranian | ans | Actual person status, with 1/0 fallbacks |
| NationalityId | countries | Normally null for Iranian people; foreign-nationality mapping needs explicit review |
| PersonKindId | person-kind | Explicit/caption selection, else default 46 remains |
GEN.44 is not covered by the hull base/files/expertise lookup validator. It also
has identity, birthday and mobile validation which can fail without a lookup error.
## Record IDs and headers: related failures, but not ordinary codebooks
| Value | Correct source / relationship |
|---|---|
| Base PolicyId | Correct guilty-party third-party policy, or first-party hull policy; never mix the products |
| Base ClaimExpertId | Staff ThirdPartyClaimExpertId or CarBodyClaimExpertId |
| Expertise ClaimExpertId | Staff ThirdPartyExpertiseClaim or CarBodyExpertiseClaim; different role from base ClaimExpertId |
| Third-party DriverId / OwnerId | Appropriate person inquiry / GEN.44 Id; required accepted roles |
| Hull AccidentCulpritId | Driver inquiry; policy CustomerId is a fallback and may identify a different person |
| NotifierPartyId | Correct notifier person record |
| Nested claimId | Base-create response Id, not ClaimNo |
| Third-party DmgCaseId | That claim's damage-case response Id |
| expertiseId | That claim's expertise response Id |
| fileId | That claim's upload response Id; use file-types only for FileTypeId |
| Location header | Responsible staff locations[].id, else their branch's code |
| ContractId header | Correct product contract; hullContractId where configured |
| CorpId header / authenticationToken | Credentials/scoping for the same insurer as all selected codes |
Amounts, wages, premiums, dates, times, counts, descriptions, licence numbers,
VIN/chassis/motor text, and plain plate digits are not generic lookup IDs. They
can still fail required-field, format, range, identity or cross-field rules.
## Highest-priority remaining checks
Third-party still needs the most attention: base accident/driver codes, damage
vehicle/use/plate codes, DmgCaseTypeId/DmgHistoryStatus, expertise inspection/drop/
severity/part codes, attachment FileTypeId, and GEN.44 defaults. Hull's live checks
prevent missing/inactive IDs but cannot prove that a valid selected code has the
correct business meaning or satisfies every provider rule.
Use stage previews before submission. Hull failures identify lookup fields through
FANAVARAN_HULL_LOOKUP_INVALID; prerequisite failures identify stage and pendingFiles.
Do not confuse a local guard rejecting invalid data with Fanavaran accepting the
whole claim: downstream conditional rules remain authoritative.