Require the damaged party in user flows to select an active insurer branch and preserve branch access rules. Accept older licence issue dates, correct anniversary boundaries, and update Fanavaran audit documentation and regression coverage.
**IsLicenseReplaced:**`1` when`CulpritLicenceIssuDate`is more than 10 years before `AccidentDate`; otherwise `null` (never send `0`). Dummy issue date when missing: `1404/08/20`.
**IsLicenseReplaced:**derived on the server from`CulpritLicenceIssuDate`and
`AccidentDate`: `0` through the third anniversary, `null` after three years
through the tenth anniversary, and `1` after ten years. Intake accepts valid past
issue dates older than ten years; no expiry-date or replacement-checkbox input
is required. The existing missing-date fallback is `1400/01/01`.
| Field | Persian | Type | Null? | Current value / source |
# Fanavaran hardcoded outbound values — current audit
Date: **2026-11-11**. Remote baseline: API `90bdc51` on `origin/main`, with the
existing local branch-routing work restored. This is a source audit of possible
outbound values, not a capture of production requests. Mongo configuration can
override seed defaults, so the numbers below are code defaults, not a claim about
what is configured on a particular production server.
**The requirement “never send guessed/default business codes” is not satisfied.**
The staff-location fix is present, and recent hull changes removed several
numeric fallbacks, but other defaults can still reach Fanavaran. Merely checking
that a default ID exists in a lookup does not establish that it describes this
accident, driver, vehicle, or assessment.
This document updates the outbound-default findings in
[lookup-coding-audit.md](./lookup-coding-audit.md), which predates the latest hull
and location changes. This audit changes documentation only.
## Audited paths
| Area | Sources and responsibility |
|---|---|
| Application write entry points | `src/fanavaran/fanavaran.controller.ts`: base claim, damage case, attachments, expertise preview/submit; automatic and soft-ensure stage calls in `ClaimRequestManagementService` use the same builders |
| Payloads and HTTP writes | `src/claim-request-management/claim-request-management.service.ts`: GEN.03, GEN.12, GEN.44, GEN.07, third-party GEN.08, hull base PUT and GEN.06 |
| Configuration and headers | `src/core/config/fanavaran-client.config.ts`, `src/fanavaran/fanavaran-{client-config,auth,location}.service.ts`, config schema, system settings |
| Lookup/inquiry and local catalogues | `src/fanavaran/fanavaran-lookup.service.ts`, `fanavaran-lookup.config.ts`, `src/lookups/`, `src/static/outer-car-parts-catalog.ts`, part helpers, vehicle/stage review code |
| Expert and user UI | Expert Fanavaran API route, vehicle review, stage-field defaults, damage reply fields; user inquiry/part-selection consumers. No matching numeric payload defaults were found in the current UI source search; the expert UI does accept backend-prefilled defaults. |
| Standalone tools | `scripts/fanavaran-flow-ui-server.js`, `scripts/data/fanavaran-flow-ui.html`, `scripts/fanavaran-flow-test.sh`, `scripts/fanavaran-auth.sh`, `scripts/get-fanavaran-car-parts.sh`; report-seeding fixtures were distinguished from application writes |
The runtime tenant type supports `parsian`, `tejaratno`, and `moallem`.
`esg/src` had no direct Fanavaran references in the search. `rewrite` was excluded.
## 1. Business IDs that can still be sent from defaults
Line references are against the restored worktree at audit time. `service` means
| Field / stage | Hardcoded or seeded value | When it reaches the payload | Evidence / required source |
|---|---|---|---|
| `AccidentCauseId` — base, both products | **6** | Always initialized to 6. `accidentReason` is passed into the builder but its selected ID / `fanavaran` code is not applied. Hull checks membership, which can accept the wrong but active cause. | `service:405`, `1894`; use the actual selected cause mapped to this tenant. |
| `AccidentCityId` — base, both products | **701** | Profile default unless an expert stage review changes it. The shared builder does not resolve the supplied coordinates into a city. | Config `:100`; `service:1893`, `5691`; use accident-city selection/inquiry. |
| `CompensationReferenceId` — third-party base | **167** | Included from the profile; not among the current editable stage fields or manual-ID overrides. Hull's key whitelist removes it. | Config `:106`; `service:1893`; confirm the required contract/codebook and source. |
| `CulpritLicenceTypeId` — base, both products | **2** | Included from the profile. The resolved driver identity includes `licenseType`, but the payload does not use it. Hull checks whether 2 is active, not whether it is the driver's licence category. | Config `:107`; `service:4679` vicinity; map the actual stored driver's selection. |
| `CulpritTypeId` — third-party base | **337 / 338** | Final value comes from a static map: policyholder/driver same national code → 337, different → 338. Missing role information can default to 337. It is no longer simply the profile's 337. | `fanavaran-party-roles.ts:205–226`; `service:4687`; resolve current tenant IDs by confirmed role meaning and reject unknown roles. |
| `AccidentVehicleUsedId` — third-party base and damage | **1** | Fallback when inquiry/group resolution is unresolved; an expert's approved use type can override it. Hull base has removed this numeric fallback. | `service:4771`, `3208`; preserve the actual vehicle use or require a selection. |
| `DmgCaseTypeId` — third-party damage | **175** | Unconditionally taken from the profile. No current expert stage field for it. | `service:3235`; determine the actual damage-case classification. |
| `PlaqueKindId` / `PlaqueSampleId` — third-party damage | **8 / 10** | National-plate fallback when matched Fanavaran vehicle has no kind. Even with a real kind, a missing sample still falls back to 10 and is labelled `vehicle-inquiry`. | `src/lookups/fanavaran-last-car-policy.ts:391–392`, `450–470`; require sourced plate IDs with compatible kind/sample. |
| `PlaqueMiddleCodeId` — third-party damage | Static **1–24** letter map | Used when the matched vehicle does not provide a middle code. These are explicit fixed mappings rather than a default letter, but are still tenant-unverified numeric codes. | `service:424–449`, `3266`; map through the tenant's plate-letter catalogue. |
| `PoliceOfficerId` — third-party base | **1** | Assigned directly; hull explicitly replaces it with null. | `service:1857`; `fanavaran-hull-base-claim.ts:164`; real officer selection or null if permitted. |
| `InspectionPlaceId` — third-party expertise | **282** | Default unless reviewed. Fetching the inspection-place list does not select or validate this fallback at the write boundary. | `service:6014–6020`; explicit inspection place. |
| `DropAmountStatus` — third-party expertise | **5458** | Always assigned directly, even though `drop-amount-status` is fetched. Not a current editable stage field. | `service:6015–6020`; derive from confirmed depreciation outcome or require selection. |
| `DmgSections[].AccidentLevel` — third-party expertise | **5456** | Any nonnumeric `typeOfDamage` falls back to 5456. **The ordinary expert UI sends `تعمیر` / `تعویض`, so normal UI replies take this fallback.** Those values express repair/replacement, not damage severity. | `service:5888–5899`; expert `damagePartTable.tsx:2292–2305`, `claimReplySubmit.tsx:183–192`; add a separate severity field rather than treating repair method as severity. |
| `FileTypeId`, including `Files[].FileTypeId` — attachments | **Parsian 63 / Tejaratno 23 / Moallem 17** | One configured type is assigned across collected document/photo categories. Hull checks that the ID is active, not that its meaning matches each document. | Config `:155`, `181`, `201` vicinity; `service:5126`, `5329`, `5495–5497`; per-document semantic mapping to current tenant catalogue. |
| `CityId` — GEN.44 person creation | **9131** | Fallback if a person's explicit city and caption lookup cannot resolve it; shared helper has no tenant argument. This remains despite the **HTTP Location** fix. | `fanavaran-other-people.ts:95`, `251–254`; actual person city, never a Parsian city ID for another tenant. |
| `PersonKindId` — GEN.44 | **46** | Natural-person caption lookup fallback; shared across all clients. | `fanavaran-other-people.ts:96`, `265–268`; resolve correct person kind for the tenant/person. |
| `IsIranian` — GEN.44 | **1 / 0** | Fallback when `ans` lookup is unavailable. The helper assumes Iranian unless explicitly false or a naturalized code is present. | `fanavaran-other-people.ts:214–215`, `259–261`; encode confirmed nationality using the proper contract. |
`ClaimFileTypeId` also has a startup migration: Moallem's stored **23 → 17**
(`fanavaran-client-config.service.ts:40–45`). Editing a stored value back to 23
## 2. Default values that are not lookup IDs but still assert case facts
| Field | Current assumption | Source / consequence |
|---|---|---|
| `AccidentLocationAddress` | **`استان تهران شهر تهران`** | `service:404`, `1910`, `5690`. Location coordinates are accepted by the builder but not used here. Expert review/manual text can replace it. **This address default is separate from the fixed HTTP `Location` header.** |
| `CulpritLicenceNo`, damage `LicenceNo` | Environment dummy, else **`9705463515`** | `service:412–413`, `1812`, `1818`, `3250`, `7570`. Real licence preferred, but missing/empty values and even empty manual overrides are replaced by a fabricated number. |
| `CulpritLicenceIssuDate`, damage `LicenceIssuDate` | **`1394/10/13`** | `fanavaran-party-roles.ts:11`, `237–242`; shared builder also initializes it at `service:1835`. Real stored date wins if available. |
| `EstimateAmount` | **1000 rials** | `service:407`, `1770`, `3238`. Base uses it when no positive calculated estimate exists; damage builder always initializes to it, with manual amount override available. |
| `FaultPercent` — damage | **100** | Profile default, `service:3239`; does not derive an actual percentage. |
| `CustomerFaultPercent` — hull | **100** | `service:2642`, `fanavaran-hull-base-claim.ts:59`, `154–157`; expert stage review can replace it. |
| `RepairDuration` — hull expertise | **3 days** | `service:2844–2846`, `fanavaran-hull-expertise.ts:80`, `121–122`; review can replace it. Optional `HullExpertiseRepairDuration` exists in the profile interface but this builder does not use it. |
| `DamagedCount` — third-party base | **1** | `service:1838`. Current two-party flow has one beneficiary, but this is a fixed scenario assumption. |
| `IsLicenseMatchWithVehicleKind` | **1** | `service:1842`; no actual licence/category compatibility calculation here. |
| `HasOtherCulprit`, `IsAccidentOutOfBorder`, `IsFatalAccident`, `IsPlaqueChanged`, `IsLicenseReplacement` — third-party base | **0** | `service:1843–1848`, `1865`; assertions of “no”, not inferred accident facts. |
| `IsLicenseReplaced` — hull | **Always 0** | `fanavaran-hull-base-claim.ts:126–129`; forced even if the incoming builder value differs. Current code intentionally implements the previous contract decision. |
| `IsOwnerChanged`, `CostSeparationToDmgSections` — hull | **0 when absent** | `fanavaran-hull-base-claim.ts:135–142`. Encoded through `ans`, validated for membership on hull writes. |
| `Count` — hull damage section | **1** | `fanavaran-hull-expertise.ts:156`; one item per selected part row. Must be explicit if quantities can differ. |
| `ComponentReplacementTaxAndToll` — third-party expertise | **0** | `service:6051`; not computed from an expert-entered tax value. |
| Flow shell `:352–380` | Fixed tenant CorpId/ContractId and Location: Tejaratno **3539/263/100**, Parsian **543/28/210050**, Moallem **5650/304/30900**. Shell hull contract falls back to the configured third-party contract if a hull contract is not supplied. |
| Flow HTML `:1052–1092`, `:1316–1399` | Static expert/branch lists. Tejaratno auto-selects case-owner2721 and assessor2709 at location100; Moallem defaults to first case-owner5347 and assessor5350 at location30900; Parsian chooses branch210110 and the first listed maker32/reviewer3989 when no preference exists. Other static choices remain in these tables. |
| Flow HTML `:789–790`, `:1611–1619` | Static culprit337/338 mapping by role scenario. |
| Flow HTML `:851–853`, `:879–900` | Prefilled GEN.44 city9131/person-kind46/Iranian1, example amounts, repair3, fault100, example vehicle current value0. Also contains sample identity/plate/licence values; do not treat these as real inquiry evidence. |
| Flow server `:1168` | Party inquiry falls back to Location **100** if neither environment nor query supplies it. |
**Update (2026-11-11):** The latest hull/accessory/location changes supersede
several findings below. See [the current hardcoded-payload audit](./hardcoded-payload-audit.md)
for what remains, including exact outbound defaults and standalone tool behavior.
Date: 2026-11-10. Clients: Moallem, Tejaratno, Parsian. Scope: current base,
damage-case, attachment, expertise and other-person payload builders shared by
app flows V1–V6. This is a code and local-snapshot audit, not a live acceptance
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.