Skip to main content

KxInspections — Contesting Charges

Unified Docusaurus documentation for the FastAPI mock backend and the Flutter frontend. Contract v1 frozen at G-01 — deterministic fixtures, exhaustive tests, offline-first design.

Easy to Use

Backend — FastAPI

Single-writer JSON store, pure domain, RFC 8785 idempotency and SSE. Every rule in contract-v1.md with exhaustive vectors and 85% branch coverage.

Focus on What Matters

Frontend — Flutter

Fixture-first Drift + go_router + bloc. Runs with no server, flips to remote with one --dart-define. Responsive, WCAG AA, offline outbox.

Powered by React

One Contract

Frozen G-01 artefact: openapi-v1.json, golden examples and fixture bundle. Python exports vectors — Dart replays them. No wire drift, no invented rule.

BEGINNER GUIDE

Use KxInspections on phone or web

KxInspections is a student-facing maintenance and charge demo. It has no login and no real payment provider. Default fixture data is built into the app, so a backend is not needed for normal exploration.

1. Start the app

Open Terminal. From the project root, install Flutter packages once:

cd /Users/rohan/kienetic_assignment/kxinspect_frontend_flutter
flutter pub get

Run on an Android device or emulator:

flutter devices
flutter run -d <device-id>

Run web version in Chrome:

flutter run -d chrome

3. Maintenance Hub

  1. Open Maintenance. This is first screen.
  2. Use Open for current inventory, inspections, open tasks, and outstanding charges.
  3. Use History for resolved and paid charge history.
  4. Tap Booking when more than one booking exists, then choose date range and property code.
  5. Tap Refresh, or pull page down, to fetch latest data.
  6. When saved-data warning appears, tap Retry; existing content remains visible.

4. Raise a maintenance task

  1. In Open, scroll to Open Tasks.
  2. Tap Raise Task.
  3. Choose category: Electrical, Plumbing, Heating, Appliance, Furniture, Cleaning, or Other.
  4. Describe issue in Notes: 10–1000 characters.
  5. Check read-only Location and Date; app fills both from selected booking.
  6. Tap Create task.
  7. For a temporary connection failure, tap Retry. For validation or conflict, use Edit or Cancel.

5. Reports and inspections

Inventory report

  1. Find report in Inventory, then tap View report.
  2. Read summary, location, completion date, status, and file type.
  3. Use Open or Download, then Back to return.

Current integrated demo does not launch an external report, so Open or Download can show a failure message.

Inspection

  1. Tap inspection card.
  2. Review general notes, item actions, item updates, and outstanding charges.
  3. Tap an available charge/item action to open its Charge screen.
  4. Pull down to refresh; use Back to return.

6. Review a charge

  1. Tap a charge card from Maintenance, Inspection, Statement, or Notifications.
  2. Read item, type, notes, amount, location, raised date, status, and response deadline.
  3. Tap an Evidence thumbnail or View evidence for full-size photo.
  4. Pinch or scroll to zoom photo; use Zoom/Reset zoom; tap close to return.

Accept

  1. Tap Accept.
  2. Read confirmation: acceptance cannot be undone in this demo.
  3. Tap Confirm to accept, or Cancel to return.
  4. Accepted charge becomes payable; tap Pay to open Statement.

Offline actions may show Waiting to send. App keeps them locally and sends after reconnection.

7. Contest a charge

  1. On an outstanding charge, tap Contest.
  2. Enter a reason: 10–2000 characters.
  3. Optional: tap Add files.
  4. Choose images, MP4 video, or PDF. Limits: five files, 10 MB each, 25 MB total.
  5. Preview attached file or remove unwanted file.
  6. Tap Submit contest.

When leaving unsent form, choose:

  • Keep draft and leave: save written draft.
  • Discard and leave: remove draft.
  • Continue editing: stay on form.

If deadline passes while writing, draft stays available for copying but cannot be submitted.

8. Pay accepted charges

  1. Open accepted charge, then tap Pay.
  2. On Statement, read three groups: Review required, Amount due, History.
  3. Tick checkbox beside each payable charge.
  4. Tap row or open icon to inspect a charge before payment.
  5. Tap bottom Pay selected.
  6. Review charge count and total, then tap Pay or Cancel.

Payment is mock confirmation. No real money moves.

9. Notifications and web behavior

Notifications

  1. Tap Notifications.
  2. On phone, tap Allow if device notification permission appears.
  3. Tap notification row: it marks as read and opens related charge when available.
  4. Pull down to refresh. Use Retry if loading fails.

Web

  • Browser Back/Forward works between screens.
  • Refreshing keeps current route and Maintenance tab.
  • Browser notifications can be unavailable; in-app feed still works.
  • File picker is browser picker; phone uses system picker.

Optional: connect web app to local backend

Normal use needs no backend. Use these commands only when testing HTTP API mode locally.

Terminal 1 — backend

cd /Users/rohan/kienetic_assignment
./run_backend.sh

Terminal 2 — web app

cd /Users/rohan/kienetic_assignment/kxinspect_frontend_flutter
flutter run -d chrome \
  --dart-define=DATA_SOURCE=remote \
  --dart-define=API_BASE_URL=http://127.0.0.1:8000

Open local API documentation at http://127.0.0.1:8000/docs.

Backend is local mock service, not production deployment.