Syncing in the trace mobile app is the process that updates the data between the trance mobile app and the trance backend. Since the app supports offline features we have to update new data from the app to the backend and vice versa.
Company details
Project details
New farmers
New cards
Buy transactions
Send transactions
Transaction invoices
Updated farmers
Product list
Buyer list
Farmer list
Transaction list
Batch list
Stage 1: Initial sync
Stage 2: Transaction sync
Stage 3: Normal sync
Initial sync is happens on onboarding screen and it starts after login and user details APIs.
When initial sync starts syncStage is updated to 1 and syncInProgress updated to true.
Initial sync starts from company details API and end on farmer list API. After initial sync user is user will get continue option on onboarding screen to go to home page.
Then syncStage is updated to 2, syncInProgress to false and, syncSuccessfull to true.
Getting company details from server side and API response is saved in userCompanyDetails redux state.
Getting project details from server side and API response is saved in userProjectDetails redux state. Also updating project premium table from premiums in this api response.
Syncing newly added farmers from app to server side.
Syncing newly added cards from app to server side.
Syncing newly added buy transactions from app to server side.
Syncing newly added buy transactions from app to server side.
If the transaction verification method is manual then transaction invoice need to sync from app to server side.
Syncing updated farmer from app to server side.
Syncing product list and updates from server side to app.
Syncing buyer list and updates from server side to app.
Syncing farmer list and updates from server side to app.
Transaction sync happens when user on dashboard after login. syncStage will be 2, transaction list and batch list will be synced from server side to app.
After transaction sync, syncStage will be updated to 3. Syncing progress can be see in transaction list page.
Syncing transaction list and updates from server side to app.
Syncing batch list and updates from server side to app.