Repository navigation
Add an admin-set full feature access override for shopkeepers - #159
Merged
Merged
Conversation
Port feature_access_state from myturntagapi so the paid clients can unlock every paid feature without a purchase: testing on production, staff/partner/comp accounts and App Review demo accounts. - shopkeepers.feature_access_state enum (normal_feature_access 1 default, all_feature_access 2), indexed, editable only in madmin - Sign-in returns feature_access_state and account_owner_feature_access_state; accounts return owner_feature_access_state - Tests: madmin can set it; sign-up and PATCH /shopkeeper_auth ignore it; serializers return the owner's state - OpenAPI, README, AGENTS.md and CHANGELOG document the override and RevenueCat promotional entitlements as the no-code alternative Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016JZoj1UtkFVFNcwoDfdb9f
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
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.
Summary
Ports MyTurnTag's
feature_access_stateoverride from myturntagapi so the paid iOS/Android clients can unlock every paid feature without a purchase: testing on production, staff/partner/comp accounts, and App Review demo accounts.shopkeepers.feature_access_stateenum:normal_feature_access(1, default) /all_feature_access(2),null: false, indexed. Same names and values as myturntagapi./madmin(ShopkeeperResource). Not permitted in sign-up orPATCH /shopkeeper_auth.ShopkeeperSignInSerializer) returnsfeature_access_stateandaccount_owner_feature_access_state; accounts (AccountSerializer) returnowner_feature_access_state. The paid clients read these exact field names and string values. The accounts index already preloadsowner, so this adds no queries.oneisnormal_feature_access,twoisall_feature_access, so tests cover both values.Tests
madmin_test: the shopkeeper edit form, submitted as the browser sends it, setsall_feature_accessregistrations_controller_test: sign-up andPATCH /shopkeeper_authwithfeature_access_state: "all_feature_access"both leave itnormal_feature_accessTo confirm each new test can fail, I permitted the param in both devise sanitizers, removed the madmin attribute and hard-coded the serializer values. All 6 new tests went red, then green again once the code was restored.
Local results:
bin/rails test(643 runs, 0 failures),bin/rubocop,erb_lint,brakeman,bundler-auditandRAILS_ENV=test db:seed_fuall pass. I also ran a dev server and set the override on a seeded shopkeeper. Sign-in andGET /accountsreturnedall_feature_access, and aPATCH /shopkeeper_auththat tried to change it was ignored.🤖 Generated with Claude Code
https://claude.ai/code/session_016JZoj1UtkFVFNcwoDfdb9f