Table of Contents |
---|
...
Code Block | ||
---|---|---|
| ||
SET IL_DB.declaration_requests.status = 'CANCELED' WHERE IL_DB.declaration_requests.id IN (:LIST) |
Search pending declaration requests
Search persons request in IL_DB.person_requests to prevent requests duplication:
- if tax_id is not null
Code Block | ||
---|---|---|
| ||
WHERE IL_DB.person_requests.data.tax_id = :($.declaration_requests.person.tax_id)
AND IL_DB.person_requests.status IN ('NEW', 'APPROVED') |
- if tax_id is null
Code Block | ||
---|---|---|
| ||
WHERE IL_DB.person_requests.data.documents.number = :($.declaration_requests.person.documents.number)
AND IL_DB.person_requests.status IN ('NEW', 'APPROVED') |
If found person request - don't create person request. Return error "This person already has a person request"
Calculate declaration end/start date
...
Validate person authentication phone
USE_DEDUPLICATION_MODEL - is a flag in in ehealth.charts that turn on logic:
If person have confidant_person, then person.auth_phone = person.confident_person.phone
...