Migrated over from MifosForge - last edit on October 16, 2015.

Target release16.12
Epic
Document status
Design near completion
Development statusIn Progress
Document owner

Ed Cable

Designer
Developers
QA


Overview

Datatables is a feature available in fineract to assist the MFIs to capture custom information associated to Client, Loan, Savings, and Group etc. This feature helps MFIs to capture custom data, but there is no system enforced verification of data entry at crucial entity actions like submit/approve etc. Datatables Verification feature will add system enforced verifications to ensure critical data is captured before user actions on the entity state changes.

Business Requirements

  1. Application should provide the ability to administrators to associate specific datatables as pre-requisites before critical status changes like submit/approve/disburse/activate/close on entities Client/Group/Loan/Savings/Shares.
  2. Application should not allow user to perform state changes if data is not captured in pre-requisite datatables.
  3. Each user action can have one or more datatables listed as pre-requisites.
  4. Administrator can define a default set of datatables against each action.
  5. In case of Loan/Savings/Shares, administrator can choose a set of datatables as pre-requisites against a specific product. In such case, the specific definition will override the default definition.

Critical Decisions

  1. The datatable data verification checks will be performed based on the mapping definition at the time of user action. For e.g., a loan disbursal done on 1st Feb 2016 with a back dated disbursal date of 1st Jan 2016 and a loan disbursal done on 1st Mar 2016 with a back dated disbursal date of 1st Jan 2016 will have datatable verification checks based on the configuration as on 1st Feb 2016 and 1st Mar 2016 respectively.
  2. Partial save of workflow wizard data is not feasible. With existing infrastructure, data in datatables can be captured only after the entity is created. Based on the permissions assigned to the user’s role, the creation itself can fail. So it is difficult to save the intermediate data.
  3. Workflow wizard will be used only while creating the entities. A wizard at the time of creation of entities can capture all the required datatable data in one. A wizard at the time of Approval/Disbursal doesn’t make sense from an end user point of view. Also this will add unnecessary code complexity to keep cross verifying against existing datatable data and required data.
  4. Inclusion of Documents/Survey Questionnaire/Task are not considered as part of the current scope

User Story Breakdown

Actors:

Platform – Fineract platform application

Administrator – Platform App User who has permissions to define system behavior

Platform User - Platform App User who has permissions to interact with Platform using APIs

Platform Consumer – Any App/system that invokes APIs on platform

Community-App – Reference web app which consumes platform APIs

User Stories

  1. As an administrator I should be able to add one or more datatables as custom verification requirement against any entity/action/product triplet where entity can be Client/Group/Loan/Savings/Shares , action can be Submit/Approve/Activate/Disburse/Close and product can be specific loan/savings/shares product or default.
  2. As an administrator I should be able to list entity/action/product triplets which have custom check requirements defined
  3. As an administrator I should be able to remove custom check requirement against entity/action/product triplet all together.
  4. As an administrator I should be able to see datatables associated with any particular entity/action/product triplets
  5. As an administrator I should be able to change one or more datatables as custom verification requirement against a given entity/action/product triplets
  6. As Platform Consumer I should be able to know the pre-requisite datatables and their form definitions as part of template data of Create/Submitting actions on Client/Group/Loan/Savings/Shares.
  7. As Platform I should be able to verify and make sure data for pre-requisite datatables are present as part of request data of Create/Submitting actions on Client/Group/Loan/Savings/Shares.
  8. As Platform I should be able to save datatable specific data that is received as part of request data of Create/Submitting actions on Client/Group/Loan/Savings/Shares.
  9. As Platform I should be able to reject or add request to checker tasks when Platform user requests Create/Submit action on Client/Group/Loan/Savings/Shares and such Platform user doesn’t have permissions to create any pre-requisite datatables or only have maker permissions on any pre-requisite datatables.
  10. As Platform I should be able to verify and make sure data for pre-requisite datatables are present before Approve/Activate/Disburse/Close actions are performed on Client/Group/Loan/Savings/Shares
  11. As community-app I should provide UI to manage datatable custom check definitions
  12. As community-app I should provide a workflow type UI to capture all the pre-requisite datatable forms along with default data as part of Create/Submitting actions on Client/Group/Loan/Savings/Shares.

Database Design

m_datatable_custom_verification 

  

Id

long

primary key

entity_enum

int

not null

action_enum

int

not null

product_id

long

not null default -1

m_datatable_to_custom_verification_mapper

  

datatable_custom_verification_id

long

foreign key to m_datatable_custom_verification 

registered_table_name

varchar(50)

foreign key to x_registered_table 

Design/Implementation notes for each User Story

  1. Add datatable verifications
    1. New GET API “/datatableverifications/template”, by default would return only entityOptions and actionOptions. Can be invoked with entity_enum param to get productOptions
    2. New POST API “/datableverifications”, verification should make sure entity/action/product combination is unique, can include the datatables mapping info as well
  2. List datatable verifications
    1. New GET API “/datatableverifications”, No need to return the datatable mapping info as well
  3. Delete datatable verification
    1. New DELETE API “/datatableverifications/{id}”
  4. Read datatable verification
    1. New GET API “/datatableverifications/{id}”, should return the datatable mapping info as well
  5. Update datatable mapping
    1. New PUT API “/datatableverifications/{id}”
  6. Provide datatable verification info as part of template APIs
    1. Enhance template API of Client/Group/Loan/Savings/Shares entities to return additional parameter ‘datatables’ which is an array of JSON objects containing same data as that of corresponding datatable’s template data.
  7. Verify datatables data is part of create APIs
    1. Verification part of create APIs of Client/Group/Loan/Savings/Shares should make sure array type of “datatables” parameter exists as part of POST data and it contains the same datatables as expected
  8. Save datatables data
    1. Enhance the Datatable Write Platform Service to provide a new method, that can read array object in “datatables” parameter and iteratively save the data into respective datatable by using existing write API. It should try saving data into all the datatables and collect any error from any of them before reporting back errors. Create APIs of Client/Group/Loan/Savings/Shares should use this new service to save the data into datatables.
  9. Verify user permissions
    1. Create APIs of Client/Group/Loan/Savings/Shares must verify if the user has permissions to add data into required datatables or if they only have maker permission. Accordingly the APIs must throw authentication error or add the API into checker tasks. See Client creation implementation for example.
  10. Verification of any datatable requirements
    1. A new service DatatableVerificationService to be implemented. Using Business Event Notify mechanism, it should listen to events on all the entities on specific actions. On such a notification, this service would check for relevant datatable associations and whether they have data. If verification fails, it should throw a domain rule violation exception.
  11. UI- Management of datatable verifications
    1. Simple UI work to interact using different APIs of “/datatableverifications”
  12. Workflow UI on create entities
    1. Based on the create template response, app can determine if there are any datatables to be captured along with default data. If datatables are pre-requisites for create action, “angular wizard” JS library can be used to provide a workflow type of UI to capture the data. “Angular wizard” is used in SMS campaign, and can be used as reference.

 

  • No labels