medic / cht-user-management

GNU Affero General Public License v3.0
3 stars 1 forks source link

Autogenerate the VHT Area Name from VHT Name. Same for CHP Area Name from CHP Name #47

Closed kennsippell closed 3 months ago

kennsippell commented 5 months ago

yes area name should be this Jonathan Bataire Area (village) and should be auto generated from name and village since area name is generated from vht name it should come after vht name. https://github.com/medic/cht-user-management/issues/39#issuecomment-1914065651

kennsippell commented 5 months ago

Togo also wants an autogenerated name and to provide first_name last_name

kennsippell commented 5 months ago

Requirement for Togo:

2 or more villages with the same name. Can we associate the name of the village with the name of its parent to facilitate the search

kennsippell commented 5 months ago

Hey @inromualdo, since you offered to take this on - I thought I'd share some quick thoughts.

I'm imagining config.json like this, where parameter is a liquidjs template hydrated with some data like place, contact, parent. I haven't thought it through a ton, but I'd be curious to hear how it goes for you!

Kenya

        {
          "friendly_name": "CHP Area Name",
          "property_name": "name",
          "type": "generated",
          "parameter": ["{{ place.name }} Area"],
          "required": true
        }

Togo

        {
          "friendly_name": "CHW Name",
          "property_name": "name",
          "type": "generated",
          "parameter": ["{{ place.first_name }} {{ place.last_name }}"],
          "required": true
        }

Uganda

        {
          "friendly_name": "VHT Area Name",
          "property_name": "name",
          "type": "generated",
          "parameter": ["{{ contact.name }} Area ({{ place.village }})"],
          "required": true
        }

Togo

        {
          "friendly_name": "Village Name",
          "property_name": "name",
          "type": "generated",
          "parameter": ["{{ place.name }} ({{ parent.name }})"],
          "required": true
        }

In the formview, instead of displaying a text input we probably just want to display nothing and rely on generation.

inromualdo commented 4 months ago

@kennsippell This is a good idea. We could display a text/label in the formview