CityOfBoston / CityWorker-issues-Incapsulate

Archived for legacy purposes
0 stars 0 forks source link

Lists cannot contain dependent values #136

Closed jqr closed 4 years ago

jqr commented 5 years ago

Some Attributes contain values which themselves have dependencies. This is unsupported in Spot Server and is better done as high level items with dependencies rather than dependencies at the values level.

Simplified Example and Solution

Unsupported:

Supported:

The net result is the same in each scenario but by moving the condition to the whole list instead of items this is compatible with Spot Server.

Example

This is presently happening with the CROSSMETER3 Attribute in LEADPNT.

{
  "required": false,
  "datatype": "string",
  "datatype_description": null,
  "order": 4,
  "description": "Occupants name and contact information (phone number, email, etc.)",
  "code": "CROSSMETER3",
  "variable": true,
  "values": [
    {
      "dependentOn": {
        "clause": "OR",
        "conditions": [
          {
            "attribute": "OVERCROWDED4",
            "op": "eq",
            "value": "No"
          }
        ]
      }
    }
  ]
}