Linked Jackpots
This feature allows jackpot instances to be linked together so that a contribution to one instance automatically results in a contribution to all linked instances. It is particularly useful in scenarios where multiple jackpots exist within a single game, for example Daily, Weekly, and Monthly raffles.
Previously, contributions had to be submitted individually for each jackpot instance. With this feature, links can be predefined, allowing a single request to result in a contribution to all associated instances.
API Version Compatability
Linked instances are supported only by the v2 contribution APIs, as this feature introduces a breaking change in the synchronous contribution response structure.
Automatic Contribution Propagation
A contribution to an instance is automatically applied to all directly linked jackpots. Only the links defined for the target instance (the instance being contributed to) are honored.
Failure Handling
- If the contribution to the main instance fails, contributions to linked instances will not be attempted.
- If a linked instance contribution fails (e.g., due to missing opt-in or validation failure), other linked instances will still be processed normally.
Opt-in Requirement
Opt-ins are not automatically propagated to linked instances. If a linked instance requires explicit opt-in, and the opt-in has not occurred, the contribution to that instance will fail with an error.
Example Scenarios
- Scenario 1: Weekly and Monthly raffles are linked to Daily raffle.
- A contribution to Daily raffle propagates to Daily, Weekly, and Monthly.
- Scenario 2: Weekly is linked to Daily, and Monthly is linked to Weekly.
- A contribution to Daily applies to Daily and Weekly, but not Monthly, since Monthly is not directly linked to Daily.
- Scenario 3: Weekly requires explicit opt-in, and the user has not opted in.
- A contribution to Daily would result in an error for Weekly, but other linked instances (e.g., Monthly) would still process normally.
Managing Instance Links
Instance links are defined in linked_instances
collection in thrillpots service database and can be managed via the following CRUD APIs:
- Retrieve links for an instance
- Returns all linked jackpots defined for a given instance
- Set links for an instance
- Updates an instance's links based on the provided input.
- Delete links for an instance
- Removes all existing links for a given instance.
OAS and Swagger documentation
For more details on using this functionality, refer to the API documentation