department-of-veterans-affairs / va.gov-cms

Editor-centered management for Veteran-centered content.
https://prod.cms.va.gov
GNU General Public License v2.0
96 stars 70 forks source link

Consider: Conditionally require field_clinic_name on Service Location Address #17380

Open davidmpickett opened 6 months ago

davidmpickett commented 6 months ago

User Story or Problem Statement

As a Facilities team member, I want to prevent Editors from entering information that will result in skipped headings. While there may be ways to make the Front End defensive against these scenarios, making a requirement at the Drupal level could be more impactful long-term

As a consumer of the Facilities API, I need a unique ID to differentiate Service Locations when there are more than 1 on a Service

Desired logic: IF either field_building_name_number or field_wing_floor_or_room_number are populated THEN field_clinic_name should be required

ALSO

IF there are two or more Service Locations on a Service THEN field_clinic_name should be required AND Should be different that other Service Locations on the Service

Possible wrinkle: Service Location Address is nested in Service Location which is nested in four different Facility Services. Can this logic live at the Paragraph level, or does it need to be added to every Content Type that uses the Paragraph?

flowchart TD
  paragraphservice_location{{"Service location<br>paragraph"}}
click paragraphservice_location "/admin/reports/content-model/entity-diagram/paragraph/service_location"
  paragraphservice_location_address{{"Service location address<br>paragraph"}}
  paragraphservice_location -->|"address"|paragraphservice_location_address
  nodehealth_care_local_health_service(("VAMC Facility Health Service<br>node"))
click nodehealth_care_local_health_service "/admin/reports/content-model/entity-diagram/node/health_care_local_health_service"
  nodehealth_care_local_health_service -->|"service_location"|paragraphservice_location
  nodeservice_region(("Service Region<br>node"))
click nodeservice_region "/admin/reports/content-model/entity-diagram/node/service_region"
  nodeservice_region -->|"service_location"|paragraphservice_location
  nodevba_facility_service(("VBA Facility Service<br>node"))
click nodevba_facility_service "/admin/reports/content-model/entity-diagram/node/vba_facility_service"
  nodevba_facility_service -->|"service_location"|paragraphservice_location
  nodevha_facility_nonclinical_service(("VAMC Facility Non-clinical Service<br>node"))
click nodevha_facility_nonclinical_service "/admin/reports/content-model/entity-diagram/node/vha_facility_nonclinical_service"
  nodevha_facility_nonclinical_service -->|"service_location"|paragraphservice_location
style paragraphservice_location_address fill:#ffaacc,stroke:#333,stroke-width:4px;

Description or Additional Context

VAMC Service locations_2024-02-28_23-56-22

Steps for Implementation

Acceptance Criteria

Team

Please check the team(s) that will do this work.

davidmpickett commented 6 months ago

@xiongjaneg - this one isn't a huge priority, but might be good to take to a Drupal Pre-refinement soon as a compliment to #17414