Add Tier Downgrade Support for Case Retention Policy with Auto-Adjustment and Admin Warning#8773
Open
sanjacornelius wants to merge 4 commits intoepic/FOUR-29101from
Open
Add Tier Downgrade Support for Case Retention Policy with Auto-Adjustment and Admin Warning#8773sanjacornelius wants to merge 4 commits intoepic/FOUR-29101from
sanjacornelius wants to merge 4 commits intoepic/FOUR-29101from
Conversation
…egration Introduce CaseRetentionTierService to manage tier-driven case retention rules and notices. Integrate the service into ProcessController to expose an admin-only adjustment notice flag, clear notice properties when an admin changes retention_period, and preserve notice keys when restoring process properties. Update EvaluateProcessRetentionJob to clamp process retention to the current tier (logging and refreshing the model when a clamp occurs). The service provides allowed-period lookup, period normalization, a 24-hour admin notice window, and a clamp operation that updates retention_period, retention_updated_at, clears retention_updated_by, and records when to show the notice.
Insert an English translation entry informing users that case retention was automatically shortened to match their subscription tier and that the new retention period applies immediately.
Resolve allowed retention periods once in the command and pass them to the queued job to avoid re-resolving per process. Add PERIOD_MONTHS and longestAllowedPeriod() to determine the longest period by duration (not array order). Update EvaluateProcessRetentionJob to accept optional tierAllowedPeriods and clampProcessRetentionToCurrentTier() to use the provided list when present; clamp now sets the retention to the longest allowed period. Minor docblock and logging updates.
Add a boolean case_retention_tier_adjustment_notice field to the Process API resource (defaults to false) so clients can detect when case retention was automatically shortened to match the subscription tier. Update the frontend ProcessMixin to append a localized warning message to process.warningMessages when this flag is true, informing users the new retention period applies immediately.
|
Contributor
|
QA server K8S was successfully deployed https://ci-b9748f55a0.engk8s.processmaker.net |
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.




Issue & Reproduction Steps
This PR implements support for handling tier downgrades in the Case Retention Policy. When a client downgrades their tier, any configured process retention periods that exceed the new tier’s maximum limit are automatically adjusted to comply with the new constraints.
Additionally, a warning message is surfaced to admin users for a 24-hour period to notify them of the automatic adjustment.
Solution
CaseRetentionTierServiceto:How to Test
six_months,one_year,three_years,five_yearsphp artisan optimize:clearTENANT=[TENANT_ID] php artisan cases:retention:evaluateRelated Tickets & Packages
ci:deploy
Code Review Checklist