# UAT Sign-Off

# UAT Sign-Off

> **Project:** Bilko
> **Version:** 0.1
> **Date:** 2026-02-23
> **Author:** Ops Architect
> **Status:** Draft (Template — fill in before each major release)
> **Reviewers:** Alem Bašić

## Document History
| Version | Date | Author | Changes |
|---------|------|--------|---------|
| 0.1     | 2026-02-23 | Ops Architect | Initial draft |

---

## INSTRUCTIONS

UAT (User Acceptance Testing) is required before:
- Initial production launch (v1.0.0)
- Any release adding new financial features
- Any release changing VAT rates or accounting rules

UAT is performed on staging environment (`bilko-staging` Railway + Vercel preview).
File: `UAT-SIGNOFF-vX.X.X.md` in `docs/releases/`

---

# UAT Sign-Off — Bilko v1.0.0 (MVP)

**UAT Period:** YYYY-MM-DD to YYYY-MM-DD
**Testing Environment:** https://staging.bilko.io
**Tested by:** Alem Bašić
**Release version:** v1.0.0

---

## 1. UAT Test Scenarios

### 1.1 Authentication & Account Setup

| # | Scenario | Steps | Expected Result | Actual Result | Pass/Fail |
|---|----------|-------|-----------------|---------------|-----------|
| A1 | Register new organization | Go to /register → Fill company name (Test Firma d.o.o.), email, password → Submit | Account created, redirect to dashboard | | |
| A2 | Login with credentials | Go to /login → Enter email + password → Submit | Dashboard loads with correct org name | | |
| A3 | Logout | Click user menu → Logout | Redirected to /login, session cleared | | |
| A4 | Wrong password rejected | Login with wrong password | 401 error, no user enumeration | | |
| A5 | Invite team member (if implemented) | Settings → Team → Invite → Enter email | Invite email sent to new user | | |

---

### 1.2 Invoice Creation (Core — P0)

| # | Scenario | Input | Expected | Actual | Pass/Fail |
|---|----------|-------|----------|--------|-----------|
| I1 | Create invoice — Serbia VAT | Customer: Acme Corp, Items: 10x 5000 RSD @ 20% VAT | Subtotal: 50,000 RSD, VAT: 10,000 RSD, Total: 60,000 RSD | | |
| I2 | Create invoice — zero-rate export | Items: 1x 10,000 RSD @ 0% VAT | VAT: 0 RSD, Total: 10,000 RSD | | |
| I3 | Create invoice — EUR currency | Items: 5x 100 EUR @ 20% VAT | Subtotal: 500 EUR, VAT: 100 EUR, Total: 600 EUR | | |
| I4 | NUMERIC precision — no float drift | Items: 1x 33.33 RSD @ 20% VAT | VAT: 6.67 RSD, Total: 40.00 RSD (not 39.996...) | | |
| I5 | Invoice number auto-generated | Create invoice | Number = INV-XXXX format | | |
| I6 | Multi-item different VAT rates | Item 1: 1000 RSD @ 20%, Item 2: 500 RSD @ 0% | VAT: 200 RSD (only on item 1), Total: 1700 RSD | | |
| I7 | Invoice status flow: Draft → Sent | Create invoice (Draft) → Send | Status changes to Sent, email delivered | | |
| I8 | Mark invoice as paid | Click "Mark as Paid" | Status = Paid, paidAt timestamp set | | |

**Financial precision test — critical:**

For I4: Open browser DevTools → check API response body:
```json
{
  "subtotal": "33.3300",
  "taxAmount": "6.6700",
  "totalAmount": "40.0000"
}
```
All amounts must be strings with 4 decimal places, never floating-point numbers.

---

### 1.3 Expense Tracking

| # | Scenario | Expected | Actual | Pass/Fail |
|---|----------|----------|--------|-----------|
| E1 | Create expense with amount | Expense saved, status = Pending | | |
| E2 | Upload receipt photo | JPG uploads successfully, preview visible | | |
| E3 | Approve expense (as admin) | Status changes to Approved | | |
| E4 | Reject expense | Status changes to Rejected | | |
| E5 | Viewer cannot approve expense | 403 error | | |

---

### 1.4 VAT Reporting

