Expense And Receipt UAT Journeys
Purpose
Use these journeys when a change may affect gig expenses, receipt attachments, quick receipt capture, reimbursement status, or expense statements.
Preconditions
- You can sign in.
- At least one client and one saved gig exist.
- You have a small PDF or image available for receipt upload.
- If testing expense statements, use gigs for the same client unless the journey asks for a mixed-client negative check.
Expense Receipt Journey
Automation: Partially automated UAT:
Glovelly.Uat.Tests.UploadAndQuickCaptureWorkflowTests.BrowserReceiptAndAttachmentUploadsRoundTripThroughGigUicovers browser receipt upload/delete and reimbursement preservation; backend tests cover API download/storage rules.
Steps
- Open a saved gig with an expense.
- Upload a PDF or image receipt to the expense.
- Confirm it appears in the receipt list.
- Download the receipt.
- Delete the receipt.
- Confirm the receipt disappears and cannot be downloaded.
Expected Results
Receipt metadata, storage, download, and deletion all work without changing the expense reimbursement state. Each completed file action shows a terminal notification; a missing receipt file shows a persistent error notification with a clear unavailable-file message.
Staging GCS Storage Verification
Use this check after a storage SDK upgrade is deployed. Run against the staging application with GCS-backed storage, not the local/in-memory store, using non-sensitive test data.
- Record the staging revision/build identifier and confirm GCS is the active storage backend.
- Calculate a SHA-256 hash of a small test PDF/image, then upload it to an expense through the normal application UI.
- Confirm the attachment appears only after successful upload, download it, and compare its byte length and SHA-256 hash with the original.
- Confirm upload/download completion notifications still appear. Repeat at a phone-sized viewport with an existing notification visible; modal controls must remain usable above notifications. Any failed action must not show success or leave a phantom receipt, and its normal error feedback must remain visible.
- Delete only the test attachment and confirm it disappears and can no longer be downloaded.
- Record pass/fail, revision, file size and hash comparison in the PR. Do not include private receipt data or credentials. An ordinary successful round trip does not itself simulate a checksum mismatch; controlled HTTP-transport backend tests cover rejection propagation.
Receipt Analysis Journey
Automation: Backend automated; browser review remains manual until a consented Vertex test environment and fixture set are available.
Steps
- Open a saved gig with an existing expense receipt and select Analyse beside that receipt.
- Confirm the review dialog identifies the receipt and either shows a prior analysis or offers Analyse receipt.
- Analyse a supported test JPEG, PNG, WebP, or PDF receipt.
- Confirm merchant, total and category suggestions show confidence/warnings; date and currency remain review-only. Foreign or unknown-currency totals remain evidence rather than copyable GBP values.
- Select Use suggestions and confirm the normal expense editor opens with the chosen merchant/category and eligible GBP total but does not save them automatically.
- Save the expense only after reviewing the populated fields.
- Repeat using a receipt saved through Add to Glovelly. Confirm analysis uses the same results presentation and only fills editable correction fields after explicit use.
- Check an unsupported or oversized test attachment. Confirm the saved attachment and expense remain unchanged and the dialog gives a safe analysis failure message.
Expected Results
Receipt analysis augments, but never blocks or silently changes, the manual expense workflow.
Add To Glovelly Receipt Journey
Automation:
IntakeEndpointsTestscover proactive/explicit application, preferences, recovery, source cleanup, and scoping.GigEndpointsTestsretain receipt correction and invoice-refresh regressions. Frontend journey tests cover stable upload, optional review, early finish and interrupted responses.Glovelly.Uat.Tests.UploadAndQuickCaptureWorkflowTests.UnifiedReceiptMobileFlowSavesThenReviewsTheExactAttachmentcovers mobile manual application and saved-record review in Ubuntu CI. Live-provider and visual variants remain manual.
Steps
- Select Add to Glovelly and confirm source type selection appears before a file picker. Choose Photo or file, enter unified upload, and choose a receipt photo/PDF. Repeat with pasted receipt text; URLs follow the resource journey.
- Confirm analysis starts immediately in upload, retains the source and shows progress. Provider failure offers retry and explicit Attach as Receipt treatment without losing the source.
- With High confidence enabled and a qualifying receipt, confirm it is proactively saved to the nearest visible non-cancelled nearby gig even when other candidates exist. Upload stays open with compact Attached to [Gig], Review attachment, and Done. No dialog automatically closes, no review appears automatically, and no workspace navigation occurs.
- Select Done without entering review, then confirm the receipt is saved in its gig. Reopen Add to Glovelly and confirm source selection is clean. Repeat closing after attached state; background/refresh during a save and confirm recovery never creates another receipt.
- Set Automatic receipt application to Manual only and confirm upload waits for explicit attachment. Check Settings label/select alignment, hover help, and focus explanation. Restore the original preference after testing.
- With no nearby gig or a historical intended destination, use Load more gigs. Confirm source, selection and fields survive loading/failure, retry works, and the action disappears when exhausted. Explicitly attach and confirm the same compact attached state.
- Select Review attachment and confirm it opens the exact saved receipt with original file access and editable destination, description, amount and category. Save corrections/reassignment and confirm affected draft invoices refresh. Close review without edits and confirm the existing receipt is untouched.
- Repeat with an issued or other non-draft invoice and confirm its lines/PDF remain unchanged. If draft PDF regeneration fails, confirm the receipt stays saved and the invoice explains its document unavailability and supports retry.
- Repeat on a phone-sized viewport with notifications already visible. Progress, inline failures, attached state and review controls must remain readable/clickable above the notification viewport; save feedback must not disappear in a transient notification.
- Close an unapplied upload and resume it from source selection. Discard it explicitly and confirm the next acquisition has empty source fields. Test deletion in saved-attachment review and confirm only that receipt/expense is removed.
- With another initial gig within the configured proximity window, confirm attached state and review show non-blocking check-the-gig guidance. Done remains available, and loaded candidate distances reflect actual dates.
- Repeat with High-confidence GBP, foreign currency and unknown currency evidence. Only a High-confidence total with High-confidence GBP initializes the amount. Other totals remain visible without blocking attachment; enter the appropriate GBP amount explicitly.
- In saved review, select Analyse again, then Use suggestions. Confirm copying changes only editable fields until Save changes. Select Go to gig explicitly and confirm navigation targets the saved destination; attachment success itself must never navigate.
- Delete a receipt expense with multiple files. Confirm the prompt names the entire expense and all attached files; cancelling preserves them. Keep existing unrelated expenses intact.
- After an interrupted source submission, choose a different file. Confirm it does not recover the earlier file as the replacement. Retry the original frozen submission separately and confirm no duplicate save.
Expected Results
Every receipt uses source selection → stable upload/application → optional saved-attachment review. Both save modes reach the same attached presentation, and users can finish there. Candidate expansion is read-only and preserves pending fields. Linked draft invoices refresh; issued, overdue, paid and cancelled invoices remain unchanged. Failed PDF regeneration preserves the receipt while preventing stale document delivery. Unapplied sources remain recoverable; completed private intake is removed without erasing open attached state. Existing unrelated expenses and attachments remain intact.
Expense Category Journey
Steps
- Open a saved gig and add or edit an ordinary expense.
- Enter a category and save the expense.
- Reopen the expense and change or clear the category, then save again.
Expected Results
The category remains editable alongside amount and description, and saving it does not affect receipts or reimbursement status.
Expense Reimbursement Journey
Automation: Backend automated; manual UAT: reimbursement and generated-line rules have backend coverage; browser prompts and visual state remain manual.
Steps
- Create a gig with at least two expenses.
- Mark one expense as
Reimbursed. - Enter a reimbursed date and method or note when prompted.
- Save or confirm the change.
- Generate an invoice from the gig, or regenerate a linked draft invoice if prompted.
Expected Results
Reimbursed expenses are visually distinct and excluded from newly generated invoice lines by default. Claimable expenses still appear.
Claimable Again
- Change a reimbursed expense back to
Claimable. - Regenerate a linked draft invoice if prompted.
Expected result: the expense becomes eligible for generated invoice lines again.
Expense Statement Journey
Automation: Partially automated UAT:
Glovelly.Uat.Tests.ExpenseStatementTests.CanGenerateExpenseStatementPreviewAndDownloadandExpenseStatementVariantsRespectReimbursementSelectionAndInvoiceLinkscover main preview/download, reimbursed inclusion, mixed-client blocking, and invoiced-gig projection rules; receipt-option variants remain manual/backend-covered.
Steps
- Create or identify multiple gigs for the same client with expenses.
- Include at least one receipt attachment.
- Mark one expense as
Reimbursed. - Select the same-client gigs in the Gigs list.
- Open the expense statement workflow.
Expected Results
The expense statement modal opens, expenses are grouped by gig, reimbursed or not-claimable expenses are visually distinct, and reimbursed expenses are excluded by default.
Invoiced Gig Selection
- Identify a gig that already has a linked invoice and at least one expense.
- Select it in the Gigs list with another gig for the same client.
- Open the expense statement workflow.
Expected result: invoiced gigs remain selectable for expense statements, the statement opens for the same-client selection, and invoice links are not changed.
Preview And Download
- Select the reimbursed expense in the modal.
- Toggle receipt attachment and receipt appendix options.
- Preview the PDF.
- Download the PDF.
Expected result: selected reimbursed expenses appear in the statement, receipt options affect the generated preview/download, the embedded PDF preview loads in the modal without being pushed out of view by long expense lists, and the downloaded PDF matches the preview.
Negative Checks
- Select a gig for one client.
- Try to select a gig for a different client.
Expected result: the app prevents mixed-client selections before generating the statement.
Then:
- Open a gig with no expenses.
- Try to launch an expense statement.
Expected result: the app explains that expenses are needed before a statement can be generated. No invoice state changes.
Notes
- Receipt attachment changes should not mutate reimbursement status.
- Reimbursement status should affect future generated documents, not old PDFs.
- Expense statements are projections and should not create invoices or mutate gig invoice links.