📂 Fail MD
📄 api-spec.md
📄 architecture.md
📄 compound-rules.md
📄 council-sync.md
📄 data-model.md
📄 money-ledger.md
📄 parking-rules.md
Sedang mengedit: compound-rules.md
# Smart Parking — Compound (Saman) Rules Rules for issuing, classifying, and paying compounds. ## Compound Types (extensible) A compound has a **type/reason**. The list is extensible per tenant; initial types: ``` UNPAID_PARKING → parked in a paid bay with no active session • staff has DISCRETION (may choose not to issue) ILLEGAL_PARKING → yellow line / roadside / traffic offence • issued REGARDLESS of payment • not tied to a session at all ``` Future types may be added (e.g. obstructing traffic, OKU/disabled bay misuse). Design as a **catalog**, not a fixed pair. ## Key Distinction ``` UNPAID_PARKING → about MONEY (no active paid session) ILLEGAL_PARKING → about PLACEMENT (breaks the law, money irrelevant) ``` This is why a compound is not purely a payment-check result — placement offences exist independently of parking sessions. ## Issuing Flow (Staff Scanner) ``` Staff (logged in with tenant_id) scans/types plate │ ▼ Lookup active session: plate + staff.tenant_id │ ┌────┴─────┐ │ │ PAID NOT PAID │ │ ▼ ▼ 🟢 OK decide compound: • UNPAID_PARKING → staff discretion (may skip) • ILLEGAL_PARKING → issue directly (independent of payment) │ ▼ Create compound (type, rate per tenant, tenant_id = staff's tenant, plate, evidence photos, location, issued_by, issued_at) │ ▼ Ledger/record + notify user (SMS/Email) ``` ## Plate Recognition - Staff may **type the plate manually** OR use **OCR/LPR** (camera auto-read). - Plate is normalized (uppercase, no spaces) before lookup. ## No Tolerance - **No grace period.** If a session is expired at scan time, it is not paid. ## Repeated Compounds - The same vehicle can receive **multiple compounds** (e.g. scanned again later still unpaid). - For `UNPAID_PARKING`, staff discretion applies each time. ## Tenant Scoping - A compound carries the **issuing staff's `tenant_id`**. - Compound revenue belongs to that tenant. - Cross-tenant note: a vehicle paid in MBPP but parked in MBSP has **no valid MBSP session** → MBSP staff scan shows NOT PAID → may be compounded under MBSP. ## Compound Rates - `compound_rates` are set **per tenant, per compound type**. - Managed under Backend → Compounds → Compound Rates. - (Tiered/late-fee structures, if needed, can be added later — not assumed now.) ## Payment A compound can be paid via: ``` 1. User App → user pays own compound (wallet / FPX / card) 2. Walk-in → Staff Parking app at the council counter ``` On payment: - Mark compound `PAID`. - Create ledger entry (`PAYMENT_COMPOUND`, tenant_id). - Recognized as that tenant's revenue. ## Evidence - Compounds should capture **evidence** (photos) and **location/geo** at issue time, especially for `ILLEGAL_PARKING`. ## Open Items - Late-fee / tiered amounts — not defined yet. - Compound dispute/appeal flow — not defined yet.
Simpan Perubahan