| # | Scenario | Expected | Actual | Pass/Fail |
|---|----------|----------|--------|-----------|
| V1 | Generate VAT report — Serbia | Select period → Generate | Report shows: Output VAT (collected on invoices), Input VAT (paid on expenses), Net VAT payable | | |
| V2 | VAT report includes only own org data | Cross-org data not visible | | |
| V3 | VAT totals match invoice list | Sum of VAT from individual invoices = VAT report total | | |
| V4 | Date range filter works | Report only includes transactions in selected period | | |

**Critical — VAT accuracy check:**

After creating 3 invoices in test period:
- INV-001: 50,000 RSD + 10,000 VAT (20%)
- INV-002: 30,000 RSD + 5,100 VAT (17% BiH)
- INV-003: 10,000 RSD + 0 VAT (export)

VAT report must show:
- Output VAT: 15,100 RSD (10,000 + 5,100 + 0)
- Not 15,099.99 or 15,100.01

---

### 1.5 Multi-Tenancy Security (P0)

| # | Scenario | Expected | Actual | Pass/Fail |
|---|----------|----------|--------|-----------|
| T1 | Create two test organizations | Both created separately | | |
| T2 | Org A cannot see Org B's invoices | Invoice list returns only Org A invoices | | |
| T3 | Org A cannot access Org B's invoice by ID | 404 (not 403 — no data enumeration) | | |
| T4 | Viewer role cannot create invoice | 403 error | | |

---

### 1.6 Performance

| # | Scenario | Expected | Actual | Pass/Fail |
|---|----------|----------|--------|-----------|
| P1 | Invoice list loads in < 2s | Dashboard response < 2s | | |
| P2 | VAT report generates in < 5s | Report appears in < 5s on staging | | |
| P3 | Receipt upload completes in < 5s | Progress indicator, file appears in < 5s | | |

---

## 2. UAT Defects Log

| # | Scenario | Defect Description | Severity | Status |
|---|----------|-------------------|----------|--------|
| | | | | |

---

## 3. UAT Summary

| Category | Total Scenarios | Passed | Failed | Blocked |
|----------|----------------|--------|--------|---------|
| Authentication | 5 | | | |
| Invoice (incl. financial precision) | 8 | | | |
| Expenses | 5 | | | |
| VAT Reporting | 4 | | | |
| Multi-tenancy security | 4 | | | |
| Performance | 3 | | | |
| **TOTAL** | **29** | | | |

---

## 4. Financial Accuracy Verification

**Required sign-off item.** Alem Bašić must verify:

- [ ] Invoice I1: Subtotal 50,000.0000, VAT 10,000.0000, Total 60,000.0000 ✅
- [ ] Invoice I4: Decimal precision correct (no float drift) ✅
- [ ] VAT Report V3: Report totals match sum of individual invoices ✅
- [ ] Multi-tenancy T2: Confirmed two orgs cannot see each other's data ✅

**I confirm that the financial calculations in this release are accurate to NUMERIC(19,4) precision and comply with the applicable VAT rules for Serbia, Bosnia, and Croatia.**

---

## 5. UAT Sign-Off Decision

### Recommendation

- [ ] **APPROVED** — All P0 scenarios pass, no P0 defects open. Release approved for production.
- [ ] **CONDITIONAL** — Approved with conditions: [conditions listed below]
- [ ] **REJECTED** — P0 defects found. Do not deploy until resolved.

**Conditions (if conditional):**
_________________________________________

### Open Defects at Sign-Off

| # | Defect | Severity | Resolution |
|---|--------|----------|-----------|
| | | | |

---

## Sign-Off

**I have tested the scenarios listed above in the staging environment and confirm that the system is ready (or not ready) for production deployment based on the recommendation above.**

| Role | Name | Date | Signature |
|------|------|------|-----------|
| Primary UAT | Alem Bašić | | |
| Tech Lead | | | |

---

## Related Documents

- [Deployment Checklist](./DEPLOYMENT-CHECKLIST.md)
- [Test Plan](../TEST-PLAN.md)
- [Release Notes](./RELEASE-NOTES.md)
- [TESTING-GUIDE.md](../testing/TESTING-GUIDE.md)