Training Comparison List

URL: <base-url>/backend/hrc#/trainingcomparision
Directory: VaahCms/Modules/HRC/Vue/pages/trainingcomparision
Controller: VaahCms/Modules/HRC/Http/Controllers/Backend/TrainingComparisionController.php
Model: VaahCms/Modules/HRC/Models/EqTrainingRecord.php
Store: VaahCms/Modules/HRC/Vue/store/modules/store-trainingcomparision.js

Description

Just like the Training Records List page this page also shows the list of all training records, but allows user to select two records and compare load comparison.

Training Records

Purpose

  • To display the list of training records
  • To let users search and filter training records
  • To display the status of the training records
  • To let users select a default racecourse for the training record
  • To let user select two records for comparison.

How it works?

  • onLoad method is called as soon as the page is loaded
  • onLoad calls the getAssets method
  • getAssets calls the getList method
  • getList method fetches the list of training records from the eq_training_records table.
  • The list will have a status field that has three states
    1. pending - When a record is created, but syncing job has not started
    2. syncing - When the records have values, therefore the syncing job has started for the record.
    3. synced - When all the collections from faunaDB has been synced
  • All records will have a compare button.
  • When compare is clicked, addSelection method is called which adds the record to selected_item data variable.
  • When a record is in selected_items that record will displayed at the top of the list with remove button.
  • When remove is clicked removeSelection method is called.
  • if selected_items have 2 or more items, then load records popup will appear and all compare buttons will be disabled

Assumptions

  • API is functional
  • The Vaah CMS queues are set

Acceptance Criteria

  • Should display the list of all training records
  • Should correctly display status
  • Should let users choose the racecourse if it is not already selected
  • If the training center only has one racecourse, that will be set as default and users don't have to choose.
  • On clicking compare, the item should be moved to the top and button should change to remove
  • Max 2 items should be able to compare, when two items are selected all other items must be disabled for comparison
  • Load Records popup should appear when max items for comparison are selected.