githubbob42 / mingle2github2

0 stars 1 forks source link

Incremental Sync for Ticket Items #3791

Open githubbob42 opened 8 years ago

githubbob42 commented 8 years ago

Mingle Card: 4116 Justification

To speed up the sync and eliminate existing problems with ticket item sync.

Acceptance Criteria

Syncing:

General Use:

Analysis

Migration Issues

TJ – How are we going to get the list of ticket items to retrieve? Currently we get a list of tickets then get all ticket items where ticket id IN (...)

DP – The new sharing rules for job would be implemented.  The fit does not have to be perfect.  In other words, if we are getting too many ticket items down, it’s not that big of a deal since the user has no way to access those items.  This will become a bigger issue as we move up the chain to tickets and jobs.  There is however, a problem with record Owner, which trumps sharing rules.  It may be the case that once a job or ticket becomes “archived” or moves to another status, the Owner of the record should be changed.   Without a feature like this, customers would be forced to implement the “optional” AltSync flag.

Code Impact

Reporting:  Reporting currently reverse maps the ticket items back to their raw layout.  This change should have almost no effect on reporting other than to possibly speed it up.

Mapping: The Primary area affected by mappings is the Ticket Item creation from a Price Book Item.  The auditor would need to be replaced.  Some of this work may already be under way.

Indexing:  Since we cannot currently index ticket items anyway, there will be no loss.  We gain indexing even though there is currently no way to leverage it.  The reference.js module’s resolveTicketItem method needs to be removed so the sobjects store will take it over. 

Sync: Regarding sync, we will whitelist Ticket Items under the new Sync.  This change should handler AltSync, removal of deleted records and incremental changes.  It will not fix problems with items which are no longer shared.

Relationships: Relationship management for the new ticket items needs to be changed to the way it’s handled for quotes.  This would affect the setting of parents in the pipelines and the ticket relationship on the newly created items.

Rule Engine:  Because of quoting most of the rule-engine has been switched to using the mappings module for getting fields by name.  So very little should have to change to make it work.

UI:  This is the most complex piece of this story:

  1. The ticket item list module would have to be changed to pull it’s data from the new sobjects store.
  2. The old mapped layouts would no longer be available for displaying the data.  Parts of the layout/layout module should be rewritten to take raw layouts as well as the old munged layouts.   Namely the flatten method.
  3. For editing individual ticket items we could easily replace the detail and edit modals which we currently use.  If we do that we would need an extra story for the lock fields.

Permissions:  Items which are no longer shared would have to be removed.  Currently we do a red sync every time which wipes everything and rewrites it.  Ticket Items currently reside at the bottom of the Job sharing tree.  

Note: Until #4120 is complete there will be unreachable zombie ticket items.  This problem currently exists with quotes.

Related Stories

Here are the defects which this eliminates:

3774 

There is also a problem similar to defect #3361 but it applies to tickets.

These are stories that should be split off to make this task easier:

  1. Replace the Readonly/Required field overrides for specific fields, see ticket-item-map.js in fetch for the list of fields.
  2. Simplify Locking Fields for ticket items.
  3. Change the way PricebookItem and Ticket are hidden on the layouts for Ticket Item.
  4. Replace usage of alias fields with mapping calls
    1. Rule-engine, snapshot and reconcile
    2. Ticket View Models
    3. Ticket Item Picker
  5. Separate Ticket Items from the Ticket in the ViewModels.
    1. Query for Child Items by Tracking Number
  6. Separate Ticket Logs from Ticket
  7. Separate Ticket Checklist from Ticket
  8. Replace the relationship mechanism for a new one which uses shallow objects with tracking number.
  9. Move the responsibility for removing recommended snapshot rows to ticket/reconcile from store/snapshot.    Note:  this may not be a prereq for getting incremental sync.
  10. Start raising new model:event-queued for model:TicketItemCreated
  11. Start raising new model:event-queued for model:TicketItemAltered
  12. Start raising new model:event-queued for model:TicketItemRemoved
  13. Use raw layout for ticket items (add a sync component for the raw layout and description)
  14. Sync Raw Data and Remove old sync data from fetch.

Tasks

{{table query: SELECT Number, Name, Owner, 'Task Status' WHERE Type = Task and Story = THIS CARD}}

Defects

{{ table query: SELECT Number, Name, Owner, 'Status' WHERE Type = Defect and 'Related Story' = THIS CARD }}

Test Plan

githubbob42 commented 5 years ago

Feature: #3862 Incremental Sync for Ticket Item (Mingle)