forked from Yara724/api
fix(fanavaran): honor supplied submission payload fields
Apply every supplied JSON field over generated defaults, preserving IDs, nested values and explicit nulls across base, damage and expertise submits. Validate manual hull payloads without rewriting their values or premium, and derive an empty replacement flag for old hull licences.
This commit is contained in:
@@ -111,7 +111,7 @@ export class FanavaranController {
|
||||
@ApiOperation({
|
||||
summary: "Submit Fanavaran base claim create request",
|
||||
description:
|
||||
"Swagger JSON body is optional. Always rebuilds GEN.03 from live inquiries, then POSTs that rebuilt payload. Pasting a previous preview JSON does not skip inquiry. Only user-entry keys are applied from the body (EstimateAmount, licence, dates, address, police report). PolicyId and AccidentVehicleUsedId in pasted JSON are ignored.",
|
||||
"Optional JSON overrides the generated GEN.03 defaults. Every supplied field takes precedence, including lookup IDs, nested objects, arrays and explicit null. Omitted fields retain generated defaults. Validation checks the final payload without rewriting supplied values.",
|
||||
})
|
||||
@ApiParam({
|
||||
name: "client",
|
||||
@@ -125,7 +125,7 @@ export class FanavaranController {
|
||||
@ApiBody({
|
||||
required: false,
|
||||
description:
|
||||
"Optional. Paste previous preview JSON if you want to tweak user-entry fields. Lookup ids in that JSON are ignored.",
|
||||
"Optional JSON payload overrides. All supplied fields are applied as-is; arrays and nested objects replace their generated counterparts. Explicit null is preserved.",
|
||||
schema: { type: "object", additionalProperties: true, example: {} },
|
||||
})
|
||||
async submit(
|
||||
@@ -171,7 +171,7 @@ export class FanavaranController {
|
||||
@ApiOperation({
|
||||
summary: "Submit Fanavaran damage-case request",
|
||||
description:
|
||||
"Swagger JSON body is optional. Always rebuilds GEN.12 from live VIN/vehicle/driver inquiries, then POSTs that rebuilt payload. Pasting a previous preview JSON does not skip inquiry. Only Desc, EstimateAmount, LicenceNo, LicenceIssuDate, DriverIsOwner are taken from the body. PlaqueKindId, PlaqueSampleId, VehicleKindId, DriverId, InsuranceCorpId in pasted JSON are ignored.",
|
||||
"Optional JSON overrides the generated GEN.12 defaults. Every supplied field takes precedence, including DriverId, plaque/vehicle IDs, nested objects, arrays and null. Omitted fields retain generated defaults.",
|
||||
})
|
||||
@ApiParam({
|
||||
name: "client",
|
||||
@@ -185,7 +185,7 @@ export class FanavaranController {
|
||||
@ApiBody({
|
||||
required: false,
|
||||
description:
|
||||
"Optional. Paste previous preview JSON if you want to tweak Desc / licence / estimate. Lookup-filter ids in that JSON are ignored.",
|
||||
"Optional JSON overrides. Every supplied field is applied as-is, including IDs and explicit null.",
|
||||
schema: { type: "object", additionalProperties: true, example: {} },
|
||||
})
|
||||
async submitDamageCase(
|
||||
@@ -283,7 +283,7 @@ export class FanavaranController {
|
||||
@ApiOperation({
|
||||
summary: "Submit Fanavaran expertise request",
|
||||
description:
|
||||
"Completes missing prerequisite stages in order before expertise: base claim, third-party damage case when applicable, then all pending attachments. Skipped images are retried; any image without a saved Fanavaran file ID blocks expertise with stage and pendingFiles details. Existing IDs/receipts are reused; existing expertise is not duplicated. Optional JSON overrides only allowed money/date fields; the GEN.08 third-party or GEN.06 hull payload is rebuilt from the expert reply and live lookups.",
|
||||
"Completes missing prerequisite stages in order before expertise: base claim, third-party damage case when applicable, then all pending attachments. Skipped images are retried; any image without a saved Fanavaran file ID blocks expertise with stage and pendingFiles details. Existing IDs/receipts are reused; existing expertise is not duplicated. Optional JSON overrides every supplied GEN.08 third-party or GEN.06 hull field, including DmgCaseId, ClaimExpertId, DmgSections and explicit null. Omitted fields retain generated defaults.",
|
||||
})
|
||||
@ApiParam({
|
||||
name: "client",
|
||||
@@ -297,7 +297,7 @@ export class FanavaranController {
|
||||
@ApiBody({
|
||||
required: false,
|
||||
description:
|
||||
"Optional. Paste previous preview JSON if you want to tweak money/date fields. DmgCaseId / ClaimExpertId / DmgSections in that JSON are ignored.",
|
||||
"Optional JSON overrides every supplied field. IDs, arrays, nested objects and explicit null take precedence over generated defaults.",
|
||||
schema: { type: "object", additionalProperties: true, example: {} },
|
||||
})
|
||||
async submitExpertise(
|
||||
|
||||
Reference in New Issue
Block a user