sample-stores
sample-stores copied to clipboard
adding stripe modular example
Description
This example models a few of Stripe's core functionality, but not everything. It introduces another modular models example splitting the model into 3 modules:
-
accounts.fga
- core Stripe account functionality -
payments.fga
- (yet to be implemented) -
issuing.fga
- credit card issuing and transactions
It also introduces modeling concepts such as "self-defining" relationships, "dual-write" relationships, and "intermediate" relationships. It also uses exclusions and conditions.
It includes tests for two scenarios:
- SCENARIO 1: An account manages 2 cards, assigned to users Raghd and Jon. Raghd's card is active and makes two purchases. Jon's card is inactive and makes one purchase
- SCENARIO 2: A Stripe account (in test mode) manages one active card that tries to make a purchase.
- [ ] Working on writing a README.md for the sample store.
Review Checklist
- [ ] I have clicked on "allow edits by maintainers".
- [ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
- [ ] The correct base branch is being used, if not
main
- [ ] I have added tests to validate that the change in functionality is working as expected