fix(condo): DOMA-13340 subscription domain fixes#7714
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (19)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (13)
📝 WalkthroughWalkthroughThis PR refactors subscription expiration/days-remaining logic by shifting computation from the ChangesSubscription Days Remaining Refactoring
🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b2b27f907
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/condo/domains/subscription/schema/SubscriptionContext.js`:
- Around line 267-287: Only run the overlap check when the record's next status
will be DONE: compute nextStatus = resolvedData.status ?? existingItem.status
and if nextStatus !== SUBSCRIPTION_CONTEXT_STATUS.DONE skip the overlap query.
Modify the block using existingItem, resolvedData and operation so you gate
building the overlapFilter (and the find('SubscriptionContext',
...)/overlappingSubscriptions check) behind this nextStatus ===
SUBSCRIPTION_CONTEXT_STATUS.DONE condition; keep the existing id_not logic for
updates unchanged.
In `@apps/condo/schema.graphql`:
- Around line 109842-109843: Update the user-facing translation for
PRICING_RULE_NOT_FOUND so it matches the actual "not found" semantics: edit the
i18n entries for
api.subscription.registerSubscriptionContext.PRICING_RULE_NOT_FOUND in
apps/condo/lang/en/en.json and apps/condo/lang/es/es.json to remove the "or is
hidden" clause so the messageForUser equals "Subscription plan pricing rule not
found" (consistent with the schema.graphql `message` and the behavior asserted
in RegisterSubscriptionContextService.test.js), then regenerate any derived
schema/translation outputs (and re-run build/tests) so schema.graphql and
generated artifacts reflect the updated translations.
In `@apps/condo/schema.ts`:
- Around line 49777-49778: Update the user-facing error mapping for the
"Subscription plan pricing rule not found" entry: locate the mapping object that
has "message": "Subscription plan pricing rule not found" and change its
messageForUser value to remove the "or is hidden" clause (e.g., set
messageForUser to "Subscription plan pricing rule not found") so the generated
schema and runtime payload reflect the new semantics that hidden pricing rules
are allowed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: af3ff224-3c13-4cce-b8ee-2e78bcbfdeaa
📒 Files selected for processing (16)
apps/condo/domains/notification/hooks/useSubscriptionExpirationNotification.tsapps/condo/domains/organization/schema/Organization.test.jsapps/condo/domains/subscription/components/SubscriptionDaysIndicator.tsxapps/condo/domains/subscription/components/SubscriptionSettingsContent/SubscriptionPlanCard/SubscriptionPlanCard.tsxapps/condo/domains/subscription/gql.jsapps/condo/domains/subscription/hooks/useOrganizationSubscription.tsapps/condo/domains/subscription/queries/SubscriptionContext.graphqlapps/condo/domains/subscription/schema/RegisterSubscriptionContextService.jsapps/condo/domains/subscription/schema/RegisterSubscriptionContextService.test.jsapps/condo/domains/subscription/schema/SubscriptionContext.jsapps/condo/domains/subscription/schema/SubscriptionContext.test.jsapps/condo/domains/subscription/schema/SubscriptionPlan.jsapps/condo/gql/index.tsapps/condo/gql/operation.types.tsapps/condo/schema.graphqlapps/condo/schema.ts
9b2b27f to
95b6e96
Compare
|



Summary
SubscriptionContext.daysRemaining— was redundant and unuseduseOrganizationSubscriptionto exposeactiveSubscriptionEndAt(string)and
activeSubscriptionEndAtWithoutBuffer(Dayjs) instead ofdaysRemaining/daysRemainingWithoutBuffer; each consumer computes days locally — eliminatesinconsistency between components where some used buffered dates and others didn't
SubscriptionDaysIndicator: no longer shows "0 days" after subscription fully expiressubscriptionPlanPricingRule.nameinstead of "Paid until Jan 26, 2126"
SubscriptionContextto run on update → DONE transitions,not only on create
activeSubscriptionEndAtchainingSummary by CodeRabbit
Bug Fixes
New Features
Refactor