Needs
- Current Subject/Object
- Current Path to Subject/Object
Uses
- Current Path to Subject/Object
- Options at Path
- Values at Path
Sets
- Form State
Reads From
- Form State
- Domain/API Model
Methods
getView :: (path, Subject/Object) -> { Options /* left side */, Values /* right side */ }- Given a path and the current Subject/Object, return the
OptionsandValuesfor the Modal
- Given a path and the current Subject/Object, return the
setForm :: (path, values) -> void- Given a path and the values selected, tell
Form Stateto update.
- Given a path and the values selected, tell
dive :: (path, Subject/Object) -> void- Given a path and next Subject/Object, tell
Form Stateto update thepathfor the next Modal.
- Given a path and next Subject/Object, tell
Internal Data Structure
const modal = {
path: [1234 /* contactInformation ID */],
title: 'Contact Information > Contact Fields',
//( Contact Fields ID )
subject: '12345',
// Choices on Left
children: [{ id: 123456, text: 'Type' }],
// No choices on Right
values: [],
// Type of qualifier for Right side
qualifier: {}
}
const drilledModal = {
path: [1234 /* contactInformation ID */, 12345 /* contact fields ID */],
title: 'Contact Information > Contact Fields > Gender',
// Gender Contact Field ID
subject: 123456,
// No choices on Left
children: [],
values: [
{ id: 1234567, label: 'Female', value: 'API return value for female' },
{ id: 1234568, label: 'Male', value: 'API Return value for male'},
{ id: 1234569, label: '[No Value]', value: 'API return value for no value' }
],
qualifier: {
title: 'Gender',
type: 'dropdown',
options: [
{ id: 12345688, label: 'Equal To', value: 'Some API Data thing' }
]
}
}Needs
- Criteria List
- Ids to Form State
Uses
- Form State
Reads From
- Mapped Form state
Methods
edit :: id -> void- Given a
criteriaid, opens a Modal to update that Criteria
- Given a
delete :: id -> void- Given a
criteriaid, opens the Delete modal
- Given a
Needs
- API contract
Uses
- API Data
Sets
- Structure for Modal and Criteria Viewing
Reads From
- API Data
Methods
update :: Update -> FormState- Given an update, return a new FormState value
Internal Data Structure
const form = {
groups: [
{
evaluator: {
conjunction: 'and',
evaluation: 1 // 'Meets all'
},
children: {
123456789: {
/* Org Item ID */
path: [12345],
sets: [
{
/* Org Item Field Id */
path: [123456],
values: [
{
id: 12345,
value: 'Commercial',
equality: 1
}
]
},
{
/* Org Item Net Worth ID*/
path: [12345],
values: [
{
id: 123456,
value: '$2',
equality: 3
}
]
}
]
}
},
rules: [
/*
Contact has Contact Information that
has Contact Type equal to Person
*/
{
path: [
12345, /* contact information id */
],
sets: [
{
/* contact type id */
path: [123456],
values: [{
value: 'Person',
id: 123456789 /* some id for this option */
}],
equality: 1,
}
]
},
/*
Contact has Relationship to John that
has Type equal to Customer or Prospect
is with Org Item that
has Field equal to Commercial
has Net Worth greater than $2
*/
{
path: [
12348, /* relationshipToJohn ID */
],
sets: [
{
/* Type id */
path: [123456],
values: [
{ id: 123456, title: 'Customer' },
{ id: 123456, title: 'Propsect' }
],
equality: 0
},
],
children: [123456789]
}
]
}
]
}