diff --git a/api_questions.json b/api_questions.json index b27446e..1342bc2 100644 --- a/api_questions.json +++ b/api_questions.json @@ -1 +1 @@ -[{"id": "family_background.number_of_siblings", "type": "number", "title": "Number of Siblings", "description": "", "tooltip": "", "placeholder": "2", "required": true, "is_required": true, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {"max": 20, "min": 0}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "2", "placeholder_fa": "\u06f2"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 0, "options": []}, {"id": "family_background.parents_survival_status", "type": "radio", "title": "Parents' Survival Status", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 1, "options": [{"id": "family_background.parents_survival_status.both_parents_are_alive", "value": "both_parents_are_alive", "label": "Both parents are alive", "order": 0}, {"id": "family_background.parents_survival_status.father_has_passed_away", "value": "father_has_passed_away", "label": "Father has passed away", "order": 1}, {"id": "family_background.parents_survival_status.mother_has_passed_away", "value": "mother_has_passed_away", "label": "Mother has passed away", "order": 2}, {"id": "family_background.parents_survival_status.both_parents_have_passed_away", "value": "both_parents_have_passed_away", "label": "Both parents have passed away", "order": 3}]}, {"id": "family_background.parents_marital_status", "type": "radio", "title": "Parents' Marital Status", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": {"dependsOn": {"title": "Parents' Survival Status", "values": ["Both parents are alive"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "family_background.parents_survival_status", "trigger_option_ids": ["family_background.parents_survival_status.both_parents_are_alive"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "family_background.parents_survival_status", "trigger_option_ids": ["family_background.parents_survival_status.both_parents_are_alive"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "family_background.parents_survival_status", "trigger_option_ids": ["family_background.parents_survival_status.both_parents_are_alive"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 2, "options": [{"id": "family_background.parents_marital_status.living_together", "value": "living_together", "label": "Living together", "order": 0}, {"id": "family_background.parents_marital_status.separated_divorced", "value": "separated_/_divorced", "label": "Separated / Divorced", "order": 1}, {"id": "family_background.parents_marital_status.one_parent_has_remarried", "value": "one_parent_has_remarried", "label": "One parent has remarried", "order": 2}, {"id": "family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description", "value": "i_have_special_family_circumstances_and_will_provide_the_details_in_the_description.", "label": "I have special family circumstances and will provide the details in the description.", "order": 3}]}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "type": "radio", "title": "Do you currently have an ongoing financial, caregiving, or guardianship responsibility for a family member?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 3, "options": [{"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.no_i_do_not_have_any_ongoing_responsibility", "value": "no,_i_do_not_have_any_ongoing_responsibility.", "label": "No, I do not have any ongoing responsibility.", "order": 0}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "value": "i_am_responsible_for_caring_for_my_father.", "label": "I am responsible for caring for my father.", "order": 1}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "value": "i_am_responsible_for_caring_for_my_mother.", "label": "I am responsible for caring for my mother.", "order": 2}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "value": "i_am_responsible_for_caring_for_both_parents.", "label": "I am responsible for caring for both parents.", "order": 3}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "value": "i_am_responsible_for_caring_for_a_sibling_(brother/sister).", "label": "I am responsible for caring for a sibling (brother/sister).", "order": 4}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "value": "i_am_the_legal_guardian_or_supervisor_of_a_family_member.", "label": "I am the legal guardian or supervisor of a family member.", "order": 5}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "value": "i_regularly_provide_financial_support_for_a_family_member's_living_expenses.", "label": "I regularly provide financial support for a family member's living expenses.", "order": 6}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description", "value": "i_have_other_circumstances_and_will_explain_in_the_description.", "label": "I have other circumstances and will explain in the description.", "order": 7}]}, {"id": "family_background.do_the_supported_individual_s_live_with_you", "type": "radio", "title": "Do the supported individual(s) live with you?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": {"dependsOn": {"title": "Do you currently have an ongoing financial, caregiving, or guardianship responsibility for a family member?", "values": ["I am responsible for caring for my father.", "I am responsible for caring for my mother.", "I am responsible for caring for both parents.", "I am responsible for caring for a sibling (brother/sister).", "I am the legal guardian or supervisor of a family member.", "I regularly provide financial support for a family member's living expenses.", "I have other circumstances and will explain in the description.", "I am responsible for caring for my parent(s) (father, mother, or both).", "I am responsible for the care, custody, or guardianship of other family members (sibling, etc.)."]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 4, "options": [{"id": "family_background.do_the_supported_individual_s_live_with_you.yes_they_live_with_me_permanently", "value": "yes,_they_live_with_me_permanently.", "label": "Yes, they live with me permanently.", "order": 0}, {"id": "family_background.do_the_supported_individual_s_live_with_you.yes_they_live_with_me_temporarily_or_periodically", "value": "yes,_they_live_with_me_temporarily_or_periodically.", "label": "Yes, they live with me temporarily or periodically.", "order": 1}, {"id": "family_background.do_the_supported_individual_s_live_with_you.no_but_they_reside_near_my_place_of_living", "value": "no,_but_they_reside_near_my_place_of_living.", "label": "No, but they reside near my place of living.", "order": 2}, {"id": "family_background.do_the_supported_individual_s_live_with_you.no_they_live_in_another_city_or_country", "value": "no,_they_live_in_another_city_or_country.", "label": "No, they live in another city or country.", "order": 3}]}, {"id": "family_background.additional_details_about_family_responsibility", "type": "textarea", "title": "Additional details about family responsibility", "description": "", "tooltip": "familyResponsibilityTooltip", "placeholder": "Enter details here...", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Enter details here...", "placeholder_fa": "\u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u062e\u0648\u062f \u0631\u0627 \u0627\u06cc\u0646\u062c\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f..."}, "logic": {"dependsOn": {"title": "Do you currently have an ongoing financial, caregiving, or guardianship responsibility for a family member?", "values": ["I am responsible for caring for my father.", "I am responsible for caring for my mother.", "I am responsible for caring for both parents.", "I am responsible for caring for a sibling (brother/sister).", "I am the legal guardian or supervisor of a family member.", "I regularly provide financial support for a family member's living expenses.", "I have other circumstances and will explain in the description.", "I am responsible for caring for my parent(s) (father, mother, or both).", "I am responsible for the care, custody, or guardianship of other family members (sibling, etc.)."]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 5, "options": []}, {"id": "family_background.family_s_religious_and_ideological_atmosphere", "type": "radio", "title": "Family's Religious and Ideological Atmosphere", "description": "Please select the option that best describes the general atmosphere and lifestyle of your family.", "tooltip": "### Family Religious Atmosphere Options\n\n* **Religious and Strictly Observant:** This specifies a family highly dedicated to performing all **obligatory duties**, strictly maintaining **religious boundaries** (such as Mahram rules), and upholding **religious rituals and teachings** across all aspects of life.\n* **Religious (Observant of Obligations):** This indicates a family committed to core **religious duties** (such as prayer and fasting) and **Islamic ethics**, living within the standard frameworks of a religious society.\n* **Traditional (Respectful of Religious Values):** This describes a family that holds devotion to moral values and **respects religion**, but may not strictly execute every specific **religious law** or obligation.\n* **Non-religious / Secular:** This represents a family where **religious rituals and frameworks** do not significantly influence their daily **lifestyle, relationships, or decisions**, despite holding a general respect for religion.", "placeholder": "Select one option", "required": false, "is_required": false, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 6, "options": [{"id": "family_background.family_s_religious_and_ideological_atmosphere.religious_and_strictly_observant", "value": "religious_and_strictly_observant", "label": "Religious and strictly observant", "order": 0}, {"id": "family_background.family_s_religious_and_ideological_atmosphere.religious_observant_of_obligations", "value": "religious_(observant_of_obligations)", "label": "Religious (observant of obligations)", "order": 1}, {"id": "family_background.family_s_religious_and_ideological_atmosphere.traditional_respectful_of_religious_values", "value": "traditional_(respectful_of_religious_values)", "label": "Traditional (respectful of religious values)", "order": 2}, {"id": "family_background.family_s_religious_and_ideological_atmosphere.non_religious_secular", "value": "non-religious_/_secular", "label": "Non-religious / Secular", "order": 3}]}, {"id": "family_background.family_economic_status", "type": "radio", "title": "Family Economic Status", "description": "", "tooltip": "", "placeholder": "Select one option", "required": false, "is_required": false, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 7, "options": [{"id": "family_background.family_economic_status.weak", "value": "weak", "label": "Weak", "order": 0}, {"id": "family_background.family_economic_status.average", "value": "average", "label": "Average", "order": 1}, {"id": "family_background.family_economic_status.good", "value": "good", "label": "Good", "order": 2}, {"id": "family_background.family_economic_status.prosperous", "value": "prosperous", "label": "Prosperous", "order": 3}]}, {"id": "family_background.short_family_description", "type": "textarea", "title": "Short Family Description", "description": "", "tooltip": "Write any important point that was not covered in the options above here.", "placeholder": "Enter details here...", "required": false, "is_required": false, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "Enter details here...", "placeholder_fa": "\u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u062e\u0648\u062f \u0631\u0627 \u0627\u06cc\u0646\u062c\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f..."}, "logic": {"operator": "any_of", "parent_question_id": "family_background.parents_marital_status", "trigger_option_ids": ["family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description"], "clear_answer_when_hidden": true}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "family_background.parents_marital_status", "trigger_option_ids": ["family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "family_background.parents_marital_status", "trigger_option_ids": ["family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "family_background.parents_marital_status", "trigger_option_ids": ["family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 8, "options": []}] \ No newline at end of file +[{"id": "family_background.number_of_siblings", "type": "number", "title": "Number of Siblings", "description": "", "tooltip": "", "placeholder": "2", "required": true, "is_required": true, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {"max": 20, "min": 0}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "2", "placeholder_fa": "۲"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 0, "options": []}, {"id": "family_background.parents_survival_status", "type": "radio", "title": "Parents' Survival Status", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 1, "options": [{"id": "family_background.parents_survival_status.both_parents_are_alive", "value": "both_parents_are_alive", "label": "Both parents are alive", "order": 0}, {"id": "family_background.parents_survival_status.father_has_passed_away", "value": "father_has_passed_away", "label": "Father has passed away", "order": 1}, {"id": "family_background.parents_survival_status.mother_has_passed_away", "value": "mother_has_passed_away", "label": "Mother has passed away", "order": 2}, {"id": "family_background.parents_survival_status.both_parents_have_passed_away", "value": "both_parents_have_passed_away", "label": "Both parents have passed away", "order": 3}]}, {"id": "family_background.parents_marital_status", "type": "radio", "title": "Parents' Marital Status", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": {"dependsOn": {"title": "Parents' Survival Status", "values": ["Both parents are alive"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "family_background.parents_survival_status", "trigger_option_ids": ["family_background.parents_survival_status.both_parents_are_alive"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "family_background.parents_survival_status", "trigger_option_ids": ["family_background.parents_survival_status.both_parents_are_alive"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "family_background.parents_survival_status", "trigger_option_ids": ["family_background.parents_survival_status.both_parents_are_alive"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 2, "options": [{"id": "family_background.parents_marital_status.living_together", "value": "living_together", "label": "Living together", "order": 0}, {"id": "family_background.parents_marital_status.separated_divorced", "value": "separated_/_divorced", "label": "Separated / Divorced", "order": 1}, {"id": "family_background.parents_marital_status.one_parent_has_remarried", "value": "one_parent_has_remarried", "label": "One parent has remarried", "order": 2}, {"id": "family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description", "value": "i_have_special_family_circumstances_and_will_provide_the_details_in_the_description.", "label": "I have special family circumstances and will provide the details in the description.", "order": 3}]}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "type": "dropdown", "title": "Do you currently have an ongoing financial, caregiving, or guardianship responsibility for a family member?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 3, "options": [{"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.no_i_do_not_have_any_ongoing_responsibility", "value": "no,_i_do_not_have_any_ongoing_responsibility.", "label": "No, I do not have any ongoing responsibility.", "order": 0}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "value": "i_am_responsible_for_caring_for_my_father.", "label": "I am responsible for caring for my father.", "order": 1}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "value": "i_am_responsible_for_caring_for_my_mother.", "label": "I am responsible for caring for my mother.", "order": 2}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "value": "i_am_responsible_for_caring_for_both_parents.", "label": "I am responsible for caring for both parents.", "order": 3}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "value": "i_am_responsible_for_caring_for_a_sibling_(brother/sister).", "label": "I am responsible for caring for a sibling (brother/sister).", "order": 4}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "value": "i_am_the_legal_guardian_or_supervisor_of_a_family_member.", "label": "I am the legal guardian or supervisor of a family member.", "order": 5}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "value": "i_regularly_provide_financial_support_for_a_family_member's_living_expenses.", "label": "I regularly provide financial support for a family member's living expenses.", "order": 6}, {"id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description", "value": "i_have_other_circumstances_and_will_explain_in_the_description.", "label": "I have other circumstances and will explain in the description.", "order": 7}]}, {"id": "family_background.do_the_supported_individual_s_live_with_you", "type": "radio", "title": "Do the supported individual(s) live with you?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": {"dependsOn": {"title": "Do you currently have an ongoing financial, caregiving, or guardianship responsibility for a family member?", "values": ["I am responsible for caring for my father.", "I am responsible for caring for my mother.", "I am responsible for caring for both parents.", "I am responsible for caring for a sibling (brother/sister).", "I am the legal guardian or supervisor of a family member.", "I regularly provide financial support for a family member's living expenses.", "I have other circumstances and will explain in the description.", "I am responsible for caring for my parent(s) (father, mother, or both).", "I am responsible for the care, custody, or guardianship of other family members (sibling, etc.)."]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 4, "options": [{"id": "family_background.do_the_supported_individual_s_live_with_you.yes_they_live_with_me_permanently", "value": "yes,_they_live_with_me_permanently.", "label": "Yes, they live with me permanently.", "order": 0}, {"id": "family_background.do_the_supported_individual_s_live_with_you.yes_they_live_with_me_temporarily_or_periodically", "value": "yes,_they_live_with_me_temporarily_or_periodically.", "label": "Yes, they live with me temporarily or periodically.", "order": 1}, {"id": "family_background.do_the_supported_individual_s_live_with_you.no_but_they_reside_near_my_place_of_living", "value": "no,_but_they_reside_near_my_place_of_living.", "label": "No, but they reside near my place of living.", "order": 2}, {"id": "family_background.do_the_supported_individual_s_live_with_you.no_they_live_in_another_city_or_country", "value": "no,_they_live_in_another_city_or_country.", "label": "No, they live in another city or country.", "order": 3}]}, {"id": "family_background.additional_details_about_family_responsibility", "type": "textarea", "title": "Additional details about family responsibility", "description": "", "tooltip": "familyResponsibilityTooltip", "placeholder": "Enter details here...", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Enter details here...", "placeholder_fa": "توضیحات خود را اینجا وارد کنید..."}, "logic": {"dependsOn": {"title": "Do you currently have an ongoing financial, caregiving, or guardianship responsibility for a family member?", "values": ["I am responsible for caring for my father.", "I am responsible for caring for my mother.", "I am responsible for caring for both parents.", "I am responsible for caring for a sibling (brother/sister).", "I am the legal guardian or supervisor of a family member.", "I regularly provide financial support for a family member's living expenses.", "I have other circumstances and will explain in the description.", "I am responsible for caring for my parent(s) (father, mother, or both).", "I am responsible for the care, custody, or guardianship of other family members (sibling, etc.)."]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member", "trigger_option_ids": ["family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_parent_s_father_mother_or_both", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_the_care_custody_or_guardianship_of_other_family_members_sibling_etc", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_regularly_provide_financial_support_for_a_family_member_s_living_expenses", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_father", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_my_mother", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_both_parents", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_responsible_for_caring_for_a_sibling_brother_sister", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_am_the_legal_guardian_or_supervisor_of_a_family_member", "family_background.do_you_currently_have_an_ongoing_financial_caregiving_or_guardianship_responsibility_for_a_family_member.i_have_other_circumstances_and_will_explain_in_the_description"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 5, "options": []}, {"id": "family_background.family_s_religious_and_ideological_atmosphere", "type": "radio", "title": "Family's Religious and Ideological Atmosphere", "description": "Please select the option that best describes the general atmosphere and lifestyle of your family.", "tooltip": "### Family Religious Atmosphere Options\n\n* **Religious and Strictly Observant:** This specifies a family highly dedicated to performing all **obligatory duties**, strictly maintaining **religious boundaries** (such as Mahram rules), and upholding **religious rituals and teachings** across all aspects of life.\n* **Religious (Observant of Obligations):** This indicates a family committed to core **religious duties** (such as prayer and fasting) and **Islamic ethics**, living within the standard frameworks of a religious society.\n* **Traditional (Respectful of Religious Values):** This describes a family that holds devotion to moral values and **respects religion**, but may not strictly execute every specific **religious law** or obligation.\n* **Non-religious / Secular:** This represents a family where **religious rituals and frameworks** do not significantly influence their daily **lifestyle, relationships, or decisions**, despite holding a general respect for religion.", "placeholder": "Select one option", "required": false, "is_required": false, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 6, "options": [{"id": "family_background.family_s_religious_and_ideological_atmosphere.religious_and_strictly_observant", "value": "religious_and_strictly_observant", "label": "Religious and strictly observant", "order": 0}, {"id": "family_background.family_s_religious_and_ideological_atmosphere.religious_observant_of_obligations", "value": "religious_(observant_of_obligations)", "label": "Religious (observant of obligations)", "order": 1}, {"id": "family_background.family_s_religious_and_ideological_atmosphere.traditional_respectful_of_religious_values", "value": "traditional_(respectful_of_religious_values)", "label": "Traditional (respectful of religious values)", "order": 2}, {"id": "family_background.family_s_religious_and_ideological_atmosphere.non_religious_secular", "value": "non-religious_/_secular", "label": "Non-religious / Secular", "order": 3}]}, {"id": "family_background.family_economic_status", "type": "radio", "title": "Family Economic Status", "description": "", "tooltip": "", "placeholder": "Select one option", "required": false, "is_required": false, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 7, "options": [{"id": "family_background.family_economic_status.weak", "value": "weak", "label": "Weak", "order": 0}, {"id": "family_background.family_economic_status.average", "value": "average", "label": "Average", "order": 1}, {"id": "family_background.family_economic_status.good", "value": "good", "label": "Good", "order": 2}, {"id": "family_background.family_economic_status.prosperous", "value": "prosperous", "label": "Prosperous", "order": 3}]}, {"id": "family_background.short_family_description", "type": "textarea", "title": "Short Family Description", "description": "", "tooltip": "Write any important point that was not covered in the options above here.", "placeholder": "Enter details here...", "required": false, "is_required": false, "private": false, "is_private": false, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": false, "noSearch": false, "placeholder_en": "Enter details here...", "placeholder_fa": "توضیحات خود را اینجا وارد کنید..."}, "logic": {"operator": "any_of", "parent_question_id": "family_background.parents_marital_status", "trigger_option_ids": ["family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description"], "clear_answer_when_hidden": true}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "family_background.parents_marital_status", "trigger_option_ids": ["family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "family_background.parents_marital_status", "trigger_option_ids": ["family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "family_background.parents_marital_status", "trigger_option_ids": ["family_background.parents_marital_status.i_have_special_family_circumstances_and_will_provide_the_details_in_the_description"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 8, "options": []}] \ No newline at end of file diff --git a/api_questions_marital.json b/api_questions_marital.json index 5997b3b..3d498f0 100644 --- a/api_questions_marital.json +++ b/api_questions_marital.json @@ -1 +1 @@ -[{"id": "marital_history.current_marital_status", "type": "radio", "title": "Current Marital Status", "description": "", "tooltip": "currentMaritalStatusTooltip", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 0, "options": [{"id": "marital_history.current_marital_status.single_never_married", "value": "single;_never_married", "label": "Single; never married", "order": 0}, {"id": "marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "value": "failed_engagement_/_annulled_marriage;_without_living_together", "label": "Failed engagement / Annulled marriage; without living together", "order": 1}, {"id": "marital_history.current_marital_status.divorced_after_living_together", "value": "divorced;_after_living_together", "label": "Divorced; after living together", "order": 2}, {"id": "marital_history.current_marital_status.widowed", "value": "widowed", "label": "Widowed", "order": 3}]}, {"id": "marital_history.previous_marriage_duration", "type": "text", "title": "Previous Marriage Duration", "description": "", "tooltip": "", "placeholder": "3 years", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "3 years", "placeholder_fa": "\u06f3 \u0633\u0627\u0644", "showYearsSuffix": true}, "logic": {"dependsOn": {"title": "Current Marital Status", "values": ["Failed engagement / Annulled marriage; without living together", "Divorced; after living together", "Widowed"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 1, "options": []}, {"id": "marital_history.reason_for_separation", "type": "text", "title": "Reason for Separation", "description": "", "tooltip": "", "placeholder": "Enter details here...", "required": false, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Enter details here...", "placeholder_fa": "\u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u0631\u0627 \u0627\u06cc\u0646\u062c\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f..."}, "logic": {"dependsOn": {"title": "Current Marital Status", "values": ["Failed engagement / Annulled marriage; without living together", "Divorced; after living together"]}}, "audience": null, "required_when": null, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 2, "options": []}, {"id": "marital_history.children_and_guardianship_status", "type": "radio", "title": "Children and Guardianship Status", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": {"dependsOn": {"title": "Current Marital Status", "values": ["Failed engagement / annulled marriage without starting joint life", "Divorced; after living together", "Widowed"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 3, "options": [{"id": "marital_history.children_and_guardianship_status.no_children", "value": "no_children", "label": "No children", "order": 0}, {"id": "marital_history.children_and_guardianship_status.have_children_living_with_me", "value": "have_children_living_with_me", "label": "Have children living with me", "order": 1}, {"id": "marital_history.children_and_guardianship_status.have_children_not_living_with_me", "value": "have_children_not_living_with_me", "label": "Have children not living with me", "order": 2}, {"id": "marital_history.children_and_guardianship_status.someone_else_is_under_my_guardianship", "value": "someone_else_is_under_my_guardianship", "label": "Someone else is under my guardianship", "order": 3}]}, {"id": "marital_history.number_of_children", "type": "number", "title": "Number of Children", "description": "", "tooltip": "", "placeholder": "2", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {"max": 10, "min": 0}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "2", "placeholder_fa": "\u06f2"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 4, "options": []}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren", "type": "radio", "title": "What is the custody status of your child(ren)?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 5, "options": [{"id": "marital_history.what_is_the_custody_status_of_your_child_ren.i_have_full_custody_of_the_child_ren", "value": "i_have_full_custody_of_the_child(ren).", "label": "I have full custody of the child(ren).", "order": 0}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren.joint_custody_or_periodic_visitation_relocation_between_parents", "value": "joint_custody_or_periodic_visitation/relocation_between_parents.", "label": "Joint custody or periodic visitation/relocation between parents.", "order": 1}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren.custody_is_with_the_other_parent_or_another_person", "value": "custody_is_with_the_other_parent_or_another_person.", "label": "Custody is with the other parent or another person.", "order": 2}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren.children_have_reached_legal_age_custody_is_not_applicable", "value": "children_have_reached_legal_age_(custody_is_not_applicable).", "label": "Children have reached legal age (custody is not applicable).", "order": 3}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren.other_circumstances_dispute_pending_or_other", "value": "other_circumstances_(dispute,_pending,_or_other).", "label": "Other circumstances (dispute, pending, or other).", "order": 4}]}, {"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you", "type": "radio", "title": "How much time do the child(ren) usually live with you?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 6, "options": [{"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you.permanently_or_most_days_of_the_week_with_me", "value": "permanently_or_most_days_of_the_week_with_me.", "label": "Permanently or most days of the week with me.", "order": 0}, {"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you.approximately_half_the_time_joint_custody_schedule", "value": "approximately_half_the_time_(joint_custody/schedule).", "label": "Approximately half the time (joint custody/schedule).", "order": 1}, {"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you.weekends_holidays_or_specific_days_only", "value": "weekends,_holidays,_or_specific_days_only.", "label": "Weekends, holidays, or specific days only.", "order": 2}, {"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you.they_do_not_live_with_me_or_there_is_no_fixed_schedule", "value": "they_do_not_live_with_me,_or_there_is_no_fixed_schedule.", "label": "They do not live with me, or there is no fixed schedule.", "order": 3}]}, {"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration", "type": "radio", "title": "Does the custody, visitation, or relocation schedule impact your residence or immigration?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 7, "options": [{"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration.no_it_has_no_significant_impact_on_residence_or_relocation", "value": "no,_it_has_no_significant_impact_on_residence_or_relocation.", "label": "No, it has no significant impact on residence or relocation.", "order": 0}, {"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration.yes_relocation_or_immigration_requires_coordination_agreement_or_a_legal_permit", "value": "yes,_relocation_or_immigration_requires_coordination,_agreement,_or_a_legal_permit.", "label": "Yes, relocation or immigration requires coordination, agreement, or a legal permit.", "order": 1}, {"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration.yes_i_am_restricted_and_must_reside_in_the_same_city_or_region", "value": "yes,_i_am_restricted_and_must_reside_in_the_same_city_or_region.", "label": "Yes, I am restricted and must reside in the same city or region.", "order": 2}, {"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration.unclear_pending_dispute_agreement_or_depends_on_conditions", "value": "unclear_(pending_dispute/agreement_or_depends_on_conditions).", "label": "Unclear (pending dispute/agreement or depends on conditions).", "order": 3}]}, {"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support", "type": "radio", "title": "What is the payment or receipt status of child support?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 8, "options": [{"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support.ongoing_financial_commitment_paying_child_support_or_sharing_expenses", "value": "ongoing_financial_commitment_(paying_child_support_or_sharing_expenses).", "label": "Ongoing financial commitment (paying child support or sharing expenses).", "order": 0}, {"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support.receiving_child_support_regularly", "value": "receiving_child_support_regularly.", "label": "Receiving child support regularly.", "order": 1}, {"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support.payments_are_case_by_case_agreed_or_irregular", "value": "payments_are_case-by-case,_agreed,_or_irregular.", "label": "Payments are case-by-case, agreed, or irregular.", "order": 2}, {"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support.no_formal_child_support_commitment_or_child_is_independent_pending", "value": "no_formal_child_support_commitment_(or_child_is_independent_/_pending).", "label": "No formal child support commitment (or child is independent / pending).", "order": 3}]}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent", "type": "radio", "title": "Acceptance of necessary communication between future spouse and the other parent", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "\u06cc\u06a9 \u06af\u0632\u06cc\u0646\u0647 \u0631\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0646\u06cc\u062f"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 9, "options": [{"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.i_accept_necessary_respectful_and_limited_communication_regarding_child_matters", "value": "i_accept_necessary,_respectful,_and_limited_communication_regarding_child_matters.", "label": "I accept necessary, respectful, and limited communication regarding child matters.", "order": 0}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.i_only_accept_formal_and_highly_limited_communication_regarding_essential_child_matters", "value": "i_only_accept_formal_and_highly_limited_communication_regarding_essential_child_matters.", "label": "I only accept formal and highly limited communication regarding essential child matters.", "order": 1}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.i_prefer_communication_to_go_through_an_intermediary_a_family_member_or_a_lawyer_as_much_as_possible", "value": "i_prefer_communication_to_go_through_an_intermediary,_a_family_member,_or_a_lawyer_as_much_as_possible.", "label": "I prefer communication to go through an intermediary, a family member, or a lawyer as much as possible.", "order": 2}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.any_ongoing_communication_beyond_essential_child_matters_with_the_other_parent_is_a_red_line_for_me", "value": "any_ongoing_communication_beyond_essential_child_matters_with_the_other_parent_is_a_red_line_for_me.", "label": "Any ongoing communication beyond essential child matters with the other parent is a red line for me.", "order": 3}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.acceptance_depends_on_the_type_and_extent_of_communication_custody_conditions_and_mutual_trust", "value": "acceptance_depends_on_the_type_and_extent_of_communication,_custody_conditions,_and_mutual_trust.", "label": "Acceptance depends on the type and extent of communication, custody conditions, and mutual trust.", "order": 4}]}, {"id": "marital_history.short_children_guardianship_explanation", "type": "textarea", "title": "Short Children/Guardianship Explanation", "description": "", "tooltip": "", "placeholder": "Enter details here...", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Enter details here...", "placeholder_fa": "\u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u0631\u0627 \u0627\u06cc\u0646\u062c\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f..."}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me", "Someone else is under my guardianship"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me", "marital_history.children_and_guardianship_status.someone_else_is_under_my_guardianship"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me", "marital_history.children_and_guardianship_status.someone_else_is_under_my_guardianship"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me", "marital_history.children_and_guardianship_status.someone_else_is_under_my_guardianship"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 10, "options": []}] \ No newline at end of file +[{"id": "marital_history.current_marital_status", "type": "radio", "title": "Current Marital Status", "description": "", "tooltip": "currentMaritalStatusTooltip", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": null, "audience": null, "required_when": null, "visibility": null, "conditional_rule": null, "is_visible": true, "order": 0, "options": [{"id": "marital_history.current_marital_status.single_never_married", "value": "single;_never_married", "label": "Single; never married", "order": 0}, {"id": "marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "value": "failed_engagement_/_annulled_marriage;_without_living_together", "label": "Failed engagement / Annulled marriage; without living together", "order": 1}, {"id": "marital_history.current_marital_status.divorced_after_living_together", "value": "divorced;_after_living_together", "label": "Divorced; after living together", "order": 2}, {"id": "marital_history.current_marital_status.widowed", "value": "widowed", "label": "Widowed", "order": 3}]}, {"id": "marital_history.previous_marriage_duration", "type": "text", "title": "Previous Marriage Duration", "description": "", "tooltip": "", "placeholder": "3 years", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "3 years", "placeholder_fa": "۳ سال", "showYearsSuffix": true}, "logic": {"dependsOn": {"title": "Current Marital Status", "values": ["Failed engagement / Annulled marriage; without living together", "Divorced; after living together", "Widowed"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 1, "options": []}, {"id": "marital_history.reason_for_separation", "type": "text", "title": "Reason for Separation", "description": "", "tooltip": "", "placeholder": "Enter details here...", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Enter details here...", "placeholder_fa": "توضیحات را اینجا وارد کنید..."}, "logic": {"dependsOn": {"title": "Current Marital Status", "values": ["Failed engagement / Annulled marriage; without living together", "Divorced; after living together"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 2, "options": []}, {"id": "marital_history.children_and_guardianship_status", "type": "radio", "title": "Children and Guardianship Status", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": true, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": {"dependsOn": {"title": "Current Marital Status", "values": ["Failed engagement / annulled marriage without starting joint life", "Divorced; after living together", "Widowed"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.current_marital_status", "trigger_option_ids": ["marital_history.current_marital_status.failed_engagement_annulled_marriage_without_living_together", "marital_history.current_marital_status.failed_marriage_contract_annulled_engagement_without_starting_joint_life", "marital_history.current_marital_status.divorced_after_living_together", "marital_history.current_marital_status.widowed"], "clear_answer_when_hidden": true}, "is_visible": true, "order": 3, "options": [{"id": "marital_history.children_and_guardianship_status.no_children", "value": "no_children", "label": "No children", "order": 0}, {"id": "marital_history.children_and_guardianship_status.have_children_living_with_me", "value": "have_children_living_with_me", "label": "Have children living with me", "order": 1}, {"id": "marital_history.children_and_guardianship_status.have_children_not_living_with_me", "value": "have_children_not_living_with_me", "label": "Have children not living with me", "order": 2}, {"id": "marital_history.children_and_guardianship_status.someone_else_is_under_my_guardianship", "value": "someone_else_is_under_my_guardianship", "label": "Someone else is under my guardianship", "order": 3}]}, {"id": "marital_history.number_of_children", "type": "number", "title": "Number of Children", "description": "", "tooltip": "", "placeholder": "2", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {"max": 10, "min": 0}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "2", "placeholder_fa": "۲"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 4, "options": []}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren", "type": "radio", "title": "What is the custody status of your child(ren)?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 5, "options": [{"id": "marital_history.what_is_the_custody_status_of_your_child_ren.i_have_full_custody_of_the_child_ren", "value": "i_have_full_custody_of_the_child(ren).", "label": "I have full custody of the child(ren).", "order": 0}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren.joint_custody_or_periodic_visitation_relocation_between_parents", "value": "joint_custody_or_periodic_visitation/relocation_between_parents.", "label": "Joint custody or periodic visitation/relocation between parents.", "order": 1}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren.custody_is_with_the_other_parent_or_another_person", "value": "custody_is_with_the_other_parent_or_another_person.", "label": "Custody is with the other parent or another person.", "order": 2}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren.children_have_reached_legal_age_custody_is_not_applicable", "value": "children_have_reached_legal_age_(custody_is_not_applicable).", "label": "Children have reached legal age (custody is not applicable).", "order": 3}, {"id": "marital_history.what_is_the_custody_status_of_your_child_ren.other_circumstances_dispute_pending_or_other", "value": "other_circumstances_(dispute,_pending,_or_other).", "label": "Other circumstances (dispute, pending, or other).", "order": 4}]}, {"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you", "type": "radio", "title": "How much time do the child(ren) usually live with you?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 6, "options": [{"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you.permanently_or_most_days_of_the_week_with_me", "value": "permanently_or_most_days_of_the_week_with_me.", "label": "Permanently or most days of the week with me.", "order": 0}, {"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you.approximately_half_the_time_joint_custody_schedule", "value": "approximately_half_the_time_(joint_custody/schedule).", "label": "Approximately half the time (joint custody/schedule).", "order": 1}, {"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you.weekends_holidays_or_specific_days_only", "value": "weekends,_holidays,_or_specific_days_only.", "label": "Weekends, holidays, or specific days only.", "order": 2}, {"id": "marital_history.how_much_time_do_the_child_ren_usually_live_with_you.they_do_not_live_with_me_or_there_is_no_fixed_schedule", "value": "they_do_not_live_with_me,_or_there_is_no_fixed_schedule.", "label": "They do not live with me, or there is no fixed schedule.", "order": 3}]}, {"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration", "type": "radio", "title": "Does the custody, visitation, or relocation schedule impact your residence or immigration?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 7, "options": [{"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration.no_it_has_no_significant_impact_on_residence_or_relocation", "value": "no,_it_has_no_significant_impact_on_residence_or_relocation.", "label": "No, it has no significant impact on residence or relocation.", "order": 0}, {"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration.yes_relocation_or_immigration_requires_coordination_agreement_or_a_legal_permit", "value": "yes,_relocation_or_immigration_requires_coordination,_agreement,_or_a_legal_permit.", "label": "Yes, relocation or immigration requires coordination, agreement, or a legal permit.", "order": 1}, {"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration.yes_i_am_restricted_and_must_reside_in_the_same_city_or_region", "value": "yes,_i_am_restricted_and_must_reside_in_the_same_city_or_region.", "label": "Yes, I am restricted and must reside in the same city or region.", "order": 2}, {"id": "marital_history.does_the_custody_visitation_or_relocation_schedule_impact_your_residence_or_immigration.unclear_pending_dispute_agreement_or_depends_on_conditions", "value": "unclear_(pending_dispute/agreement_or_depends_on_conditions).", "label": "Unclear (pending dispute/agreement or depends on conditions).", "order": 3}]}, {"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support", "type": "radio", "title": "What is the payment or receipt status of child support?", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 8, "options": [{"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support.ongoing_financial_commitment_paying_child_support_or_sharing_expenses", "value": "ongoing_financial_commitment_(paying_child_support_or_sharing_expenses).", "label": "Ongoing financial commitment (paying child support or sharing expenses).", "order": 0}, {"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support.receiving_child_support_regularly", "value": "receiving_child_support_regularly.", "label": "Receiving child support regularly.", "order": 1}, {"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support.payments_are_case_by_case_agreed_or_irregular", "value": "payments_are_case-by-case,_agreed,_or_irregular.", "label": "Payments are case-by-case, agreed, or irregular.", "order": 2}, {"id": "marital_history.what_is_the_payment_or_receipt_status_of_child_support.no_formal_child_support_commitment_or_child_is_independent_pending", "value": "no_formal_child_support_commitment_(or_child_is_independent_/_pending).", "label": "No formal child support commitment (or child is independent / pending).", "order": 3}]}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent", "type": "dropdown", "title": "Acceptance of necessary communication between future spouse and the other parent", "description": "", "tooltip": "", "placeholder": "Select one option", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": true, "placeholder_en": "Select one option", "placeholder_fa": "یک گزینه را انتخاب کنید"}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 9, "options": [{"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.i_accept_necessary_respectful_and_limited_communication_regarding_child_matters", "value": "i_accept_necessary,_respectful,_and_limited_communication_regarding_child_matters.", "label": "I accept necessary, respectful, and limited communication regarding child matters.", "order": 0}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.i_only_accept_formal_and_highly_limited_communication_regarding_essential_child_matters", "value": "i_only_accept_formal_and_highly_limited_communication_regarding_essential_child_matters.", "label": "I only accept formal and highly limited communication regarding essential child matters.", "order": 1}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.i_prefer_communication_to_go_through_an_intermediary_a_family_member_or_a_lawyer_as_much_as_possible", "value": "i_prefer_communication_to_go_through_an_intermediary,_a_family_member,_or_a_lawyer_as_much_as_possible.", "label": "I prefer communication to go through an intermediary, a family member, or a lawyer as much as possible.", "order": 2}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.any_ongoing_communication_beyond_essential_child_matters_with_the_other_parent_is_a_red_line_for_me", "value": "any_ongoing_communication_beyond_essential_child_matters_with_the_other_parent_is_a_red_line_for_me.", "label": "Any ongoing communication beyond essential child matters with the other parent is a red line for me.", "order": 3}, {"id": "marital_history.acceptance_of_necessary_communication_between_future_spouse_and_the_other_parent.acceptance_depends_on_the_type_and_extent_of_communication_custody_conditions_and_mutual_trust", "value": "acceptance_depends_on_the_type_and_extent_of_communication,_custody_conditions,_and_mutual_trust.", "label": "Acceptance depends on the type and extent of communication, custody conditions, and mutual trust.", "order": 4}]}, {"id": "marital_history.short_children_guardianship_explanation", "type": "textarea", "title": "Short Children/Guardianship Explanation", "description": "", "tooltip": "", "placeholder": "Enter details here...", "required": true, "is_required": false, "private": true, "is_private": true, "show_guardian_notice": false, "validation": {}, "ui_config": {"private": true, "noSearch": false, "placeholder_en": "Enter details here...", "placeholder_fa": "توضیحات را اینجا وارد کنید..."}, "logic": {"dependsOn": {"title": "Children and Guardianship Status", "values": ["Have children living with me", "Have children not living with me", "Someone else is under my guardianship"]}}, "audience": null, "required_when": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me", "marital_history.children_and_guardianship_status.someone_else_is_under_my_guardianship"], "clear_answer_when_hidden": true}, "visibility": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me", "marital_history.children_and_guardianship_status.someone_else_is_under_my_guardianship"], "clear_answer_when_hidden": true}, "conditional_rule": {"operator": "any_of", "parent_question_id": "marital_history.children_and_guardianship_status", "trigger_option_ids": ["marital_history.children_and_guardianship_status.have_children_living_with_me", "marital_history.children_and_guardianship_status.have_children_not_living_with_me", "marital_history.children_and_guardianship_status.someone_else_is_under_my_guardianship"], "clear_answer_when_hidden": true}, "is_visible": false, "order": 10, "options": []}] \ No newline at end of file diff --git a/conditional-rules.js b/conditional-rules.js index 9c0d5d1..ee52044 100644 --- a/conditional-rules.js +++ b/conditional-rules.js @@ -105,7 +105,7 @@ function matchesAudience(audience, context) { return true; } if (audience.genders && audience.genders.length > 0) { - if ((context === null || context === void 0 ? void 0 : context.gender) && !audience.genders.includes(context.gender)) { + if (!context || !context.gender || !audience.genders.map(function(g) { return g.toLowerCase(); }).includes(context.gender.toLowerCase())) { return false; } } @@ -139,8 +139,8 @@ function ruleMatches(rawRule, answers, context) { var expectedValues = (rule.dependsOn.values || []).map(function (v) { return String(v).toLowerCase().trim(); }); - var actualTokens_1 = getSelectedOptionTokens(answer); - var hasMatch = expectedValues.some(function (v) { return actualTokens_1.has(v); }); + var actualTokens = getSelectedOptionTokens(answer); + var hasMatch = expectedValues.some(function (v) { return actualTokens.has(v); }); return hasMatch; } var mainMatches = true; @@ -155,17 +155,17 @@ function ruleMatches(rawRule, answers, context) { mainMatches = false; } else { - var actualTokens_2 = getSelectedOptionTokens(answer); + var actualTokens_1 = getSelectedOptionTokens(answer); var expectedIds = (rule.trigger_option_ids || []).map(function (id) { return String(id).toLowerCase().trim(); }); var isTokenMatched = function (expectedId) { - if (actualTokens_2.has(expectedId)) + if (actualTokens_1.has(expectedId)) return true; var lastDot = expectedId.lastIndexOf("."); if (lastDot !== -1 && lastDot < expectedId.length - 1) { var suffix = expectedId.slice(lastDot + 1); - if (actualTokens_2.has(suffix)) + if (actualTokens_1.has(suffix)) return true; } return false; @@ -177,7 +177,7 @@ function ruleMatches(rawRule, answers, context) { mainMatches = expectedIds.length > 0 && expectedIds.every(isTokenMatched) && - actualTokens_2.size <= expectedIds.length * 2; + actualTokens_1.size <= expectedIds.length * 2; } else { // default: "any_of" @@ -201,7 +201,7 @@ function ruleMatches(rawRule, answers, context) { ? mainMatches || conditionsResult : mainMatches && conditionsResult; } - return mainMatches; + return parentId ? mainMatches : Boolean(!rule.audience || matchesAudience(rule.audience, context)); } function isQuestionVisible(question, answers, context) { // 1. Audience check @@ -224,14 +224,11 @@ function isQuestionRequired(question, answers, context) { if (!isQuestionVisible(question, answers, context)) { return false; } - if (question.required || question.baseRequired) { - return true; - } if (question.requiredWhen) { - if (question.requiredWhen.genders || question.requiredWhen.minAge || question.requiredWhen.maxAge) { + if (question.requiredWhen.genders || question.requiredWhen.minAge !== undefined || question.requiredWhen.maxAge !== undefined) { return matchesAudience(question.requiredWhen, context); } return ruleMatches(question.requiredWhen, answers, context); } - return false; + return Boolean(question.baseRequired !== undefined ? question.baseRequired : question.required); } diff --git a/src/app/questions-list/[slug]/question-detail-client.tsx b/src/app/questions-list/[slug]/question-detail-client.tsx index 4d5a043..de0b253 100644 --- a/src/app/questions-list/[slug]/question-detail-client.tsx +++ b/src/app/questions-list/[slug]/question-detail-client.tsx @@ -137,13 +137,34 @@ function QuestionFlowWrapper({ return undefined; }, [profile?.age, answers]); - const userContext = useMemo( - () => ({ - gender: profile?.gender, + const userContext = useMemo(() => { + let gender = profile?.gender; + if (!gender) { + const genderAns = + answers["personal_identity.gender"] || + answers["personal_info.gender"] || + answers["gender"] || + Object.entries(answers).find(([k]) => k.includes("gender"))?.[1]; + const gVal = + typeof genderAns === "object" && + genderAns !== null && + "value" in genderAns + ? genderAns.value + : genderAns; + if (typeof gVal === "string" && gVal) { + gender = + gVal.toLowerCase().includes("female") || + gVal.toLowerCase().includes("woman") || + gVal.toLowerCase().includes("زن") + ? "female" + : "male"; + } + } + return { + gender, age: computedAge, - }), - [profile?.gender, computedAge], - ); + }; + }, [profile?.gender, answers, computedAge]); const dynamicQuestions = useMemo(() => { diff --git a/src/components/Componentes/question-file.test.tsx b/src/components/Componentes/question-file.test.tsx new file mode 100644 index 0000000..eeab4ac --- /dev/null +++ b/src/components/Componentes/question-file.test.tsx @@ -0,0 +1,224 @@ +import { + act, + cleanup, + fireEvent, + render, + screen, + waitFor, +} from "@testing-library/react"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import type { QuestionField } from "@/lib/schema-adapter"; +import { QuestionFile } from "./question-file"; + +let answerMap: Record = {}; +const mockSetAnswerValue = vi.fn((q: QuestionField, val: unknown) => { + answerMap[q.id] = val; +}); + +const mockMutateAsync = vi.fn(async (file: File) => ({ + path: `/media/tmp/${file.name}`, +})); + +vi.mock("@/hooks/marriage/use-upload-tmp-media", () => ({ + useUploadTmpMediaMutation: () => ({ + mutate: vi.fn(), + mutateAsync: mockMutateAsync, + isPending: false, + isError: false, + }), +})); + +vi.mock("@/translations/provider", () => ({ + useI18n: () => ({ + locale: "en", + dictionary: { + upload_certificates: "upload certificates", + add_another_document: "Add another document", + max_files_reached: "Maximum of 4 files uploaded", + remove_document: "Remove document", + upload_failed: "Upload failed. Please try again.", + }, + }), +})); + +vi.mock("./question-answer-storage", () => ({ + useQuestionAnswers: () => ({ + getAnswerValue: (q: QuestionField) => answerMap[q.id] ?? null, + setAnswerValue: mockSetAnswerValue, + isLoading: false, + }), +})); + +const mockFileQuestion: QuestionField = { + id: "documents_verification.valid_identification_document", + title: "Valid Identification Document", + type: "file", + order: 1, + required: true, + baseRequired: true, + isVisible: true, + description: "Passport, National ID, or Driver's License", + tooltip: "", + extras: { + placeHolder: "Upload document", + range: [0, 0], + options: [".pdf", ".jpg", ".jpeg", ".png"], + }, + options: [], +}; + +describe("QuestionFile Component (Multiple Upload)", () => { + beforeEach(() => { + answerMap = {}; + mockSetAnswerValue.mockClear(); + mockMutateAsync.mockClear(); + vi.clearAllMocks(); + }); + + afterEach(() => { + cleanup(); + }); + + it("renders empty dropzone when no files are uploaded without formats text", () => { + render(); + + expect(screen.getByText(/Valid Identification/)).toBeInTheDocument(); + expect(screen.getByText(/Passport, National ID, or Driver's License/)).toBeInTheDocument(); + expect(screen.getByText("upload certificates")).toBeInTheDocument(); + expect(screen.queryByText("pdf, jpg, jpeg, png")).not.toBeInTheDocument(); + }); + + it("renders legacy single file stored as string correctly", () => { + answerMap[mockFileQuestion.id] = "/media/marriage/media/passport.pdf"; + + render(); + + expect(screen.getByText("passport.pdf")).toBeInTheDocument(); + expect(screen.getByText(/Add another document/)).toBeInTheDocument(); + expect(screen.getByText(/(1\/4)/)).toBeInTheDocument(); + }); + + it("renders multiple stored files correctly", () => { + answerMap[mockFileQuestion.id] = [ + "/media/marriage/media/doc1.pdf", + "/media/marriage/media/doc2.jpg", + "/media/marriage/media/doc3.png", + ]; + + render(); + + expect(screen.getByText("doc1.pdf")).toBeInTheDocument(); + expect(screen.getByAltText("doc2.jpg")).toBeInTheDocument(); + expect(screen.getByAltText("doc3.png")).toBeInTheDocument(); + expect(screen.getByText(/Add another document/)).toBeInTheDocument(); + expect(screen.getByText(/(3\/4)/)).toBeInTheDocument(); + }); + + it("uploads a new file and transitions from empty state to list with Add button", async () => { + render(); + + const input = screen.getByLabelText("Upload files"); + expect(input).toBeInTheDocument(); + + const file = new File(["dummy content"], "national_id.pdf", { + type: "application/pdf", + }); + + await act(async () => { + fireEvent.change(input, { target: { files: [file] } }); + }); + + await waitFor(() => { + expect(mockMutateAsync).toHaveBeenCalledWith(file); + expect(mockSetAnswerValue).toHaveBeenCalledWith(mockFileQuestion, [ + "/media/tmp/national_id.pdf", + ]); + }); + + expect(screen.getByText("national_id.pdf")).toBeInTheDocument(); + expect(screen.getByText(/Add another document/)).toBeInTheDocument(); + }); + + it("allows adding 2nd, 3rd, 4th file and disables upload at 4 items", async () => { + answerMap[mockFileQuestion.id] = [ + "/media/marriage/media/file1.pdf", + "/media/marriage/media/file2.pdf", + "/media/marriage/media/file3.pdf", + ]; + + render(); + + expect(screen.getByText("file1.pdf")).toBeInTheDocument(); + expect(screen.getByText("file2.pdf")).toBeInTheDocument(); + expect(screen.getByText("file3.pdf")).toBeInTheDocument(); + expect(screen.getByText(/(3\/4)/)).toBeInTheDocument(); + + // Add 4th file + const addInput = screen.getByLabelText("Add file"); + const fourthFile = new File(["content"], "file4.jpg", { type: "image/jpeg" }); + + await act(async () => { + fireEvent.change(addInput, { target: { files: [fourthFile] } }); + }); + + await waitFor(() => { + expect(mockSetAnswerValue).toHaveBeenCalledWith(mockFileQuestion, [ + "/media/marriage/media/file1.pdf", + "/media/marriage/media/file2.pdf", + "/media/marriage/media/file3.pdf", + "/media/tmp/file4.jpg", + ]); + }); + + // Now 4 items are present, max files reached badge should be displayed + expect(screen.getByText("Maximum of 4 files uploaded")).toBeInTheDocument(); + expect(screen.queryByText(/Add another document/)).not.toBeInTheDocument(); + }); + + it("deleting an item removes it from list, preserves remaining items, and restores Add button", async () => { + answerMap[mockFileQuestion.id] = [ + "/media/marriage/media/file1.pdf", + "/media/marriage/media/file2.jpg", + "/media/marriage/media/file3.png", + "/media/marriage/media/file4.pdf", + ]; + + render(); + + expect(screen.getByText("Maximum of 4 files uploaded")).toBeInTheDocument(); + + const deleteButtons = screen.getAllByTitle("Remove document"); + expect(deleteButtons).toHaveLength(4); + + // Delete 2nd file (file2.jpg) + await act(async () => { + fireEvent.click(deleteButtons[1]); + }); + + expect(mockSetAnswerValue).toHaveBeenCalledWith(mockFileQuestion, [ + "/media/marriage/media/file1.pdf", + "/media/marriage/media/file3.png", + "/media/marriage/media/file4.pdf", + ]); + + // Now 3 items remain, add button should be visible again + expect(screen.getByText(/Add another document/)).toBeInTheDocument(); + expect(screen.getByText(/(3\/4)/)).toBeInTheDocument(); + }); + + it("deleting the only item clears answer back to null and returns to empty dropzone", async () => { + answerMap[mockFileQuestion.id] = ["/media/marriage/media/only_file.pdf"]; + + render(); + + expect(screen.getByText("only_file.pdf")).toBeInTheDocument(); + + const deleteButton = screen.getByTitle("Remove document"); + await act(async () => { + fireEvent.click(deleteButton); + }); + + expect(mockSetAnswerValue).toHaveBeenCalledWith(mockFileQuestion, null); + expect(screen.getByText("upload certificates")).toBeInTheDocument(); + }); +}); diff --git a/src/components/Componentes/question-file.tsx b/src/components/Componentes/question-file.tsx index 48e8d8d..971d076 100644 --- a/src/components/Componentes/question-file.tsx +++ b/src/components/Componentes/question-file.tsx @@ -1,20 +1,30 @@ "use client"; import Image from "next/image"; -import { useCallback, useEffect, useState } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import type { QuestionField } from "@/lib/schema-adapter"; import { useUploadTmpMediaMutation } from "@/hooks/marriage/use-upload-tmp-media"; import { getApiRequestUrl } from "@/lib/http"; import { isInFlutterWebView, uploadFile } from "@/lib/webview-actions"; +import { useI18n } from "@/translations/provider"; import { useQuestionAnswers } from "./question-answer-storage"; import QuestionTitle from "./question-title"; import { LoadingSkeleton } from "./loading-skeleton"; +const MAX_FILES = 4; + type QuestionFileProps = { question: QuestionField; disabled?: boolean; }; +export type UploadedFileItem = { + id: string; + url: string; + name: string; + isUploading?: boolean; +}; + /** Map question file extensions to upload_file mediaType. */ function resolveMediaType( extensions: string[], @@ -53,56 +63,115 @@ function isImageFile( return true; } const nameToCheck = fileName || fileUrl || ""; - return /\.(jpg|jpeg|png|webp|gif|svg|bmp|avif)$/i.test(nameToCheck); + return /\.(jpg|jpeg|png|webp|gif|svg|bmp|avif)($|\?)/i.test(nameToCheck); } -export function QuestionFile({ - question, - disabled, -}: QuestionFileProps) { +function getDisplayFileName(url: string, name?: string): string { + if (name && name.trim().length > 0) return name; + if (!url) return "document"; + try { + const clean = url.split("?")[0].split("#")[0]; + const extracted = clean.split("/").pop(); + return extracted ? decodeURIComponent(extracted) : "document"; + } catch { + return url.split("/").pop() ?? "document"; + } +} + +function parseStoredFiles(storedValue: unknown): UploadedFileItem[] { + if (!storedValue) return []; + if (Array.isArray(storedValue)) { + return storedValue + .filter((v): v is string => typeof v === "string" && v.trim().length > 0) + .slice(0, MAX_FILES) + .map((url, idx) => ({ + id: `stored-${idx}-${url}`, + url, + name: getDisplayFileName(url), + })); + } + if (typeof storedValue === "string" && storedValue.trim().length > 0) { + return [ + { + id: `stored-0-${storedValue}`, + url: storedValue, + name: getDisplayFileName(storedValue), + }, + ]; + } + return []; +} + +function extractFilePath(res: unknown): string | null { + if (!res || typeof res !== "object") return null; + const r = res as Record; + if (typeof r.path === "string" && r.path.trim().length > 0) return r.path; + if (typeof r.file === "string" && r.file.trim().length > 0) return r.file; + if (typeof r.url === "string" && r.url.trim().length > 0) return r.url; + if (typeof r.apath === "string" && r.apath.trim().length > 0) return r.apath; + return null; +} + +export function QuestionFile({ question, disabled }: QuestionFileProps) { + const { dictionary: t } = useI18n(); const { getAnswerValue, setAnswerValue } = useQuestionAnswers(); const storedValue = getAnswerValue(question); - const initialFileName = - typeof storedValue === "string" && storedValue.trim().length > 0 - ? (storedValue.split("/").pop() ?? storedValue) - : null; - - const initialFileUrl = - typeof storedValue === "string" && storedValue.trim().length > 0 - ? storedValue.startsWith("http") || - storedValue.startsWith("blob:") || - storedValue.startsWith("data:") - ? storedValue - : getApiRequestUrl(storedValue) - : null; - - const [selectedFileName, setSelectedFileName] = useState( - initialFileName, - ); - const [filePreviewUrl, setFilePreviewUrl] = useState( - initialFileUrl, + const initialItems = useMemo( + () => parseStoredFiles(storedValue), + // eslint-disable-next-line react-hooks/exhaustive-deps + [], ); + + const [files, setFiles] = useState(initialItems); const [isFlutterPicking, setIsFlutterPicking] = useState(false); + const [uploadError, setUploadError] = useState(null); + + const fileInputRef = useRef(null); + const addFileInputRef = useRef(null); + const filesRef = useRef(files); + filesRef.current = files; + + // Sync state if storedValue changes externally + useEffect(() => { + const parsed = parseStoredFiles(storedValue); + const currentUrls = filesRef.current + .filter((f) => !f.isUploading) + .map((f) => f.url); + const parsedUrls = parsed.map((p) => p.url); + + const isDifferent = + currentUrls.length !== parsedUrls.length || + currentUrls.some((u, i) => u !== parsedUrls[i]); + + if (isDifferent) { + setFiles(parsed); + } + }, [storedValue]); const acceptedFiles = (question.extras?.options ?? []) .map((option) => option.replace(/^\./, "")) .join(", "); - const uploadTmpMediaMutation = useUploadTmpMediaMutation({ - onSuccess: (response) => { - if (response.path) { - setAnswerValue(question, response.path); + const uploadTmpMediaMutation = useUploadTmpMediaMutation(); + + const persistFiles = useCallback( + (newFiles: UploadedFileItem[]) => { + setFiles(newFiles); + const validUrls = newFiles + .filter((f) => !f.isUploading && f.url) + .map((f) => f.url); + + if (validUrls.length === 0) { + setAnswerValue(question, null); + } else { + setAnswerValue(question, validUrls); } }, - onError: (error) => { - console.error("File upload error:", error); - }, - }); - - const isPending = uploadTmpMediaMutation.isPending || isFlutterPicking; + [question, setAnswerValue], + ); - // Listen for upload_file responses from Flutter + // Listen for upload_file responses from Flutter WebView useEffect(() => { if (!isInFlutterWebView()) return; @@ -112,37 +181,72 @@ export function QuestionFile({ switch (event.status) { case "picking": setIsFlutterPicking(true); + setUploadError(null); break; case "picked": - if (event.data?.files?.[0]) { - const fileName = event.data.files[0].name ?? null; - setSelectedFileName(fileName); - if (fileName) { - setAnswerValue(question, fileName); - } - } break; case "progress": break; case "completed": { setIsFlutterPicking(false); + setUploadError(null); const file = event.data?.files?.[0]; - if (file?.url) { - setAnswerValue(question, file.url); - setSelectedFileName(file.name ?? "uploaded"); - setFilePreviewUrl(file.url); + const fileUrl = file?.url || file?.path || (file as any)?.apath; + if (fileUrl) { + const current = filesRef.current.filter( + (f) => !f.isUploading && f.url, + ); + if (current.length < MAX_FILES) { + const newItem: UploadedFileItem = { + id: `flutter-${Date.now()}-${fileUrl}`, + url: fileUrl, + name: file?.name ?? getDisplayFileName(fileUrl), + }; + persistFiles([...current, newItem]); + } } else if (file?.base64) { const b64 = file.base64; - setSelectedFileName(file.name ?? "upload"); - setFilePreviewUrl(b64); - fetch(b64) - .then((res) => res.blob()) - .then((blob) => { - const f = new File([blob], file.name ?? "upload", { - type: blob.type, + const tempId = `flutter-uploading-${Date.now()}`; + const tempItem: UploadedFileItem = { + id: tempId, + url: b64, + name: file.name ?? "document", + isUploading: true, + }; + const current = filesRef.current.filter((f) => f.url); + if (current.length < MAX_FILES) { + setFiles([...current, tempItem]); + fetch(b64) + .then((res) => res.blob()) + .then((blob) => { + const f = new File([blob], file.name ?? "document", { + type: blob.type, + }); + return uploadTmpMediaMutation.mutateAsync(f); + }) + .then((res) => { + const extracted = extractFilePath(res); + if (extracted) { + const finalItem: UploadedFileItem = { + id: `uploaded-${Date.now()}-${extracted}`, + url: extracted, + name: file.name ?? getDisplayFileName(extracted), + }; + const next = filesRef.current + .filter((item) => item.id !== tempId) + .concat(finalItem); + persistFiles(next.slice(0, MAX_FILES)); + } else { + setFiles((prev) => prev.filter((item) => item.id !== tempId)); + setUploadError((t?.upload_failed as string) ?? "Upload failed. Please try again."); + } + }) + .catch((err) => { + console.error("Flutter base64 upload error:", err); + setFiles((prev) => prev.filter((item) => item.id !== tempId)); + setUploadError((t?.upload_failed as string) ?? "Upload failed. Please try again."); }); - uploadTmpMediaMutation.mutate(f); - }); + } } break; } @@ -151,6 +255,7 @@ export function QuestionFile({ break; case "failed": setIsFlutterPicking(false); + setUploadError((t?.upload_failed as string) ?? "Upload failed. Please try again."); console.error("upload_file failed:", event.message); break; } @@ -159,10 +264,13 @@ export function QuestionFile({ return () => { unsubscribe?.(); }; - }, [question, setAnswerValue, uploadTmpMediaMutation]); + }, [persistFiles, uploadTmpMediaMutation, t]); /** Handle file pick in Flutter WebView via upload_file action. */ const handleFlutterPick = useCallback(() => { + if (filesRef.current.length >= MAX_FILES || disabled) return; + + setUploadError(null); const extensions = (question.extras?.options ?? []).map((o) => o.replace(/^\./, "").toLowerCase(), ); @@ -179,182 +287,364 @@ export function QuestionFile({ title: typeof question.title === "string" ? question.title : "Upload File", }); - }, [question]); - - /** Handle file pick via browser (fallback). */ - function handleBrowserFileChange(files: FileList | null) { - const file = files?.[0]; - - if (!file) { - setSelectedFileName(null); - setFilePreviewUrl(null); - setAnswerValue(question, null); - return; - } + }, [question, disabled]); + + /** Process multiple files uploaded via browser input */ + async function handleBrowserFiles(fileList: FileList | null) { + if (!fileList || fileList.length === 0 || disabled) return; + + setUploadError(null); + const currentValid = filesRef.current.filter((f) => !f.isUploading); + const availableSlots = MAX_FILES - currentValid.length; + if (availableSlots <= 0) return; + + const filesToUpload = Array.from(fileList).slice(0, availableSlots); + + // Create temporary placeholders for visual feedback + const tempItems: { item: UploadedFileItem; file: File }[] = + filesToUpload.map((file, i) => { + const isImg = file.type.startsWith("image/"); + const previewUrl = isImg ? URL.createObjectURL(file) : ""; + return { + item: { + id: `temp-${Date.now()}-${i}-${file.name}`, + url: previewUrl, + name: file.name, + isUploading: true, + }, + file, + }; + }); + + setFiles([...currentValid, ...tempItems.map((t) => t.item)]); + + // Upload files + try { + const results = await Promise.all( + tempItems.map(async ({ item, file }) => { + try { + const res = await uploadTmpMediaMutation.mutateAsync(file); + const extracted = extractFilePath(res); + if (!extracted) { + return { id: item.id, finalItem: null }; + } + return { + id: item.id, + finalItem: { + id: `uploaded-${Date.now()}-${extracted}`, + url: extracted, + name: file.name, + } as UploadedFileItem, + }; + } catch (err) { + console.error(`Upload error for ${file.name}:`, err); + return { id: item.id, finalItem: null }; + } + }), + ); + + const successfulUploads = results + .map((r) => r.finalItem) + .filter((item): item is UploadedFileItem => item !== null); + + if (successfulUploads.length === 0 && tempItems.length > 0) { + setUploadError( + (t?.upload_failed as string) ?? "Upload failed. Please try again.", + ); + persistFiles(currentValid); + return; + } - setSelectedFileName(file.name); - setAnswerValue(question, file.name); + if (successfulUploads.length < tempItems.length) { + setUploadError( + (t?.upload_failed as string) ?? "Upload failed. Please try again.", + ); + } else { + setUploadError(null); + } - if (file.type.startsWith("image/")) { - const objectUrl = URL.createObjectURL(file); - setFilePreviewUrl(objectUrl); - } else { - setFilePreviewUrl(null); + const nextFiles = [ + ...currentValid, + ...successfulUploads, + ].slice(0, MAX_FILES); + persistFiles(nextFiles); + } catch { + setUploadError( + (t?.upload_failed as string) ?? "Upload failed. Please try again.", + ); + persistFiles(currentValid); } - - uploadTmpMediaMutation.mutate(file); } - const handleRemoveFile = (e: React.MouseEvent) => { + const handleRemoveFile = (indexToRemove: number, e: React.MouseEvent) => { e.stopPropagation(); e.preventDefault(); - setSelectedFileName(null); - setFilePreviewUrl(null); - setAnswerValue(question, null); + setUploadError(null); + const updated = filesRef.current.filter((_, idx) => idx !== indexToRemove); + persistFiles(updated); }; const inWebView = isInFlutterWebView(); - const isUploaded = Boolean(selectedFileName || storedValue); - const currentFileName = - selectedFileName ?? - (typeof storedValue === "string" ? storedValue.split("/").pop() : null); - const currentFileUrl = - filePreviewUrl ?? - (typeof storedValue === "string" && storedValue.trim().length > 0 - ? storedValue.startsWith("http") || - storedValue.startsWith("blob:") || - storedValue.startsWith("data:") - ? storedValue - : getApiRequestUrl(storedValue) - : null); - - const isImg = isImageFile(currentFileName, currentFileUrl); + const hasFiles = files.length > 0; + const isMaxReached = files.length >= MAX_FILES; + const isAnyPending = + isFlutterPicking || files.some((item) => item.isUploading); + + const getFullFileUrl = (url: string) => { + if (!url) return ""; + if ( + url.startsWith("http://") || + url.startsWith("https://") || + url.startsWith("blob:") || + url.startsWith("data:") + ) { + return url; + } + return getApiRequestUrl(url); + }; return (
- { - if (e.key === "Enter" || e.key === " ") handleFlutterPick(); - } - : undefined - } - > - {/* Fallback: browser file input (hidden in WebView or when uploaded) */} - {!inWebView && !isUploaded && ( - handleBrowserFileChange(event.target.files)} - className="absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0" - /> - )} - - {isUploaded ? ( - /* ────── UPLOADED STATE ────── */ -
- {isImg && currentFileUrl ? ( - /* Image Preview (Left design in screenshot) */ - {currentFileName fileInputRef.current?.click() + } + onKeyDown={(e) => { + if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + if (inWebView) handleFlutterPick(); + else fileInputRef.current?.click(); + } + }} + > + {!inWebView && ( + { + handleBrowserFiles(e.target.files); + if (e.target) e.target.value = ""; + }} + className="sr-only" + aria-label="Upload files" + /> + )} + + {isAnyPending ? ( + + ) : ( + <> + Upload - ) : ( - /* Document / PDF Preview (Right design in screenshot) */ -
-
- - - - - - PDF - -
- - {currentFileName ?? "document"} + + {(t?.upload_certificates as string) ?? "upload certificates"} + + {uploadError ? ( + + {uploadError} -
- )} - - {/* Trash Button in Bottom-Right */} -
+ ) : ( + /* ────── MULTIPLE FILES LIST / GRID ────── */ +
+
+ {files.map((fileItem, index) => { + const fullUrl = getFullFileUrl(fileItem.url); + const isImg = isImageFile(fileItem.name, fullUrl); + + return ( +
+ {isImg && fullUrl ? ( +
+ {/* eslint-disable-next-line @next/next/no-img-element */} + {fileItem.name} +
+ ) : ( +
+
+ + + + + + PDF + +
+ + {fileItem.name} + +
+ )} + + {/* Individual Delete / Trash Button */} + {!fileItem.isUploading && ( + + )} + + {/* Loading overlay for item */} + {fileItem.isUploading && ( +
+ +
+ )} +
+ ); + })} +
+ + {/* ────── ADD ANOTHER DOCUMENT ACTION / STATUS ────── */} + {!isMaxReached ? ( +
addFileInputRef.current?.click() + } + onKeyDown={(e) => { + if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + if (inWebView) handleFlutterPick(); + else addFileInputRef.current?.click(); + } + }} + className="flex min-h-[48px] w-full cursor-pointer items-center justify-center gap-2 rounded-[16px] border-2 border-dashed border-[#8D8D8D]/70 bg-[#F9F9F9] px-4 py-3 text-center transition-all hover:border-[#6F6F6F] hover:bg-[#F2F2F2] active:scale-[0.99] select-none" > + {!inWebView && ( + { + handleBrowserFiles(e.target.files); + if (e.target) e.target.value = ""; + }} + className="sr-only" + aria-label="Add file" + /> + )} + - - - + + - - - {isPending && ( -
- -
- )} -
- ) : /* ────── DEFAULT EMPTY STATE ────── */ - isPending ? ( - - ) : ( - <> - Upload - - {selectedFileName ?? "upload certificates"} - - {uploadTmpMediaMutation.isError ? ( - - Upload failed. Please try again. + + {(t?.add_another_document as string) ?? "Add another document"}{" "} + + ({files.length}/{MAX_FILES}) + - ) : acceptedFiles ? ( - - {acceptedFiles} +
+ ) : ( +
+ + + + + {(t?.max_files_reached as string) ?? + "Maximum of 4 files uploaded"} - ) : null} - - )} - +
+ )} + + {uploadError && ( + + {uploadError} + + )} +
+ )} ); } diff --git a/src/components/Componentes/question-sheet.test.tsx b/src/components/Componentes/question-sheet.test.tsx index 497c82b..31bfb97 100644 --- a/src/components/Componentes/question-sheet.test.tsx +++ b/src/components/Componentes/question-sheet.test.tsx @@ -382,4 +382,54 @@ describe("QuestionSheet component", () => { expect(section).not.toHaveClass("h-auto"); expect(screen.getByPlaceholderText("جستجو...")).toBeDefined(); }); + + it("should render relationship persons and NOT countries for contact_residence.relationship_to_representative", () => { + const queryClient = new QueryClient({ + defaultOptions: { queries: { retry: false } }, + }); + + const relQuestion = { + id: "contact_residence.relationship_to_representative", + title: "نسبت رابط با شما", + type: "dropdown", + required: false, + extras: { + placeHolder: "انتخاب کنید", + noSearch: true, + }, + options: [ + { id: "contact_residence.relationship_to_representative.father", value: "father", label: "پدر", order: 1 }, + { id: "contact_residence.relationship_to_representative.mother", value: "mother", label: "مادر", order: 2 }, + { id: "contact_residence.relationship_to_representative.brother", value: "brother", label: "برادر", order: 3 }, + { id: "contact_residence.relationship_to_representative.sister", value: "sister", label: "خواهر", order: 4 }, + { id: "contact_residence.relationship_to_representative.paternal_maternal_uncle", value: "paternal_maternal_uncle", label: "عمو / دایی", order: 5 }, + { id: "contact_residence.relationship_to_representative.paternal_maternal_aunt", value: "paternal_maternal_aunt", label: "خاله / عمه", order: 6 }, + { id: "contact_residence.relationship_to_representative.trusted_family_friend", value: "trusted_family_friend", label: "دوست خانوادگی معتمد", order: 7 }, + { id: "contact_residence.relationship_to_representative.religious_clerical_sponsor", value: "religious_clerical_sponsor", label: "معرف مذهبی / روحانی", order: 8 }, + { id: "contact_residence.relationship_to_representative.trusted_social_sponsor", value: "trusted_social_sponsor", label: "معرف اجتماعی معتمد", order: 9 }, + ], + ui_config: {}, + } as QuestionField; + + render( + + + + + , + ); + + fireEvent.click(screen.getByRole("button", { name: "انتخاب کنید" })); + + // Should contain person relationships + expect(screen.getByText("پدر")).toBeDefined(); + expect(screen.getByText("مادر")).toBeDefined(); + expect(screen.getByText("برادر")).toBeDefined(); + expect(screen.getByText("عمو / دایی")).toBeDefined(); + + // Should NOT contain countries + expect(screen.queryByText("Afghanistan")).toBeNull(); + expect(screen.queryByText("Antigua and Barbuda")).toBeNull(); + expect(screen.queryByText("افغانستان")).toBeNull(); + }); }); diff --git a/src/components/Componentes/question-sheet.tsx b/src/components/Componentes/question-sheet.tsx index 67e7c18..4028d71 100644 --- a/src/components/Componentes/question-sheet.tsx +++ b/src/components/Componentes/question-sheet.tsx @@ -97,30 +97,38 @@ export function QuestionSheet({ question, disabled }: QuestionSheetProps) { return () => window.removeEventListener("keydown", handleKeyDown); }, [isOpen, closeSheet]); + const isExcludedFromAutoDatasets = + question.id?.toLowerCase().includes("representative") || + question.id?.toLowerCase().includes("relationship") || + question.id?.toLowerCase().includes("residence_status") || + question.id?.toLowerCase().includes("status") || + question.id?.toLowerCase().includes("responsibility") || + question.extras?.noSearch === true || + question.ui_config?.noSearch === true; + const isLanguageQuestion = - question.id?.toLowerCase().includes("language") || - question.id?.toLowerCase().includes("mother_tongue") || - question.id?.toLowerCase().includes("other_languages") || - question.title?.toLowerCase().includes("language") || - question.title?.toLowerCase().includes("tongue") || - question.title?.includes("زبان") || - question.ui_config?.dataset === "languages"; + !isExcludedFromAutoDatasets && + (question.ui_config?.dataset === "languages" || + question.id?.endsWith(".mother_tongue") || + question.id?.endsWith(".native_language") || + question.id?.endsWith(".other_languages") || + (Boolean(question.title?.toLowerCase().includes("language")) && + !question.options?.length)); const isCountryQuestion = - question.id?.toLowerCase().includes("nationality") || - question.id?.toLowerCase().includes("citizenship") || - question.id?.toLowerCase().includes("country") || - question.id?.toLowerCase().includes("birthplace") || - question.id?.toLowerCase().includes("residence") || - question.title?.toLowerCase().includes("nationality") || - question.title?.toLowerCase().includes("citizenship") || - question.title?.toLowerCase().includes("country") || - question.title?.includes("ملیت") || - question.title?.includes("تابعیت") || - question.title?.includes("کشور") || - question.title?.includes("سکونت") || - question.ui_config?.dataset === "countries" || - question.ui_config?.dataset === "nationalities"; + !isExcludedFromAutoDatasets && + (question.ui_config?.dataset === "countries" || + question.ui_config?.dataset === "nationalities" || + question.id?.endsWith(".nationality") || + question.id?.endsWith(".citizenship") || + question.id?.endsWith(".second_nationality") || + (Boolean( + question.id?.endsWith(".birthplace") || + question.id?.endsWith(".current_residence") || + question.title?.toLowerCase().includes("nationality") || + question.title?.toLowerCase().includes("citizenship"), + ) && + !question.options?.length)); const options = useMemo(() => { const rawOptions = question.options || []; @@ -142,8 +150,8 @@ export function QuestionSheet({ question, disabled }: QuestionSheetProps) { LANGUAGES_EN.forEach((enLang, idx) => { const localizedLabel = (locale === "fa" || locale === "fa-ir" - ? (LANGUAGE_EN_TO_FA[enLang] || LANGUAGES_FA[idx]) - : (t as any)[enLang]) || enLang; + ? LANGUAGES_FA[idx] + : (t as any)[LANGUAGE_EN_TO_FA[enLang] || enLang]) || enLang; const cleanSlug = enLang .toLowerCase() .replace(/[^a-z0-9]+/g, "_") @@ -162,7 +170,7 @@ export function QuestionSheet({ question, disabled }: QuestionSheetProps) { const isPersian = locale === "fa" || locale === "fa-ir"; const displayLabel = isPersian - ? (LANGUAGE_EN_TO_FA[enLang] || localizedLabel) + ? (LANGUAGES_FA[idx] || localizedLabel) : enLang; mergedOptions.push({ @@ -241,14 +249,22 @@ export function QuestionSheet({ question, disabled }: QuestionSheetProps) { return mergedOptions; } - return rawOptions; + return rawOptions.map((opt) => ({ + ...opt, + label: (t as any)[opt.label] || opt.label, + })); }, [question, isLanguageQuestion, isCountryQuestion, locale, t]); + const noSearch = Boolean( + question.extras?.noSearch === true || + question.ui_config?.noSearch === true || + question.id?.toLowerCase().includes("responsibility"), + ); + const COMPACT_OPTIONS_MAX = 6; - const isCompact = options.length <= COMPACT_OPTIONS_MAX; - const showSearch = - !question.extras?.noSearch && options.length > COMPACT_OPTIONS_MAX; + const isCompact = options.length <= COMPACT_OPTIONS_MAX || noSearch; + const showSearch = !noSearch && options.length > COMPACT_OPTIONS_MAX; useEffect(() => { if (!isOpen || isClosing || !isCompact) return; @@ -411,7 +427,7 @@ export function QuestionSheet({ question, disabled }: QuestionSheetProps) { ref={sheetRef} className={[ "flex w-full flex-col overflow-hidden rounded-t-[22px] bg-white pb-[env(safe-area-inset-bottom)] shadow-[0_-10px_32px_rgba(0,0,0,0.12)] transition-transform duration-[300ms] ease-out sm:max-w-[375px] animate-in slide-in-from-bottom", - isCompact && !showSearch + !showSearch ? "h-auto max-h-[82svh]" : "h-[82svh] min-h-[82svh] max-h-[82svh]", isClosing ? "translate-y-full" : "translate-y-0", @@ -527,9 +543,9 @@ export function QuestionSheet({ question, disabled }: QuestionSheetProps) { } }} className={[ - "flex min-h-12 w-full items-start gap-3 rounded-lg border px-3 py-3 text-start transition-colors cursor-pointer", + "flex min-h-[52px] w-full items-start gap-3 rounded-[12px] border px-3.5 py-3 text-start transition-colors cursor-pointer", isSelected - ? "bg-[#FFF4F5] border-[#F0445B]/30 text-[#181818]" + ? "bg-[#FFF4F5] border-[#F0445B]/40 text-[#181818]" : "bg-white hover:bg-[#F2F4F7] border-[#EAECF0] text-[#181818]", ].join(" ")} > @@ -537,7 +553,7 @@ export function QuestionSheet({ question, disabled }: QuestionSheetProps) { {isMulti ? (
+ > + {isSelected && ( +
+ )} +
)} - + {option.label.includes(" - ") ? ( (() => { const parts = option.label.split(" - "); @@ -593,8 +613,8 @@ export function QuestionSheet({ question, disabled }: QuestionSheetProps) { {option.label} diff --git a/src/lib/conditional-rules.test.ts b/src/lib/conditional-rules.test.ts index 66fb416..b0d48cd 100644 --- a/src/lib/conditional-rules.test.ts +++ b/src/lib/conditional-rules.test.ts @@ -201,6 +201,77 @@ describe("Conditional Rules Evaluator", () => { expect(isQuestionRequired(q, matchingAnswers)).toBe(true); }); + it("should evaluate representative questions as optional for men and conditional for women based on age", () => { + const repNameQuestion: QuestionField = { + ...dummyQuestion, + id: "contact_residence.representative_s_full_name", + title: "Representative's Full Name", + required: false, + baseRequired: false, + requiredWhen: { + genders: ["female"], + maxAge: 26, + }, + }; + + const repPhoneQuestion: QuestionField = { + ...dummyQuestion, + id: "contact_residence.representative_s_contact_number", + title: "Representative's Contact Number", + type: "phone", + required: false, + baseRequired: false, + requiredWhen: { + genders: ["female"], + maxAge: 26, + }, + }; + + const repRelQuestion: QuestionField = { + ...dummyQuestion, + id: "contact_residence.relationship_to_representative", + title: "Relationship to Representative", + type: "dropdown", + required: false, + baseRequired: false, + requiredWhen: { + genders: ["female"], + maxAge: 26, + }, + }; + + const repQuestions = [repNameQuestion, repPhoneQuestion, repRelQuestion]; + + // For Male (regardless of age: 20, 26, 30): ALWAYS OPTIONAL + for (const age of [18, 20, 25, 26, 27, 35]) { + const maleContext = { gender: "male", age }; + for (const question of repQuestions) { + expect(isQuestionRequired(question, {}, maleContext)).toBe(false); + } + } + + // For Female <= 26: REQUIRED + for (const age of [18, 20, 25, 26]) { + const youngFemaleContext = { gender: "female", age }; + for (const question of repQuestions) { + expect(isQuestionRequired(question, {}, youngFemaleContext)).toBe(true); + } + } + + // For Female >= 27: OPTIONAL + for (const age of [27, 30, 35]) { + const olderFemaleContext = { gender: "female", age }; + for (const question of repQuestions) { + expect(isQuestionRequired(question, {}, olderFemaleContext)).toBe(false); + } + } + + // When gender is unknown: OPTIONAL + for (const question of repQuestions) { + expect(isQuestionRequired(question, {}, {})).toBe(false); + } + }); + it("should correctly handle physical health 4-option visibility and medication requirement", () => { // 1. Physical Health Description const physicalHealthDescription: QuestionField = { diff --git a/src/lib/conditional-rules.ts b/src/lib/conditional-rules.ts index 7aeee6e..b9fd253 100644 --- a/src/lib/conditional-rules.ts +++ b/src/lib/conditional-rules.ts @@ -58,6 +58,16 @@ export function canonicalRule(rule: any): CanonicalRule | null { if (rule.audience && typeof rule.audience === "object") { result.audience = rule.audience; + } else if ( + rule.genders || + rule.minAge !== undefined || + rule.maxAge !== undefined + ) { + result.audience = { + genders: rule.genders, + minAge: rule.minAge, + maxAge: rule.maxAge, + }; } if (Array.isArray(rule.conditions)) { @@ -140,19 +150,24 @@ export function matchesAudience( } if (audience.genders && audience.genders.length > 0) { - if (context?.gender && !audience.genders.includes(context.gender)) { + if ( + !context?.gender || + !audience.genders + .map((g) => g.toLowerCase()) + .includes(context.gender.toLowerCase()) + ) { return false; } } - if (audience.minAge !== undefined && context?.age !== undefined && context.age !== null) { - if (context.age < audience.minAge) { + if (audience.minAge !== undefined) { + if (context?.age === undefined || context.age === null || context.age < audience.minAge) { return false; } } - if (audience.maxAge !== undefined && context?.age !== undefined && context.age !== null) { - if (context.age > audience.maxAge) { + if (audience.maxAge !== undefined) { + if (context?.age === undefined || context.age === null || context.age > audience.maxAge) { return false; } } @@ -250,7 +265,9 @@ export function ruleMatches( : mainMatches && conditionsResult; } - return mainMatches; + return parentId + ? mainMatches + : Boolean(!rule.audience || matchesAudience(rule.audience, context)); } export function isQuestionVisible( @@ -289,16 +306,16 @@ export function isQuestionRequired( return false; } - if (question.required || question.baseRequired) { - return true; - } - if (question.requiredWhen) { - if (question.requiredWhen.genders || question.requiredWhen.minAge || question.requiredWhen.maxAge) { + if ( + question.requiredWhen.genders || + question.requiredWhen.minAge !== undefined || + question.requiredWhen.maxAge !== undefined + ) { return matchesAudience(question.requiredWhen, context); } return ruleMatches(question.requiredWhen, answers, context); } - return false; + return Boolean(question.baseRequired ?? question.required); } diff --git a/src/translations/locales/ar.json b/src/translations/locales/ar.json index a4d1241..614fd9f 100644 --- a/src/translations/locales/ar.json +++ b/src/translations/locales/ar.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "أدخل اسم الدواء وسبب الاستخدام...", "وضعیت سلامت جسمانی": "حالة الصحة الجسدية", "توضیحات وضعیت جسمانی": "وصف الصحة الجسدية", - "Name": "الاسم" -} \ No newline at end of file + "Name": "الاسم", + "upload_certificates": "تحميل الشهادات والوثائق", + "add_another_document": "إضافة وثيقة أخرى", + "max_files_reached": "تم تحميل الحد الأقصى (4 ملفات)", + "remove_document": "حذف الوثيقة", + "upload_failed": "فشل التحميل. يرجى المحاولة مرة أخرى." +} diff --git a/src/translations/locales/az.json b/src/translations/locales/az.json index be8ef8f..53cbbb8 100644 --- a/src/translations/locales/az.json +++ b/src/translations/locales/az.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "Dərmanın adını və istifadə səbəbini daxil edin...", "وضعیت سلامت جسمانی": "Fiziki Sağlamlıq Vəziyyəti", "توضیحات وضعیت جسمانی": "Fiziki Sağlamlıq Təsviri", - "Name": "Ad" -} \ No newline at end of file + "Name": "Ad", + "upload_certificates": "Sənədləri yükləyin", + "add_another_document": "Başqa sənəd əlavə edin", + "max_files_reached": "Maksimum 4 fayl yükləndi", + "remove_document": "Sənədi sil", + "upload_failed": "Yükləmə uğursuz oldu. Yenidən cəhd edin." +} diff --git a/src/translations/locales/bn.json b/src/translations/locales/bn.json index cd3a011..d275f8e 100644 --- a/src/translations/locales/bn.json +++ b/src/translations/locales/bn.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "ওষুধের নাম এবং কারণ লিখুন...", "وضعیت سلامت جسمانی": "শারীরিক স্বাস্থ্যের অবস্থা", "توضیحات وضعیت جسمانی": "শারীরিক স্বাস্থ্যের বিবরণ", - "Name": "নাম" -} \ No newline at end of file + "Name": "নাম", + "upload_certificates": "নথিপত্র আপলোড করুন", + "add_another_document": "অন্য নথি যোগ করুন", + "max_files_reached": "সর্বোচ্চ ৪টি ফাইল আপলোড করা হয়েছে", + "remove_document": "নথি মুছুন", + "upload_failed": "আপলোড ব্যর্থ হয়েছে। আবার চেষ্টা করুন।" +} diff --git a/src/translations/locales/da.json b/src/translations/locales/da.json index 6ca63b0..ac26ef6 100644 --- a/src/translations/locales/da.json +++ b/src/translations/locales/da.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "Indtast medicinnavn og årsag...", "وضعیت سلامت جسمانی": "Fysisk helbredstilstand", "توضیحات وضعیت جسمانی": "Beskrivelse af fysisk helbred", - "Name": "Navn" -} \ No newline at end of file + "Name": "Navn", + "upload_certificates": "Upload certifikater", + "add_another_document": "Tilføj et andet dokument", + "max_files_reached": "Maksimalt 4 filer uploadet", + "remove_document": "Fjern dokument", + "upload_failed": "Upload mislykkedes. Prøv igen." +} diff --git a/src/translations/locales/de.json b/src/translations/locales/de.json index 4f19576..b3ab795 100644 --- a/src/translations/locales/de.json +++ b/src/translations/locales/de.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "Geben Sie den Medikamentennamen und den Grund ein...", "وضعیت سلامت جسمانی": "Körperlicher Gesundheitszustand", "توضیحات وضعیت جسمانی": "Beschreibung des körperlichen Zustands", - "Name": "Name" -} \ No newline at end of file + "Name": "Name", + "upload_certificates": "Zertifikate hochladen", + "add_another_document": "Ein weiteres Dokument hinzufügen", + "max_files_reached": "Maximal 4 Dateien hochgeladen", + "remove_document": "Dokument entfernen", + "upload_failed": "Upload fehlgeschlagen. Bitte versuchen Sie es erneut." +} diff --git a/src/translations/locales/en.json b/src/translations/locales/en.json index a34416a..369f10a 100644 --- a/src/translations/locales/en.json +++ b/src/translations/locales/en.json @@ -845,5 +845,10 @@ "Medication Name and Reason for Use": "Medication Name and Reason for Use", "Enter medication name and reason for use...": "Enter medication name and reason for use...", "Enter a valid phone number with country code.": "Enter a valid phone number with country code.", - "Name": "Name" -} \ No newline at end of file + "Name": "Name", + "upload_certificates": "Upload certificates", + "add_another_document": "Add another document", + "max_files_reached": "Maximum of 4 files uploaded", + "remove_document": "Remove document", + "upload_failed": "Upload failed. Please try again." +} diff --git a/src/translations/locales/es.json b/src/translations/locales/es.json index cdbd522..69c328d 100644 --- a/src/translations/locales/es.json +++ b/src/translations/locales/es.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "Ingrese el nombre del medicamento y el motivo...", "وضعیت سلامت جسمانی": "Estado de salud física", "توضیحات وضعیت جسمانی": "Descripción de la salud física", - "Name": "Nombre" -} \ No newline at end of file + "Name": "Nombre", + "upload_certificates": "Subir certificados", + "add_another_document": "Agregar otro documento", + "max_files_reached": "Máximo de 4 archivos subidos", + "remove_document": "Eliminar documento", + "upload_failed": "Error al subir. Por favor, inténtelo de nuevo." +} diff --git a/src/translations/locales/fa.json b/src/translations/locales/fa.json index bb11a05..66f1725 100644 --- a/src/translations/locales/fa.json +++ b/src/translations/locales/fa.json @@ -856,5 +856,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "نام دارو و دلیل مصرف را وارد نمایید...", "وضعیت سلامت جسمانی": "وضعیت سلامت جسمانی", "توضیحات وضعیت جسمانی": "توضیحات وضعیت جسمانی", - "Name": "نام" -} \ No newline at end of file + "Name": "نام", + "upload_certificates": "بارگذاری مدارک", + "add_another_document": "افزودن مدرک جدید", + "max_files_reached": "حداکثر ۴ فایل بارگذاری شده است", + "remove_document": "حذف مدرک", + "upload_failed": "بارگذاری با خطا مواجه شد. لطفاً دوباره تلاش کنید." +} diff --git a/src/translations/locales/fr.json b/src/translations/locales/fr.json index 282e887..e3f2496 100644 --- a/src/translations/locales/fr.json +++ b/src/translations/locales/fr.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "Entrez le nom du médicament et le motif...", "وضعیت سلامت جسمانی": "État de santé physique", "توضیحات وضعیت جسمانی": "Description de la santé physique", - "Name": "Nom" -} \ No newline at end of file + "Name": "Nom", + "upload_certificates": "Télécharger les certificats", + "add_another_document": "Ajouter un autre document", + "max_files_reached": "Maximum de 4 fichiers téléchargés", + "remove_document": "Supprimer le document", + "upload_failed": "Échec du téléchargement. Veuillez réessayer." +} diff --git a/src/translations/locales/gu.json b/src/translations/locales/gu.json index fe99916..dce5747 100644 --- a/src/translations/locales/gu.json +++ b/src/translations/locales/gu.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "દવાનું નામ અને કારણ દાખલ કરો...", "وضعیت سلامت جسمانی": "શારીરિક સ્વાસ્થ્ય સ્થિતિ", "توضیحات وضعیت جسمانی": "શારીરિક સ્વાસ્થ્ય વર્ણન", - "Name": "નામ" -} \ No newline at end of file + "Name": "નામ", + "upload_certificates": "પ્રમાણપત્રો અપલોડ કરો", + "add_another_document": "બીજો દસ્તાવેજ ઉમેરો", + "max_files_reached": "મહત્તમ 4 ફાઇલો અપલોડ કરવામાં આવી છે", + "remove_document": "દસ્તાવેજ દૂર કરો", + "upload_failed": "અપલોડ નિષ્ફળ ગયું. કૃપા કરીને ફરી પ્રયાસ કરો." +} diff --git a/src/translations/locales/ha.json b/src/translations/locales/ha.json index 986c768..e7c1c8b 100644 --- a/src/translations/locales/ha.json +++ b/src/translations/locales/ha.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "Shigar da sunan magani da dalilin sha...", "وضعیت سلامت جسمانی": "Yanayin Lafiyar Jiki", "توضیحات وضعیت جسمانی": "Bayanin Lafiyar Jiki", - "Name": "Suna" -} \ No newline at end of file + "Name": "Suna", + "upload_certificates": "Loda takardun shaida", + "add_another_document": "Ƙara wata takarda", + "max_files_reached": "An loda matsakaicin fayiloli 4", + "remove_document": "Cire takarda", + "upload_failed": "Loda ya faskara. Da fatan za a sake gwadawa." +} diff --git a/src/translations/locales/he.json b/src/translations/locales/he.json index 0fbd3ef..50b80e2 100644 --- a/src/translations/locales/he.json +++ b/src/translations/locales/he.json @@ -355,5 +355,10 @@ "Job Title": "תואר התפקיד", "Employment Status": "מצב תעסוקתי", "Your Hobbies and Main Interests": "התחביבים ותחומי העניין העיקריים שלך", - "View more details": "הצג פרטים נוספים" -} \ No newline at end of file + "View more details": "הצג פרטים נוספים", + "upload_certificates": "העלאת תעודות ומסמכים", + "add_another_document": "הוסף מסמך נוסף", + "max_files_reached": "הועלו מקסימום 4 קבצים", + "remove_document": "הסר מסמך", + "upload_failed": "ההעלאה נכשלה. אנא נסה שוב." +} diff --git a/src/translations/locales/hi.json b/src/translations/locales/hi.json index edfc79b..ca2ea00 100644 --- a/src/translations/locales/hi.json +++ b/src/translations/locales/hi.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "दवा का नाम और उपयोग का कारण दर्ज करें...", "وضعیت سلامت جسمانی": "शारीरिक स्वास्थ्य की स्थिति", "توضیحات وضعیت جسمانی": "शारीरिक स्वास्थ्य का विवरण", - "Name": "नाम" -} \ No newline at end of file + "Name": "नाम", + "upload_certificates": "प्रमाणपत्र अपलोड करें", + "add_another_document": "दूसरा दस्तावेज़ जोड़ें", + "max_files_reached": "अधिकतम 4 फ़ाइलें अपलोड की गईं", + "remove_document": "दस्तावेज़ हटाएं", + "upload_failed": "अपलोड विफल रहा। कृपया पुन: प्रयास करें।" +} diff --git a/src/translations/locales/id.json b/src/translations/locales/id.json index 15bb748..598c76b 100644 --- a/src/translations/locales/id.json +++ b/src/translations/locales/id.json @@ -355,5 +355,10 @@ "Job Title": "Jabatan / Pekerjaan", "Employment Status": "Status Pekerjaan", "Your Hobbies and Main Interests": "Hobi dan Minat Utama Anda", - "View more details": "Lihat detail selengkapnya" -} \ No newline at end of file + "View more details": "Lihat detail selengkapnya", + "upload_certificates": "Unggah sertifikat", + "add_another_document": "Tambah dokumen lain", + "max_files_reached": "Maksimum 4 file diunggah", + "remove_document": "Hapus dokumen", + "upload_failed": "Pengunggahan gagal. Silakan coba lagi." +} diff --git a/src/translations/locales/ks.json b/src/translations/locales/ks.json index ff18a96..cdf402a 100644 --- a/src/translations/locales/ks.json +++ b/src/translations/locales/ks.json @@ -355,5 +355,10 @@ "Job Title": "کٲم ہُنٛد ناو", "Employment Status": "مُلازمتٕچ حالت", "Your Hobbies and Main Interests": "تُہنٛدؠ شۄق تہٕ اَہَم دِلچسپی", - "View more details": "مزید تفصیل وُچھِو" -} \ No newline at end of file + "View more details": "مزید تفصیل وُچھِو", + "upload_certificates": "دستاویز اپ لوڈ کریو", + "add_another_document": "بیٛاکھ دستاویز جمع کریو", + "max_files_reached": "زیاد کھوتہ زیاد ۴ فائل اپ لوڈ کرنہ آمژٕ", + "remove_document": "دستاویز ہٹاوِیو", + "upload_failed": "اپ لوڈ ناکام۔ مہربانی کرتھ دوبارہ کوشش کریو۔" +} diff --git a/src/translations/locales/pt.json b/src/translations/locales/pt.json index 5ed018f..2530412 100644 --- a/src/translations/locales/pt.json +++ b/src/translations/locales/pt.json @@ -355,5 +355,10 @@ "Job Title": "Cargo / Título profissional", "Employment Status": "Situação profissional", "Your Hobbies and Main Interests": "Seus hobbies e principais interesses", - "View more details": "Ver mais detalhes" -} \ No newline at end of file + "View more details": "Ver mais detalhes", + "upload_certificates": "Enviar certificados", + "add_another_document": "Adicionar outro documento", + "max_files_reached": "Máximo de 4 arquivos enviados", + "remove_document": "Remover documento", + "upload_failed": "Falha no envio. Por favor, tente novamente." +} diff --git a/src/translations/locales/ru.json b/src/translations/locales/ru.json index 268671b..5241ead 100644 --- a/src/translations/locales/ru.json +++ b/src/translations/locales/ru.json @@ -812,5 +812,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "Введите название препарата и причину приема...", "وضعیت سلامت جسمانی": "Физическое состояние здоровья", "توضیحات وضعیت جسمانی": "Описание физического состояния", - "Name": "Имя" -} \ No newline at end of file + "Name": "Имя", + "upload_certificates": "Загрузить сертификаты", + "add_another_document": "Добавить еще один документ", + "max_files_reached": "Загружено максимум 4 файла", + "remove_document": "Удалить документ", + "upload_failed": "Ошибка загрузки. Пожалуйста, повторите попытку." +} diff --git a/src/translations/locales/sw.json b/src/translations/locales/sw.json index 224c42e..5190fa7 100644 --- a/src/translations/locales/sw.json +++ b/src/translations/locales/sw.json @@ -355,5 +355,10 @@ "Job Title": "Wadhifa wa Kazi", "Employment Status": "Hali ya Ajira", "Your Hobbies and Main Interests": "Mambo unayopenda na Maslahi Kuu", - "View more details": "Angalia maelezo zaidi" -} \ No newline at end of file + "View more details": "Angalia maelezo zaidi", + "upload_certificates": "Pakia vyeti", + "add_another_document": "Ongeza hati nyingine", + "max_files_reached": "Upeo wa faili 4 zimepakiwa", + "remove_document": "Ondoa hati", + "upload_failed": "Upakiaji umeshindwa. Tafadhali jaribu tena." +} diff --git a/src/translations/locales/tg.json b/src/translations/locales/tg.json index b0dbf5e..2dfac2f 100644 --- a/src/translations/locales/tg.json +++ b/src/translations/locales/tg.json @@ -355,5 +355,10 @@ "Job Title": "Унвони вазифа", "Employment Status": "Вазъи шуғл", "Your Hobbies and Main Interests": "Машғулиятҳо ва манфиатҳои асосии шумо", - "View more details": "Дидани тафсилоти бештар" -} \ No newline at end of file + "View more details": "Дидани тафсилоти бештар", + "upload_certificates": "Боргузории ҳуҷҷатҳо", + "add_another_document": "Ҳуҷҷати дигар илова кунед", + "max_files_reached": "Ҳадди аксар 4 файл боргузорӣ шудааст", + "remove_document": "Ҳуҷҷатро нест кунед", + "upload_failed": "Боргузорӣ ноком шуд. Лутфан бори дигар кӯшиш кунед." +} diff --git a/src/translations/locales/tr.json b/src/translations/locales/tr.json index 0f5be69..402c6ca 100644 --- a/src/translations/locales/tr.json +++ b/src/translations/locales/tr.json @@ -355,5 +355,10 @@ "Job Title": "Meslek / Unvan", "Employment Status": "Çalışma Durumu", "Your Hobbies and Main Interests": "Hobileriniz ve Temel İlgi Alanlarınız", - "View more details": "Daha fazla ayrıntı gör" -} \ No newline at end of file + "View more details": "Daha fazla ayrıntı gör", + "upload_certificates": "Belgeleri yükle", + "add_another_document": "Başka bir belge ekle", + "max_files_reached": "Maksimum 4 dosya yüklendi", + "remove_document": "Belgeyi kaldır", + "upload_failed": "Yükleme başarısız oldu. Lütfen tekrar deneyin." +} diff --git a/src/translations/locales/ul.json b/src/translations/locales/ul.json index 3ba710b..76f347d 100644 --- a/src/translations/locales/ul.json +++ b/src/translations/locales/ul.json @@ -355,5 +355,10 @@ "Job Title": "Job Title", "Employment Status": "Employment Status", "Your Hobbies and Main Interests": "Your Hobbies and Main Interests", - "View more details": "View more details" -} \ No newline at end of file + "View more details": "View more details", + "upload_certificates": "دستاویزات اپ لوڈ کریں", + "add_another_document": "مزید دستاویز شامل کریں", + "max_files_reached": "زیادہ سے زیادہ 4 فائلیں اپ لوڈ کی گئیں", + "remove_document": "دستاویز ہٹائیں", + "upload_failed": "اپ لوڈ ناکام ہو گیا۔ براہ کرم دوبارہ کوشش کریں۔" +} diff --git a/src/translations/locales/ur.json b/src/translations/locales/ur.json index 7677d0e..eb53bcc 100644 --- a/src/translations/locales/ur.json +++ b/src/translations/locales/ur.json @@ -355,5 +355,10 @@ "Job Title": "عہدہ / ملازمت کا عنوان", "Employment Status": "ملازمت کی صورتحال", "Your Hobbies and Main Interests": "آپ کے مشاغل اور اہم دلچسپیاں", - "View more details": "مزید تفصیلات دیکھیں" -} \ No newline at end of file + "View more details": "مزید تفصیلات دیکھیں", + "upload_certificates": "دستاویزات اپ لوڈ کریں", + "add_another_document": "مزید دستاویز شامل کریں", + "max_files_reached": "زیادہ سے زیادہ 4 فائلیں اپ لوڈ کی گئیں", + "remove_document": "دستاویز ہٹائیں", + "upload_failed": "اپ لوڈ ناکام ہو گیا۔ براہ کرم دوبارہ کوشش کریں۔" +} diff --git a/src/translations/locales/uz.json b/src/translations/locales/uz.json index 9c69367..7bd6271 100644 --- a/src/translations/locales/uz.json +++ b/src/translations/locales/uz.json @@ -355,5 +355,10 @@ "Job Title": "Kasb / Lavozim", "Employment Status": "Bandlik holati", "Your Hobbies and Main Interests": "Qiziqishlaringiz va asosiy mashgʻulotlaringiz", - "View more details": "Batafsil maʼlumotni koʻrish" -} \ No newline at end of file + "View more details": "Batafsil maʼlumotni koʻrish", + "upload_certificates": "Hujjatlarni yuklash", + "add_another_document": "Boshqa hujjat qo'shish", + "max_files_reached": "Maksimal 4 ta fayl yuklandi", + "remove_document": "Hujjatni o'chirish", + "upload_failed": "Yuklab bo'lmadi. Qayta urinib ko'ring." +} diff --git a/src/translations/locales/zh.json b/src/translations/locales/zh.json index 9cd097a..667bd97 100644 --- a/src/translations/locales/zh.json +++ b/src/translations/locales/zh.json @@ -808,5 +808,10 @@ "نام دارو و دلیل مصرف را وارد نمایید...": "输入药物名称和使用原因...", "وضعیت سلامت جسمانی": "身体健康状况", "توضیحات وضعیت جسمانی": "身体健康说明", - "Name": "姓名" -} \ No newline at end of file + "Name": "姓名", + "upload_certificates": "上传证书和文件", + "add_another_document": "添加其他文件", + "max_files_reached": "最多已上传 4 个文件", + "remove_document": "删除文件", + "upload_failed": "上传失败,请重试。" +}