# Current ShasPOS v3.9.1 → ShasPOS Pro Reference Map

The existing Android app remains unchanged. It is used only as a domain/reference source for ShasPOS Pro; its SQLite schema is not copied into the SaaS database.

## RBAC baseline extracted from v3.9.1

| System role | Current default permission count |
|---|---:|
| OWNER | 108 |
| ADMIN | 108 |
| MANAGER | 95 |
| SUPERVISOR | 31 |
| CASHIER | 13 |
| SENIOR_CASHIER | 19 |
| INVENTORY_CLERK | 39 |
| ACCOUNTANT | 32 |
| AUDITOR | 30 |

The current source defines 108 permission keys. `database/seed_rbac.sql` preserves those keys and current role defaults as SaaS role templates. A business may later clone/customize templates without changing the global permission catalog.

## Domain mapping

| Existing Android domain | ShasPOS Pro canonical domain |
|---|---|
| POS / sales / held sales | `sales`, `sale_items`, `sale_payments` |
| Sales returns / refunds | `sales_returns`, `sales_return_items` |
| Products/categories/units | `products`, `product_barcodes`, `categories`, `units` |
| Stock/inventory | `inventory_movements`, `stock_balances`, `inventory_locations` |
| Transfers | `stock_transfers`, `stock_transfer_items` |
| Stock adjustment | `stock_adjustments`, `stock_adjustment_items` |
| Stock take / cycle count | `stock_take_sessions`, `stock_take_items` |
| Batch/expiry | `product_batches`, `batch_stock_balances`, `sale_item_batches` |
| Purchasing | `purchases`, `purchase_items` |
| Purchase orders / partial receiving | `purchase_orders`, `purchase_order_items`, `goods_receipts`, `goods_receipt_items` |
| Suppliers/payables | `suppliers`, `supplier_ledger`, `supplier_payments` |
| Customers/credit | `customers`, `customer_ledger`, `customer_payments` |
| Cash register | `cash_registers`, `cash_register_sessions`, `cash_register_movements`, `cash_register_audits` |
| FIFO/COGS | `inventory_cost_layers`, `sale_cost_allocations`, `cost_layer_movements` |
| Income/expense/accounts | `financial_accounts`, `financial_account_entries`, `other_income`, `expenses` |
| Staff / roles / permissions | `business_users`, `roles`, `permissions`, mappings/overrides |
| Approval policy | `approval_rules` |
| Security/audit | `audit_logs`, `login_attempts`, `user_sessions`, `devices` |

## Deliberate differences in Pro

1. Pro has no local SQLite business database.
2. Every operational record is tenant-scoped by `business_id`; outlet-specific records also carry `outlet_id`.
3. Posted documents are immutable/reversal-oriented rather than rewritten silently.
4. Money/quantity types are normalized decimals instead of inheriting historical local types.
5. Public API identifiers are ULIDs rather than sequential database IDs.
6. Subscription entitlement and plan limits are server-side concerns absent from the local edition.
7. Permission checks are server-authoritative; Flutter visibility is only UX.
8. Online concurrency and idempotency are explicit database/API contracts.

## Existing app coexistence

There is no automatic data synchronization between the current ShasPOS app and ShasPOS Pro in the initial scope. A future import/migration utility can be designed separately if commercially useful, without coupling the two applications at runtime.
