avniproject / integration-service

Service for integration Avni with other systems
GNU Affero General Public License v3.0
0 stars 2 forks source link

Refactor Goonj module to handle non-actionable errorTypes and enhance Health-checks #80

Closed himeshr closed 1 year ago

himeshr commented 1 year ago

ErrorTypes classification available in doc https://docs.google.com/spreadsheets/d/1qw9DLEaBS7o0Svc0TYUztj8n6UjzO7iQTONDhbIbI44/edit?usp=sharing

GIST with the update commands as per this card tasks is available here

### Modify Integration-service error handling code to handle "deprecated" and "automatically resolved" type of errors
- [x] Use Enum errorTypeFollowThroughStep to indicate terminal error or any-other action
- [x] Delete entries in errorRecord and errorRecordLog for deprecated errors
- [x] Dont process errorRecord log if errorType followUp is terminal
- [x] Also remove processing of errors in the normal flow, as we would be running error job at the same frequency as main job
### In Goonj module, call multiple health checks (Standard, customer, integration)
- [x] cron job not running (Ping for success of Standard Goonj job)
- [x] Create and use new slugs for goonj-integration and goonj-salesforce
- [x] integration code error (including unclassified). (Call Integration failure api explicitly)
- [x] customer error (Call customer failure api explicitly)
himeshr commented 1 year ago

Sql query to mark terminal errorTypes:

select * from error_type where name in (
                                        'DemandDeletionFailure',
                                        'DispatchDeletionFailure',
                                        'DispatchLineItemsDeletionFailure',
                                        'UpdateDispatchReceiptError',
                                        'DeleteEntityError',
                                        'AddressNotFoundError'
    );

update error_type set follow_up_step = '1' where name in (
                                     'DemandDeletionFailure',
                                     'DispatchDeletionFailure',
                                     'DispatchLineItemsDeletionFailure',
                                     'UpdateDispatchReceiptError',
                                     'DeleteEntityError',
                                     'AddressNotFoundError'
    );