-
Notifications
You must be signed in to change notification settings - Fork 126
feat(entitlement): Attach features to plans #3899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fde9347
to
a610e09
Compare
julienbourdeau
commented
Jul 3, 2025
524910c
to
3e42154
Compare
groyoh
approved these changes
Jul 3, 2025
spec/serializers/v1/entitlement/plan_entitlement_serializer_spec.rb
Outdated
Show resolved
Hide resolved
3bc26fb
to
e384459
Compare
groyoh
approved these changes
Jul 3, 2025
e384459
to
ee20620
Compare
ee20620
to
8144804
Compare
8144804
to
8262634
Compare
diegocharles
pushed a commit
that referenced
this pull request
Jul 11, 2025
This PR follows #3873 It adds a way to attach features and privilges to a plan. In serialized plans, you get ```rb "entitlements" => [ { "code" => "seats", "name" => "Seats", "description" => "Nb users", "privileges" => { "max" => { "code" => "max", "name" => nil, "value_type" => "integer", "value" => 100, # <<------- "config" => {} } } } ] ``` **Now, the core is only missing the subscription override.**  ``` Prefix Verb URI Pattern Controller#Action api_v1_plan_entitlement_privilege DELETE /api/v1/plans/:plan_code/entitlements/:entitlement_code/privileges/:code(.:format) api/v1/plans/entitlements/privileges#destroy {code: /.*/, plan_code: /.*/, entitlement_code: /.*/} api_v1_plan_entitlements GET /api/v1/plans/:plan_code/entitlements(.:format) api/v1/plans/entitlements#index {plan_code: /.*/} POST /api/v1/plans/:plan_code/entitlements(.:format) api/v1/plans/entitlements#create {plan_code: /.*/} api_v1_plan_entitlement GET /api/v1/plans/:plan_code/entitlements/:code(.:format) api/v1/plans/entitlements#show {code: /.*/, plan_code: /.*/} PATCH /api/v1/plans/:plan_code/entitlements/:code(.:format) api/v1/plans/entitlements#update {code: /.*/, plan_code: /.*/} PUT /api/v1/plans/:plan_code/entitlements/:code(.:format) api/v1/plans/entitlements#update {code: /.*/, plan_code: /.*/} DELETE /api/v1/plans/:plan_code/entitlements/:code(.:format) api/v1/plans/entitlements#destroy {code: /.*/, plan_code: /.*/} ``` ### Next PR * Dispatch `plan.updated` webhooks * Create and dispatch `feature.*` webhooks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR follows #3873
It adds a way to attach features and privilges to a plan.
In serialized plans, you get
Now, the core is only missing the subscription override.
Next PR
plan.updated
webhooksfeature.*
webhooks