# TANRAIL ONE — Business Architecture

## 1. Overview
This document defines the structural map of TANRAIL Investments Limited within the TANRAIL ONE platform. It establishes how multiple businesses coexist within a single platform without data leakage or reporting fragmentation.

## 2. Organizational Structure Model

```text
[ ORGANIZATION ] - TANRAIL Investments Limited
       │
       ├── [ BUSINESS UNIT ] - Restaurant
       │          ├── [ BRANCH ] - Main Branch
       │          └── [ BRANCH ] - Downtown Branch (Future)
       │
       ├── [ BUSINESS UNIT ] - Catering
       │          └── [ BRANCH ] - HQ Event Team
       │
       ├── [ BUSINESS UNIT ] - Water (Future)
       │          ├── [ BRANCH ] - Production Facility
       │          └── [ BRANCH ] - Distribution Hub
       │
       └── [ BUSINESS UNIT ] - Transport (Future)
```

## 3. Entity Definitions

### 3.1 Organization
- The top-level root entity. Represents the holding company.
- **Ownership:** Owns the global master data (e.g., Chart of Accounts, Global Users).

### 3.2 Business Unit (BU)
- A distinct operational division with its own business model, revenue streams, and specialized processes.
- **Examples:** Restaurant, Catering, Water.
- **Scope:** Defines the primary operational context. Many reports are filtered at this level.

### 3.3 Branch / Location
- Physical or logical sub-divisions of a Business Unit.
- **Scope:** Inventory is typically tracked at the Branch/Location level. Sales are attributed to a Branch.

### 3.4 Departments
- Functional groupings within a BU or Organization (e.g., HR, Finance, Kitchen, Logistics).

## 4. User and Actor Mapping
Users interact with the system based on their assigned scopes.

- **System Administrator:** Global access across the entire platform.
- **Executive / Director:** View-level access across all Business Units for consolidated reporting.
- **BU Manager:** Full operational control within a specific Business Unit.
- **Branch Manager:** Operational control limited to a specific Branch.
- **Accountant:** Cross-BU access limited to financial modules (Invoices, Expenses).
- **Operational Staff (e.g., Waiter, Driver):** Highly restricted access to specific modules within a specific Branch.

## 5. External Entities
- **Customers:** Can be global (transacting with multiple BUs) or BU-specific.
- **Suppliers:** Can supply multiple BUs (e.g., a general food supplier) or be specific to one BU.

## 6. Financial & Operational Flow
Every operational transaction (e.g., a Sale, an Inventory adjustment) must be tagged with:
1. Business Unit ID
2. Branch / Location ID

This enables the **Executive Consolidated View** (rolling up all BU data) while strictly maintaining the **Business Unit Isolation View** (a Restaurant manager cannot see Catering sales unless explicitly authorized).

## 7. How Businesses Coexist
- **Shared Data:** Users, Global Settings, Currency, Core Chart of Accounts.
- **Partitioned Data (Logical):** Orders, Invoices, Inventory balances, Expenses. These are stored in shared tables but enforce strict row-level scoping via `business_unit_id` and `branch_id`.
- **Specialized Data:** Tables unique to a BU (e.g., `restaurant_tables`, `catering_events`). These inherently belong to their respective BU.
