Files
aiform_dev/frontend
AI Assistant 717295eb02 feat: Complete wizard_answers to propertyName conversion from DB data
Problem:
- Data comes from DB in wizard_answers format (answers to wizard questions)
- Form confirmation expects propertyName format (structured data)
- transformDraftToClaimPlanFormat tried to extract propertyName from DB, but it doesn't exist
- Form shows empty because propertyName structure is empty

Solution:
1. Added complete field mapping from wizard_answers to propertyName:
   - answersParsed.item → contract_or_service.subject
   - answersParsed.price → contract_or_service.amount_paid (normalized)
   - answersParsed.place_date → contract_or_service.agreement_date
   - answersParsed.cancel_date → contract_or_service.period_start
   - answersParsed.steps_taken → claim.description
   - answersParsed.expectation → claim.reason
   - payload.problem_description → claim.description and contract.subject

2. Added applicant data extraction:
   - phone from claim.phone, payload.phone, body.phone, or formData.phone
   - email from claim.email, payload.email, body.email, or formData.email
   - Other applicant fields (FIO, birth_date, INN) will be filled in confirmation form

3. Added default values:
   - case.category = 'consumer'
   - case.direction = 'web_form'

4. Enhanced logging:
   - Logs what data exists in DB
   - Logs wizard_answers keys
   - Logs conversion process

Files:
- frontend/src/pages/ClaimForm.tsx: Complete wizard_answers conversion
2025-11-24 16:35:27 +03:00
..