Skip to content

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:

StateMeaningGarages
Trial14 days from e-mail verificationFull use
ActiveA plan was chosen or the subscription was extendedFull use
Past due (read-only)The period ended; 7-day grace periodData can be viewed, not changed
SuspendedThe grace period endedLocked; data kept
IDTitlePriorityAutomation
E2E-LIC-001A new owner gets a 14-day trial with trial limitsP1Automated (API, partial)
E2E-LIC-002Owner switches from the trial to a paid planP1Automated (API, partial)
E2E-LIC-003Downgrade is refused while usage exceeds the new planP1Automated (API, partial)
E2E-LIC-004Staff limit counts members and pending invitations once per personP1Automated (API, partial)
E2E-LIC-005Platform admin creates plans; hidden and duplicate plansP1Automated
E2E-LIC-006Platform admin changes a plan’s limits; owners see them at onceP1Automated
E2E-LIC-007A plan taken off sale cannot be chosen; subscribers keep itP2Automated (API, partial)
E2E-LIC-008Platform admin finds and extends a subscriptionP1Automated
E2E-LIC-009Expiry reminder e-mailP2Automated
E2E-LIC-010Period ends: the owner’s garages become read-onlyP1Automated (API, partial)
E2E-LIC-011Grace period ends: garages are suspended; admin extension restores themP1Automated (API, partial)
E2E-LIC-012Owner renews from read-only by choosing a planP2Automated (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

  1. Sign up and verify with the test data.
  2. Open Subscription.
  3. 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

  1. Subscription → Choose this plan on Starter.
  2. Read the dialog and confirm.
  3. 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

  1. Sign in as OWNER_A → Subscription → Choose this plan on Starter (1 garage) → confirm.
  2. Deactivate A2 (settings → Status), then choose Starter again.
  3. 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

  1. As [email protected], switch to QA Small.
  2. Create the garage QA Gara LIC001 Binh Thanh.
  3. Invite FREELANCER (group Technician). FREELANCER accepts.
  4. Invite VIEWER_A1 (group Technician). Leave it pending.
  5. Open Subscription. Then invite ADVISOR_A1.
  6. 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:

PlanCodePriceCycleGaragesStaffTransactions/dayShown to customersOn sale
QA Hiddenqa-hidden50,000Monthly115NoYes
QA Yearlyqa-yearly5,000,000Yearly330300YesYes
(duplicate)qa-small1Monthly111YesYes

Steps

  1. Plans → Add plan: create QA Hidden, then QA Yearly.
  2. Try to create a plan with code qa-small.
  3. Open Edit plan on QA Yearly and look at the code field.
  4. 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

  1. In the admin web, ADMIN → Plans → Edit plan on QA Small: Max staff 2 → 3. Save.
  2. [email protected] reloads Subscription, then invites VIEWER_A1 to QA Gara LIC001 Binh Thanh.
  3. 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

  1. ADMIN → Edit QA Small → untick On sale. Save.
  2. OWNER_B → Subscription.
  3. [email protected] → Subscription.
  4. 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

  1. In the admin web, ADMIN → Subscriptions → search owner.b.
  2. Search QA Owner and filter by status Trial.
  3. On OWNER_B’s row press Extend, enter 0, then 400, then 30.
  4. 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

  1. Apply H3 for [email protected].
  2. Wait 1–2 minutes and check Mailpit for [email protected].
  3. 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:

  1. Sign up and verify [email protected] (name QA Owner LIC010, password Qa@123456).
  2. Create garage QA Gara LIC010 Tan Binh and customer QA Customer Em Vo (0911000010).
  3. Invite FREELANCER with group Service Advisor; FREELANCER accepts.
  4. Apply H1 for [email protected] and wait up to 1 minute.

Steps

  1. OWNER LIC010 opens Subscription, then Customers.
  2. OWNER LIC010 tries to add customer QA Customer Giang Do (0911000011), and to edit Em Vo.
  3. 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

  1. OWNER LIC010 opens Customers of QA Gara LIC010 Tan Binh.
  2. FREELANCER does the same.
  3. ADMIN → Subscriptions → find signup.lic010 → Extend 30 days.
  4. 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

  1. OWNER LIC010 → Subscription → choose Starter (the button may read Renew on the current plan) and confirm.
  2. Edit customer Em Vo’s address to 99 Cong Hoa, Tan Binh and save.

Expected results

  • Status Active, Valid until today + 1 month; the read-only banner is gone.
  • Step 2 is saved.