--- id: ArrearsFullyPaidEventV1 name: Arrears Fully Paid Event version: 0.0.1 summary: Event emitted when all arrears on a policy have been fully paid owners: - digisure-engineering schemaPath: schema.json badges: - content: Collection backgroundColor: green textColor: white --- ## Overview The `ArrearsFullyPaidEventV1` event is emitted when all arrears on a policy have been fully paid, resulting in the reset of the failed collection counter and the policy returning to good standing. This event indicates that the policy balance has reached zero or positive after a payment. ### When is this event emitted? This event is triggered when: - A payment is received that clears all outstanding arrears on a policy - The policy balance transitions from negative (in arrears) to zero or positive - The failed collection counter is reset as a result of the payment ### Why is this event important? This event enables downstream systems to: - Update the policy status to reflect good standing - Reset any internal counters tracking failed collections - Notify policyholders that their account is back in good standing - Trigger reinstatement of any services that were limited due to arrears - Update risk assessments and credit scoring systems ### Key Fields | Field | Description | |-------|-------------| | `policyId` | The unique identifier of the policy that is now fully paid | | `paymentAmount` | The amount of the payment that cleared the arrears | | `newBalance` | The new policy balance after the payment (zero or positive) | | `previousFailedCollectionCounter` | The failed collection counter value before it was reset | | `paymentReference` | External reference for the payment that cleared the arrears | > **Note: No Avro Schema** > > This event has a Java domain class (`ArrearsFullyPaidEvent`) but no corresponding Avro `.avsc` schema file in the `sft-capstone-policy-avro-events` module. It is an internal domain event not published to Kinesis. Schema fields above are derived from the Java domain class. ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ArrearsFullyPaidEventV1", "description": "Event emitted when all arrears on a policy have been fully paid.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "policyId", "paymentAmount", "newBalance", "previousFailedCollectionCounter" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event." }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "paymentAmount": { "type": "object", "description": "The amount of the payment that cleared the arrears", "properties": { "amount": { "type": "number", "description": "The numeric amount" }, "currency": { "type": "string", "description": "The currency code (e.g., ZAR)" } }, "required": ["amount", "currency"] }, "newBalance": { "type": "object", "description": "The new policy balance after the payment", "properties": { "amount": { "type": "number", "description": "The numeric amount" }, "currency": { "type": "string", "description": "The currency code (e.g., ZAR)" } }, "required": ["amount", "currency"] }, "previousFailedCollectionCounter": { "type": "integer", "description": "The failed collection counter value before it was reset" }, "paymentReference": { "type": "string", "description": "External reference for the payment that cleared the arrears" } } } --- id: BundleIssuanceForNewPolicyEventV2 name: Bundle Issuance For New Policy Event version: 0.0.1 summary: Event emitted when bundle issuance is initiated for a new policy. owners: - digisure-engineering schemaPath: schema.avsc badges: - content: Issuance backgroundColor: purple textColor: white --- ## Overview The `BundleIssuanceForNewPolicyEventV2` event is emitted when a bundle issuance is initiated to create a new insurance policy. This event contains comprehensive information needed to establish the policy including products, beneficiaries, coverage terms, and policyholder details. ## When is this event emitted? This event is published when: - An InitiateBundleIssuanceForNewPolicy command is processed - The command passes validation against the bundle configuration - Coverage amounts are calculated based on configuration rules ## Key Information The event payload includes: - **Bundle Identification**: Bundle ID, partner ID, package ID, bundle name - **Product Details**: Full list of products with beneficiaries and cover amounts - **Coverage Terms**: Cover term, chrono unit, and cover per term unit - **Policyholder Details**: Employment information and bank details - **Compliance**: Terms acceptance and POPIA consent flags ## Downstream Consumers Systems that typically consume this event include: - Policy Service for new policy creation - Unverified Identity Service for customer data capture - Data product services for reporting - Partner notification services ## Raw Schema:schema.avsc { "type": "record", "name": "BundleIssuanceForNewPolicyV2", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro", "doc": "Event emitted when bundle issuance is initiated for a new policy.", "fields": [ { "name": "id", "type": { "type": "string", "logicalType": "uuid" }, "doc": "Event ID" }, { "name": "correlationId", "type": ["null", { "type": "string", "logicalType": "uuid" }], "doc": "Correlation ID (nullable)", "default": null }, { "name": "noticedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "effectedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "detailType", "type": "string" }, { "name": "logicalClockReading", "type": "int" }, { "name": "bundleId", "type": "string" }, { "name": "partnerId", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "packageId", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "bundleName", "type": "string" }, { "name": "products", "type": { "type": "array", "items": { "type": "record", "name": "RedeemedProduct", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro.bundleissuance", "fields": [ { "name": "productId", "type": "string" }, { "name": "productInstanceId", "type": "string" }, { "name": "productLifeId", "type": "string" }, { "name": "productLifeExternalId", "type": ["null", { "type": "string" }], "default": null }, { "name": "productLifeRelationshipToMain", "type": "string" }, { "name": "dateOfBirth", "type": ["null", { "type": "int", "logicalType": "date" }], "default": null, "doc": "Date of birth of the product life (nullable)" }, { "name": "gender", "type": ["null", "string"], "default": null, "doc": "Gender of the product life (nullable)" }, { "name": "beneficiaries", "type": { "type": "array", "items": { "type": "record", "name": "RedeemedBeneficiary", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro.bundleissuance", "fields": [ { "name": "beneficiaryId", "type": { "type": "string", "logicalType": "uuid" }, "doc": "Internal generated beneficiary UUID (string)" }, { "name": "percentageAllocation", "type": ["null", "long"], "default": null, "doc": "Allocation percentage (nullable)" } ] } }, "default": [] }, { "name": "coverAmount", "type": ["null", "double"], "default": null, "doc": "Cover amount allocated to this product." }, { "name": "premium", "type": ["null", "double"], "default": null, "doc": "Premium allocated to this product (nullable)." }, { "name": "replacementCoverDetails", "type": [ "null", { "type": "record", "name": "ReplacementCoverDetail", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro.bundleissuance", "fields": [ { "name": "isReplacementPolicy", "type": ["null", "boolean"], "default": null }, { "name": "previousInsurer", "type": ["null", "string"], "default": null }, { "name": "willCancelExistingPolicy", "type": ["null", "boolean"], "default": null }, { "name": "datetimeCommittedToCancel", "type": [ "null", { "type": "long", "logicalType": "timestamp-millis" } ], "default": null } ] } ], "default": null, "doc": "Replacement cover details for the main life product (nullable)." } ] } }, "default": [] }, { "name": "policyStartDate", "type": { "type": "long", "logicalType": "timestamp-millis" }, "doc": "Start date of the policy associated with this issuance (if supplied)." }, { "name": "coverTerm", "type": ["null", "int"], "default": null, "doc": "Cover term magnitude paired with coverTermChronoUnit (nullable)." }, { "name": "coverTermChronoUnit", "type": "string", "doc": "ChronoUnit that qualifies the cover term." }, { "name": "coverPerTermUnit", "type": [ "null", { "type": "record", "name": "AvroMoneyNewPolicy", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro.bundleissuance", "fields": [ { "name": "amount", "type": "long", "doc": "Amount in smallest currency unit - cents" }, { "name": "currency", "type": "string" } ] } ], "default": null, "doc": "Cover amount per term unit (nullable)." }, { "name": "policyholderEmployment", "type": [ "null", { "type": "record", "name": "Employment", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro.bundleissuance", "fields": [ { "name": "status", "type": ["null", "string"], "default": null }, { "name": "industry", "type": ["null", "string"], "default": null } ] } ], "default": null, "doc": "Employment details of the policyholder (nullable)." }, { "name": "bankDetails", "type": [ "null", { "type": "record", "name": "BankDetails", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro.bundleissuance", "fields": [ { "name": "bankAccountName", "type": ["null", "string"], "default": null }, { "name": "bankName", "type": ["null", "string"], "default": null }, { "name": "bankAccountNumber", "type": ["null", "string"], "default": null }, { "name": "bankBranch", "type": ["null", "string"], "default": null }, { "name": "accountType", "type": ["null", "string"], "default": null } ] } ], "default": null, "doc": "Bank details for the policyholder (nullable)." }, { "name": "termsAndConditionsAccepted", "type": ["null", "boolean"], "default": null, "doc": "Whether the terms and conditions were accepted (nullable)." }, { "name": "popiaConsentGiven", "type": ["null", "boolean"], "default": null, "doc": "Whether the POPIA consent was given (nullable)." } ] } --- id: CaptchaFailedEventV1 name: CAPTCHA Failed Event version: 0.0.1 summary: Logged when a reCAPTCHA validation fails or returns a low score. owners: - digisure-engineering schemaPath: schema.json badges: - content: Observability backgroundColor: green textColor: white - content: Security backgroundColor: red textColor: white --- ## Overview The `CaptchaFailedEventV1` is a log event emitted when the BFF Web service fails to validate a reCAPTCHA v3 token. This may indicate bot activity, missing tokens, or configuration issues. ## When is this event emitted? This event is logged when: - A request requires CAPTCHA but no token is provided - The reCAPTCHA token is invalid or expired - Google's siteverify API returns a score below the threshold - The CAPTCHA service is misconfigured ## Key Information The event payload includes: - **Reason**: The specific failure reason - **Score**: The risk score if available - **Advisory Mode**: Whether the request was allowed despite failure ## Failure Reasons | Reason | Description | |--------|-------------| | `missing_token` | No x-recaptcha-token header provided | | `missing_secret` | Server-side secret not configured | | `low_score` | Score below configured threshold | | `verification_failed` | Google API rejected the token | | `action_mismatch` | Token action doesn't match expected | | `hostname_mismatch` | Token hostname doesn't match expected | ## Advisory Mode When `recaptchaAdvisory` is enabled (non-production), failed validations are logged but requests are allowed to proceed. This helps identify issues without blocking legitimate traffic during testing. ## Use Cases This event is used for: - Detecting bot attack patterns - Monitoring CAPTCHA configuration issues - Identifying misconfigured client applications - Security incident investigation ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://eventcatalog.digisure.com/schemas/BFFWeb/CaptchaFailedEventV1.json", "x-parser-schema-format": "application/schema+json;version=draft-2020-12", "title": "CaptchaFailedEventV1", "description": "Log event emitted when a reCAPTCHA validation fails.", "type": "object", "required": [ "level", "msg", "env", "partner_id", "request_id", "method", "path", "reason" ], "properties": { "level": { "type": "string", "enum": ["warn", "error"], "description": "Log level (warn for advisory mode, error for blocking)" }, "msg": { "type": "string", "enum": ["recaptcha_failed", "recaptcha_failed_advisory"], "description": "Event message identifier" }, "env": { "type": "string", "description": "Environment name (e.g., sbx, stg, prd)" }, "partner_id": { "type": "string", "description": "Partner identifier for multi-tenant context" }, "request_id": { "type": "string", "format": "uuid", "description": "Unique identifier for request correlation" }, "method": { "type": "string", "description": "HTTP method of the request" }, "path": { "type": "string", "description": "URL path of the request" }, "reason": { "type": "string", "enum": [ "missing_token", "missing_secret", "low_score", "verification_failed", "action_mismatch", "hostname_mismatch", "unsupported_provider" ], "description": "Reason for CAPTCHA validation failure" }, "score": { "type": ["number", "null"], "minimum": 0, "maximum": 1, "description": "Risk score if available" }, "advisory": { "type": "boolean", "description": "Whether advisory mode allowed the request to proceed" } } } --- id: CaptchaValidatedEventV1 name: CAPTCHA Validated Event version: 0.0.1 summary: Logged when a reCAPTCHA token is successfully validated. owners: - digisure-engineering schemaPath: schema.json badges: - content: Observability backgroundColor: green textColor: white - content: Security backgroundColor: red textColor: white --- ## Overview The `CaptchaValidatedEventV1` is a log event emitted when the BFF Web service successfully validates a reCAPTCHA v3 token. This indicates the request passed bot detection and is allowed to proceed to the backend. ## When is this event emitted? This event is logged when: - A request requires CAPTCHA validation (POST, PUT, PATCH, DELETE methods) - The x-recaptcha-token header contains a valid token - Google's siteverify API returns a passing score above the threshold ## Key Information The event payload includes: - **Provider**: The CAPTCHA provider used (recaptcha_v3) - **Score**: The risk score returned by Google (0.0 to 1.0) - **Request Context**: Environment, partner, request ID ## CAPTCHA Score Interpretation | Score Range | Interpretation | |-------------|----------------| | 0.9 - 1.0 | Very likely a good interaction | | 0.7 - 0.9 | Likely a good interaction | | 0.5 - 0.7 | Uncertain, may require additional verification | | 0.0 - 0.5 | Likely bot or suspicious activity | ## Use Cases This event is used for: - Monitoring CAPTCHA validation success rates - Analyzing score distributions - Tuning threshold configurations - Security audit trails ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://eventcatalog.digisure.com/schemas/BFFWeb/CaptchaValidatedEventV1.json", "x-parser-schema-format": "application/schema+json;version=draft-2020-12", "title": "CaptchaValidatedEventV1", "description": "Log event emitted when a reCAPTCHA token is successfully validated.", "type": "object", "required": [ "level", "msg", "env", "partner_id", "request_id", "method", "path", "provider" ], "properties": { "level": { "type": "string", "const": "info", "description": "Log level for this event" }, "msg": { "type": "string", "const": "recaptcha_validated", "description": "Event message identifier" }, "env": { "type": "string", "description": "Environment name (e.g., sbx, stg, prd)" }, "partner_id": { "type": "string", "description": "Partner identifier for multi-tenant context" }, "request_id": { "type": "string", "format": "uuid", "description": "Unique identifier for request correlation" }, "method": { "type": "string", "description": "HTTP method of the request" }, "path": { "type": "string", "description": "URL path of the request" }, "provider": { "type": "string", "const": "recaptcha_v3", "description": "CAPTCHA provider used for validation" }, "score": { "type": "number", "minimum": 0, "maximum": 1, "description": "Risk score from reCAPTCHA (0.0 = bot, 1.0 = human)" } } } --- id: ClaimRepudiatedEventV1 name: Claim Repudiated Event version: 0.0.1 summary: Event emitted when a claim is repudiated (denied). owners: - digisure-engineering schemaPath: schema.json badges: - content: Lifecycle backgroundColor: purple textColor: white --- ## Overview The `ClaimRepudiatedEventV1` event is emitted by the ClaimsService when a claim is repudiated (denied). This marks a terminal negative outcome for the claim, recording the reason codes, who repudiated it, and when. ## When is this event emitted? This event is published when: - A claims assessor repudiates a claim due to policy exclusions or invalid claim conditions - An automated rule determines the claim should be repudiated ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, noticed and effected timestamps - **Claim Identification**: Claim ID - **Repudiation Details**: Reason codes (array), who repudiated, and when - **Logical Clock**: Event ordering via logical clock reading ## Downstream Consumers Systems that typically consume this event include: - Notification services (to inform claimant of repudiation) - BFF services (for UI updates) - Reporting and analytics platforms ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ClaimRepudiatedEventV1", "description": "Event representing the repudiated status of a claim.", "type": "object", "required": ["id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "claimId"], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking related events" }, "noticedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event was noticed" }, "effectedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event took effect" }, "detailType": { "type": "string", "const": "claimRepudiated", "description": "Type of the event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "claimId": { "type": "string", "description": "The ID of the claim that was repudiated" }, "repudiationReasonCodes": { "type": ["array", "null"], "items": { "type": "string" }, "description": "List of reason codes for the repudiation" }, "repudiatedBy": { "type": ["string", "null"], "description": "The user who repudiated the claim" }, "repudiatedAt": { "type": ["integer", "null"], "description": "Timestamp (epoch millis) when the claim was repudiated" } } } --- id: ClaimSubmittedToCrmEventV1 name: Claim Submitted to CRM Event version: 0.0.1 summary: Event emitted when a claim is submitted to a CRM system for servicing. owners: - digisure-engineering schemaPath: schema.json badges: - content: Integration backgroundColor: orange textColor: white --- ## Overview The `ClaimSubmittedToCrmEventV1` event is emitted by the ClaimsService when a claim is submitted to the CRM system for servicing. This event contains the CRM submission details including the document pack link and submission metadata. ## When is this event emitted? This event is published when: - The SubmitClaimToCrmCommand is successfully executed - The claim documents have been packaged and submitted to the CRM ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, noticed and effected timestamps - **Claim Identification**: Claim ID - **CRM Submission**: Document pack link, submission timestamp, who submitted ## Downstream Consumers Systems that typically consume this event include: - CRM integration systems - Notification services - Audit and compliance systems ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ClaimSubmittedToCrmEventV1", "description": "Event representing when a claim was submitted to a CRM.", "type": "object", "required": ["id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "claimId", "crmSubmission"], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking related events" }, "noticedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event was noticed" }, "effectedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event took effect" }, "detailType": { "type": "string", "const": "claimSubmittedToCrm", "description": "Type of the event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "claimId": { "type": "string", "description": "The ID of the claim" }, "crmSubmission": { "type": "object", "description": "CRM submission details", "required": ["documentPackLink", "submittedAt", "submittedBy"], "properties": { "documentPackLink": { "type": "string", "description": "Link for the document pack" }, "submittedAt": { "type": "integer", "description": "Timestamp (epoch millis) of submission" }, "submittedBy": { "type": "string", "description": "Who submitted the claim to the CRM" } } } } } --- id: ClaimUpdatedEventV1 name: Claim Updated Event version: 0.0.1 summary: Event emitted when a claim is updated (main life, covered life, or banking details change). owners: - digisure-engineering schemaPath: schema.json badges: - content: Lifecycle backgroundColor: purple textColor: white --- ## Overview The `ClaimUpdatedEventV1` event is emitted by the ClaimsService when a claim's state is modified. This is a general-purpose update event that covers multiple scenarios, differentiated by the `detailType` field. ## When is this event emitted? This event is published when: - A claim is updated for a main life deceased scenario (`claimUpdatedMainLife`) - A claim is updated for a covered life deceased scenario (`claimUpdatedCoveredLife`) - Banking details are updated on a claim (`claimUpdatedBankDetails`) ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, noticed and effected timestamps - **Claim Identification**: Claim ID - **Detail Type**: Discriminator indicating which type of update occurred (claimUpdatedMainLife, claimUpdatedCoveredLife, claimUpdatedBankDetails) - **Logical Clock**: Event ordering via logical clock reading ## Downstream Consumers Systems that typically consume this event include: - BFF services (for real-time UI updates) - Reporting and analytics platforms - CRM integration services ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ClaimUpdatedEventV1", "description": "Event representing the update of a claim.", "type": "object", "required": ["id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "claimId"], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking related events" }, "noticedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event was noticed" }, "effectedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event took effect" }, "detailType": { "type": "string", "enum": ["claimUpdatedMainLife", "claimUpdatedCoveredLife", "claimUpdatedBankDetails"], "description": "Type of the update event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "claimId": { "type": "string", "description": "The ID of the claim that was updated" } } } --- id: CollectionCreationFailedEventV4 name: Collection Creation Failed Event version: 0.0.1 summary: Event emitted when a collection creation request fails in the collections gateway. owners: - digisure-engineering schemaPath: schema.json badges: - content: Collection backgroundColor: green textColor: white - content: Failure backgroundColor: red textColor: white --- ## Overview The `CollectionCreationFailedEventV4` event indicates a collection request could not be created. It includes failure details used by policy services to handle collection setup failures. ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "CollectionCreationFailedEventV4", "title": "CollectionCreationFailedEventV4", "description": "Event emitted when a collection creation request fails (derived from collections CG Avro schema).", "x-schema-format": "avro", "x-avro-namespace": "sft.multi.pay.collections.cg.events.collectioncreationevent.v4.avro", "type": "object", "required": [ "id", "correlationId", "detailType", "noticedDate", "effectedDate", "orderReferenceId", "merchantId", "collectionId" ], "properties": { "id": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Correlation identifier linking to the originating command" }, "detailType": { "type": "string", "description": "Type of the event" }, "noticedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "orderReferenceId": { "type": "string", "description": "Order reference identifier associated with the collection" }, "merchantId": { "type": "string", "description": "Merchant to which this collection pertains" }, "collectionId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Unique identifier for the collection" }, "errorCode": { "type": "string", "description": "Error code associated with the failure" }, "errorMessage": { "type": "string", "description": "Error message associated with the failure" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" } } } --- id: CollectionCreationSucceededEventV4 name: Collection Creation Succeeded Event version: 0.0.1 summary: Event emitted when a collection is created successfully by the collections gateway. owners: - digisure-engineering schemaPath: schema.json badges: - content: Collection backgroundColor: green textColor: white - content: Success backgroundColor: teal textColor: white --- ## Overview The `CollectionCreationSucceededEventV4` event indicates that a collection request was accepted and a collection record was created successfully. Policy services use this signal to confirm schedule creation and proceed with collection tracking. ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "CollectionCreationSucceededEventV4", "title": "CollectionCreationSucceededEventV4", "description": "Event emitted when a collection is created successfully (derived from collections CG Avro schema).", "x-schema-format": "avro", "x-avro-namespace": "sft.multi.pay.collections.cg.events.collectioncreationevent.v4.avro", "type": "object", "required": [ "id", "correlationId", "detailType", "noticedDate", "effectedDate", "orderReferenceId", "merchantId", "collectionId" ], "properties": { "id": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Correlation identifier linking to the originating command" }, "detailType": { "type": "string", "description": "Type of the event" }, "noticedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "orderReferenceId": { "type": "string", "description": "Order reference identifier associated with the collection" }, "merchantId": { "type": "string", "description": "Merchant to which this collection pertains" }, "collectionId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Unique identifier for the collection" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" } } } --- id: CollectionFailedEventV5 name: Collection Failed Event version: 0.0.1 summary: Event emitted when a premium collection fails. owners: - digisure-engineering schemaPath: schema.avsc badges: - content: Collection backgroundColor: green textColor: white - content: Failure backgroundColor: red textColor: white --- ## Overview The `CollectionFailedEventV5` event indicates a collection transaction failed. Policy services use this event to update collection status and handle retry or lapse logic. ## Raw Schema:schema.avsc { "sft-metadata": { "version": 1, "owner-application": "sft-multi-pay-collections-cg", "aws-glue-schema-registry-name-pattern": "${StackName}-event-stream-registry", "aws-glue-schema-registry-read-only-role-arn-pattern": "arn:aws:iam::${AwsAccountId}:role/${StackName}-glue-schema-role", "default-env-variables": { "sbx": { "StackName": "sft-multi-pay-collections-cg", "AwsAccountId": "381491845955" }, "dev": { "StackName": "sft-multi-pay-collections-cg", "AwsAccountId": "017820704877" }, "ppe": { "StackName": "sft-multi-pay-collections-cg", "AwsAccountId": "017820704723" }, "prd": { "StackName": "sft-multi-pay-collections-cg", "AwsAccountId": "017820704959" } } }, "namespace": "sft.multi.pay.collections.cg.events.collectionfailedevent.v5.avro", "type": "record", "name": "CollectionFailedEventV5", "fields": [ { "name": "id", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "detailType", "type": "string" }, { "name": "noticedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "effectedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "submissionDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "logicalClockReading", "type": [ "null", "int" ], "default": null }, { "name": "correlationId", "type": { "type": "string", "logicalType": "uuid" }, "doc": "The correlation identifier for tracing" }, { "name": "merchantId", "type": "string", "doc": "The merchant to which this transaction pertains" }, { "name": "orderReferenceId", "type": "string", "doc": "The order reference identifier associated with the collection, this can be a policy code, contract number, etc." }, { "name": "collectionId", "type": { "type": "string", "logicalType": "uuid" }, "doc": "The unique identifier for the collection" }, { "name": "transactionDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "transactionAmount", "type": { "type": "record", "name": "AvroMoney", "fields": [ { "name": "amount", "type": "long", "doc": "Amount in smallest currency unit - cents" }, { "name": "currency", "type": "string" } ] } }, { "name": "transactionExternalReason", "type": [ "null", "string" ], "default": null }, { "name": "metadata", "type": [ "null", { "type": "record", "name": "AvroMetadata", "fields": [ { "name": "externalId", "type": [ "null", "string" ], "default": null }, { "name": "originCode", "type": [ "null", "string" ], "default": null }, { "name": "submittedAt", "type": [ "null", { "type": "long", "logicalType": "timestamp-millis" } ], "default": null }, { "name": "nextActionAt", "type": [ "null", { "type": "long", "logicalType": "timestamp-millis" } ], "default": null }, { "name": "group", "type": [ "null", "string" ], "default": null }, { "name": "subgroup", "type": [ "null", "string" ], "default": null }, { "name": "entityId", "type": [ "null", "string" ], "default": null }, { "name": "entityName", "type": [ "null", "string" ], "default": null }, { "name": "categoryId", "type": [ "null", "string" ], "default": null }, { "name": "categoryName", "type": [ "null", "string" ], "default": null }, { "name": "itemId", "type": [ "null", "string" ], "default": null }, { "name": "itemName", "type": [ "null", "string" ], "default": null }, { "name": "value", "type": [ "null", "AvroMoney" ], "default": null }, { "name": "items", "type": [ "null", { "type": "array", "items": { "type": "record", "name": "AvroItemDetails", "fields": [ { "name": "itemId", "type": [ "null", "string" ], "default": null }, { "name": "itemName", "type": [ "null", "string" ], "default": null }, { "name": "itemAmount", "type": [ "null", "AvroMoney" ], "default": null } ] } } ], "default": null }, { "name": "additionalData", "type": [ "null", { "type": "map", "values": "string" } ], "default": null } ] } ], "default": null } ] } --- id: CollectionSucceededEventV5 name: Collection Succeeded Event version: 0.0.1 summary: Event emitted when a premium collection succeeds. owners: - digisure-engineering schemaPath: schema.avsc badges: - content: Collection backgroundColor: green textColor: white - content: Success backgroundColor: teal textColor: white --- ## Overview The `CollectionSucceededEventV5` event indicates a collection transaction completed successfully. Policy services use this event to update financial state and billing status. ## Raw Schema:schema.avsc { "sft-metadata": { "version": 1, "owner-application": "sft-multi-pay-collections-cg", "aws-glue-schema-registry-name-pattern": "${StackName}-event-stream-registry", "aws-glue-schema-registry-read-only-role-arn-pattern": "arn:aws:iam::${AwsAccountId}:role/${StackName}-glue-schema-role", "default-env-variables": { "sbx": { "StackName": "sft-multi-pay-collections-cg", "AwsAccountId": "381491845955" }, "dev": { "StackName": "sft-multi-pay-collections-cg", "AwsAccountId": "017820704877" }, "ppe": { "StackName": "sft-multi-pay-collections-cg", "AwsAccountId": "017820704723" }, "prd": { "StackName": "sft-multi-pay-collections-cg", "AwsAccountId": "017820704959" } } }, "namespace": "sft.multi.pay.collections.cg.events.collectionsucceededevent.v5.avro", "type": "record", "name": "CollectionSucceededEventV5", "fields": [ { "name": "id", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "detailType", "type": "string" }, { "name": "noticedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "effectedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "submissionDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "logicalClockReading", "type": [ "null", "int" ], "default": null }, { "name": "correlationId", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "merchantId", "type": "string", "doc": "The merchant to which this transaction pertains" }, { "name": "orderReferenceId", "type": "string", "doc": "The order reference identifier associated with the collection, this can be a policy code, contract number, etc." }, { "name": "collectionId", "type": { "type": "string", "logicalType": "uuid" }, "doc": "The unique identifier for the collection" }, { "name": "transactionDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "transactionAmount", "type": { "type": "record", "name": "AvroMoney", "fields": [ { "name": "amount", "type": "long", "doc": "Amount in smallest currency unit - cents" }, { "name": "currency", "type": "string" } ] } }, { "name": "transactionExternalReason", "type": [ "null", "string" ], "default": null }, { "name": "metadata", "type": [ "null", { "type": "record", "name": "AvroMetadata", "fields": [ { "name": "externalId", "type": [ "null", "string" ], "default": null }, { "name": "originCode", "type": [ "null", "string" ], "default": null }, { "name": "submittedAt", "type": [ "null", { "type": "long", "logicalType": "timestamp-millis" } ], "default": null }, { "name": "nextActionAt", "type": [ "null", { "type": "long", "logicalType": "timestamp-millis" } ], "default": null }, { "name": "group", "type": [ "null", "string" ], "default": null }, { "name": "subgroup", "type": [ "null", "string" ], "default": null }, { "name": "entityId", "type": [ "null", "string" ], "default": null }, { "name": "entityName", "type": [ "null", "string" ], "default": null }, { "name": "categoryId", "type": [ "null", "string" ], "default": null }, { "name": "categoryName", "type": [ "null", "string" ], "default": null }, { "name": "itemId", "type": [ "null", "string" ], "default": null }, { "name": "itemName", "type": [ "null", "string" ], "default": null }, { "name": "value", "type": [ "null", "AvroMoney" ], "default": null }, { "name": "items", "type": [ "null", { "type": "array", "items": { "type": "record", "name": "AvroItemDetails", "fields": [ { "name": "itemId", "type": [ "null", "string" ], "default": null }, { "name": "itemName", "type": [ "null", "string" ], "default": null }, { "name": "itemAmount", "type": [ "null", "AvroMoney" ], "default": null } ] } } ], "default": null }, { "name": "additionalData", "type": [ "null", { "type": "map", "values": "string" } ], "default": null } ] } ], "default": null } ] } --- id: CorsPreflightHandledEventV1 name: CORS Preflight Handled Event version: 0.0.1 summary: Logged when a CORS preflight (OPTIONS) request is handled. owners: - digisure-engineering schemaPath: schema.json badges: - content: Observability backgroundColor: green textColor: white - content: CORS backgroundColor: blue textColor: white --- ## Overview The `CorsPreflightHandledEventV1` is a log event emitted when the BFF Web service handles a CORS preflight request. Browsers send these OPTIONS requests before making cross-origin requests to verify the server allows the intended request. ## When is this event emitted? This event is logged when: - An OPTIONS request is received from a browser - The request includes Access-Control-Request-Method header - The service responds with CORS headers allowing or denying the request ## Key Information The event payload includes: - **Origin**: The requesting origin attempting cross-origin access - **Allowed Status**: Whether the origin is in the allowed list - **Dev Passthrough**: Whether development mode allowed an unlisted origin ## Use Cases This event is used for: - Monitoring CORS configuration effectiveness - Identifying misconfigured client applications - Debugging cross-origin access issues - Security auditing of origin access patterns ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://eventcatalog.digisure.com/schemas/BFFWeb/CorsPreflightHandledEventV1.json", "x-parser-schema-format": "application/schema+json;version=draft-2020-12", "title": "CorsPreflightHandledEventV1", "description": "Log event emitted when a CORS preflight request is handled.", "type": "object", "required": [ "level", "msg", "env", "partner_id", "request_id", "method", "path", "origin", "allowed" ], "properties": { "level": { "type": "string", "const": "info", "description": "Log level for this event" }, "msg": { "type": "string", "const": "cors_preflight", "description": "Event message identifier" }, "env": { "type": "string", "description": "Environment name (e.g., sbx, stg, prd)" }, "partner_id": { "type": "string", "description": "Partner identifier for multi-tenant context" }, "request_id": { "type": "string", "format": "uuid", "description": "Unique identifier for request correlation" }, "method": { "type": "string", "const": "OPTIONS", "description": "HTTP method (always OPTIONS for preflight)" }, "path": { "type": "string", "description": "URL path of the request" }, "origin": { "type": "string", "description": "Origin header from the preflight request" }, "allowed": { "type": "boolean", "description": "Whether the origin is in the allowed origins list" }, "dev_passthru": { "type": "boolean", "description": "Whether dev extension passthrough mode is enabled" } } } --- id: CrmOutcomeCapturedEventV1 name: CRM Outcome Captured Event version: 0.0.1 summary: Event emitted when CRM servicing outcomes are captured for a claim. owners: - digisure-engineering schemaPath: schema.json badges: - content: Integration backgroundColor: orange textColor: white --- ## Overview The `CrmOutcomeCapturedEventV1` event is emitted by the ClaimsService when the CRM servicing outcomes are captured for a claim. This includes verification results from various checks performed by the CRM system. ## When is this event emitted? This event is published when: - The CaptureCrmOutcomeCommand is successfully executed - CRM servicing results are recorded against a claim ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, noticed and effected timestamps - **Claim Identification**: Claim ID - **CRM Outcome**: Case number, document verification status, VOPD outcomes (deceased and claimant), PDD outcome, Xtend outcome, employment verification, extended outcome, capture metadata ## Downstream Consumers Systems that typically consume this event include: - Payout decision services - Repudiation evaluation services - Audit and compliance systems - Reporting and analytics platforms ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "CrmOutcomeCapturedEventV1", "description": "Event representing when CRM servicing outcomes were captured for a claim.", "type": "object", "required": ["id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "claimId", "crmOutcome"], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking related events" }, "noticedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event was noticed" }, "effectedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event took effect" }, "detailType": { "type": "string", "const": "crmOutcomeCaptured", "description": "Type of the event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "claimId": { "type": "string", "description": "The ID of the claim" }, "crmOutcome": { "type": "object", "description": "CRM servicing outcome details", "required": ["crmCaseNumber"], "properties": { "crmCaseNumber": { "type": "string", "description": "CRM case number" }, "documentsVerified": { "type": ["boolean", "null"], "description": "Whether documents were verified" }, "deceasedVopdOutcome": { "type": ["string", "null"], "description": "Deceased VOPD verification outcome" }, "claimantVopdOutcome": { "type": ["string", "null"], "description": "Claimant VOPD verification outcome" }, "pddOutcome": { "type": ["string", "null"], "description": "PDD verification outcome" }, "xtendOutcome": { "type": ["string", "null"], "description": "Xtend verification outcome" }, "deceasedEmploymentVerified": { "type": ["boolean", "null"], "description": "Whether deceased employment was verified" }, "extendedOutcome": { "type": ["string", "null"], "description": "Extended verification outcome" }, "capturedAt": { "type": ["integer", "null"], "description": "Timestamp (epoch millis) when outcome was captured" }, "capturedBy": { "type": ["string", "null"], "description": "Who captured the outcome" } } } } } --- id: DeathDetailsCapturedEventV1 name: Death Details Captured Event version: 0.0.1 summary: Event emitted when death details are captured for a claim. owners: - digisure-engineering schemaPath: schema.json badges: - content: Lifecycle backgroundColor: purple textColor: white --- ## Overview The `DeathDetailsCapturedEventV1` event is emitted by the ClaimsService when the death details (date and cause of death) are captured for a claim. This is a key step in the claims process before payout calculation. ## When is this event emitted? This event is published when: - The CaptureDeathDetailsCommand is successfully executed - Death certificate information is recorded against a claim ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, noticed and effected timestamps - **Claim Identification**: Claim ID - **Death Details**: Date of death and cause of death ## Downstream Consumers Systems that typically consume this event include: - Payout calculation services - CRM integration systems - Reporting and analytics platforms ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "DeathDetailsCapturedEventV1", "description": "Event for when death details of a claim were captured.", "type": "object", "required": ["id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "claimId", "deathDetails"], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking related events" }, "noticedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event was noticed" }, "effectedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event took effect" }, "detailType": { "type": "string", "const": "claimDeathDetailsCaptured", "description": "Type of the event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "claimId": { "type": "string", "description": "The ID of the claim" }, "deathDetails": { "type": "object", "description": "Death details captured for the claim", "required": ["dateOfDeath", "causeOfDeath"], "properties": { "dateOfDeath": { "type": "integer", "description": "Timestamp (epoch millis) of the date of death" }, "causeOfDeath": { "type": "string", "description": "The cause of death" } } } } } --- id: DocumentExtractionCompletedEventV1 name: Document Extraction Completed Event version: 0.0.1 summary: | Published when document extraction completes successfully. Contains extracted data, confidence scores, and processing metadata. --- ## Overview The **Document Extraction Completed Event** is published when a document extraction command finishes successfully. It contains the extracted structured data, confidence metrics, and contextual information for downstream processing. ## Event Structure ```json { "id": "550e8400-e29b-41d4-a716-446655440001", "commandId": "550e8400-e29b-41d4-a716-446655440000", "createdDate": "2025-03-11T10:35:22Z", "createdBy": "DocumentExtractionCGService", "originationType": "POLICY", "originationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "documentType": "DEATH_CERTIFICATE", "fileType": "PDF", "provider": "AWS_TEXTRACT", "correlationId": "a1b2c3d4-e5f6-47a8-9b1c-2d3e4f5a6b7c", "extractedFields": { "full_name": "John Doe", "date_of_birth": "1950-05-15", "date_of_death": "2025-03-10", "id_number": "1950051500123" }, "confidenceScores": { "full_name": 0.95, "date_of_birth": 0.87, "date_of_death": 0.92, "id_number": 0.89 }, "rawText": "...", "processingDuration": 317, "metadata": { "pageCount": 2, "detectedLanguage": "en" } } ``` ## Event Details ### Standard Fields - **id**: Unique event identifier - **commandId**: Reference to the original ExtractDocumentCommand - **createdDate**: Event publication timestamp - **createdBy**: Service identifier - **correlationId**: Trace ID for request tracking ### Extraction Metadata - **originationType**: Business context (POLICY, QUOTE, CLAIMS) - **originationId**: ID of the related business entity - **documentType**: Classified document type (DEATH_CERTIFICATE, BIRTH_CERTIFICATE, etc.) - **fileType**: Original file format (PDF, JPEG, PNG, etc.) - **provider**: Extraction provider used (AWS_TEXTRACT, BI_FORM, etc.) ### Extraction Results - **extractedFields**: Key-value pairs of extracted data - **confidenceScores**: Confidence level (0.0-1.0) for each field - **rawText**: Full OCR text output from provider - **bounding_boxes**: Position information (optional) ### Processing Metrics - **processingDuration**: Elapsed milliseconds from command start to completion - **metadata**: Additional processing context - pageCount: Number of pages analyzed - detectedLanguage: Language detected in document - modelVersion: Extraction model/version used ## Downstream Consumers ### Policy Service Receives extracted policy document data: - Policyholder information - Policy details - Premium information ### Quote Service Receives extracted supporting documents: - Income verification documents - Identification documents - Medical records ### Claims Service Receives claim evidence extraction: - Medical reports - Receipts - Supporting documentation ## Integration Patterns ### Event Publishing ``` DocumentExtractionCGService -> EventBridge -> Kinesis Stream (future) ``` Current flow publishes via EventBridge rules to downstream subscribers. ### Event Consumption Downstream services subscribe via: 1. **EventBridge Rules**: Filter by originationType and documentType 2. **SQS Queues**: Receive routed events from EventBridge 3. **Lambda Handlers**: Process extracted data and update domain models ## Field Mapping ### Death Certificate Extraction | Extracted Field | Domain Field | Notes | |-----------------|--------------|-------| | full_name | Deceased Name | | | date_of_birth | DOB | | | date_of_death | Death Date | Primary extraction target | | id_number | ID/Passport | | ### Birth Certificate Extraction | Extracted Field | Domain Field | Notes | |-----------------|--------------|-------| | full_name | Child Name | | | date_of_birth | DOB | Primary extraction target | | mother_name | Mother Name | | | father_name | Father Name | | ### BI Form Extraction | Extracted Field | Domain Field | Notes | |-----------------|--------------|-------| | gross_income | Annual Income | Key field | | employment_status | Employment | | | tax_reference_number | TRN | | | monthly_rent | Rental Cost | | ## Confidence Handling Extracted fields include confidence scores (0.0-1.0): - **0.90-1.0**: High confidence - use directly - **0.75-0.89**: Medium confidence - may require review - **< 0.75**: Low confidence - recommend manual verification Downstream services implement confidence thresholds: ```json { "confidenceThreshold": 0.85, "action": "if_below_threshold = manual_review" } ``` ## Failure Scenarios If extraction fails, `DocumentExtractionFailedEventV1` is published instead. ## Event Retention - **Event Store**: 30 days in Kinesis - **Archive**: 1 year in S3 (compliance) - **Audit Log**: Indefinite (locked storage) ## Idempotency Events are idempotent using commandId: - Duplicate events with same commandId contain identical extraction results - Downstream services deduplicate using commandId --- id: DocumentExtractionFailedEventV1 name: Document Extraction Failed Event version: 0.0.1 summary: | Published when document extraction fails after all retry attempts. Contains error details and recommendations for resolution. --- ## Overview The **Document Extraction Failed Event** is published when a document extraction command fails to complete successfully after exhausting configured retry attempts. It signals failure and provides diagnostic information for debugging and manual intervention. ## Event Structure ```json { "id": "550e8400-e29b-41d4-a716-446655440002", "commandId": "550e8400-e29b-41d4-a716-446655440000", "createdDate": "2025-03-11T10:50:15Z", "createdBy": "DocumentExtractionCGService", "originationType": "POLICY", "originationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "documentType": "DEATH_CERTIFICATE", "fileType": "PDF", "provider": "AWS_TEXTRACT", "correlationId": "a1b2c3d4-e5f6-47a8-9b1c-2d3e4f5a6b7c", "errorCode": "EXTRACTION_TIMEOUT", "errorMessage": "Document extraction exceeded configured timeout threshold", "errorDetails": { "retrievalTimestamp": "2025-03-11T10:45:00Z", "timeoutDuration": 300, "lastRetryAttempt": 5, "maxRetryAttempts": 5 }, "suggestedAction": "MANUAL_REVIEW", "dlqLocation": "arn:aws:sqs:us-east-1:123456789:sft-capstone-document-extraction-prd-dlq", "metadata": { "fileSize": 2097152, "pageCount": 15 } } ``` ## Event Details ### Standard Fields - **id**: Unique event identifier - **commandId**: Reference to the original ExtractDocumentCommand - **createdDate**: Event publication timestamp - **createdBy**: Service identifier - **correlationId**: Trace ID for request tracking ### Failure Information - **errorCode**: Machine-readable error classification - **errorMessage**: Human-readable error description - **errorDetails**: Structured error context with retry information - **suggestedAction**: Recommended next action (MANUAL_REVIEW, RETRY_LATER, CONTACT_SUPPORT) ### DLQ Location - **dlqLocation**: ARN of Dead-Letter Queue containing the failed command - Enables manual retrieval and reprocessing of failed messages ## Error Codes | Code | Category | Cause | Action | |------|----------|-------|--------| | INVALID_DOCUMENT | Validation | Document not processable | MANUAL_REVIEW | | EXTRACTION_TIMEOUT | Timeout | Processing exceeded threshold | RETRY_LATER | | EXTRACTION_FAILED | Provider Error | Provider returned error | CONTACT_SUPPORT | | INVALID_FILE_TYPE | Validation | Unsupported file type | MANUAL_REVIEW | | CORRUPTED_FILE | Integrity | File cannot be read | CONTACT_SUPPORT | | PROVIDER_ERROR | Provider | External service error | RETRY_LATER | | RATE_LIMITED | Throttle | Provider rate limit hit | RETRY_LATER | | MEMORY_ERROR | System | Processing memory limit | CONTACT_SUPPORT | | NETWORK_ERROR | Connectivity | Network failure | RETRY_LATER | | UNKNOWN_ERROR | Other | Unexpected error | CONTACT_SUPPORT | ## Suggested Actions ### MANUAL_REVIEW Trigger manual document review workflow: - Human review of document quality - Potential alternative extraction method - Manual data entry if needed - Document quarantine for analysis ### RETRY_LATER Automatic retry with exponential backoff: - Initial delay: 1 minute - Max delay: 1 hour - Max attempts: Configurable (default: 3) ### CONTACT_SUPPORT Escalate to operations team: - Create support ticket - Notify relevant stakeholders - Block workflow pending resolution ## Downstream Consumers ### Policy Service Receives extraction failure notifications: - Mark document processing as pending - Trigger manual review workflows - Block policy creation if required ### Quote Service Receives extraction failure for supporting documents: - Notify applicant of document issues - Request document resubmission - Suggest alternative document types ### Claims Service Receives extraction failure for claim evidence: - Alert claims processor - Create manual evidence review task - Track failure metrics ## Retry Mechanism ### Automatic Retries (within Service) ``` Attempt 1 -> Fail -> Wait 1s Attempt 2 -> Fail -> Wait 2s Attempt 3 -> Fail -> Wait 4s Attempt 4 -> Fail -> Wait 8s Attempt 5 -> Fail -> Move to DLQ, Publish Event ``` ### Manual Reprocessing Failed command moved to DLQ can be: 1. Investigated by operations team 2. Fixed (e.g., document replaced) 3. Resubmitted to command queue ## Error Investigation ### Debugging Information Included in event for diagnostics: - **File Metadata**: Size, page count, format - **Processing Timeline**: Start time, attempt timestamps - **Provider Logs**: Error responses from extraction provider - **System Context**: Memory usage, timeout values ### Log Correlation Use correlationId to find related logs: ``` Dashboard -> Filter by correlationId -> View command flow -> See all extraction attempts -> Review provider responses ``` ## Monitoring and Alerting ### Metrics - Total extraction failures per hour - Failure rate by document type - Failure rate by error code - Recovery rate (manual reprocessing success) ### Alerts - Alert if failure rate > 5% - Alert if specific error code spike detected - Alert if DLQ depth exceeds threshold ## Handling Strategies ### By Document Type **Death Certificate Failures** - Usually corruption or image quality - Recommend rescanning - May require manual review **BI Form Failures** - Often layout variations - Try alternate form template - Fall back to manual extraction **General Document** - Try alternative provider - Check file format conversion - Manual data entry ### By Error Code **Timeout Errors** - Usually large files - Split document into parts - Increase timeout threshold **Validation Errors** - User action required - Document replacement - Format conversion needed **Provider Errors** - Retry with backoff - Contact provider support - Use fallback provider ## Event Retention - **Event Store**: 30 days in Kinesis - **Archive**: 1 year in S3 - **DLQ Messages**: 14 days (configurable) - **Audit Logs**: Indefinite ## Idempotency Events are idempotent using commandId: - Duplicate failures with same commandId indicate same issue - Downstream services prevent duplicate error handling --- id: FileDeletedEvent name: File Deleted Event version: 0.0.1 summary: Event emitted when a file associated with a quote is deleted. owners: - digisure-engineering schemaPath: schema.json badges: - content: File backgroundColor: green textColor: white --- ## Overview The `FileDeletedEvent` is emitted when a file (such as a document or image) that was previously associated with a quote is deleted. This event is consumed by services that need to clean up or track file deletions. ## When is this event emitted? This event is published when: - A customer removes an uploaded document - An outdated document is replaced - A document is deleted as part of data cleanup ## Key Information The event payload includes: - **File Identification**: File ID and event ID - **Origination**: The type and ID of the entity the file was associated with - **Timestamps**: When the event was noticed and effected ## Downstream Consumers Systems that typically consume this event include: - Document management systems - Storage cleanup services - Compliance and audit systems ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "FileDeletedEvent", "type": "object", "title": "FileDeletedEvent", "description": "Event emitted when a file associated with a quote is deleted.", "properties": { "eventId": { "type": "string", "format": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking" }, "eventType": { "type": "string", "description": "The type of event" }, "noticedDate": { "type": "string", "format": "date-time", "description": "When the event was noticed" }, "effectedDate": { "type": "string", "format": "date-time", "description": "When the event took effect" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for ordering" }, "fileId": { "type": "string", "format": "uuid", "description": "Unique identifier for the deleted file" }, "origination": { "type": "string", "description": "The type of entity the file was associated with" }, "originationId": { "type": "string", "format": "uuid", "description": "The ID of the entity the file was associated with" } }, "required": ["eventId", "correlationId", "noticedDate", "effectedDate", "fileId", "origination", "originationId"] } --- id: FileDeletedEventV1 name: File Deleted Event version: 0.0.1 summary: Event emitted when a file is deleted from the system. owners: - digisure-engineering schemaPath: schema.json badges: - content: Lifecycle backgroundColor: purple textColor: white - content: Avro backgroundColor: orange textColor: black --- ## Overview The `FileDeletedEventV1` event is emitted by the FileUploadService when a file is successfully deleted from the system. This event marks the end of the file lifecycle and notifies downstream systems that the file is no longer available. ## When is this event emitted? This event is published when: - A delete file command is successfully processed - The file record is marked as deleted in the system - Associated storage resources may be cleaned up ## Key Information The event payload includes: - **Event Identification**: Event ID, correlation ID, timestamps - **File Details**: File ID of the deleted file - **Origination**: Source context (CLAIMS, POLICY, QUOTE) and origination ID - **Event Ordering**: Logical clock reading for event ordering ## Downstream Consumers Systems that typically consume this event include: - Policy service (to update document references) - Claims service (to update claim evidence records) - Document indexing services (to remove from search indexes) - Audit and compliance systems ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "FileDeletedEventV1", "title": "FileDeletedEventV1", "description": "Event emitted when a file is deleted. Wire format: Avro (namespace: sft.pas.fileupload.events.filedeleted.avro)", "x-schema-format": "avro", "x-avro-namespace": "sft.pas.fileupload.events.filedeleted.avro", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "fileId", "origination", "originationId" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking the event across systems" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch, Avro logicalType: timestamp-millis)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch, Avro logicalType: timestamp-millis)" }, "detailType": { "type": "string", "description": "Type of the event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "fileId": { "type": "string", "format": "uuid", "description": "Unique identifier for the deleted file" }, "origination": { "type": "string", "enum": ["CLAIMS", "POLICY", "QUOTE"], "description": "Source or origin of the file (Avro enum: AvroOrigination)" }, "originationId": { "type": "string", "format": "uuid", "description": "Unique identifier for the origination entity" } } } --- id: FileOriginationSetEventV1 name: File Origination Set Event version: 0.0.1 summary: Event emitted when a file has its origination context set or updated. owners: - digisure-engineering schemaPath: schema.json badges: - content: Lifecycle backgroundColor: purple textColor: white - content: Avro backgroundColor: orange textColor: black --- ## Overview The `FileOriginationSetEventV1` event is emitted by the FileUploadService when a file's origination context is set or updated. This event enables files to be associated with their business context (Claims, Policy, or Quote) after upload. ## When is this event emitted? This event is published when: - A file's origination is set for the first time - A file's origination context is updated (e.g., a quote document becomes a policy document) - The SetFileOrigination command is successfully processed ## Key Information The event payload includes: - **Event Identification**: Event ID, correlation ID, timestamps - **File Details**: File ID, file name, and document type - **Origination**: New source context (CLAIMS, POLICY, QUOTE) and origination ID - **Event Ordering**: Logical clock reading for event ordering ## Use Cases - Files uploaded before their business context is known - Quote documents converted to policy documents - Reassigning documents between business contexts ## Downstream Consumers Systems that typically consume this event include: - Policy service (to link documents to policies) - Claims service (to link documents to claims) - Quote service (to link documents to quotes) - Document routing and classification services ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "FileOriginationSetEventV1", "title": "FileOriginationSetEventV1", "description": "Event emitted when a file has its origination set. Wire format: Avro (namespace: sft.pas.fileupload.events.fileoriginationset.avro)", "x-schema-format": "avro", "x-avro-namespace": "sft.pas.fileupload.events.fileoriginationset.avro", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "fileId", "origination", "originationId", "fileName", "documentType" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking the event across systems" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch, Avro logicalType: timestamp-millis)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch, Avro logicalType: timestamp-millis)" }, "detailType": { "type": "string", "description": "Type of the event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "fileId": { "type": "string", "format": "uuid", "description": "Unique identifier for the file" }, "origination": { "type": "string", "enum": ["CLAIMS", "POLICY", "QUOTE"], "description": "New source or origin context for the file (Avro enum: AvroOrigination)" }, "originationId": { "type": "string", "format": "uuid", "description": "Unique identifier for the origination entity" }, "fileName": { "type": "string", "description": "Name of the file" }, "documentType": { "type": "string", "description": "Type of document" } } } --- id: FileUploadedEvent name: File Uploaded Event version: 0.0.1 summary: Event emitted when a file is uploaded and associated with a quote. owners: - digisure-engineering schemaPath: schema.json badges: - content: File backgroundColor: green textColor: white --- ## Overview The `FileUploadedEvent` is emitted when a file (such as a document or image) is uploaded and associated with a quote. This event is consumed by services that need to process or store uploaded files. ## When is this event emitted? This event is published when: - A customer uploads an identity document - A supporting document is attached to a quote - A signed document is uploaded ## Key Information The event payload includes: - **File Identification**: File ID and event ID - **Origination**: The type and ID of the entity the file is associated with - **File Details**: File name and document type - **Timestamps**: When the event was noticed and effected ## Downstream Consumers Systems that typically consume this event include: - Document management systems - Verification services - Compliance and audit systems ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "FileUploadedEvent", "type": "object", "title": "FileUploadedEvent", "description": "Event emitted when a file is uploaded and associated with a quote.", "properties": { "eventId": { "type": "string", "format": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking" }, "eventType": { "type": "string", "description": "The type of event" }, "noticedDate": { "type": "string", "format": "date-time", "description": "When the event was noticed" }, "effectedDate": { "type": "string", "format": "date-time", "description": "When the event took effect" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for ordering" }, "fileId": { "type": "string", "format": "uuid", "description": "Unique identifier for the uploaded file" }, "origination": { "type": "string", "description": "The type of entity the file is associated with" }, "originationId": { "type": "string", "format": "uuid", "description": "The ID of the entity the file is associated with" }, "fileName": { "type": "string", "description": "The name of the uploaded file" }, "documentType": { "type": "string", "description": "The type of document uploaded" } }, "required": ["eventId", "correlationId", "noticedDate", "effectedDate", "fileId", "origination", "originationId"] } --- id: FileUploadedEventV1 name: File Uploaded Event version: 0.0.1 summary: Event emitted when a file is successfully uploaded to the system. owners: - digisure-engineering schemaPath: schema.json badges: - content: Lifecycle backgroundColor: purple textColor: white - content: Avro backgroundColor: orange textColor: black --- ## Overview The `FileUploadedEventV1` event is emitted by the FileUploadService when a file is successfully uploaded and stored in the system. This event marks the completion of the file upload process and contains information about the uploaded file and its origination context. ## When is this event emitted? This event is published when: - A file is uploaded via the direct upload (base64) endpoint - A file upload is completed via a pre-signed URL (S3 triggers this) - The file has been validated and stored successfully ## Key Information The event payload includes: - **Event Identification**: Event ID, correlation ID, timestamps - **File Details**: File ID for referencing the uploaded file - **Origination**: Source context (CLAIMS, POLICY, QUOTE) and origination ID - **File Metadata**: File name and document type - **Event Ordering**: Logical clock reading for event ordering ## Downstream Consumers Systems that typically consume this event include: - Policy service (for policy document tracking) - Claims service (for claim evidence processing) - Quote service (for quote document management) - Document management and indexing services ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "FileUploadedEventV1", "title": "FileUploadedEventV1", "description": "Event emitted when a file is uploaded. Wire format: Avro (namespace: sft.pas.fileupload.events.fileuploaded.avro)", "x-schema-format": "avro", "x-avro-namespace": "sft.pas.fileupload.events.fileuploaded.avro", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "fileId", "origination", "originationId", "fileName", "documentType" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking the event across systems" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch, Avro logicalType: timestamp-millis)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch, Avro logicalType: timestamp-millis)" }, "detailType": { "type": "string", "description": "Type of the event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "fileId": { "type": "string", "format": "uuid", "description": "Unique identifier for the uploaded file" }, "origination": { "type": "string", "enum": ["CLAIMS", "POLICY", "QUOTE"], "description": "Source or origin of the file upload (Avro enum: AvroOrigination)" }, "originationId": { "type": "string", "format": "uuid", "description": "Unique identifier for the origination entity" }, "fileName": { "type": "string", "description": "Name of the uploaded file" }, "documentType": { "type": "string", "description": "Type of document uploaded" } } } --- id: InventoryItemRedeemedExistingPolicyEventV2 name: Inventory Item Redeemed Existing Policy Event version: 0.0.1 summary: Event emitted when an inventory item is linked to an existing policy. owners: - digisure-engineering schemaPath: schema.avsc badges: - content: Redemption backgroundColor: green textColor: white --- ## Overview The `InventoryItemRedeemedExistingPolicyEventV2` event is emitted when an inventory item is successfully linked to an existing insurance policy. This allows partners to extend coverage on policies that are already active. ## When is this event emitted? This event is published when: - A customer redeems an active, non-expired inventory item for an existing policy - The item is validated against the bundle configuration - The item is marked as redeemed with the policy code reference ## Key Information The event payload includes: - **Item Identification**: Bundle ID, serial number, partner ID, package ID - **Policy Reference**: The policy code being extended - **Coverage Information**: Cover term and cover amount per term unit - **Timestamps**: Original redemption time and update time ## Downstream Consumers Systems that typically consume this event include: - Policy Service for coverage extension - Data product services for reporting - Partner integration services ## Raw Schema:schema.avsc { "type": "record", "name": "InventoryItemRedeemedExistingPolicyV2", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro", "doc": "Event emitted when an inventory item is linked to an existing policy.", "fields": [ { "name": "id", "type": { "type": "string", "logicalType": "uuid" }, "doc": "Event ID" }, { "name": "correlationId", "type": ["null", { "type": "string", "logicalType": "uuid" }], "doc": "Correlation ID (nullable)", "default": null }, { "name": "noticedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "effectedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "detailType", "type": "string" }, { "name": "logicalClockReading", "type": "int" }, { "name": "bundleId", "type": "string" }, { "name": "partnerId", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "packageId", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "serialNumber", "type": "string" }, { "name": "policyCode", "type": "string" }, { "name": "redeemedAt", "type": ["null", { "type": "long", "logicalType": "timestamp-millis" }], "default": null, "doc": "Original redemption timestamp (nullable)." }, { "name": "coverTerm", "type": ["null", "int"], "default": null, "doc": "Cover term in months (nullable)." }, { "name": "coverPerTermUnit", "type": [ "null", { "type": "record", "name": "AvroMoneyExistingPolicy", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro", "fields": [ { "name": "amount", "type": "long", "doc": "Amount in smallest currency unit - cents" }, { "name": "currency", "type": "string" } ] } ], "default": null, "doc": "Cover amount per term unit (nullable)." }, { "name": "updatedAt", "type": { "type": "long", "logicalType": "timestamp-millis" }, "doc": "Timestamp when the existing policy linkage occurred." } ] } --- id: InventoryItemRedeemedNewPolicyEventV2 name: Inventory Item Redeemed New Policy Event version: 0.0.1 summary: Event emitted when an inventory item is redeemed to create a new insurance policy. owners: - digisure-engineering schemaPath: schema.avsc badges: - content: Redemption backgroundColor: green textColor: white --- ## Overview The `InventoryItemRedeemedNewPolicyEventV2` event is emitted when an inventory item is successfully redeemed to create a new insurance policy. This event contains comprehensive information about the redemption including products, beneficiaries, and coverage details. ## When is this event emitted? This event is published when: - A customer redeems an active, non-expired inventory item - The redemption is validated against the bundle configuration rules - The item is marked as redeemed in the inventory ## Key Information The event payload includes: - **Item Identification**: Bundle ID, serial number, partner ID, package ID - **Product Details**: List of redeemed products with life IDs and beneficiaries - **Coverage Information**: Cover term, cover amount per term unit, policy start date - **Event Metadata**: Correlation ID, timestamps, and logical clock reading ## Downstream Consumers Systems that typically consume this event include: - Policy Service for new policy creation - Data product services for reporting - Partner integration services - Customer communication services ## Raw Schema:schema.avsc { "type": "record", "name": "InventoryItemRedeemedNewPolicyV2", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro", "doc": "Event emitted when a single inventory item is redeemed.", "fields": [ { "name": "id", "type": { "type": "string", "logicalType": "uuid" }, "doc": "Event ID" }, { "name": "correlationId", "type": ["null", { "type": "string", "logicalType": "uuid" }], "doc": "Correlation ID (nullable)", "default": null }, { "name": "noticedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "effectedDate", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "detailType", "type": "string" }, { "name": "logicalClockReading", "type": "int" }, { "name": "bundleId", "type": "string" }, { "name": "partnerId", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "packageId", "type": { "type": "string", "logicalType": "uuid" } }, { "name": "serialNumber", "type": "string" }, { "name": "products", "type": { "type": "array", "items": { "type": "record", "name": "RedeemedProduct", "fields": [ { "name": "productId", "type": "string" }, { "name": "productInstanceId", "type": "string" }, { "name": "productLifeId", "type": "string" }, { "name": "productLifeExternalId", "type": ["null", {"type": "string"}], "default": null }, { "name": "productLifeRelationshipToMain", "type": "string" }, { "name": "dateOfBirth", "type": ["null", { "type": "int", "logicalType": "date" }], "default": null, "doc": "Date of birth of the product life (nullable)" }, { "name": "gender", "type": ["null", "string"], "default": null, "doc": "Gender of the product life (nullable)" }, { "name": "beneficiaries", "type": { "type": "array", "items": { "type": "record", "name": "RedeemedBeneficiary", "fields": [ { "name": "beneficiaryId", "type": { "type": "string", "logicalType": "uuid" }, "doc": "Internal generated beneficiary UUID (string)" }, { "name": "percentageAllocation", "type": ["null", "long"], "default": null, "doc": "Allocation percentage (nullable)" } ] } }, "default": [] }, { "name": "coverAmount", "type": ["null", "double"], "default": null, "doc": "Cover amount allocated to this product." } ] } }, "default": [] }, { "name": "redeemedAt", "type": { "type": "long", "logicalType": "timestamp-millis" } }, { "name": "policyStartDate", "type": { "type": "long", "logicalType": "timestamp-millis" }, "doc": "Start date of the policy associated with this redemption (if supplied)." }, { "name": "coverTerm", "type": ["null", "int"], "default": null, "doc": "Cover term magnitude paired with coverTermChronoUnit (nullable)." }, { "name": "coverTermChronoUnit", "type": "string", "doc": "ChronoUnit that qualifies the cover term." }, { "name": "coverPerTermUnit", "type": [ "null", { "type": "record", "name": "AvroMoneyNewPolicy", "namespace": "sft.capstone.productbundle.events.productbundleinventory.avro", "fields": [ { "name": "amount", "type": "long", "doc": "Amount in smallest currency unit - cents" }, { "name": "currency", "type": "string" } ] } ], "default": null, "doc": "Cover amount per term unit (nullable)." } ] } --- id: LastFailedCollectionReceivedBeforeCancellationEventV1 name: Last Failed Collection Received Before Cancellation Event version: 0.0.1 summary: Event emitted when a policy receives its final failed collection before cancellation owners: - digisure-engineering schemaPath: schema.json badges: - content: Collection backgroundColor: red textColor: white --- ## Overview The `LastFailedCollectionReceivedBeforeCancellationEventV1` event is emitted when a policy receives its final failed collection attempt before it will be cancelled. This event serves as a critical warning that the policy is one more failed collection away from automatic cancellation. ### When is this event emitted? This event is triggered when: - A collection attempt fails and the policy reaches its maximum allowed failed collections minus one - The next failed collection will result in automatic policy cancellation - The policy is in a critical state requiring immediate attention ### Why is this event important? This event enables downstream systems to: - Send urgent notifications to policyholders warning of imminent cancellation - Trigger escalation workflows for retention efforts - Update policy status to reflect the critical state - Initiate proactive outreach from customer service teams - Log the event for compliance and audit trail purposes ### Key Fields | Field | Description | |-------|-------------| | `policyId` | The unique identifier of the policy that received the last failed collection before cancellation | > **Note: Java-Only Internal Event (No Avro Schema)** > > This event exists as a Java domain class (`LastFailedCollectionReceivedBeforeCancellationEvent`) but has no corresponding Avro `.avsc` schema file in the `sft-capstone-policy-avro-events` module. It is an internal domain event used within the Policy service boundary and is not published to Kinesis. Only `policyId` is carried as event payload alongside the standard base event fields. ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "LastFailedCollectionReceivedBeforeCancellationEventV1", "description": "Event emitted when a policy receives its final failed collection before cancellation.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "policyId" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event." }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" } } } --- id: NoPolicyCollectionReceivedWithinGracePeriodEventV1 name: No Policy Collection Received Within Grace Period version: 0.0.1 summary: Event emitted when no premium collection has been received within the grace period owners: - digisure-engineering schemaPath: schema.json badges: - content: Collection backgroundColor: green textColor: white --- ## Overview The `NoPolicyCollectionReceivedWithinGracePeriodEventV1` event is emitted when a policy's premium payment has not been received within the allowed grace period. This event signals a critical point in the collection workflow where the policy may be at risk of lapsing due to non-payment. This event is part of the collection workflow's monitoring and escalation process, enabling downstream systems to take appropriate action when payment is overdue. ### Collection Workflow Context The premium collection workflow includes a grace period mechanism to handle failed or missed collections: 1. **Premium Due Date** - The date when the premium payment is expected 2. **Grace Period** - A defined period after the due date during which payment can still be made 3. **Grace Period Expiry** - When the grace period ends without payment, this event is emitted 4. **Policy Status Impact** - Downstream processes may update policy status (e.g., lapse the policy) This event represents the expiry of the grace period without successful collection. It provides: - The original premium due date - The grace period end date - The amount that was due ### Key Fields - **premiumDueDate** - The date when the premium was originally due - **gracePeriodEndDate** - The date when the grace period expired - **amountDue** - The premium amount that was not collected - **policyId** - The affected policy identifier ### Typical Downstream Actions When this event is received, systems may: - Update the policy status to "lapsed" or "suspended" - Trigger notifications to the policyholder - Initiate reinstatement workflows if the policyholder makes a subsequent payment - Update reporting and analytics systems ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "NoPolicyCollectionReceivedWithinGracePeriodEventV1", "type": "object", "description": "Event emitted when no premium collection has been received within the grace period for a policy.", "definitions": { "Money": { "type": "object", "properties": { "amount": { "type": "integer", "description": "Amount in minor units (e.g. cents)" }, "currency": { "type": "string", "description": "ISO 4217 currency code" } }, "required": ["amount", "currency"] } }, "properties": { "id": { "type": "string", "format": "uuid", "description": "Event ID (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID (UUID as string)" }, "noticedDate": { "type": "integer", "description": "When the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "When the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Event detail type string" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Policy ID (UUID as string)" }, "premiumDueDate": { "type": "integer", "description": "Premium due date (milliseconds since epoch, start of day)" }, "gracePeriodEndDate": { "type": "integer", "description": "Grace period end date (milliseconds since epoch, start of day)" }, "amountDue": { "$ref": "#/definitions/Money", "description": "Amount due for the premium" } }, "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "policyId", "premiumDueDate", "gracePeriodEndDate", "amountDue" ] } --- id: NotificationDispatchedEventV1 name: Notification Dispatched Event version: 0.0.1 summary: "DEPRECATED: Superseded by NotificationDispatchedEventV2." owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white - content: Deprecated backgroundColor: red textColor: white --- > **Deprecated**: This event has been superseded by `NotificationDispatchedEventV2`. New consumers should use V2. ## Overview The `NotificationDispatchedEventV1` event is emitted by the NotificationService when a notification has been dispatched to the delivery provider (email via SES or SMS). This event marks the transition of a notification from triggered/scheduled state to dispatched state. ## When is this event emitted? This event is published when: - An immediate notification is triggered and sent to the Glue gateway - A scheduled notification reaches its dispatch time and is sent - A notification is re-dispatched after a previous failure ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Origin Identification**: Origin ID (policy ID or claim ID) and source type - **Notification Details**: Notification type, medium (EMAIL/SMS), and status - **Provider Tracking**: Notification provider correlation ID for delivery tracking - **Recipient**: Configured recipient type (POLICY_HOLDER or CLAIMANT) ## Downstream Consumers Systems that typically consume this event include: - Notification data product (for analytics and auditing) - Notification state aggregates (to update dispatched notifications list) - Operational dashboards (for real-time monitoring) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationDispatchedEventV1", "x-schema-format": "JSON Schema", "x-avro-schema-version": "NotificationDispatchedEventV2", "title": "NotificationDispatchedEventV1", "description": "Event emitted when a notification is dispatched to the delivery provider. Note: Production uses Avro schema NotificationDispatchedEventV2.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "originId", "notificationSource", "notificationType", "notificationMethod", "notificationStatus" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "notificationProviderCorrelationId": { "type": ["string", "null"], "format": "uuid", "description": "Correlation ID from the notification provider for delivery tracking" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "originId": { "type": "string", "format": "uuid", "description": "The origin identifier - policy ID or claim ID (UUID as string)" }, "notificationSource": { "type": "string", "enum": ["POLICY_FUNERAL", "POLICY_RISK", "QUOTE", "CLAIMS"], "description": "The source domain that triggered the notification" }, "notificationType": { "type": "string", "description": "The type of notification being dispatched", "enum": [ "POLICY_CONFIRMATION_WELCOME", "POLICY_CANCELLED", "POLICY_EXPIRED", "POLICY_EXPIRING_SOON", "POLICY_EXPIRING_TOMORROW", "POLICY_SEND_SCHEDULE", "PREMIUM_COLLECTED", "POLICY_REINSTATEMENT", "POLICY_PAYMENT_REMINDER", "CLAIM_REJECTED", "CLAIM_APPROVED_POLICY_ACTIVE", "CLAIM_PAYOUT_COMPLETE", "WAITING_PERIOD_COMPLETE" ] }, "notificationMethod": { "type": "string", "enum": ["EMAIL", "SMS"], "description": "The delivery channel for the notification" }, "notificationStatus": { "type": "string", "enum": ["DISPATCHED", "SCHEDULED", "PROVIDER_SEND_SUCCESS", "PROVIDER_SEND_FAILED"], "description": "The current status of the notification" }, "recipient": { "type": ["string", "null"], "enum": ["POLICY_HOLDER", "CLAIMANT", null], "description": "The configured recipient for this notification" } } } --- id: NotificationDispatchedEventV2 name: Notification Dispatched Event version: 0.0.1 summary: Event emitted when a notification is dispatched to the delivery provider. owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white - content: V2 backgroundColor: green textColor: white --- ## Overview The `NotificationDispatchedEventV2` event is emitted by the NotificationService when a notification has been dispatched to the delivery provider (email via SES or SMS). This event marks the transition of a notification from triggered/scheduled state to dispatched state. ## What Changed from V1 - `correlationId` is now nullable (union with null) - `noticedDate` and `effectedDate` are nullable timestamp fields - `detailType` field added with default value `notificationDispatched` - `recipient` field type changed to nullable string ## When is this event emitted? This event is published when: - An immediate notification is triggered and sent to the Glue gateway - A scheduled notification reaches its dispatch time and is sent - A notification is re-dispatched after a previous failure ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Origin Identification**: Origin ID (policy ID or claim ID) - **Notification Details**: Notification type, medium (EMAIL/SMS), and status - **Provider Tracking**: Notification provider correlation ID for delivery tracking - **Recipient**: Configured recipient type (POLICY_HOLDER or CLAIMANT) ## Downstream Consumers Systems that typically consume this event include: - Notification data product (for analytics and auditing) - Notification state aggregates (to update dispatched notifications list) - Operational dashboards (for real-time monitoring) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationDispatchedEventV2", "x-schema-format": "JSON Schema", "x-avro-schema-version": "NotificationDispatchedEventV2", "title": "NotificationDispatchedEventV2", "description": "Event emitted when a notification is dispatched to the provider gateway.", "type": "object", "required": [ "id", "originId", "notificationSource", "notificationType", "notificationMethod", "notificationStatus" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": ["string", "null"], "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "originId": { "type": "string", "format": "uuid", "description": "The origin entity ID (policy ID or claim ID)" }, "detailType": { "type": ["string", "null"], "default": "notificationDispatched", "description": "Event detail type identifier" }, "noticedDate": { "type": ["integer", "null"], "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": ["integer", "null"], "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "notificationSource": { "type": "string", "description": "The source of the notification (e.g. POLICY_FUNERAL, CLAIMS)" }, "notificationType": { "type": "string", "description": "The type of notification (e.g. POLICY_CONFIRMATION_WELCOME)" }, "notificationMethod": { "type": "string", "description": "The delivery channel (EMAIL or SMS)" }, "notificationStatus": { "type": "string", "description": "Current status of the notification (e.g. DISPATCHED)" }, "notificationProviderCorrelationId": { "type": ["string", "null"], "format": "uuid", "description": "Correlation ID from the notification provider for delivery tracking" }, "recipient": { "type": ["string", "null"], "description": "Recipient type (POLICY_HOLDER or CLAIMANT)" } } } --- id: NotificationScheduleCancelledEventV1 name: Notification Schedule Cancelled Event version: 0.0.1 summary: "DEPRECATED: Superseded by NotificationScheduledProcessCancelledEventV2." owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white - content: Deprecated backgroundColor: red textColor: white --- > **Deprecated**: This event has been superseded by `NotificationScheduledProcessCancelledEventV2`. New consumers should use V2. ## Overview The `NotificationScheduleCancelledEventV1` event is emitted by the NotificationService when a previously scheduled notification is cancelled before dispatch. This typically occurs when the conditions that triggered the scheduled notification are no longer valid. ## When is this event emitted? This event is published when: - A policy is cancelled before a scheduled notification is dispatched - A scheduled expiry reminder is cancelled because the policy was renewed - A payment reminder is cancelled because payment was received - A beneficiary reminder is cancelled because beneficiaries were added - Schedule cancellation rules are triggered by subsequent policy events ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Origin Identification**: Origin ID (policy ID) and source type - **Schedule Reference**: The schedule process ID being cancelled - **Notification Configuration**: The notification config that was to be sent ## Cancellation Rules Scheduled notifications are cancelled based on configured rules: - Policy status changes (cancelled, lapsed, expired) - Condition satisfaction (beneficiaries added, payment received) - Manual cancellation requests - Conflicting notification triggers ## Downstream Consumers Systems that typically consume this event include: - Notification scheduler (to remove from queue) - Notification data product (for audit trail) - Notification state aggregates (to update scheduled notifications list) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationScheduleCancelledEventV1", "x-schema-format": "JSON Schema", "x-avro-schema-version": "NotificationScheduledProcessCancelledEventV2", "title": "NotificationScheduleCancelledEventV1", "description": "Event emitted when a scheduled notification is cancelled before dispatch. Note: Production uses Avro schema NotificationScheduledProcessCancelledEventV2.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "originId", "scheduleProcessId" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "originId": { "type": "string", "format": "uuid", "description": "The origin identifier - policy ID (UUID as string)" }, "notificationSource": { "type": ["string", "null"], "enum": ["POLICY_FUNERAL", "POLICY_RISK", "QUOTE", "CLAIMS", null], "description": "The source domain of the cancelled notification" }, "scheduleProcessId": { "type": "string", "description": "The unique identifier of the scheduled notification process being cancelled" }, "notificationConfig": { "$ref": "#/$defs/NotificationConfig", "description": "The notification configuration that was to be sent" }, "packageId": { "type": ["string", "null"], "format": "uuid", "description": "The package identifier for the notification" }, "partnerId": { "type": ["string", "null"], "format": "uuid", "description": "The partner identifier for the notification" } }, "$defs": { "NotificationConfig": { "type": ["object", "null"], "properties": { "notificationType": { "type": "string", "description": "The type of notification that was scheduled" }, "notificationTiming": { "type": ["string", "null"], "enum": ["IMMEDIATE", "SCHEDULED", null], "description": "Whether the notification was immediate or scheduled" }, "notificationFrequency": { "type": ["string", "null"], "enum": ["ONCE", "RECURRING", null], "description": "Whether the notification was one-time or recurring" } } } } } --- id: NotificationScheduledEventV1 name: Notification Scheduled Event version: 0.0.1 summary: "DEPRECATED: Superseded by NotificationScheduledEventV2." owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white - content: Deprecated backgroundColor: red textColor: white --- > **Deprecated**: This event has been superseded by `NotificationScheduledEventV2`. New consumers should use V2. ## Overview The `NotificationScheduledEventV1` event is emitted by the NotificationService when a notification is scheduled for delivery at a future time. This event captures the intent to send a notification at a calculated dispatch time based on policy state and notification configuration. ## When is this event emitted? This event is published when: - A policy event triggers a notification configured with scheduled timing - A notification is scheduled based on policy dates (e.g., expiry reminders) - A recurring notification schedule is created ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Origin Identification**: Origin ID (policy ID) and source type - **Notification Details**: Notification type being scheduled - **Schedule Information**: Target dispatch time and schedule process ID - **Recipient**: Configured recipient type (POLICY_HOLDER) ## Schedule Process ID The schedule process ID is a unique identifier for the scheduled notification process. It is used to: - Track the scheduled notification through its lifecycle - Cancel the notification if conditions change - Link scheduled and dispatched events together ## Downstream Consumers Systems that typically consume this event include: - Notification scheduler (to queue the notification for future dispatch) - Notification data product (for tracking scheduled notifications) - Notification state aggregates (to update scheduled notifications list) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationScheduledEventV1", "x-schema-format": "JSON Schema", "x-avro-schema-version": "NotificationScheduledEventV2", "title": "NotificationScheduledEventV1", "description": "Event emitted when a notification is scheduled for future delivery. Note: Production uses Avro schema NotificationScheduledEventV2.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "originId", "notificationSource", "notificationType", "scheduledFor", "scheduleProcessId" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "originId": { "type": "string", "format": "uuid", "description": "The origin identifier - policy ID or claim ID (UUID as string)" }, "notificationSource": { "type": "string", "enum": ["POLICY_FUNERAL", "POLICY_RISK", "QUOTE", "CLAIMS"], "description": "The source domain that triggered the notification" }, "notificationType": { "type": "string", "description": "The type of notification being scheduled", "enum": [ "POLICY_EXPIRING_SOON", "POLICY_EXPIRING_IN_ONE_WEEK", "POLICY_EXPIRING_IN_TWO_WEEKS", "POLICY_EXPIRING_TOMORROW", "POLICY_PAYMENT_REMINDER", "WAITING_PERIOD_COMPLETE", "POLICY_NO_BENEFICIARIES_ADDED", "POLICY_OUTSTANDING_BENEFICIARY_INFO" ] }, "scheduledFor": { "type": "integer", "description": "Timestamp when the notification is scheduled for dispatch (milliseconds since epoch)" }, "scheduleProcessId": { "type": "string", "description": "Unique identifier for the scheduled notification process" }, "recipient": { "type": ["string", "null"], "enum": ["POLICY_HOLDER", "CLAIMANT", null], "description": "The configured recipient for this notification" } } } --- id: NotificationScheduledEventV2 name: Notification Scheduled Event version: 0.0.1 summary: Event emitted when a notification is scheduled for future delivery. owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white - content: V2 backgroundColor: green textColor: white --- ## Overview The `NotificationScheduledEventV2` event is emitted by the NotificationService when a notification is scheduled for delivery at a future time. This event captures the intent to send a notification at a calculated dispatch time based on policy state and notification configuration. ## What Changed from V1 - `correlationId` is now nullable - `noticedDate` and `effectedDate` are nullable timestamp fields - `detailType` field added with default value `notificationScheduled` - `recipient` field is now a required non-null string ## When is this event emitted? This event is published when: - A policy event triggers a notification configured with scheduled timing - A notification is scheduled based on policy dates (e.g., expiry reminders) - A recurring notification schedule is created ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Origin Identification**: Origin ID (policy ID) - **Notification Details**: Notification type being scheduled - **Schedule Information**: Target dispatch time (`scheduledFor`) and schedule process ID - **Recipient**: Configured recipient type (POLICY_HOLDER) ## Schedule Process ID The schedule process ID is a unique identifier for the scheduled notification process. It is used to: - Track the scheduled notification through its lifecycle - Cancel the notification if conditions change (via NotificationScheduledProcessCancelledEventV2) - Link scheduled and dispatched events together ## Downstream Consumers Systems that typically consume this event include: - Notification scheduler (to queue the notification for future dispatch) - Notification data product (for tracking scheduled notifications) - Notification state aggregates (to update scheduled notifications list) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationScheduledEventV2", "x-schema-format": "JSON Schema", "x-avro-schema-version": "NotificationScheduledEventV2", "title": "NotificationScheduledEventV2", "description": "Event emitted when a notification is scheduled for future delivery.", "type": "object", "required": [ "id", "originId", "notificationSource", "notificationType", "scheduledFor", "scheduleProcessId", "recipient" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": ["string", "null"], "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "originId": { "type": "string", "format": "uuid", "description": "The origin entity ID (policy ID)" }, "detailType": { "type": ["string", "null"], "default": "notificationScheduled", "description": "Event detail type identifier" }, "noticedDate": { "type": ["integer", "null"], "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": ["integer", "null"], "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "notificationSource": { "type": "string", "description": "The source of the notification (e.g. POLICY_FUNERAL)" }, "notificationType": { "type": "string", "description": "The type of notification being scheduled (e.g. POLICY_EXPIRING_SOON)" }, "scheduledFor": { "type": "integer", "description": "Timestamp when the notification is scheduled to be dispatched (milliseconds since epoch)" }, "scheduleProcessId": { "type": "string", "description": "Unique identifier for the scheduled notification process, used to track and cancel" }, "recipient": { "type": "string", "description": "Recipient type (POLICY_HOLDER)" } } } --- id: NotificationScheduledProcessCancelledEventV2 name: Notification Scheduled Process Cancelled Event version: 0.0.1 summary: Event emitted when a previously scheduled notification process is cancelled and will not be executed. owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white - content: V2 backgroundColor: green textColor: white --- ## Overview The `NotificationScheduledProcessCancelledEventV2` event is emitted by the NotificationService when a previously scheduled notification is cancelled before dispatch. This is the V2 replacement for `NotificationScheduleCancelledEventV1`, renamed to more accurately reflect that it is the scheduled *process* that is cancelled (not just the schedule entry). ## What Changed from V1 (NotificationScheduleCancelledEventV1) - Renamed from `NotificationScheduleCancelledEventV1` to `NotificationScheduledProcessCancelledEventV2` - `correlationId` is now nullable - `noticedDate` and `effectedDate` are nullable timestamp fields - `detailType` field added with default value `notificationScheduledProcessCancelled` - `notificationSource` and `notificationType` fields added for richer context ## When is this event emitted? This event is published when: - A policy is cancelled before a scheduled notification is dispatched - A scheduled expiry reminder is cancelled because the policy was renewed - A payment reminder is cancelled because payment was received - A beneficiary reminder is cancelled because beneficiaries were added - Schedule cancellation rules are triggered by subsequent policy events ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Origin Identification**: Origin ID (policy ID) - **Schedule Reference**: The `scheduleProcessId` of the process being cancelled - **Notification Context**: Source and type of the notification that was cancelled ## Cancellation Rules Scheduled notifications are cancelled based on configured rules: - Policy status changes (cancelled, lapsed, expired) - Condition satisfaction (beneficiaries added, payment received) - Conflicting notification triggers - Manual cancellation requests ## Downstream Consumers Systems that typically consume this event include: - Notification scheduler (to remove from queue) - Notification data product (for audit trail) - Notification state aggregates (to update scheduled notifications list) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationScheduledProcessCancelledEventV2", "x-schema-format": "JSON Schema", "x-avro-schema-version": "NotificationScheduledProcessCancelledEventV2", "title": "NotificationScheduledProcessCancelledEventV2", "description": "Event emitted when a previously scheduled notification process has been cancelled and will not be executed.", "type": "object", "required": [ "id", "originId", "notificationSource", "notificationType", "scheduleProcessId" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": ["string", "null"], "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "originId": { "type": "string", "format": "uuid", "description": "The origin entity ID (policy ID)" }, "detailType": { "type": ["string", "null"], "default": "notificationScheduledProcessCancelled", "description": "Event detail type identifier" }, "noticedDate": { "type": ["integer", "null"], "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": ["integer", "null"], "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "notificationSource": { "type": "string", "description": "The source of the notification (e.g. POLICY_FUNERAL)" }, "notificationType": { "type": "string", "description": "The type of notification that was cancelled (e.g. POLICY_EXPIRING_SOON)" }, "scheduleProcessId": { "type": "string", "description": "The schedule process ID of the cancelled notification process" } } } --- id: NotificationSendFailedEventV2 name: Notification Send Failed Event version: 0.0.1 summary: Event emitted when a notification send request fails. owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white - content: V2 backgroundColor: green textColor: white --- ## Overview The `NotificationSendFailedEventV2` event is emitted by the NotificationService (via the Glue gateway callback) when a notification delivery attempt has failed. This event includes details about the failure reason and whether it is a terminal failure (no further retry). ## When is this event emitted? This event is published when: - The Glue gateway reports a failed delivery attempt for an email or SMS - A notification send exceeds maximum retry attempts - An unrecoverable delivery error is encountered ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Gateway Correlation**: `gcid` — the Glue gateway correlation ID - **Sender Identity**: The sender identity configured for the notification - **Destination**: The recipient email address or phone number - **Medium**: Delivery channel (EMAIL, SMS, or other supported channels) - **Message**: The message content that failed to send - **Failure Details**: `failedReason` (optional description) and `terminalFailure` flag ## Failure Semantics | Field | Type | Description | |-------|------|-------------| | `failedReason` | string (nullable) | Human-readable description of why the send failed | | `terminalFailure` | boolean | `true` if no further retry will be attempted; `false` if the system may retry | ## Message Structure The `message` object contains: ### Body | Field | Type | Values | Description | |-------|------|--------|-------------| | `format` | enum | `TEXT`, `HTML` | The body content format | | `source` | enum | `INLINE`, `S3_PRE_SIGNED`, `S3_OBJECT` | Where the body content is sourced from | | `value` | string | — | The body content or reference URL | ### Attachments Each attachment in the `attachments` array contains: | Field | Type | Values | Description | |-------|------|--------|-------------| | `format` | enum | `PDF`, `XLSX` | Attachment file format | | `source` | enum | `S3_PRE_SIGNED`, `S3_OBJECT` | Where the attachment is sourced from | | `value` | string | — | The attachment content or reference URL | ## Supported Channels (Medium) `EMAIL`, `SMS`, `FACEBOOK`, `TWITTER`, `WHATSAPP`, `INSTAGRAM`, `LINKEDIN`, `TELEGRAM` ## Downstream Consumers Systems that typically consume this event include: - Notification data product (to record PROVIDER_SEND_FAILED status) - Notification state aggregates (to update failed notification state) - Alerting systems (for operational monitoring of delivery failures) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationSendFailedEventV2", "x-schema-format": "JSON Schema", "x-avro-schema-version": "NotificationSendFailedEventV2", "title": "NotificationSendFailedEventV2", "description": "Event emitted when a notification send request fails.", "type": "object", "required": [ "id", "gcid", "senderIdentity", "destination", "medium", "message", "terminalFailure" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": ["string", "null"], "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "detailType": { "type": ["string", "null"], "default": "notificationSendFailed", "description": "Event detail type identifier" }, "noticedDate": { "type": ["integer", "null"], "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": ["integer", "null"], "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "gcid": { "type": "string", "format": "uuid", "description": "Glue gateway correlation ID for delivery tracking" }, "senderIdentity": { "type": "string", "description": "The sender identity configured for the notification (e.g. email address or sender ID)" }, "destination": { "type": "string", "description": "The recipient email address or phone number" }, "medium": { "type": "string", "enum": ["EMAIL", "SMS", "FACEBOOK", "TWITTER", "WHATSAPP", "INSTAGRAM", "LINKEDIN", "TELEGRAM"], "description": "The delivery channel used" }, "message": { "type": "object", "description": "The message content that failed to send", "required": ["body"], "properties": { "subject": { "type": ["string", "null"], "description": "Email subject line (null for SMS)" }, "body": { "type": "object", "description": "The message body", "required": ["format", "source", "value"], "properties": { "format": { "type": "string", "enum": ["TEXT", "HTML"], "description": "The body content format" }, "source": { "type": "string", "enum": ["INLINE", "S3_PRE_SIGNED", "S3_OBJECT"], "description": "Where the body content is sourced from" }, "value": { "type": "string", "description": "The body content or reference URL" } } }, "attachments": { "type": "array", "default": [], "description": "List of attachments", "items": { "type": "object", "required": ["format", "source", "value"], "properties": { "format": { "type": "string", "enum": ["PDF", "XLSX"], "description": "Attachment file format" }, "source": { "type": "string", "enum": ["S3_PRE_SIGNED", "S3_OBJECT"], "description": "Where the attachment is sourced from" }, "value": { "type": "string", "description": "The attachment content or reference URL" } } } } } }, "failedReason": { "type": ["string", "null"], "description": "Human-readable description of why the send failed" }, "terminalFailure": { "type": "boolean", "default": false, "description": "true if no further retry will be attempted; false if the system may retry" } } } --- id: NotificationSentSucceededEventV2 name: Notification Sent Succeeded Event version: 0.0.1 summary: Event emitted when a notification send request has completed successfully. owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white - content: V2 backgroundColor: green textColor: white --- ## Overview The `NotificationSentSucceededEventV2` event is emitted by the NotificationService (via the Glue gateway callback) when a notification has been successfully delivered to the recipient. This event confirms end-to-end delivery success. ## When is this event emitted? This event is published when: - The Glue gateway confirms successful delivery of an email via AWS SES - The Glue gateway confirms successful delivery of an SMS - A previously queued notification send has been acknowledged as delivered ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Gateway Correlation**: `gcid` — the Glue gateway correlation ID - **Sender Identity**: The sender identity configured for the notification - **Destination**: The recipient email address or phone number - **Medium**: Delivery channel (EMAIL, SMS, or other supported channels) - **Message**: Full message content including subject, body (with format and source), and attachments ## Message Structure The `message` object contains: ### Body | Field | Type | Values | Description | |-------|------|--------|-------------| | `format` | enum | `TEXT`, `HTML` | The body content format | | `source` | enum | `INLINE`, `S3_PRE_SIGNED`, `S3_OBJECT` | Where the body content is sourced from | | `value` | string | — | The body content or reference URL | ### Attachments Each attachment in the `attachments` array contains: | Field | Type | Values | Description | |-------|------|--------|-------------| | `format` | enum | `PDF`, `XLSX` | Attachment file format | | `source` | enum | `S3_PRE_SIGNED`, `S3_OBJECT` | Where the attachment is sourced from | | `value` | string | — | The attachment content or reference URL | ## Supported Channels (Medium) `EMAIL`, `SMS`, `FACEBOOK`, `TWITTER`, `WHATSAPP`, `INSTAGRAM`, `LINKEDIN`, `TELEGRAM` ## Downstream Consumers Systems that typically consume this event include: - Notification data product (for delivery confirmation analytics) - Notification state aggregates (to mark notification as PROVIDER_SEND_SUCCESS) - Operational dashboards (for SLA and delivery tracking) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationSentSucceededEventV2", "x-schema-format": "JSON Schema", "x-avro-schema-version": "NotificationSentSucceededEventV2", "title": "NotificationSentSucceededEventV2", "description": "Event emitted when a notification send request has completed successfully.", "type": "object", "required": [ "id", "gcid", "senderIdentity", "destination", "medium", "message" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": ["string", "null"], "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "detailType": { "type": ["string", "null"], "default": "notificationSentSucceeded", "description": "Event detail type identifier" }, "noticedDate": { "type": ["integer", "null"], "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": ["integer", "null"], "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "gcid": { "type": "string", "format": "uuid", "description": "Glue gateway correlation ID for delivery tracking" }, "senderIdentity": { "type": "string", "description": "The sender identity configured for the notification (e.g. email address or sender ID)" }, "destination": { "type": "string", "description": "The recipient email address or phone number" }, "medium": { "type": "string", "enum": ["EMAIL", "SMS", "FACEBOOK", "TWITTER", "WHATSAPP", "INSTAGRAM", "LINKEDIN", "TELEGRAM"], "description": "The delivery channel used" }, "message": { "type": "object", "description": "The message content", "required": ["body"], "properties": { "subject": { "type": ["string", "null"], "description": "Email subject line (null for SMS)" }, "body": { "type": "object", "description": "The message body", "required": ["format", "source", "value"], "properties": { "format": { "type": "string", "enum": ["TEXT", "HTML"], "description": "The body content format" }, "source": { "type": "string", "enum": ["INLINE", "S3_PRE_SIGNED", "S3_OBJECT"], "description": "Where the body content is sourced from" }, "value": { "type": "string", "description": "The body content or reference URL" } } }, "attachments": { "type": "array", "default": [], "description": "List of attachments", "items": { "type": "object", "required": ["format", "source", "value"], "properties": { "format": { "type": "string", "enum": ["PDF", "XLSX"], "description": "Attachment file format" }, "source": { "type": "string", "enum": ["S3_PRE_SIGNED", "S3_OBJECT"], "description": "Where the attachment is sourced from" }, "value": { "type": "string", "description": "The attachment content or reference URL" } } } } } } } } --- id: NotificationTriggeredEventV1 name: Notification Triggered Event version: 0.0.1 summary: Event emitted when notification trigger rules are satisfied and a notification is ready for dispatch. owners: - digisure-engineering schemaPath: schema.json badges: - content: Notification backgroundColor: orange textColor: white --- ## Overview The `NotificationTriggeredEventV1` event is emitted by the NotificationService when a notification's trigger rules are satisfied and the notification is ready for dispatch. This event is an internal domain event that initiates the notification dispatch process. ## When is this event emitted? This event is published when: - A policy event triggers an immediate notification and all trigger rules pass - A scheduled notification reaches its dispatch time and conditions are still valid - Trigger rules for a notification configuration are satisfied ## Immediate vs Scheduled Triggers ### Immediate Notifications For immediate notifications, this event is emitted right after the triggering policy/claims event when: - All trigger rules are satisfied - The notification config specifies IMMEDIATE timing ### Scheduled Notifications For scheduled notifications, this event is emitted when: - The scheduled dispatch time is reached - The conditions are re-evaluated and still valid - The notification has not been cancelled ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps - **Origin Identification**: Policy ID, partner ID, package ID - **Notification Configuration**: Full notification config including template and timing - **Sender Identity**: Configured sender for email/SMS - **State Snapshot**: Policy or claims state at trigger time for template rendering - **Dispatch Time**: When the notification should be sent (for scheduled) ## Downstream Consumers This event triggers: - Notification enrichment with recipient contact details - Template rendering with policy/claims context - Dispatch command creation for Glue gateway ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "NotificationTriggeredEventV1", "x-schema-format": "JSON Schema", "x-note": "Internal domain event - no Avro schema published", "title": "NotificationTriggeredEventV1", "description": "Event emitted when notification trigger rules are satisfied and a notification is ready for dispatch. This is an internal domain event.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "policyId", "notificationConfig" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier linking related events (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering within the aggregate" }, "detailType": { "type": ["string", "null"], "description": "Detail type for the event (e.g., FuneralPolicyImmediateNotificationTriggered)" }, "policyId": { "type": "string", "format": "uuid", "description": "The policy identifier (UUID as string)" }, "partnerId": { "type": "string", "format": "uuid", "description": "The partner identifier (UUID as string)" }, "packageId": { "type": "string", "format": "uuid", "description": "The package identifier (UUID as string)" }, "notificationConfig": { "$ref": "#/$defs/NotificationConfig", "description": "The notification configuration for this trigger" }, "senderIdentity": { "$ref": "#/$defs/SenderIdentity", "description": "The configured sender identity for the notification" }, "policyState": { "$ref": "#/$defs/PolicyState", "description": "Snapshot of policy state at trigger time for template rendering" }, "dispatchTime": { "type": ["integer", "null"], "description": "Target dispatch time for scheduled notifications (milliseconds since epoch)" } }, "$defs": { "NotificationConfig": { "type": "object", "required": ["notificationType"], "properties": { "notificationType": { "type": "string", "description": "The type of notification to send" }, "notificationTiming": { "type": ["string", "null"], "enum": ["IMMEDIATE", "SCHEDULED", null], "description": "Whether notification is immediate or scheduled" }, "notificationFrequency": { "type": ["string", "null"], "enum": ["ONCE", "RECURRING", null], "description": "Whether notification is one-time or recurring" }, "notificationMediums": { "type": ["array", "null"], "items": { "$ref": "#/$defs/NotificationMediumConfig" }, "description": "Configured delivery channels for the notification" }, "recipients": { "type": ["array", "null"], "items": { "type": "string", "enum": ["POLICY_HOLDER", "CLAIMANT"] }, "description": "Configured recipients for the notification" } } }, "NotificationMediumConfig": { "type": "object", "properties": { "medium": { "type": "string", "enum": ["EMAIL", "SMS"], "description": "The delivery channel" }, "templateId": { "type": ["string", "null"], "description": "Template identifier for this medium" } } }, "SenderIdentity": { "type": ["object", "null"], "properties": { "emailFrom": { "type": ["string", "null"], "description": "Email sender address" }, "emailFromName": { "type": ["string", "null"], "description": "Email sender display name" }, "smsFrom": { "type": ["string", "null"], "description": "SMS sender ID" } } }, "PolicyState": { "type": ["object", "null"], "description": "Snapshot of policy state for template context", "properties": { "policyCode": { "type": ["string", "null"], "description": "Human-readable policy code" }, "policyStatus": { "type": ["string", "null"], "enum": ["ACTIVE", "LAPSED", "CANCELLED", "EXPIRED", null], "description": "Current policy status" }, "policyStartDate": { "type": ["integer", "null"], "description": "Policy start date (milliseconds since epoch)" }, "policyExpiryDate": { "type": ["integer", "null"], "description": "Policy expiry date (milliseconds since epoch)" }, "policyHolder": { "$ref": "#/$defs/PolicyHolder", "description": "Policy holder details" } } }, "PolicyHolder": { "type": ["object", "null"], "properties": { "firstName": { "type": ["string", "null"], "description": "Policy holder first name" }, "surname": { "type": ["string", "null"], "description": "Policy holder surname" }, "email": { "type": ["string", "null"], "format": "email", "description": "Policy holder email address" }, "mobileNumber": { "type": ["string", "null"], "description": "Policy holder mobile number" } } } } } --- id: OrmsDecisionFoundEventV1 name: ORMS Decision Found Event version: 0.0.1 summary: Event emitted when an ORMS analyst decision is found during polling. owners: - digisure-engineering schemaPath: schema.json badges: - content: ORMS backgroundColor: purple textColor: white - content: Decision backgroundColor: green textColor: white --- ## Overview The `OrmsDecisionFoundEventV1` event is emitted by the Verification Service when an ORMS analyst has made a decision on a previously pending case. This event signals that the manual review process is complete and contains the analyst's final decision. ## When is this event emitted? This event is published when: - Decision polling finds that an analyst has made a decision - The ORMS case status changes from pending to resolved - A compliance analyst approves or rejects a flagged party ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps - **Original Command**: Reference to the original command that triggered screening - **Screening Reference**: ORMS screening event ID that was resolved - **Decision Details**: Analyst decision, description, decision ID, and who made it - **Resolution Metrics**: Check attempts and time to resolution - **Risk Assessment**: Final risk indicator and resolved watchlists - **Party Reference**: The CIS party ID that was screened ## Analyst Decisions | Decision | Description | Downstream Event | |----------|-------------|------------------| | `APPROVED` | Party cleared after review | VerificationSucceededEventV1 | | `REJECTED` | Party confirmed on watchlist | VerificationHardFailEventV1 | ## What Happens Next After this event is emitted: 1. Based on the analyst decision: - `APPROVED` -> `VerificationSucceededEventV1` is emitted - `REJECTED` -> `VerificationHardFailEventV1` is emitted 2. The verification workflow completes 3. Downstream services can proceed based on final outcome ## Downstream Consumers Systems that typically consume this event include: - ORMS Reactor (to emit final verification event) - Compliance Monitoring (to log analyst decisions) - Audit Systems (to maintain decision history) - SLA Monitoring (to track resolution times) - Policy Service (to receive final verification result) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "OrmsDecisionFoundEventV1", "title": "OrmsDecisionFoundEventV1", "description": "Event emitted when an ORMS analyst decision is found during polling. This is a JSON Schema representation of the Avro schema used in production (namespace: sft.pas.verification.cg.events.ormsdecisionfounde.avro).", "x-schema-format": "avro", "x-avro-namespace": "sft.pas.verification.cg.events.ormsdecisionfounde.avro", "x-avro-registry": "sft-capstone-verification-cg-event-stream-registry", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "verificationType", "requestExternalToken", "internalId", "requestTo", "partyId", "originalCommandId", "screeningEventId" ], "properties": { "id": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Correlation ID to link this event to the originating command" }, "noticedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event (e.g., ORMS_DECISION_FOUND_EVENT)" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "verificationType": { "type": "string", "enum": [ "VERIFICATION_OF_PERSONAL_DETAILS", "VERIFICATION_OF_BANK_DETAILS", "SANCTIONS_SCREENING" ], "x-avro-type": "enum", "x-avro-enum-name": "AvroVerificationType", "description": "Type of verification that was resolved" }, "requestExternalToken": { "type": "string", "description": "The id of the external request made to the provider" }, "internalId": { "type": "string", "description": "The id of the command received by the command gateway" }, "requestTo": { "type": "string", "description": "The provider to whom the request was made (ORMS)" }, "partyId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "The CIS identifier for party who was being verified" }, "originalCommandId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "The original command that triggered the screening" }, "screeningEventId": { "type": "integer", "description": "The ORMS screening event ID that was resolved" }, "decisionId": { "type": ["null", "integer"], "x-avro-type": "union", "description": "The analyst's decision ID from ORMS" }, "analystDecision": { "type": ["null", "string"], "x-avro-type": "union", "description": "The analyst's final decision (e.g., APPROVED, REJECTED)" }, "decisionDescription": { "type": ["null", "string"], "x-avro-type": "union", "description": "Description of the decision" }, "decisionUser": { "type": ["null", "string"], "x-avro-type": "union", "description": "The analyst who made the decision" }, "decisionCreated": { "type": ["null", "integer"], "x-avro-type": "union", "x-avro-logical-type": "timestamp-millis", "description": "When the decision was made (milliseconds since epoch)" }, "relationshipRiskIndicator": { "type": ["null", "string"], "x-avro-type": "union", "description": "Final risk indicator" }, "resolvedWatchlists": { "type": ["null", "string"], "x-avro-type": "union", "description": "Watchlists involved in the case" }, "checkAttempts": { "type": ["null", "integer"], "x-avro-type": "union", "description": "Number of attempts before resolution" }, "resolutionTimeMinutes": { "type": ["null", "integer"], "x-avro-type": "union", "description": "Time to resolution in minutes" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "x-avro-type": "map", "default": {}, "description": "Additional data specific to the verification request" } } } --- id: OrmsDecisionPendingEventV1 name: ORMS Decision Pending Event version: 0.0.1 summary: Event emitted when an ORMS verification case requires manual analyst review. owners: - digisure-engineering schemaPath: schema.json badges: - content: ORMS backgroundColor: purple textColor: white - content: Pending backgroundColor: yellow textColor: black --- ## Overview The `OrmsDecisionPendingEventV1` event is emitted by the Verification Service when an ORMS sanctions screening returns a STOP status, indicating that the case requires manual analyst review due to potential watchlist matches. ## When is this event emitted? This event is published when: - ORMS screening finds potential matches against watchlists - The case is flagged for due diligence review - A human analyst needs to verify the match before proceeding - The screening status indicates "Under Review" or similar ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps - **Screening Details**: ORMS screening event ID, status, and description - **Risk Information**: Flagged watchlists and risk indicator - **Party Reference**: The CIS party ID being screened ## Screening Status Values | Status | Description | |--------|-------------| | `STOP` | Potential match found, review required | | `UNDER_REVIEW` | Case assigned to analyst | | `DUE_DILIGENCE_IN_PROGRESS` | Active investigation ongoing | ## What Happens Next When this event is emitted: 1. The verification remains in a pending state 2. Decision polling is initiated to check for analyst decisions 3. Once an analyst makes a decision, `OrmsDecisionFoundEventV1` is emitted 4. Finally, a `VerificationSucceededEventV1` or `VerificationHardFailEventV1` is emitted ## Downstream Consumers Systems that typically consume this event include: - ORMS Decision Poller (to start polling for analyst decisions) - Policy Service (to mark verification as pending manual review) - Operations Dashboard (to track pending reviews) - Compliance Monitoring (to track SLA on review times) ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "OrmsDecisionPendingEventV1", "title": "OrmsDecisionPendingEventV1", "description": "Event emitted when an ORMS verification case requires manual analyst review. This is a JSON Schema representation of the Avro schema used in production (namespace: sft.pas.verification.cg.events.ormsdecisionpendingevent.avro).", "x-schema-format": "avro", "x-avro-namespace": "sft.pas.verification.cg.events.ormsdecisionpendingevent.avro", "x-avro-registry": "sft-capstone-verification-cg-event-stream-registry", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "verificationType", "requestExternalToken", "internalId", "requestTo", "partyId", "screeningEventId" ], "properties": { "id": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Correlation ID to link this event to the originating command" }, "noticedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event (e.g., ORMS_DECISION_PENDING_EVENT)" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "verificationType": { "type": "string", "enum": [ "VERIFICATION_OF_PERSONAL_DETAILS", "VERIFICATION_OF_BANK_DETAILS", "SANCTIONS_SCREENING" ], "x-avro-type": "enum", "x-avro-enum-name": "AvroVerificationType", "description": "Type of verification that requires decision" }, "requestExternalToken": { "type": "string", "description": "The id of the external request made to the provider" }, "internalId": { "type": "string", "description": "The id of the command received by the command gateway" }, "requestTo": { "type": "string", "description": "The provider to whom the request was made (ORMS)" }, "partyId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "The CIS identifier for party who was being verified" }, "screeningEventId": { "type": "integer", "description": "The ORMS screening event ID requiring decision" }, "screeningStatus": { "type": ["null", "string"], "x-avro-type": "union", "description": "The status from ORMS screening (e.g., STOP, UNDER_REVIEW)" }, "screeningDescription": { "type": ["null", "string"], "x-avro-type": "union", "description": "Description of the screening result" }, "flaggedWatchlists": { "type": ["null", "string"], "x-avro-type": "union", "description": "Watchlists that flagged this case" }, "riskIndicator": { "type": ["null", "string"], "x-avro-type": "union", "description": "Risk indicator from the screening (e.g., HIGH, MEDIUM, LOW)" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "x-avro-type": "map", "default": {}, "description": "Additional data specific to the verification request" } } } --- id: OrmsScreeningCompletedEventV1 name: ORMS Screening Completed Event version: 0.0.1 summary: Event emitted when ORMS sanctions screening is completed, regardless of outcome. owners: - digisure-engineering schemaPath: schema.json badges: - content: ORMS backgroundColor: purple textColor: white - content: Screening backgroundColor: blue textColor: white --- ## Overview The `OrmsScreeningCompletedEventV1` event is emitted by the Verification Service when an ORMS sanctions screening request completes. This event captures the immediate result from ORMS before any analyst review. ## When is this event emitted? This event is published when: - ORMS returns an immediate GO decision (no matches found) - ORMS returns a STOP decision (potential match found) - ORMS screening completes with any status ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps - **ORMS Response**: Screening event ID, status, code, and success flag - **Risk Assessment**: Flagged watchlists and risk indicator - **Party Reference**: The CIS party ID that was screened ## ORMS Status Codes | Code | Status | Description | |------|--------|-------------| | `GO` | No alert | Party cleared with no watchlist matches | | `STOP` | Due Diligence in Progress | Potential match requires review | ## Risk Indicators | Indicator | Description | |-----------|-------------| | `HIGH` | High-risk match requiring immediate attention | | `MEDIUM` | Medium-risk match requiring standard review | | `LOW` | Low-risk or false positive likely | ## Downstream Flow ``` OrmsScreeningCompletedEventV1 | +---> If GO: Emit VerificationSucceededEventV1 | +---> If STOP: Emit OrmsDecisionPendingEventV1 -> Start decision polling ``` ## Downstream Consumers Systems that typically consume this event include: - ORMS Reactor (to determine next steps) - Compliance Monitoring (to track screening results) - Risk Management Systems - Audit and Reporting platforms ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "OrmsScreeningCompletedEventV1", "title": "OrmsScreeningCompletedEventV1", "description": "Event emitted when ORMS screening is completed, regardless of outcome. This is a JSON Schema representation of the Avro schema used in production (namespace: sft.pas.verification.cg.events.ormsscreeningcompletedevent.avro).", "x-schema-format": "avro", "x-avro-namespace": "sft.pas.verification.cg.events.ormsscreeningcompletedevent.avro", "x-avro-registry": "sft-capstone-verification-cg-event-stream-registry", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "verificationType", "requestExternalToken", "internalId", "requestTo", "partyId" ], "properties": { "id": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "Correlation ID to link this event to the originating command" }, "noticedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "x-avro-logical-type": "timestamp-millis", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event (e.g., ORMS_SCREENING_COMPLETED_EVENT)" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "verificationType": { "type": "string", "enum": [ "VERIFICATION_OF_PERSONAL_DETAILS", "VERIFICATION_OF_BANK_DETAILS", "SANCTIONS_SCREENING" ], "x-avro-type": "enum", "x-avro-enum-name": "AvroVerificationType", "description": "Type of verification that was screened" }, "requestExternalToken": { "type": "string", "description": "The id of the external request made to the provider" }, "internalId": { "type": "string", "description": "The id of the command received by the command gateway" }, "requestTo": { "type": "string", "description": "The provider to whom the request was made (ORMS)" }, "partyId": { "type": "string", "format": "uuid", "x-avro-logical-type": "uuid", "description": "The CIS identifier for party who was being verified" }, "ormsScreeningEventId": { "type": ["null", "integer"], "x-avro-type": "union", "description": "The ORMS screening event ID" }, "ormsStatus": { "type": ["null", "string"], "x-avro-type": "union", "description": "The ORMS response status (e.g., No alert, Due Diligence in Progress)" }, "ormsCode": { "type": ["null", "string"], "x-avro-type": "union", "description": "The ORMS response code (GO, STOP, etc.)" }, "ormsSuccess": { "type": ["null", "boolean"], "x-avro-type": "union", "description": "Whether the ORMS call was successful" }, "flaggedWatchlists": { "type": ["null", "string"], "x-avro-type": "union", "description": "Watchlists that flagged this party (if any)" }, "riskIndicator": { "type": ["null", "string"], "x-avro-type": "union", "description": "Risk indicator from screening (e.g., HIGH, MEDIUM, LOW)" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" }, "x-avro-type": "map", "default": {}, "description": "Additional data specific to the verification request" } } } --- id: PayoutInitiatedEventV1 name: Payout Initiated Event version: 0.0.1 summary: Event emitted when a claim payout is initiated. owners: - digisure-engineering schemaPath: schema.json badges: - content: Financial backgroundColor: green textColor: white --- ## Overview The `PayoutInitiatedEventV1` event is emitted by the ClaimsService when a payout is initiated for an approved claim. This event contains the financial details of the payout including amount, currency, and payment references. ## When is this event emitted? This event is published when: - A claim has been approved and the payout process is initiated - The PayClaimCommand is successfully executed ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, noticed and effected timestamps - **Claim Identification**: Claim ID - **Payout Details**: Payout ID, payment reference, payment instruction ID, amount, currency - **Actor**: Who initiated the payout ## Downstream Consumers Systems that typically consume this event include: - Payment processing systems - Notification services (to inform claimant of payout) - Financial reconciliation systems - Reporting and analytics platforms ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PayoutInitiatedEventV1", "description": "Event representing initiation of a claim payout.", "type": "object", "required": ["id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "claimId", "payoutId", "paymentReference", "paymentInstructionId", "amount", "currency", "initiatedBy"], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation ID for tracking related events" }, "noticedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event was noticed" }, "effectedDate": { "type": "integer", "description": "Timestamp (epoch millis) when the event took effect" }, "detailType": { "type": "string", "const": "payoutInitiated", "description": "Type of the event" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "claimId": { "type": "string", "description": "The ID of the claim" }, "payoutId": { "type": "string", "format": "uuid", "description": "The payout identifier" }, "paymentReference": { "type": "string", "description": "External payment reference" }, "paymentInstructionId": { "type": "string", "description": "Reference to the payout payment instruction (no PII)" }, "amount": { "type": "string", "description": "Payout amount as a string" }, "currency": { "type": "string", "description": "Payout currency code" }, "initiatedBy": { "type": "string", "description": "Actor who initiated the payout" } } } --- id: PDFEncryptedEventV1 name: PDF Encrypted Event version: 0.0.1 summary: Event emitted when a PDF document has been successfully encrypted with password protection. owners: - digisure-engineering schemaPath: schema.json badges: - content: Security backgroundColor: red textColor: white - content: Not Yet Implemented backgroundColor: red textColor: white --- ## Overview The `PDFEncryptedEventV1` event is designed to be emitted by the PDF Generator Service when a PDF document has been successfully encrypted with password protection and uploaded to S3. This event provides the location and access information for the encrypted document. > **⚠️ Implementation Status:** This event is currently **not being published** by the PDF Generator Service handlers. The event is documented here to define the contract, but no Kinesis publishing code exists in the current V1 implementation. ## When is this event emitted? This event is published when: - An encryption request is successfully processed - The source PDF has been retrieved and encrypted - The encrypted PDF has been uploaded to S3 - A pre-signed URL has been created for document access ## Key Information The event payload includes: - **Storage Location**: S3 bucket and key where the encrypted document is stored - **Access URL**: Pre-signed URL for downloading the encrypted document (valid for 7 days) - **Resource URI**: S3 URI format for internal service references ## Important Notes - The password used for encryption is NOT included in the event for security reasons - The recipient must be provided with the password through a separate secure channel - The encrypted document requires the password to be opened and viewed ## Downstream Consumers Systems that typically consume this event include: - Policy Service (to update document references with encrypted version) - Notification Service (to send secure document links with password delivery) - Audit and Compliance Systems ## Response Structure The event contains the same information returned in the API response: ```json { "bucket": "capstone-documents", "key": "policies/POL-123/schedule-encrypted.pdf", "link": "https://bucket.s3.amazonaws.com/key?signature=...", "resourceUri": "s3://capstone-documents/policies/POL-123/schedule-encrypted.pdf" } ``` ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "PDFEncryptedEventV1", "title": "PDFEncryptedEventV1", "x-schema-format": "json-schema", "description": "Event emitted when a PDF document has been successfully encrypted with password protection. Based on Python lambda response format.", "type": "object", "required": ["bucket", "key", "link", "resourceUri"], "properties": { "bucket": { "type": "string", "description": "The S3 bucket where the encrypted PDF is stored" }, "key": { "type": "string", "description": "The S3 object key (path) of the encrypted PDF" }, "link": { "type": "string", "format": "uri", "description": "Pre-signed URL for downloading the encrypted document (expires in 7 days)" }, "resourceUri": { "type": "string", "description": "S3 URI in format s3://bucket/key for internal references" } } } --- id: PDFGeneratedEventV1 name: PDF Generated Event version: 0.0.1 summary: Event emitted when a PDF document has been successfully generated and stored in S3. owners: - digisure-engineering schemaPath: schema.json badges: - content: Document backgroundColor: purple textColor: white - content: Not Yet Implemented backgroundColor: red textColor: white --- ## Overview The `PDFGeneratedEventV1` event is designed to be emitted by the PDF Generator Service when a PDF document has been successfully created from HTML content and uploaded to S3. This event provides the location and access information for the generated document. > **⚠️ Implementation Status:** This event is currently **not being published** by the PDF Generator Service handlers. The event is documented here to define the contract, but no Kinesis publishing code exists in the current V1 implementation. ## When is this event emitted? This event is published when: - A PDF generation request is successfully processed - The generated PDF has been uploaded to S3 - A pre-signed URL has been created for document access ## Key Information The event payload includes: - **Storage Location**: S3 bucket and key where the document is stored - **Access URL**: Pre-signed URL for downloading the document (valid for 7 days) - **Resource URI**: S3 URI format for internal service references ## Downstream Consumers Systems that typically consume this event include: - Policy Service (to store document references on policies) - Notification Service (to include download links in communications) - Document Management Systems ## Response Structure The event contains the same information returned in the API response: ```json { "bucket": "capstone-documents", "key": "policies/POL-123/schedule.pdf", "link": "https://bucket.s3.amazonaws.com/key?signature=...", "resourceUri": "s3://capstone-documents/policies/POL-123/schedule.pdf" } ``` ## Signed URL Expiration The pre-signed URL included in the event expires after 7 days (604800 seconds). If access is needed after expiration, a new signed URL must be generated using the bucket and key information. ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "PDFGeneratedEventV1", "title": "PDFGeneratedEventV1", "x-schema-format": "json-schema", "description": "Event emitted when a PDF document has been successfully generated and stored in S3. Based on DocumentGenerationResponseSchema from source TypeScript code.", "type": "object", "required": ["bucket", "key", "link", "resourceUri"], "properties": { "bucket": { "type": "string", "description": "The S3 bucket where the generated PDF is stored" }, "key": { "type": "string", "description": "The S3 object key (path) of the generated PDF" }, "link": { "type": "string", "format": "uri", "description": "Pre-signed URL for downloading the document (expires in 7 days)" }, "resourceUri": { "type": "string", "description": "S3 URI in format s3://bucket/key for internal references" } } } --- id: PolicyAdHocCollectionRequestedEventV1 name: Policy Ad-Hoc Collection Requested version: 0.0.1 summary: Event emitted when an ad-hoc premium collection is requested for a policy owners: - digisure-engineering schemaPath: schema.json badges: - content: Collection backgroundColor: green textColor: white --- ## Overview The `PolicyAdHocCollectionRequestedEventV1` event is emitted when an ad-hoc (out-of-schedule) premium collection is requested for a funeral policy. Unlike regular scheduled collections, ad-hoc collections are triggered manually or by specific business processes that require immediate payment processing. This event is part of the collection workflow and enables flexibility in premium collection beyond the standard billing cycle. ### Collection Workflow Context The premium collection workflow typically operates on a scheduled basis, but ad-hoc collections provide flexibility for: 1. **Catch-up Payments** - When a policyholder wants to pay missed premiums 2. **Advance Payments** - When a policyholder wishes to pay premiums ahead of schedule 3. **Special Circumstances** - Business processes that require immediate collection outside the normal cycle When an ad-hoc collection is requested: 1. This event is emitted with the collection details 2. The collection provider processes the payment request 3. Success or failure events are published based on the outcome ### Key Fields - **collectionAmount** - The specific amount to be collected in this ad-hoc request - **policyPremium** - The total premium amount for reference - **collectionProviderName** - The provider that will process this collection - **products** - Detailed breakdown of products, tranches, and beneficiaries associated with the policy - **collectionFrequency** - The normal collection frequency for context ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PolicyAdHocCollectionRequestedEventV1", "type": "object", "description": "Event emitted when an ad-hoc premium collection is requested for a funeral policy.", "definitions": { "Money": { "type": "object", "properties": { "amount": { "type": "string", "description": "The monetary amount as a string" }, "currency": { "type": "string", "description": "The currency code (e.g., USD, EUR, ZAR)" } }, "required": ["amount", "currency"] }, "TemporalInterval": { "type": "object", "properties": { "unit": { "type": "string", "enum": ["DAYS", "WEEKS", "MONTHS", "YEARS"], "description": "The temporal unit" }, "amount": { "type": "integer", "description": "The amount of the temporal unit" } }, "required": ["unit", "amount"] }, "TemporalFrequency": { "type": "object", "properties": { "recurrence": { "type": "string", "enum": ["ONCE", "RECURRING"], "description": "Whether the frequency is once-off or recurring" }, "interval": { "oneOf": [ { "$ref": "#/definitions/TemporalInterval" }, { "type": "null" } ], "description": "The temporal interval (null for ONCE recurrence)" } }, "required": ["recurrence"] }, "BeneficiaryEventInfo": { "type": "object", "properties": { "beneficiaryId": { "type": "string", "description": "Beneficiary ID" }, "percentageAllocated": { "type": "number", "description": "Percentage allocated to the beneficiary" } }, "required": ["beneficiaryId", "percentageAllocated"] }, "TrancheEventInfo": { "type": "object", "properties": { "id": { "type": "string", "description": "Tranche ID" }, "startDate": { "type": "integer", "description": "Tranche start date (milliseconds since epoch)" }, "endDate": { "type": "integer", "description": "Tranche end date (milliseconds since epoch)" }, "premium": { "$ref": "#/definitions/Money", "description": "Tranche premium" }, "coverAmount": { "$ref": "#/definitions/Money", "description": "Tranche cover amount" }, "waitingPeriods": { "type": "object", "additionalProperties": { "$ref": "#/definitions/TemporalInterval" }, "description": "Waiting periods as key-value pairs" } }, "required": ["id", "startDate", "endDate", "premium", "coverAmount", "waitingPeriods"] }, "ProductEventInfo": { "type": "object", "properties": { "id": { "type": "string", "description": "Product ID" }, "productInstanceId": { "type": "string", "description": "Product instance ID" }, "productLifeId": { "type": "string", "description": "Product life ID" }, "riskRatings": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Risk ratings as key-value pairs" }, "name": { "type": "string", "description": "Product name" }, "premium": { "$ref": "#/definitions/Money", "description": "Product premium" }, "tranches": { "type": "array", "items": { "$ref": "#/definitions/TrancheEventInfo" }, "description": "Product tranches" }, "beneficiaries": { "type": "array", "items": { "$ref": "#/definitions/BeneficiaryEventInfo" }, "description": "Product beneficiaries" } }, "required": ["id", "productInstanceId", "productLifeId", "riskRatings", "name", "premium", "tranches", "beneficiaries"] } }, "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "detailType": { "type": "string", "description": "Type of the event detail" }, "noticedDate": { "type": "integer", "description": "Date when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Date when the event was effected (milliseconds since epoch)" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for the event" }, "policyCode": { "type": ["string", "null"], "description": "The code of the policy" }, "policyHolderId": { "type": ["string", "null"], "description": "The ID of the policyholder" }, "partnerId": { "type": ["string", "null"], "description": "The ID of the partner associated with the policy" }, "partnerName": { "type": ["string", "null"], "description": "The name of the partner associated with the policy" }, "packageId": { "type": ["string", "null"], "description": "The ID of the package associated with the policy" }, "packageName": { "type": ["string", "null"], "description": "The name of the package associated with the policy" }, "productCategoryId": { "type": ["string", "null"], "description": "The ID of the product category associated with the policy" }, "productCategoryName": { "type": ["string", "null"], "description": "The name of the product category associated with the policy" }, "division": { "type": ["string", "null"], "description": "The division associated with the policy" }, "subdivision": { "type": ["string", "null"], "description": "The subdivision associated with the policy" }, "collectionId": { "type": ["string", "null"], "format": "uuid", "description": "The collection ID associated with the policy" }, "collectionDaySelected": { "type": ["integer", "null"], "description": "The day selected for collections" }, "collectionFrequency": { "oneOf": [ { "$ref": "#/definitions/TemporalFrequency" }, { "type": "null" } ], "description": "The frequency of collections for the policy" }, "collectionAmount": { "oneOf": [ { "$ref": "#/definitions/Money" }, { "type": "null" } ], "description": "The amount to be collected in this ad-hoc collection" }, "policyPremium": { "oneOf": [ { "$ref": "#/definitions/Money" }, { "type": "null" } ], "description": "The total premium amount for the policy" }, "nextCollectionDate": { "type": ["integer", "null"], "description": "The next scheduled collection date for the policy (milliseconds since epoch)" }, "collectionProviderName": { "type": ["string", "null"], "description": "The name of the collection provider to be used" }, "products": { "oneOf": [ { "type": "array", "items": { "$ref": "#/definitions/ProductEventInfo" } }, { "type": "null" } ], "description": "A list of products associated with the policy at the time of event creation" }, "countryCode": { "type": ["string", "null"], "description": "Country code for collection command creation" } }, "required": [ "id", "correlationId", "detailType", "noticedDate", "effectedDate", "logicalClockReading" ] } --- id: PolicyBeneficiaryAddedEventV1 name: Policy Beneficiary Added Event version: 0.0.1 summary: Event emitted when a beneficiary is added to a policy owners: - digisure-engineering schemaPath: schema.json badges: - content: Beneficiary backgroundColor: orange textColor: white --- ## Overview The `PolicyBeneficiaryAddedEventV1` event is emitted when a new beneficiary is added to a policy. This event captures all relevant details about the beneficiary addition, including the policy and product instance the beneficiary is associated with, the percentage allocation assigned to the beneficiary, and who performed the addition. This event is essential for tracking beneficiary changes on policies and maintaining an accurate audit trail of all beneficiary-related modifications within the Policy Administration System. ### Key Fields - **policyId**: The unique identifier of the policy to which the beneficiary was added - **beneficiaryId**: The unique identifier of the newly added beneficiary - **productInstanceId**: The specific product instance within the policy that the beneficiary is linked to - **percentageAllocated**: The benefit percentage assigned to this beneficiary - **updatedBy**: The service or person who performed the beneficiary addition ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PolicyBeneficiaryAddedEventV1", "description": "Event emitted when a beneficiary is added to a policy", "type": "object", "required": [ "id", "correlationId", "detailType", "noticedDate", "effectedDate", "logicalClockReading", "policyId", "beneficiaryId", "productInstanceId", "percentageAllocated", "updatedBy" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "detailType": { "type": "string", "description": "Type of the event." }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "beneficiaryId": { "type": "string", "format": "uuid", "description": "Unique identifier for the beneficiary (UUID as string)" }, "productInstanceId": { "type": "string", "format": "uuid", "description": "Unique identifier for the product (UUID as string)" }, "percentageAllocated": { "type": "number", "description": "Percentage allocated to the beneficiary (serialized Percentage object)" }, "updatedBy": { "type": "string", "description": "The service/person who added the beneficiary." } } } --- id: PolicyBeneficiaryRemovedEventV1 name: Policy Beneficiary Removed Event version: 0.0.1 summary: Event emitted when a beneficiary is removed from a policy owners: - digisure-engineering schemaPath: schema.json badges: - content: Beneficiary backgroundColor: orange textColor: white --- ## Overview The `PolicyBeneficiaryRemovedEventV1` event is emitted when a beneficiary is removed from a policy. This event captures the details of the removal action, including which beneficiary was removed, from which policy and product instance, the reason for removal (if provided), and who performed the removal. This event is critical for maintaining compliance and audit trails when beneficiaries are removed from policies, whether due to policyholder requests, regulatory requirements, or other business reasons. ### Key Fields - **policyId**: The unique identifier of the policy from which the beneficiary was removed - **beneficiaryId**: The unique identifier of the removed beneficiary - **productInstanceId**: The specific product instance within the policy that the beneficiary was linked to - **removalReason**: An optional field capturing the reason for the beneficiary removal - **removedBy**: The service or person who performed the beneficiary removal ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PolicyBeneficiaryRemovedEventV1", "description": "Event emitted when a beneficiary is removed on a policy", "type": "object", "required": [ "id", "correlationId", "detailType", "noticedDate", "effectedDate", "logicalClockReading", "policyId", "productInstanceId", "beneficiaryId", "removedBy" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "detailType": { "type": "string", "description": "Type of the event." }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "productInstanceId": { "type": "string", "format": "uuid", "description": "Unique identifier for the product (UUID as string)" }, "beneficiaryId": { "type": "string", "format": "uuid", "description": "Unique identifier for the beneficiary (UUID as string)" }, "removalReason": { "type": ["string", "null"], "description": "Reason for a beneficiary getting removed" }, "removedBy": { "type": "string", "description": "The service/person who removed the beneficiary detail" } } } --- id: PolicyBeneficiaryUpdatedEventV1 name: Policy Beneficiary Updated Event version: 0.0.1 summary: Event emitted when a beneficiary is updated on a policy owners: - digisure-engineering schemaPath: schema.json badges: - content: Beneficiary backgroundColor: orange textColor: white --- ## Overview The `PolicyBeneficiaryUpdatedEventV1` event is emitted when an existing beneficiary's details are modified on a policy. This event captures what changes were made to the beneficiary, including the updated percentage allocation and a list of which specific fields were modified. This event enables downstream systems to react to beneficiary changes and maintain accurate records of all modifications made to beneficiary information over time. ### Key Fields - **policyId**: The unique identifier of the policy containing the updated beneficiary - **beneficiaryId**: The unique identifier of the beneficiary that was updated - **productInstanceId**: The specific product instance within the policy that the beneficiary is linked to - **percentageAllocated**: The updated benefit percentage assigned to this beneficiary - **updatedBy**: The service or person who performed the beneficiary update - **updatedFields**: An array of field names that were modified in this update, enabling consumers to understand exactly what changed ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PolicyBeneficiaryUpdatedEventV1", "description": "Event emitted when a beneficiary is updated on a policy", "type": "object", "required": [ "id", "correlationId", "detailType", "noticedDate", "effectedDate", "logicalClockReading", "policyId", "beneficiaryId", "productInstanceId", "percentageAllocated", "updatedBy", "updatedFields" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "detailType": { "type": "string", "description": "Type of the event." }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "beneficiaryId": { "type": "string", "format": "uuid", "description": "Unique identifier for the beneficiary (UUID as string)" }, "productInstanceId": { "type": "string", "format": "uuid", "description": "Unique identifier for the product (UUID as string)" }, "percentageAllocated": { "type": "number", "description": "Percentage allocated to the beneficiary (serialized Percentage object)" }, "updatedBy": { "type": "string", "description": "The service/person who updated the beneficiary detail" }, "updatedFields": { "type": "array", "items": { "type": "string" }, "description": "An array of string values representing the fields updated for a beneficiary" } } } --- id: PolicyBillingDateUpdatedEventV1 name: Policy Billing Date Updated Event version: 0.0.1 summary: Event emitted when a policy billing date is updated owners: - digisure-engineering schemaPath: schema.json badges: - content: Update backgroundColor: blue textColor: white --- ## Overview The `PolicyBillingDateUpdatedEventV1` event is emitted when the billing date for a policy is changed. This event captures the transition from the previous billing date to a new billing date, along with when the change becomes effective. ### When is this event emitted? This event is triggered when: - A policyholder requests a change to their billing date - Administrative adjustments are made to align billing cycles - Billing date is modified due to payment schedule optimization ### Why is this event important? This event enables downstream systems to: - Update billing and collection schedules - Adjust premium collection timing - Synchronize financial systems with new billing cycles - Notify relevant parties of billing schedule changes - Maintain accurate records for audit and compliance ### Key Fields | Field | Description | |-------|-------------| | `policyId` | The unique identifier of the policy being updated | | `previousBillingDate` | The original billing date before the change | | `newBillingDate` | The updated billing date | | `effectiveFrom` | When the new billing date becomes effective | | `updatedBy` | The user or system that initiated the update | ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PolicyBillingDateUpdatedEventV1", "description": "Event emitted when a policy billing date is updated.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "policyId", "previousBillingDate", "newBillingDate", "effectiveFrom" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event." }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "previousBillingDate": { "type": "integer", "description": "The date at which billing was previously sent (milliseconds since epoch)" }, "newBillingDate": { "type": "integer", "description": "The new billing date to update to (milliseconds since epoch)" }, "effectiveFrom": { "type": "integer", "description": "The date at which the new billing date will take effect (milliseconds since epoch)" }, "updatedBy": { "type": ["null", "string"], "description": "Who updated the policy" } } } --- id: PolicyCancelledEventV1 name: Policy Cancelled Event version: 0.0.1 summary: Event emitted when an insurance policy is cancelled. owners: - digisure-engineering schemaPath: schema.json badges: - content: Lifecycle backgroundColor: purple textColor: white --- ## Overview The `PolicyCancelledEventV1` event is emitted by the PolicyService when an insurance policy is cancelled. This event signifies a terminal state in the policy lifecycle and contains details about the cancellation including the reason, any applicable refunds, and the financial state at the time of cancellation. ## When is this event emitted? This event is published when: - A policyholder requests cancellation of their policy - An administrator cancels a policy on behalf of the policyholder - A policy is cancelled due to non-payment after exhausting grace periods - A policy is cancelled due to fraud or misrepresentation ## Key Information The event payload includes: - **Event Metadata**: Event ID, correlation ID, timestamps for noticed and effected dates - **Policy Identification**: Policy ID and policy status at cancellation - **Cancellation Details**: Cancellation date, reason, who requested it, and who approved it - **Financial Information**: Refund amount and financial details at the time of cancellation - **Policyholder**: Policy holder identifier ## Downstream Consumers Systems that typically consume this event include: - Billing systems (to stop collections and process refunds) - Customer communication services (to send cancellation confirmations) - Reporting and analytics platforms - Partner systems (to update policy status) - Claims systems (to close any open claims) ## Schemas ## Raw Schema:schema.json { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "PolicyCancelledEventV1", "title": "PolicyCancelledEventV1", "description": "Event emitted when a policy is cancelled.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "policyId", "cancellationDate", "refundAmount", "cancellationReason" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event." }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "requestedBy": { "type": [ "null", "string" ], "description": "Who requested the cancellation." }, "approvedBy": { "type": [ "null", "string" ], "description": "Who approved the cancellation." }, "cancellationDate": { "type": "integer", "description": "Timestamp when the cancellation took effect (milliseconds since epoch)" }, "refundAmount": { "$ref": "#/$defs/Money", "description": "The refund amount." }, "cancellationReason": { "type": "string", "description": "The reason for the cancellation of the policy." }, "policyFinancialDetail": { "oneOf": [ { "type": "null" }, { "$ref": "#/$defs/PolicyFinancialDetail" } ], "description": "Financial details captured when the policy was cancelled." }, "policyHolderId": { "type": [ "null", "string" ], "format": "uuid", "description": "Unique identifier for the policy holder (UUID as string)" }, "policyStatus": { "type": [ "null", "string" ], "description": "Status of the policy at cancellation time" } }, "$defs": { "Money": { "type": "object", "required": [ "amount", "currency" ], "properties": { "amount": { "type": "integer", "description": "Amount in smallest currency unit - cents" }, "currency": { "type": "string" } } }, "TemporalInterval": { "type": "object", "required": [ "unit", "value" ], "properties": { "unit": { "type": "string", "enum": [ "NANOS", "MICROS", "MILLIS", "SECONDS", "MINUTES", "HOURS", "HALF_DAYS", "DAYS", "WEEKS", "MONTHS", "YEARS", "DECADES", "CENTURIES", "MILLENNIA", "ERAS", "FOREVER" ], "description": "The temporal unit for the interval" }, "value": { "type": "integer", "description": "The value for the temporal interval" } } }, "TemporalFrequency": { "type": "object", "required": [ "recurrence", "interval" ], "properties": { "recurrence": { "type": "string", "enum": [ "RECURRING", "ONCE" ], "description": "Indicates how the interval recurs" }, "interval": { "$ref": "#/$defs/TemporalInterval", "description": "Interval for the frequency" } } }, "BankDetails": { "type": "object", "required": [ "bankAccountName", "bankName", "bankAccountNumber" ], "properties": { "bankAccountName": { "type": "string", "description": "Name on the bank account" }, "bankName": { "type": "string", "description": "Name of the bank" }, "bankAccountNumber": { "type": "string", "description": "Bank account number" }, "bankBranch": { "type": [ "null", "string" ], "description": "Bank branch information" }, "accountType": { "type": [ "null", "string" ], "description": "Type of bank account" } } }, "CollectionSchedule": { "type": "object", "required": [ "scheduleId", "createdAt", "isActive" ], "properties": { "scheduleId": { "type": "string", "format": "uuid", "description": "Identifier of the collection schedule" }, "createdAt": { "type": "integer", "description": "Timestamp when the schedule entry was created (milliseconds since epoch)" }, "isActive": { "type": "boolean", "description": "Indicates if the schedule is active" }, "scheduleActivatedAt": { "type": [ "null", "integer" ], "description": "Timestamp when the schedule became active (milliseconds since epoch)" } } }, "PolicyFinancialDetail": { "type": "object", "required": [ "policyBalance" ], "properties": { "policyBalance": { "$ref": "#/$defs/Money", "description": "Current balance of the policy" }, "nextCollectionDate": { "type": [ "null", "integer" ], "description": "Next collection date for the policy (milliseconds since epoch)" }, "bankDetails": { "oneOf": [ { "type": "null" }, { "$ref": "#/$defs/BankDetails" } ], "description": "Bank details for collection" }, "collectionFrequency": { "oneOf": [ { "type": "null" }, { "$ref": "#/$defs/TemporalFrequency" } ], "description": "Frequency of collection" }, "collectionDaySelected": { "type": [ "null", "integer" ], "description": "Day of the month selected for collection" }, "collectionMethod": { "type": [ "null", "string" ], "description": "Method of collection (e.g., DIRECT_DEBIT, PARTNER_COLLECTION)" }, "collectionProviderName": { "type": [ "null", "string" ], "description": "Name of the collection provider" }, "collectionId": { "type": [ "null", "string" ], "format": "uuid", "description": "Unique identifier for the collection" }, "sourceOfFunds": { "type": [ "null", "string" ], "description": "Source of funds for the policy" }, "collectionSchedules": { "type": [ "null", "array" ], "description": "Collection schedules associated to the policy", "items": { "$ref": "#/$defs/CollectionSchedule" } }, "globalCounters": { "oneOf": [ { "type": "null" }, { "$ref": "#/$defs/GlobalCounters" } ], "description": "Global counters tracking collection attempts and client actions" } } }, "GlobalCounters": { "type": "object", "properties": { "collectionMonthsTotal": { "type": [ "null", "integer" ], "description": "Total number of collection months" }, "collectionAttemptedMonthsTotal": { "type": [ "null", "integer" ], "description": "Total number of months where collection was attempted" }, "runningBalanceFail": { "type": [ "null", "integer" ], "description": "Count of failed running balance attempts" }, "runningBalanceSuccess": { "type": [ "null", "integer" ], "description": "Count of successful running balance attempts" }, "runningBalanceSkip": { "type": [ "null", "integer" ], "description": "Count of skipped running balance attempts" }, "runningBalanceOther": { "type": [ "null", "integer" ], "description": "Count of other running balance outcomes" }, "noOfClientCancellations": { "type": [ "null", "integer" ], "description": "Number of client-initiated cancellations" }, "noOfClientReinstatements": { "type": [ "null", "integer" ], "description": "Number of client-initiated reinstatements" }, "noOfClientPauses": { "type": [ "null", "integer" ], "description": "Number of client-initiated pauses" } } } } } --- id: PolicyCollectionAnalysisEventV1 name: Policy Collection Analysis version: 0.0.1 summary: Event emitted when the premium collection command is run for analysis purposes owners: - digisure-engineering schemaPath: schema.json badges: - content: Collection backgroundColor: green textColor: white --- ## Overview The `PolicyCollectionAnalysisEventV1` event is emitted when the premium collection command is executed. This event provides detailed analysis data about a collection transaction, including comprehensive information about the policy, products, and collection configuration. This event is part of the collection workflow and serves as a rich data source for analytics, reporting, and downstream processing of collection-related information. ### Collection Workflow Context The premium collection workflow involves several stages: 1. **Collection Scheduling** - The system schedules premium collections based on the policy's billing date and collection frequency 2. **Collection Command Execution** - When a collection command runs, this analysis event is emitted 3. **Collection Processing** - The collection provider processes the payment request 4. **Outcome Recording** - Success or failure events are published based on the result This event is emitted during step 2, providing a comprehensive snapshot of the collection context at the time the command is executed. It includes: - Policy and policyholder details - Partner and package information - Product breakdown with individual premiums - Collection frequency and scheduling details - Transaction amount and type ### Key Fields - **transactionAmount** / **policyPremium** - The monetary values involved in the collection - **productData** - Array containing details about each product and its premium contribution - **collectionFrequency** - The recurring schedule for collections (e.g., monthly, weekly) - **transactionExternalReason** - External reason code for the transaction ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PolicyCollectionAnalysisEventV1", "type": "object", "description": "Event emitted when the premium collection command is run.", "definitions": { "Money": { "type": "object", "properties": { "amount": { "type": "integer", "description": "Amount in smallest currency unit - cents" }, "currency": { "type": "string", "description": "ISO 4217 currency code" } }, "required": ["amount", "currency"] }, "TemporalInterval": { "type": "object", "properties": { "unit": { "type": "string", "enum": ["NANOS", "MICROS", "MILLIS", "SECONDS", "MINUTES", "HOURS", "HALF_DAYS", "DAYS", "WEEKS", "MONTHS", "YEARS", "DECADES", "CENTURIES", "MILLENNIA", "ERAS", "FOREVER"], "description": "The temporal unit for the interval" }, "value": { "type": "integer", "description": "The value for the temporal interval" } }, "required": ["unit", "value"] }, "TemporalFrequency": { "type": "object", "properties": { "recurrence": { "type": "string", "enum": ["RECURRING", "ONCE"], "description": "Indicates how the interval recurs" }, "interval": { "$ref": "#/definitions/TemporalInterval", "description": "Interval for the frequency" } }, "required": ["recurrence", "interval"] }, "ProductData": { "type": "object", "properties": { "productId": { "type": "string", "format": "uuid", "description": "Unique identifier for the product (UUID as string)" }, "productName": { "type": ["string", "null"], "description": "Name of the product" }, "productPremium": { "$ref": "#/definitions/Money", "description": "Premium amount for the product" } }, "required": ["productId", "productPremium"] } }, "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": ["string", "null"], "description": "Type of the event" }, "logicalClockReading": { "type": ["integer", "null"], "description": "Logical clock reading for event ordering" }, "policyCode": { "type": "string", "description": "Unique policy code" }, "correlationId": { "type": ["string", "null"], "format": "uuid", "description": "The correlationId (UUID as string)" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "partnerId": { "type": "string", "format": "uuid", "description": "Unique identifier for the partner (UUID as string)" }, "partnerName": { "type": ["string", "null"], "description": "Name of the partner" }, "productCategoryId": { "type": "string", "format": "uuid", "description": "Identifier for the product category (UUID as string)" }, "productCategoryName": { "type": ["string", "null"], "description": "Name for the product category" }, "packageId": { "type": "string", "format": "uuid", "description": "Identifier for the package (UUID as string)" }, "packageName": { "type": "string", "description": "Name of the package" }, "policyHolderId": { "type": "string", "format": "uuid", "description": "Identifier for the policy holder (UUID as string)" }, "divisionName": { "type": ["string", "null"], "description": "Division name" }, "subDivisionName": { "type": ["string", "null"], "description": "Subdivision name" }, "transactionDate": { "type": ["integer", "null"], "description": "Date/time of the transaction (milliseconds since epoch)" }, "nextCollectionDate": { "type": ["integer", "null"], "description": "Next collection date/time (milliseconds since epoch)" }, "transactionAmount": { "$ref": "#/definitions/Money", "description": "Transaction amount" }, "transactionType": { "type": "string", "description": "Type of transaction" }, "policyPremium": { "$ref": "#/definitions/Money", "description": "Premium amount for the policy" }, "transactionExternalReason": { "type": "string", "description": "External reason for the transaction" }, "originCountry": { "type": "string", "description": "Origin country code" }, "productData": { "type": "array", "items": { "$ref": "#/definitions/ProductData" }, "description": "List of product data" }, "collectionId": { "type": ["string", "null"], "format": "uuid", "description": "Unique identifier for the collection" }, "collectionDay": { "type": ["integer", "null"], "description": "Selected collection day of month" }, "collectionFrequency": { "$ref": "#/definitions/TemporalFrequency", "description": "Frequency of the collection" }, "provider": { "type": ["string", "null"], "description": "Collection provider" } }, "required": [ "id", "noticedDate", "effectedDate", "policyCode", "policyId", "partnerId", "productCategoryId", "packageId", "packageName", "policyHolderId", "transactionAmount", "transactionType", "policyPremium", "transactionExternalReason", "originCountry", "productData", "collectionFrequency" ] } --- id: PolicyCollectionDetailsUpdatedEventV1 name: Policy Collection Details Updated Event version: 0.0.1 summary: Event emitted when collection details on a policy are updated owners: - digisure-engineering schemaPath: schema.json badges: - content: Update backgroundColor: blue textColor: white --- ## Overview The `PolicyCollectionDetailsUpdatedEventV1` event is emitted when payment collection details associated with a policy are modified. This includes changes to banking information used for premium collection. ### When is this event emitted? This event is triggered when: - A policyholder updates their bank account details - The collection method is changed (e.g., switching banks) - Bank account holder information is modified - Branch code or account type is updated ### Why is this event important? This event enables downstream systems to: - Update payment collection systems with new banking details - Ensure premium collections are directed to the correct account - Maintain compliance with financial regulations - Trigger verification workflows for new banking details ### Key Fields | Field | Description | |-------|-------------| | `policyId` | The unique identifier of the policy being updated | | `collectionMethod` | The method used to collect premiums | | `bankName` | Name of the bank for premium collection | | `accountNumber` | Obfuscated bank account number for security | | `accountType` | Type of bank account (e.g., savings, checking) | | `branchCode` | Bank branch code for routing | | `accountHolderName` | Obfuscated name of the account holder | ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PolicyCollectionDetailsUpdatedEventV1", "description": "Event emitted when collection details are updated.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "policyId", "collectionMethod", "bankName", "accountNumber", "branchCode", "accountHolderName" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event." }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "collectionMethod": { "type": "string", "description": "Collection method" }, "bankName": { "type": "string", "description": "Bank name" }, "accountNumber": { "type": "string", "description": "Obfuscated bank account number" }, "accountType": { "type": ["null", "string"], "description": "Type of bank account" }, "branchCode": { "type": "string", "description": "Bank branch code" }, "accountHolderName": { "type": "string", "description": "Obfuscated account holder name" } } } --- id: PolicyCoveredLifeDeceasedEventV1 name: Policy Covered Life Deceased Event version: 0.0.1 summary: Event emitted when a covered life on a funeral policy is marked as deceased owners: - digisure-engineering schemaPath: schema.json badges: - content: Other backgroundColor: gray textColor: white --- ## Overview The `PolicyCoveredLifeDeceasedEventV1` event is emitted when a covered life on a funeral policy is marked as deceased. This event captures the critical information needed to process claims and adjust policy premiums following the death of an insured person. ### When is this event emitted? This event is triggered when: - A covered life (insured person) on the policy is reported and confirmed as deceased - The policy administration system processes the death notification and updates the policy accordingly ### Why is this event important? This event enables downstream systems to: - Initiate claims processing workflows for the deceased covered life - Update premium calculations to reflect the removal of the deceased person from coverage - Trigger notifications to beneficiaries and relevant parties - Maintain accurate policy records and audit trails - Update billing systems with the new premium amount ### Key Fields | Field | Description | |-------|-------------| | `policyId` | The unique identifier of the policy affected by the death | | `policyCode` | The policy code associated with the policy | | `policyHolderId` | The unique identifier of the policy holder | | `deceasedCoveredLifeId` | The unique identifier of the covered life that was declared deceased | | `lapseType` | The type of lapse affecting the policy | | `billingRef` | The billing reference for the policy | | `policyPremiumBefore` | The policy premium amount before the covered life was marked as deceased | | `policyPremiumAfter` | The policy premium amount after the covered life was marked as deceased | | `countryCode` | The country code for the policy | ## Schemas ## Raw Schema:schema.json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PolicyCoveredLifeDeceasedEventV1", "description": "Event emitted when a covered life on a funeral policy is marked as deceased.", "type": "object", "required": [ "id", "correlationId", "noticedDate", "effectedDate", "detailType", "logicalClockReading", "policyId", "policyCode", "policyHolderId", "deceasedCoveredLifeId", "lapseType", "billingRef", "policyPremiumBefore", "policyPremiumAfter", "countryCode" ], "properties": { "id": { "type": "string", "format": "uuid", "description": "Unique identifier for the event (UUID as string)" }, "correlationId": { "type": "string", "format": "uuid", "description": "Correlation identifier for the event (UUID as string)" }, "noticedDate": { "type": "integer", "description": "Timestamp when the event was noticed (milliseconds since epoch)" }, "effectedDate": { "type": "integer", "description": "Timestamp when the event took effect (milliseconds since epoch)" }, "detailType": { "type": "string", "description": "Type of the event." }, "logicalClockReading": { "type": "integer", "description": "Logical clock reading for event ordering" }, "policyId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy (UUID as string)" }, "policyCode": { "type": "string", "description": "Policy code associated with the policy" }, "policyHolderId": { "type": "string", "format": "uuid", "description": "Unique identifier for the policy holder" }, "deceasedCoveredLifeId": { "type": "string", "format": "uuid", "description": "Unique identifier for the covered life that was declared deceased" }, "lapseType": { "type": "string", "description": "Type of lapse affecting the policy" }, "billingRef": { "type": "string", "description": "Billing reference for the policy" }, "policyPremiumBefore": { "type": "object", "description": "The policy premium before the covered life was marked as deceased", "required": ["amount", "currency"], "properties": { "amount": { "type": "integer", "description": "Amount in smallest currency unit - cents" }, "currency": { "type": "string", "description": "Currency code" } } }, "policyPremiumAfter": { "type": "object", "description": "The policy premium after the covered life was marked as deceased", "required": ["amount", "currency"], "properties": { "amount": { "type": "integer", "description": "Amount in smallest currency unit - cents" }, "currency": { "type": "string", "description": "Currency code" } } }, "countryCode": { "type": "string", "description": "Country code for the policy." } } } --- id: PolicyCoverEscalationAppliedEventV1 name: Policy Cover Escalation Applied version: 0.0.1 summary: Event emitted when a cover escalation is applied to a policy owners: - digisure-engineering schemaPath: schema.json badges: - content: Cover backgroundColor: teal textColor: white - content: Escalation backgroundColor: purple textColor: white --- import Footer from '@catalog/components/footer.astro' ## Overview The `PolicyCoverEscalationAppliedEventV1` event is emitted when a cover escalation is applied to a policy. Cover escalation is a mechanism that automatically increases the coverage amount on a policy at defined intervals, helping policyholders maintain adequate protection against inflation and rising costs. ## Understanding Cover Escalation Cover escalation ensures that the policy's coverage keeps pace with economic changes: - **Percentage-based increase**: The cover amount increases by a defined percentage (e.g., 5% annually) - **Interval-driven**: Escalations occur at regular intervals (typically annually) - **Automatic application**: Once configured, escalations are applied automatically without policyholder intervention ### Key Differences from Premium Escalation While cover escalation increases the benefit amount, premium escalation increases the premium paid. These can be applied independently or together: | Escalation Type | What Changes | Impact | |----------------|--------------|--------| | Cover Escalation | Benefit/coverage amount | Higher payout on claims | | Premium Escalation | Premium payments | Higher monthly/annual cost | ## Event Fields The event captures: - **Previous and new cover amounts**: Track the change in coverage - **Escalation details**: Percentage and interval of the escalation - **Escalation reason and type**: Context for why the escalation occurred ## Schemas