fix: default new workspace to Control for annual subscription users#84095
fix: default new workspace to Control for annual subscription users#84095
Conversation
Annual subscription users are billed at the Control rate, so new workspaces should be created as Control (corporate) instead of Collect (team). This adds an annual subscription check alongside the existing invoicing subscription check. Co-authored-by: Jason Mills <JmillsExpensify@users.noreply.github.com>
The test created a flight departing "today at 23:00" which was already in the past when CI ran after that hour. Changed to depart tomorrow at noon so the test is not sensitive to time of day. Co-authored-by: Jason Mills <JmillsExpensify@users.noreply.github.com>
|
Fixed the failing check. The Root cause: The test "should exclude reservation that departed yesterday" created a flight departing "today at 23:00 UTC" ( Fix: Changed the "upcoming" flight to depart tomorrow at noon ( |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Explanation of Change
When a user has an annual subscription, they are billed at the Control rate. New workspaces created by these users should default to Control (corporate) type instead of Collect (team) type.
The codebase already has a
shouldCreateControlPolicyflag that creates Control workspaces for invoicing subscription users. This PR extends that check to also cover annual subscription users.Context: The original fix (#67477) was merged in Aug 2025 but was reverted because it exposed a backend bug where the
CreateWorkspaceAPI didn't return rules data for Control policies (Expensify/Expensify#545433). That backend fix has now been deployed to production (Mar 3, 2026), so this FE change can safely be re-applied.Fixed Issues
$ #65697
PROPOSAL: #65697 (comment)
Tests
Precondition: Account is on an annual subscription
Offline tests
N/A — workspace creation already has offline handling. The subscription type is read from local Onyx data, so the Control policy determination works offline.
QA Steps
Precondition: Account is on an annual subscription
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — logic-only change, no UI modifications
Android: mWeb Chrome
N/A — logic-only change, no UI modifications
iOS: Native
N/A — logic-only change, no UI modifications
iOS: mWeb Safari
N/A — logic-only change, no UI modifications
MacOS: Chrome / Safari
N/A — logic-only change, no UI modifications