Skip to content

Commit

Permalink
Hlm 4501 smc referral flow code comments (#636)
Browse files Browse the repository at this point in the history
* Dev to master : beneficiary tag bug fix, downsync pagination fix (#576)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-4062: added count api changes for household

* HLM-4062: Updated findbyid references

* HLM-4062: Updated pom.xml of household

* Hlm 3376 reviewcomments (#524)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-3376: added comments as per review comments

* HLM-3376 : added changes as per code review comments, each column's name included in query

* HLM-3376: query column names

* Hlm 4062 count api (#547)

* hlm-4062: updated household

* HLM-4062: added  count api support using cte for household

* HLM-4062: updated HouseholdRepository.java

* updated householdrowmapper.java

* HLM-4062:code refactor, removed useCTE parameter

* Project beneficiary tag cherrypick (#539)

* added downsync dummy api

* added downsync dummy api with res

* HLM-4062: added count api changes for household

* HLM-4062: Updated findbyid references

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-4062: Updated pom.xml of household

* Hlm 3376 reviewcomments (#524)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-3376: added comments as per review comments

* HLM-3376 : added changes as per code review comments, each column's name included in query

* HLM-3376: query column names

* Dev (#537)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-4062: added count api changes for household

* HLM-4062: Updated findbyid references

* HLM-4062: Updated pom.xml of household

* Hlm 3376 reviewcomments (#524)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-3376: added comments as per review comments

* HLM-3376 : added changes as per code review comments, each column's name included in query

* HLM-3376: query column names

---------

Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>
Co-authored-by: kanishq-egov <138671649+kanishq-egov@users.noreply.github.com>

* Added project beneficiary tag field

* renamed project beneficiary tag to voucher tag

* Added project beneficiary tag field

* renamed project beneficiary tag to voucher tag

* rebased project-persister.yml from configs

* updated pom.xml: update common model version to 1.0.10

* updated db script, added unique constraint to tag column

* updated referral-management.yml

* updated db script

* project beneficiary voucher tag uniqueness validator and search support

* updated PbVoucherTagUniqueValidator.java

* Added and updated for unique field voucher tag create and update scenario

* project beneficiary bug fix

* removed unused import

* project beneficiary : voucherTag renamed to tag

* Hlm 4062 count api (#547) (#548)

* hlm-4062: updated household

* HLM-4062: added  count api support using cte for household

* HLM-4062: updated HouseholdRepository.java

* updated householdrowmapper.java

* HLM-4062:code refactor, removed useCTE parameter

Co-authored-by: kanishq-egov <138671649+kanishq-egov@users.noreply.github.com>

* referral management project beneficiary validation fix

* deleted persister and indexer file from project module resource folder

---------

Co-authored-by: kavi_elrey <25226238+kavi-egov@users.noreply.github.com>
Co-authored-by: Vishal <sarasani.vishalreddy@egovernments.org>

* HH member clientrefid (#551)

* adding clientRefId, Models version change, migration file

* adding clientRefId for HouseholdMemberSearch as List

* updated migration

* adding Notnull for clientrefId

---------

Co-authored-by: Vishal <sarasani.vishalreddy@egovernments.org>

* Downsync smc referral module (#556)

* added downsync dummy api

* added downsync dummy api with res

* HLM-4062: added count api changes for household

* HLM-4062: Updated findbyid references

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-4062: Updated pom.xml of household

* Hlm 3376 reviewcomments (#524)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-3376: added comments as per review comments

* HLM-3376 : added changes as per code review comments, each column's name included in query

* HLM-3376: query column names

* Dev (#537)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-4062: added count api changes for household

* HLM-4062: Updated findbyid references

* HLM-4062: Updated pom.xml of household

* Hlm 3376 reviewcomments (#524)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-3376: added comments as per review comments

* HLM-3376 : added changes as per code review comments, each column's name included in query

* HLM-3376: query column names

---------

Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>
Co-authored-by: kanishq-egov <138671649+kanishq-egov@users.noreply.github.com>

* Added project beneficiary tag field

* renamed project beneficiary tag to voucher tag

* Hlm 4062 count api (#547) (#548)

* hlm-4062: updated household

* HLM-4062: added  count api support using cte for household

* HLM-4062: updated HouseholdRepository.java

* updated householdrowmapper.java

* HLM-4062:code refactor, removed useCTE parameter

Co-authored-by: kanishq-egov <138671649+kanishq-egov@users.noreply.github.com>

* Project beneficiary tag cherrypick (#549)

* Added project beneficiary tag field

* renamed project beneficiary tag to voucher tag

* rebased project-persister.yml from configs

* updated pom.xml: update common model version to 1.0.10

* updated db script, added unique constraint to tag column

* updated referral-management.yml

* updated db script

* project beneficiary voucher tag uniqueness validator and search support

* updated PbVoucherTagUniqueValidator.java

* Added and updated for unique field voucher tag create and update scenario

* project beneficiary bug fix

* removed unused import

* project beneficiary : voucherTag renamed to tag

* referral management project beneficiary validation fix

---------

Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>
Co-authored-by: Vishal <sarasani.vishalreddy@egovernments.org>

* dummy api with same pagination response

* dummy api with same pagination response

* dummy api with same pagination response

* downsync data test

* data integrated till beneficiary

* Update CHANGELOG.md

* Delete health-services/project/src/main/resources/project-persistor.yml

* skip on empty result added

* skip on empty result added

* beneficary searhc based on individual clientref id added

* sideeffetc, ref, task fetch added

* tasks earch fix

* referral search fix

---------

Co-authored-by: kavi_elrey <25226238+kavi-egov@users.noreply.github.com>
Co-authored-by: Vishal <sarasani.vishalreddy@egovernments.org>

* Dev downsync fix smc (#561)

* household model reverse

* Update CHANGELOG.md

* Added changes for includeDeleted for downsync

* not null added

---------

Co-authored-by: kavi_elrey <25226238+kavi-egov@users.noreply.github.com>
Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>

* Dev master conflict fix (#562)

* HLM-3069: updated build.config.yml

* HLM-3069: updated build-config.yml renamed adrm to referralmanagement

* HLM-3372: increased stock version from 1.1.0 to 1.1.1-beta and project version from 1.1.0 to 1.1.1-beta

* referralmanagement version 1.0.0-beta, added changelog, localsetup

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* HLM-3069: null project beneficiary validation error fix

* HLM-3069: added comments and splitted validation condition

* Dev to master (#550)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-4062: added count api changes for household

* HLM-4062: Updated findbyid references

* HLM-4062: Updated pom.xml of household

* Hlm 3376 reviewcomments (#524)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-3376: added comments as per review comments

* HLM-3376 : added changes as per code review comments, each column's name included in query

* HLM-3376: query column names

* Hlm 4062 count api (#547)

* hlm-4062: updated household

* HLM-4062: added  count api support using cte for household

* HLM-4062: updated HouseholdRepository.java

* updated householdrowmapper.java

* HLM-4062:code refactor, removed useCTE parameter

---------

Co-authored-by: kavi_elrey@1993 <25226238+kavi-egov@users.noreply.github.com>

---------

Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>
Co-authored-by: kanishq-egov <138671649+kanishq-egov@users.noreply.github.com>

* Dev downsync fix smc (#563)

* household model reverse

* Update CHANGELOG.md

* Added changes for includeDeleted for downsync

* not null added

---------

Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>

* Dev master conflict fix (#565)

* HLM-3069: updated build.config.yml

* HLM-3069: updated build-config.yml renamed adrm to referralmanagement

* HLM-3372: increased stock version from 1.1.0 to 1.1.1-beta and project version from 1.1.0 to 1.1.1-beta

* referralmanagement version 1.0.0-beta, added changelog, localsetup

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* HLM-3069: null project beneficiary validation error fix

* HLM-3069: added comments and splitted validation condition

* Dev to master (#550)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-4062: added count api changes for household

* HLM-4062: Updated findbyid references

* HLM-4062: Updated pom.xml of household

* Hlm 3376 reviewcomments (#524)

* HLM-3376: review comments commit

* HLM-3069: side effect code comments, code refactor

* HLM-3376: code review comments and code refactoring

* updated the common-models version to 1.0.10, and updated in dependent service

* HLM-3376 : Added additional field in side effect, referral.

* HLM-3376: missing column fix

* HLM-3372: constants type changed

* HLM-3376: removed not used validators

* code refactor and code comments

* hlm-3376: added test cases

* hlm-3376: referralmanagement context in test cases

* hlm-3376: changed parameters for find by id

* HLM-3372: typo fix

* hlm-3376: persister changes, removed invalid parameters

* hlm-3372: added changes as per code review, removed unused properties

* hlm-3376: recipient validator for faciliy not working fix

* HLM-3376: throwing exception on invalid recipient type

* HLM-3376: added comments as per review comments

* HLM-3376 : added changes as per code review comments, each column's name included in query

* HLM-3376: query column names

* Hlm 4062 count api (#547)

* hlm-4062: updated household

* HLM-4062: added  count api support using cte for household

* HLM-4062: updated HouseholdRepository.java

* updated householdrowmapper.java

* HLM-4062:code refactor, removed useCTE parameter

---------

Co-authored-by: kavi_elrey@1993 <25226238+kavi-egov@users.noreply.github.com>

---------

Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>
Co-authored-by: kanishq-egov <138671649+kanishq-egov@users.noreply.github.com>

* Dev downsync fix smc (#566)

* household model reverse

* Update CHANGELOG.md

* Added changes for includeDeleted for downsync

* not null added

---------

Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>

* Added fix for testcases for householdmember (#570)

Co-authored-by: kanishq-egov <kanishq.bhatnagar@egovernments.org>

* updated the version, and added the changelog (#571)

* updated the version, and added the changelog

* updated ReferralManagement CHANGELOG

* Update CHANGELOG.md

---------

Co-authored-by: kavi_elrey@1993 <25226238+kavi-egov@users.noreply.github.com>

* HLM-4062: removed pagination from fields excluding household api call

* HLM-4062: missed in implementation (#574)

* HLM-4062: missed in implementation

* HLM-4062: default max is set to 1000 for not null limit value and 0 for offset value

* project beneficiary tag update failed fix HLM-4444

* HLM-4444: added code review comments

* sownsync bug fix for limit

---------

Co-authored-by: kavi_elrey <25226238+kavi-egov@users.noreply.github.com>

* HLM-4444: project beneficiary update fix (#575)

* Update CHANGELOG.md

* updated changelog with dates (#577)

* updated stock module changelog (#578)

---------

Co-authored-by: kavi_elrey@1993 <25226238+kavi-egov@users.noreply.github.com>
Co-authored-by: Vishal <sarasani.vishalreddy@egovernments.org>
Co-authored-by: bhanu prakash <109132521+bhanuprakash-egov@users.noreply.github.com>
Co-authored-by: Naveen J <83631045+naveen-egov@users.noreply.github.com>
Co-authored-by: talele08 <talele08@users.noreply.github.com>

* Referral and Side effect sequence diagram

* HLM-4501: Added changes for HFReferral flow

* updated comments for common models

* updated comments for common models removed ini file

This reverts commit c1e226f.

* HLM-4501: updated topics and hfreferal constants

* HLM-4501: updated HFReferralService.java

* HLM-4501: Added changes in project id validator

* HLM-4501: updated HFReferralService.java

* HLM-4501: fixed hfreferral changes

* HLM-4501: added project facility id validator for hf_referral

* HLM-4501: missing link for validator added

* HLM-4501: updated HfrProjectFacilityIdValidator for NPE

* HLM-4501 : updated hf referral symtoms character length to 256

* HLM-4501: updated additionalFields field value size from 2 to 1

* HLM-4501: added code comments for all hf referral related classes

* HLM-4501: hf-referral sequence diagram

---------

Co-authored-by: kavi_elrey@1993 <25226238+kavi-egov@users.noreply.github.com>
Co-authored-by: Vishal <sarasani.vishalreddy@egovernments.org>
Co-authored-by: bhanu prakash <109132521+bhanuprakash-egov@users.noreply.github.com>
Co-authored-by: Naveen J <83631045+naveen-egov@users.noreply.github.com>
Co-authored-by: talele08 <talele08@users.noreply.github.com>
  • Loading branch information
6 people authored Feb 23, 2024
1 parent fe8c32b commit 00ac1a1
Show file tree
Hide file tree
Showing 30 changed files with 3,368 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
@startuml
title HFReferral - Bulk Create
!theme vibrant
participant Client as c
participant ReferralManagement as rm
participant FacilityService as fs
participant ProjectService as ps
participant RedisCache as rc
queue Kafka as k
participant PersisterService as prs
participant IndexerService as idx
participant ErrorService as es
participant ElasticSearch as el
database Database as db

c -> rm : /referralmanagement/hf-referral/v1/bulk/_create
activate rm
rm -> rm : Validate request body

alt request validation fails
rm -> rm: Request validation failed
rm -> k: HFReferral Data /error_topic
note left
This will be marked as unrecoverable right away
and require manual intervention
end note
activate k
group async
es -> k: Consume HFReferral Data
activate es
deactivate k
es -> db: Persist HFReferral Data /error_table
activate db
deactivate db
deactivate es
end
rm -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: REQUEST_VALIDATION_FAILED
end note
end
rm -> rm: Request validation successful
loop for each hfReferral
alt record already exists
alt record found in cache
rm -> rc: Check using clientReferenceId/serverGeneratedId
activate rc
rc -> rm: 1 row
deactivate rc
rm -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: RECORD_ALREADY_EXISTS
end note
end
rm -> rc: Check using clientReferenceId/serverGeneratedId
activate rc
rc -> rm: 0 rows
deactivate rc
rm -> db: Check if record already exists
activate db
db -> rm: 1 row
deactivate db
rm -> rc: Put data in cache using clientReferenceId/serverGeneratedId
activate rc
deactivate rc
rm -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: RECORD_ALREADY_EXISTS
end note
end
alt projectId invalid
rm -> ps: Check if projectId exists
activate ps
ps -> db: Check if projectId exists
activate db
db -> ps: 0 rows
deactivate db
ps -> rm: 0 rows
deactivate ps
rm -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: DEPENDENCY_ERROR
end note
end
rm -> ps: Check if projectId exists
activate ps
ps -> db: Check if projectId exists
activate db
db -> ps: n row
deactivate db
ps -> rm: n row
deactivate ps
alt projectFacilityId invalid
rm -> ps: Check if projectFacilityId exists
activate ps
ps -> db: Check if projectFacilityId exists
activate db
db -> ps: 0 rows
deactivate db
ps -> rm: 0 rows
deactivate ps
rm -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: DEPENDENCY_ERROR
end note
end
rm -> ps: Check if projectFacilityId exists
activate ps
ps -> db: Check if projectFacilityId exists
activate db
db -> ps: n row
deactivate db
ps -> rm: n row
deactivate ps
rm -> k: HFReferral Data /persist_topic
activate k
rm -> rc: Put HFReferral Data against clientReferenceId/serverGeneratedId in cache
activate rc
deactivate rc
group async
prs -> k: Consume HFReferral Data
activate prs
idx -> k: Consume HFReferral Data
activate idx
idx -> el: Store HFReferral Data
activate el
deactivate el
deactivate idx
prs -> db: Persist HFReferral Data
activate db
deactivate db
deactivate prs
end
deactivate k
end

rm -> c : HttpStatus: 202 ACCEPTED
deactivate rm

@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
@startuml
title HFReferral - Bulk Delete
!theme vibrant
participant Client as c
participant ReferralManagement as rm
participant RedisCache as rc
queue Kafka as k
database Database as db
participant FacilityService as fs
participant HouseholdService as hs
participant IndividualService as inds
participant ProjectService as ps
participant UserService as us
participant PersisterService as prs
participant IndexerService as idx
participant ErrorService as es
participant ElasticSearch as el

c -> rm : /referralmanagement/hf-referral/v1/bulk/_delete
activate rm
rm -> rm : Validate request body

alt request validation fails
rm -> rm: Request validation failed
rm -> k: HFReferral Data /error_topic
note left
This will be marked as unrecoverable right away
and require manual intervention
end note
activate k
group async
es -> k: Consume HFReferral Data
activate es
deactivate k
es -> db: Persist HFReferral Data /error_table
activate db
deactivate db
deactivate es
end
rm -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: REQUEST_VALIDATION_FAILED
end note
end
rm -> rm: Request validation successful
loop for each hfReferral
alt id is null
rm -> rm: Check if HFReferral object id is null
rm -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: NULL_ID
end note
end
rm -> rm: Check if HFReferral id is not null
alt record doesn't exist
rm -> rc: Search record based on clientReferenceId/serverGeneratedId
activate rc
rc -> rm: 0 rows
deactivate rc
rm -> db: Search record based on clientReferenceId/serverGeneratedId
activate db
db -> rm: 0 row
deactivate db
note left
This will be marked as unrecoverable right away
and require manual intervention
end note
rm -> k: HFReferral Data /error_topic
activate k
group async
es -> k: Consume HFReferral Data
activate es
deactivate k
es -> db: Persist HFReferral Data /error_table
activate db
deactivate db
deactivate es
end
s -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: RECORD_NOT_FOUND
end note
end
alt record doesn't exists in cache
rm -> rc: Search record based on clientReferenceId/serverGeneratedId
activate rc
rc -> rm: 0 rows
deactivate rc
rm -> db: Search record based on clientReferenceId/serverGeneratedId
activate db
db -> rm: 1 row
deactivate db
rm -> rc: 1 record
activate rc
deactivate rc
end
rm -> rc: Fetch the existing record
activate rc
rc -> rm: 1 row
deactivate rc
alt Duplicate Entry is present [Unique entity validation failed]
rm -> rm: Check if HFReferral object isDeleted is true
rm -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: IS_DELETED_TRUE
end note
end
rm -> rm: Duplicate Entry is not present [Unique entity validation successful]
alt incorrect rowVersion
s -> s: Compare rowVersion between request and db
s -> s: Incorrect rowVersion [request: should be +1 only]
s -> k: HFReferral Data /error_topic
group async
es -> k: Consume HFReferral Data
activate es
deactivate k
es -> db: Persist HFReferral Data /error_table
activate db
deactivate db
deactivate es
end
s -> c: HttpStatus: 400 with appropriate error code
note left
Error Code: BAD_REQUEST
end note
end
s -> s: Compare rowVersion between request and db
s -> s: rowVersion in request = rowVersion in db + 1
rm -> k: HFReferral Data /persist_topic
activate k
rm -> rc: Put HFReferral Data against clientReferenceId/serverGeneratedId in cache
activate rc
deactivate rc
group async
prs -> k: Consume HFReferral Data
activate prs
idx -> k: Consume HFReferral Data
activate idx
idx -> el: Store HFReferral Data
activate el
deactivate el
deactivate idx
prs -> db: Persist HFReferral Data
activate db
deactivate db
deactivate prs
end
deactivate k
end
rm -> c : HttpStatus: 202 ACCEPTED
deactivate rm

@enduml
Loading

0 comments on commit 00ac1a1

Please sign in to comment.