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.
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 and total are clearly labelled as suggestions, confidence and warnings are visible, and date, currency, and category are labelled review-only.
- Select Use merchant and total and confirm the normal expense editor opens with the suggested values but does not save them automatically.
- Save the expense only after reviewing the populated fields.
- Repeat using a receipt saved through Scan receipt. Confirm Analyse receipt opens the same review dialog and only fills the editable draft 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.
Quick Receipt Journey
Automation: Backend and browser automated:
Glovelly.Api.Tests.GigEndpointsTests.QuickReceiptDraft_*covers draft creation, candidate matching, updates, and reassignment;Glovelly.Uat.Tests.UploadAndQuickCaptureWorkflowTests.QuickReceiptFlowOpensTargetGigInViewportcovers quick-capture navigation. Receipt analysis and visual capture variants remain manual.
Steps
- Use quick receipt capture to upload a receipt.
- If the app suggests a nearby gig, accept it or choose a different gig.
- Fill in the receipt draft description and amount.
- Save it.
- Click
Go to gigand confirm the target Gig overview scrolls into view and remains selected.
Expected Results
The draft becomes a normal gig expense with its receipt attached. Existing expenses and attachments remain intact. Completion feedback remains visible after navigating to the target gig.
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.