# TMS UAT – Terminal Management System

## Umbrella Project Structure

This repository is structured as an **Elixir umbrella project**.  
All OTP apps live under `apps/`.

| App | Description |
|-----|-------------|
| `da_product_app` | Existing Phoenix application (transitional, full-stack) |
| `platform_core`  | Shared infrastructure: `PlatformCore.Repo` (single DB pool shared by all core apps) |
| `tms_core`       | Scaffold: Terminal Management domain with public `TmsCore.Terminal` API |
| `settlement_core` | Settlement domain — `SettlementCore.*` modules, AlipayPlus scheduler, EOD generators |
| `risk_core`       | **New**: Risk monitoring domain — `RiskCore.*` modules, rule engine, supervisor dashboard, adapter pattern |
| `platform_web`   | Scaffold: Phoenix web layer (endpoint, router, LiveViews) |

See [`docs/INTEGRATION.md`](docs/INTEGRATION.md) for the full extraction
guide, module mapping, and release instructions.

## Quick Start

```bash
# Install dependencies
mix deps.get

# Setup the database and assets
mix setup

# Start the Phoenix server
mix phx.server
```

Visit [http://localhost:14002](http://localhost:14002) in your browser.

## Development

```bash
# Run all tests
mix test

# Format code
mix format

# Lint
mix credo
```

## Release Configurations

```bash
# Full release (all apps)
MIX_ENV=prod mix release full

# TMS-only headless release
MIX_ENV=prod mix release tms_release
```

## Legacy Documentation

  * Official Phoenix website: https://www.phoenixframework.org/
  * Guides: https://hexdocs.pm/phoenix/overview.html
  * Docs: https://hexdocs.pm/phoenix

