Files
cal.diy/packages/app-store/routing-forms/TODO.md
T
654a204878 feat: Attribute based routing from Team Routing Form to Team Event(with assigned users matching the attribute logic) (#16823)
* Initial commit

* routingForm to Booking a particular team member working

* Happy path working

* Fixes

* Fix router query params forwarding

* Add basicConfig within app

* Tests

* More tests

* Update packages/app-store/routing-forms/components/SingleForm.tsx

Co-authored-by: Omar López <[email protected]>

---------

Co-authored-by: Omar López <[email protected]>
Co-authored-by: Benny Joo <[email protected]>
2024-10-08 21:12:32 +05:30

3.2 KiB

TODO - Routing

  • Use teamMemberIds to calculate availabilithy as well in addition to doing it in handleNewBooking
  • Don't let the Routing Form with attributesQueryValue be picked
  • Use a subset of event assignees using teamMemberIds
  • Ensure that renaming an attribute option doesn't remove it from routing logic
  • Add support for multiselect_contains and multiselect_not_contains operators in attributes
  • Fix bug with Multiselect attribute
  • Connect Form Response to Booking
  • Test with non option based attributes and form field input
  • Switching from Select to MultiSelect in attribute
    • It immediately makes the Routing logic to not work. Fix it.
    • It removes the selected option from Routing. Fix it.
    • Warnings are needed with recommendation to create new attribute instead in unsupported scenarios. We need to test for more such changes to Attribute types.
  • When choosing 'Value of Field' option in RAQB, show a warning somewhere if all options of the Form field aren't present in the attribute option. - So, if Form Field is 'What is Comapny Size' with options Enterprise, Large, Medium, Small and Attribute for which Value of 'What is compnay size' has options Enterprise, Large, Medium. It would show a warning that 'Small' option is not present in the attribute.

Performance Tests and Improvements

  • Test with ~1000 team members and ~100 attributes.
  • getAttributes query optimization. It needs info from various tables(Attribute, AttributeOption, AttributeToUser, Membership)
  • findTeamMembersMatchingAttributesQuery - Parallelize jsonLogic.apply across team members.

Unit Tests

  • findTeamMembersMatchingAttributesQuery
    • Basic Tests
    • Performance Tests with say 1000 team members and 100 attributes to ensure no regression
  • evaluateRAQB
    • Basic Tests
    • More Detailed Tests
  • jsonLogic
    • Basic Tests
  • getAttributes
    • Querying Logic Test
  • getRoutedUsers tests

Documentation

  • Document well that the option label in Routing Form Field and Attribute Option label must be same to connect them.
    • Due to the connection requirement b/w Attribute Option and Field Option, we use label(lowercased) to match attributes instead of attribute slug

V2.0

  • Fallback for when no team member matches the criteria.
    • Fallback will be attributes query builder that would match a different set of users. Though the booking will use the team members assigned to the event type, it might be better to be able to identify such a scenario and use a different set of users. It also makes it easy to identify when the fallback scenario happens.
  • cal.routedTeamMembersIds query param - Could possible become a big payload and possibly break the URL limit. We could work on a short-lived row in a table that would hold that info and we pass the id of that row only in query param. handleNewBooking can then retrieve the routedTeamMembersIds from that short-lived row and delete the entry after successfully creating a booking.

TODO - Attributes

  • Attributes configuration
    1. through DB initially for POC
    2. through CSV upload
    3. through Salesforce Connect