E2E SCENARIOS — LICENSE & SUBSCRIPTION
VietGara — Release 1.0–1.1 · Version 1.0 — September 28, 2026
Covers FR-LIC-01, 02, 04 and 05, and FR-NOT-04 (expiry reminder). The daily transaction limit is enforced from Release 1.2 and is not tested here. Plans and users are in 00_Test_Data.md; time-moving SQL helpers H1–H5 are in README §3.4.
Subscription states, as the owner web names them:
| State | Meaning | Garages |
|---|---|---|
| Trial | 14 days from e-mail verification | Full use |
| Active | A plan was chosen or the subscription was extended | Full use |
| Past due (read-only) | The period ended; 7-day grace period | Data can be viewed, not changed |
| Suspended | The grace period ended | Locked; data kept |
| ID | Title | Priority | Automation |
|---|---|---|---|
| E2E-LIC-001 | A new owner gets a 14-day trial with trial limits | P1 | Automated (API, partial) |
| E2E-LIC-002 | Owner switches from the trial to a paid plan | P1 | Automated (API, partial) |
| E2E-LIC-003 | Downgrade is refused while usage exceeds the new plan | P1 | Automated (API, partial) |
| E2E-LIC-004 | Staff limit counts members and pending invitations once per person | P1 | Automated (API, partial) |
| E2E-LIC-005 | Platform admin creates plans; hidden and duplicate plans | P1 | Automated |
| E2E-LIC-006 | Platform admin changes a plan’s limits; owners see them at once | P1 | Automated |
| E2E-LIC-007 | A plan taken off sale cannot be chosen; subscribers keep it | P2 | Automated (API, partial) |
| E2E-LIC-008 | Platform admin finds and extends a subscription | P1 | Automated |
| E2E-LIC-009 | Expiry reminder e-mail | P2 | Automated |
| E2E-LIC-010 | Period ends: the owner’s garages become read-only | P1 | Automated (API, partial) |
| E2E-LIC-011 | Grace period ends: garages are suspended; admin extension restores them | P1 | Automated (API, partial) |
| E2E-LIC-012 | Owner renews from read-only by choosing a plan | P2 | Automated (API, partial) |
E2E-LIC-001 · A new owner gets a 14-day trial with trial limits
Priority: P1 · Covers: FR-LIC-01, FR-IAM-01 · Automation: Automated (API, partial)
Preconditions: baseline. No user uses [email protected].
Test data: sign up [email protected], name QA Owner LIC001, phone 0900000401, password Qa@123456.
Steps
- Sign up and verify with the test data.
- Open Subscription.
- Look at the banner at the top of the page, then open Garages, Staff and Account and look at it again.
Expected results
- Current plan Free trial, status Trial, Trial until today + 14 days.
- Usage: Garages 0 / 1, Staff 0 / 5, Transactions today 0 / 50.
- Plan cards show Starter, Pro, Garage chain and QA Small with price per month and a limits line such as “2 garages · 20 staff · 100 transactions/day”. The trial plan is not offered as a card.
- The note “Online payment arrives in Phase 16: the new plan applies at once.” is shown.
- The banner “14 days left in your free trial — Choose a plan to keep using VietGara after the trial.” appears on every page, with a Choose a plan button that opens Subscription.
E2E-LIC-002 · Owner switches from the trial to a paid plan
Priority: P1 · Covers: FR-LIC-02 · Automation: Automated (API, partial)
Preconditions: [email protected] on the trial (E2E-LIC-001).
Test data: plan Starter (299,000 VND/month, 1 garage, 5 staff).
Steps
- Subscription → Choose this plan on Starter.
- Read the dialog and confirm.
- As ADMIN, open Subscriptions and search
signup.lic001.
Expected results
- The dialog reads “Switch to Starter?” with the price, limits and “The plan applies at once to all your garages.”
- After confirming: “Switched to Starter.”; plan Starter, status Active, Valid until today + 1 month; the Starter card is marked Current plan.
- The trial banner is gone.
- The admin list shows QA Owner LIC001 on Starter, Active.
E2E-LIC-003 · Downgrade is refused while usage exceeds the new plan
Priority: P1 · Covers: FR-LIC-02 · Automation: Automated (API, partial)
Preconditions: baseline. OWNER_A is on Pro with 2 active garages (A1, A2).
Steps
- Sign in as OWNER_A → Subscription → Choose this plan on Starter (1 garage) → confirm.
- Deactivate A2 (settings → Status), then choose Starter again.
- Switch back to Pro, then reactivate A2.
Expected results
- Step 1 is refused with “Your plan limit is reached. Upgrade to add more.”; the plan stays Pro.
- Step 2 succeeds: only active garages count (usage Garages 1 / 1).
- While on Starter, reactivating A2 would be refused with the same limit message (try it before switching back).
- After step 3 OWNER_A is on Pro with A1 and A2 active, as in the baseline.
E2E-LIC-004 · Staff limit counts members and pending invitations once per person
Priority: P1 · Covers: FR-LIC-02, FR-TEN-04 · Automation: Automated (API, partial)
Preconditions: baseline. [email protected] exists (E2E-LIC-001). Plan QA Small is on sale (2 staff, 1 garage).
Test data: owner [email protected]; garage QA Gara LIC001 Binh Thanh; invitees FREELANCER, VIEWER_A1, then ADVISOR_A1.
Steps
- As
[email protected], switch to QA Small. - Create the garage QA Gara LIC001 Binh Thanh.
- Invite FREELANCER (group Technician). FREELANCER accepts.
- Invite VIEWER_A1 (group Technician). Leave it pending.
- Open Subscription. Then invite ADVISOR_A1.
- Revoke VIEWER_A1’s invitation and invite ADVISOR_A1 again.
Expected results
- Step 5: usage shows Staff 2 / 2 (one member plus one pending invitation); the Staff page shows “Staff: 2 / 2”. Inviting ADVISOR_A1 is refused with “Your plan limit is reached. Upgrade to add more.”
- Step 6 succeeds: revoking freed a seat.
- The owner is never counted as staff.
- VIEWER_A1 and ADVISOR_A1 working for another owner (A1) does not count against this owner until they are invited here.
E2E-LIC-005 · Platform admin creates plans; hidden and duplicate plans
Priority: P1 · Covers: FR-LIC-05 · Automation: Automated
Preconditions: baseline. Signed in as ADMIN in the admin web.
Test data:
| Plan | Code | Price | Cycle | Garages | Staff | Transactions/day | Shown to customers | On sale |
|---|---|---|---|---|---|---|---|---|
| QA Hidden | qa-hidden | 50,000 | Monthly | 1 | 1 | 5 | No | Yes |
| QA Yearly | qa-yearly | 5,000,000 | Yearly | 3 | 30 | 300 | Yes | Yes |
| (duplicate) | qa-small | 1 | Monthly | 1 | 1 | 1 | Yes | Yes |
Steps
- Plans → Add plan: create QA Hidden, then QA Yearly.
- Try to create a plan with code
qa-small. - Open Edit plan on QA Yearly and look at the code field.
- Sign in as OWNER_B → Subscription.
Expected results
- Both plans appear in the admin table with code, name, price, limits; QA Hidden is marked Hidden.
- Step 2: “A plan with this code exists.”
- Step 3: the code cannot be changed.
- OWNER_B sees QA Yearly with a price “/year” and limits “3 garages · 30 staff · 300 transactions/day”; QA Hidden is not offered.
E2E-LIC-006 · Platform admin changes a plan’s limits; owners see them at once
Priority: P1 · Covers: FR-LIC-05, FR-LIC-02 · Automation: Automated
Preconditions: E2E-LIC-004 done: [email protected] is on QA Small with Staff 2 / 2.
Steps
- In the admin web, ADMIN → Plans → Edit plan on QA Small: Max staff 2 → 3. Save.
[email protected]reloads Subscription, then invites VIEWER_A1 to QA Gara LIC001 Binh Thanh.- ADMIN sets Max staff back to 2.
Expected results
- Step 2: usage shows Staff 2 / 3 without any action by the owner, and the invitation is sent.
- After step 3 the owner sees 3 / 2: existing staff and invitations are kept, but a new invitation is refused with the limit message.
E2E-LIC-007 · A plan taken off sale cannot be chosen; subscribers keep it
Priority: P2 · Covers: FR-LIC-05 · Automation: Automated (API, partial)
Preconditions: [email protected] is on QA Small.
Steps
- ADMIN → Edit QA Small → untick On sale. Save.
- OWNER_B → Subscription.
[email protected]→ Subscription.- ADMIN ticks On sale again.
Expected results
- The admin table marks QA Small as Retired.
- OWNER_B no longer sees QA Small among the plans.
[email protected]is still on QA Small, status Active, with its limits.
E2E-LIC-008 · Platform admin finds and extends a subscription
Priority: P1 · Covers: FR-LIC-05 · Automation: Automated
Preconditions: baseline. Note OWNER_B’s Trial until date from their Subscription page.
Test data: extension 30 days; invalid extensions 0 and 400 days.
Steps
- In the admin web, ADMIN → Subscriptions → search
owner.b. - Search
QA Ownerand filter by status Trial. - On OWNER_B’s row press Extend, enter 0, then 400, then 30.
- OWNER_B reloads Subscription.
Expected results
- Step 1 finds QA Owner B with plan Free trial, status Trial, its period end and usage (1 garage).
- Step 2 lists only trial owners whose name matches (OWNER_B, not OWNER_A on Pro); the table is paginated.
- 0 and 400 are refused (allowed: 1–366 days). 30 shows “Subscription extended.”
- OWNER_B’s Trial until moved 30 days later; the banner’s day count grew by 30.
E2E-LIC-009 · Expiry reminder e-mail
Priority: P2 · Covers: FR-LIC-04, FR-NOT-04 · Automation: Automated
Preconditions: baseline. LICENSE_EXPIRY_JOB_INTERVAL=1m.
Test data: OWNER_B.
Steps
- Apply H3 for
[email protected]. - Wait 1–2 minutes and check Mailpit for
[email protected]. - Wait another 2 minutes.
Expected results
- One reminder e-mail arrives, in OWNER_B’s language, saying the subscription ends in about 3 days and how to renew.
- No second reminder arrives for the same period end.
- Clean-up: ADMIN extends OWNER_B by 14 days (E2E-LIC-008) so the trial is not left near its end.
E2E-LIC-010 · Period ends: the owner’s garages become read-only
Priority: P1 · Covers: FR-LIC-04 · Automation: Automated (API, partial)
Preconditions: a dedicated owner, so the baseline is not affected:
- Sign up and verify
[email protected](nameQA Owner LIC010, passwordQa@123456). - Create garage QA Gara LIC010 Tan Binh and customer QA Customer Em Vo (
0911000010). - Invite FREELANCER with group Service Advisor; FREELANCER accepts.
- Apply H1 for
[email protected]and wait up to 1 minute.
Steps
- OWNER LIC010 opens Subscription, then Customers.
- OWNER LIC010 tries to add customer QA Customer Giang Do (
0911000011), and to edit Em Vo. - FREELANCER selects QA Gara LIC010 Tan Binh and opens Customers.
Expected results
- Subscription shows status Past due (read-only) and Read-only until about 7 days after the old end.
- One e-mail arrives for
[email protected], in the owner’s language, saying the subscription has ended, that the garages are read-only until that date, and the amount and bank details to pay. - Owner banner: “The subscription has expired: the garage is read-only — You can still view your data, but changes are blocked. Renew within 7 days to avoid suspension.” with a renew button.
- Customers still lists Em Vo (reading is allowed).
- Every change in step 2 is refused with “The subscription is past due: read-only mode.”; nothing is saved. The garage profile and settings are deliberately exempt from the read-only rule, so the owner can still edit them.
- FREELANCER sees the data and the staff banner “Ask the garage owner to renew the subscription.” with no renew button.
E2E-LIC-011 · Grace period ends: garages are suspended; admin extension restores them
Priority: P1 · Covers: FR-LIC-04, FR-LIC-05 · Automation: Automated (API, partial)
Preconditions: E2E-LIC-010 done (status Past due). Apply H2 for [email protected] and wait up to 1 minute.
Steps
- OWNER LIC010 opens Customers of QA Gara LIC010 Tan Binh.
- FREELANCER does the same.
- ADMIN → Subscriptions → find
signup.lic010→ Extend 30 days. - OWNER LIC010 reloads Customers and adds QA Customer Giang Do (
0911000011).
Expected results
- Steps 1–2: the garage is locked: no customer data is shown; the banner reads “The subscription is suspended” (owner: “The garage is locked until you renew. Your data is kept safe.”; staff: ask the owner).
- A second e-mail reaches
[email protected]when the status becomes Suspended, with the amount and bank details to reactivate it. - The admin list shows the subscription as Suspended before step 3 and Active after.
- Step 4 works: Em Vo is still there (data was kept) and Giang Do is added.
E2E-LIC-012 · Owner renews from read-only by choosing a plan
Priority: P2 · Covers: FR-LIC-02, FR-LIC-04 · Automation: Automated (API, partial)
Preconditions: E2E-LIC-011 done. Apply H1 for [email protected] again and wait up to 1 minute (status Past due).
Steps
- OWNER LIC010 → Subscription → choose Starter (the button may read Renew on the current plan) and confirm.
- Edit customer Em Vo’s address to
99 Cong Hoa, Tan Binhand save.
Expected results
- Status Active, Valid until today + 1 month; the read-only banner is gone.
- Step 2 is saved.