# danielcriollo/pharmacovigilance-lifefile architecture

> Architecture diagram of the GitHub repository danielcriollo/pharmacovigilance-lifefile, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danielcriollo/pharmacovigilance-lifefile
- Repository: https://github.com/danielcriollo/pharmacovigilance-lifefile

## Overview

1. **Overall shape**
   This is a split frontend/backend Laravel application. Laravel serves a single Blade entry page for the UI, while all domain interaction happens through `/api/*` endpoints consumed by a Vue 3 SPA.

2. **Frontend boundary**
   The frontend lives under `resources/js/pharmacovigilance` and is a standalone SPA built with Vue Router and Pinia. Main screens are `LoginView` and `DashboardView`, with reusable components for orders, customers, alerts, search, and modals. `api.js` is the HTTP client layer that centralizes API calls and token handling.

3. **Backend API layer**
   HTTP requests enter through API controllers in `app/Http/Controllers/Api/*` for auth, customers, medications, orders, and alerts. Controllers are intentionally thin: they accept validated requests, call services, and return standardized JSON through `ApiResponse`.

4. **Validation and request boundaries**
   FormRequest classes in `app/Http/Requests/*` enforce inbound validation before business logic runs. This is a clear boundary between untrusted API input and internal service logic, and it is used for login, search, export, and alert-sending flows.

5. **Business logic layer**
   The core domain behavior sits in `app/Services`. `OrderService` appears to handle the affected-order search/export workflow, `AlertService` manages alert creation and dispatch, `AuthService` handles login/session behavior, and `SmsService` encapsulates external SMS delivery. Controllers do not talk directly to the database.

6. **Persistence and repository pattern**
   Data access is isolated behind repositories in `app/Repositories`, with contracts in `app/Repositories/Contracts`. `RepositoryServiceProvider` binds interfaces to implementations, so services depend on abstractions rather than Eloquent models directly. This is the main decoupling layer between domain logic and MySQL storage.

7. **Domain model**
   The primary entities are `User`, `Customer`, `Medication`, `Order`, `OrderItem`, and `Alert`. The data model suggests the central use case is tracing customers from orders and medications back to specific recalled lots, then recording who was notified and by which channel.

8. **Alerting workflow**
   The alert path likely starts from a matching order search, then records an `Alert` and sends notifications. The system supports both single and bulk alerting, and `SendAlertForOrderJob` indicates bulk notifications are pushed into the queue to avoid request timeouts and to process multiple recipients asynchronously.

9. **External integration**
   SMS delivery is integrated through Vonage, configured via environment variables and wrapped by `SmsService`. The app also has an email notification template under `resources/views/emails/pharmacovigilance/alert.blade.php`, so alerting is multi-channel rather than SMS-only.

10. **Authentication and access control**
   Authentication is token-based through Laravel Sanctum, with login handled by `AuthController`. Role-based protection is enforced by `EnsureUserHasRole`, which is important for privileged operations such as exports and alert dispatching.

11. **Serving model**
   `routes/web.php` likely serves the SPA shell at one route, while `routes/api.php` exposes the functional backend. This means the browser route is mostly a container for Vue, and the actual app state is driven by API responses rather than server-rendered pages.

12. **Operational concerns**
   Background execution uses Laravel’s queue infrastructure, backed by the configured queue system in `config/queue.php` and the `jobs` table migration. Docker support via `compose.yaml` suggests local deployment includes PHP and MySQL services. The database is seeded for test/demo usage, and PHPUnit feature tests cover key API and authorization flows.

Main entry points: [`routes/api.php`](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/routes/api.php) (API routes), [`app/Providers/RepositoryServiceProvider.php`](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Providers/RepositoryServiceProvider.php) (Repo bindings), [`app/Http/Controllers/Api/Orders/OrderController.php`](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Orders/OrderController.php) (Orders API), [`app/Http/Controllers/Api/Alerts/AlertController.php`](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Alerts/AlertController.php) (Alerts API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Vue SPA"]
  node_blade_shell["SPA shell<br/>Blade entry<br/>[index.blade.php]"]
  node_vue_main["App entry<br/>Vue bootstrap<br/>[main.js]"]
  node_vue_router["Router<br/>[router.js]"]
  node_vue_store["Store<br/>Pinia state<br/>[store.js]"]
  node_vue_api["API client<br/>HTTP client<br/>[api.js]"]
  node_login_view["Login view<br/>screen<br/>[LoginView.vue]"]
  node_dashboard_view["Dashboard<br/>screen<br/>[DashboardView.vue]"]
  node_ui_components["UI widgets<br/>components"]
end

subgraph group_backend_http["HTTP boundary"]
  node_routes_web["Web routes<br/>routing<br/>[web.php]"]
  node_routes_api["API routes<br/>routing<br/>[api.php]"]
  node_auth_controller["Auth API<br/>controller<br/>[AuthController.php]"]
  node_order_controller["Orders API<br/>controller"]
  node_customer_controller["Customers API<br/>controller"]
  node_medication_controller["Medications API<br/>controller"]
  node_alert_controller["Alerts API<br/>controller"]
  node_api_response["API response<br/>helper<br/>[ApiResponse.php]"]
  node_ensure_role["Role guard<br/>middleware"]
  node_login_request["Login request<br/>validation<br/>[LoginRequest.php]"]
  node_order_requests["Order requests<br/>validation"]
  node_med_request["Medication request<br/>validation"]
  node_alert_requests["Alert requests<br/>validation"]
end

subgraph group_backend_domain["Domain services"]
  node_auth_service["Auth service<br/>[AuthService.php]"]
  node_order_service["Order service<br/>[OrderService.php]"]
  node_customer_service["Customer service"]
  node_medication_service["Medication service"]
  node_alert_service["Alert service<br/>[AlertService.php]"]
  node_sms_service["SMS service<br/>integration<br/>[SmsService.php]"]
  node_send_job["Alert job<br/>queue job"]
end

subgraph group_backend_data["Data layer"]
  node_repo_provider["Repo bindings<br/>provider"]
  node_order_repo["Order repo"]
  node_customer_repo["Customer repo"]
  node_med_repo["Medication repo"]
  node_alert_repo["Alert repo"]
  node_user_repo["User repo<br/>[UserRepository.php]"]
end

subgraph group_backend_ops["Runtime & ops"]
end

node_routes_web -->|"serves"| node_blade_shell
node_routes_api -->|"maps"| node_auth_controller
node_routes_api -->|"maps"| node_order_controller
node_routes_api -->|"maps"| node_customer_controller
node_routes_api -->|"maps"| node_medication_controller
node_routes_api -->|"maps"| node_alert_controller
node_vue_main -->|"uses"| node_vue_router
node_vue_main -->|"uses"| node_vue_store
node_vue_main -->|"uses"| node_vue_api
node_vue_router -->|"loads"| node_login_view
node_vue_router -->|"loads"| node_dashboard_view
node_dashboard_view -->|"composes"| node_ui_components
node_login_view -->|"calls"| node_vue_api
node_dashboard_view -->|"calls"| node_vue_api
node_auth_controller -->|"validates"| node_login_request
node_auth_controller -->|"delegates"| node_auth_service
node_auth_controller -->|"returns"| node_api_response
node_order_controller -->|"validates"| node_order_requests
node_order_controller -->|"delegates"| node_order_service
node_order_controller -->|"returns"| node_api_response
node_customer_controller -->|"delegates"| node_customer_service
node_customer_controller -->|"returns"| node_api_response
node_medication_controller -->|"validates"| node_med_request
node_medication_controller -->|"delegates"| node_medication_service
node_medication_controller -->|"returns"| node_api_response
node_alert_controller -->|"validates"| node_alert_requests
node_alert_controller -->|"delegates"| node_alert_service
node_alert_controller -->|"returns"| node_api_response
node_order_controller -->|"guards"| node_ensure_role
node_alert_controller -->|"guards"| node_ensure_role
node_auth_service -->|"uses"| node_user_repo
node_order_service -->|"uses"| node_order_repo
node_order_service -->|"uses"| node_customer_repo
node_order_service -->|"uses"| node_med_repo
node_customer_service -->|"uses"| node_customer_repo
node_medication_service -->|"uses"| node_med_repo
node_alert_service -->|"uses"| node_alert_repo
node_alert_service -->|"uses"| node_order_repo
node_alert_service -->|"uses"| node_sms_service
node_alert_service -->|"dispatches"| node_send_job
node_repo_provider -->|"binds"| node_order_repo
node_repo_provider -->|"binds"| node_customer_repo
node_repo_provider -->|"binds"| node_med_repo
node_repo_provider -->|"binds"| node_alert_repo
node_repo_provider -->|"binds"| node_user_repo

click node_blade_shell "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/views/pharmacovigilance/index.blade.php"
click node_vue_main "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/main.js"
click node_vue_router "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/router.js"
click node_vue_store "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/store.js"
click node_vue_api "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/api.js"
click node_login_view "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/views/LoginView.vue"
click node_dashboard_view "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/views/DashboardView.vue"
click node_ui_components "https://github.com/danielcriollo/pharmacovigilance-lifefile/tree/main/resources/js/pharmacovigilance/components"
click node_routes_web "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/routes/web.php"
click node_routes_api "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/routes/api.php"
click node_auth_controller "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Auth/AuthController.php"
click node_order_controller "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Orders/OrderController.php"
click node_customer_controller "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Customers/CustomerController.php"
click node_medication_controller "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Medications/MedicationController.php"
click node_alert_controller "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Alerts/AlertController.php"
click node_api_response "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Helpers/ApiResponse.php"
click node_ensure_role "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Middleware/EnsureUserHasRole.php"
click node_login_request "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Requests/Auth/LoginRequest.php"
click node_order_requests "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Requests/Orders/OrderIndexRequest.php"
click node_med_request "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Requests/Medications/SearchMedicationRequest.php"
click node_alert_requests "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Requests/Alerts/SendAlertRequest.php"
click node_auth_service "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/AuthService.php"
click node_order_service "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/OrderService.php"
click node_customer_service "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/CustomerService.php"
click node_medication_service "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/MedicationService.php"
click node_alert_service "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/AlertService.php"
click node_sms_service "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/SmsService.php"
click node_send_job "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Jobs/SendAlertForOrderJob.php"
click node_repo_provider "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Providers/RepositoryServiceProvider.php"
click node_order_repo "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/OrderRepository.php"
click node_customer_repo "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/CustomerRepository.php"
click node_med_repo "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/MedicationRepository.php"
click node_alert_repo "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/AlertRepository.php"
click node_user_repo "https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/UserRepository.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_blade_shell,node_vue_main,node_vue_router,node_vue_store,node_vue_api,node_login_view,node_dashboard_view,node_ui_components toneBlue
class node_routes_web,node_routes_api,node_auth_controller,node_order_controller,node_customer_controller,node_medication_controller,node_alert_controller,node_api_response,node_ensure_role,node_login_request,node_order_requests,node_med_request,node_alert_requests toneAmber
class node_auth_service,node_order_service,node_customer_service,node_medication_service,node_alert_service,node_sms_service,node_send_job toneMint
class node_repo_provider,node_order_repo,node_customer_repo,node_med_repo,node_alert_repo,node_user_repo toneRose
```

## Components

### Vue SPA

Single-page frontend for pharmacovigilance workflows.

- [SPA shell](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/views/pharmacovigilance/index.blade.php): Blade entry · Serves the single-page application container for the frontend. · `resources/views/pharmacovigilance/index.blade.php`
- [App entry](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/main.js): Vue bootstrap · Bootstraps the pharmacovigilance SPA. · `resources/js/pharmacovigilance/main.js`
- [Router](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/router.js): Vue Router · Defines SPA navigation between login and dashboard. · `resources/js/pharmacovigilance/router.js`
- [Store](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/store.js): Pinia state · Shared client state for auth and app data. · `resources/js/pharmacovigilance/store.js`
- [API client](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/api.js): HTTP client · Centralized API calls and token handling for the SPA. · `resources/js/pharmacovigilance/api.js`
- [Login view](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/views/LoginView.vue): screen · Authentication screen. · `resources/js/pharmacovigilance/views/LoginView.vue`
- [Dashboard](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/resources/js/pharmacovigilance/views/DashboardView.vue): screen · Main operational screen for searches and alerts. · `resources/js/pharmacovigilance/views/DashboardView.vue`
- [UI widgets](https://github.com/danielcriollo/pharmacovigilance-lifefile/tree/main/resources/js/pharmacovigilance/components): components · Reusable search, order, customer, and alert modals/tables. · `resources/js/pharmacovigilance/components`

### HTTP boundary

Laravel entrypoints, controllers, requests, and middleware.

- [Web routes](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/routes/web.php): routing · Serves the SPA shell. · `routes/web.php`
- [API routes](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/routes/api.php): routing · Exposes authenticated pharmacovigilance endpoints. · `routes/api.php`
- [Auth API](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Auth/AuthController.php): controller · Handles login and auth-related API requests. · `app/Http/Controllers/Api/Auth/AuthController.php`
- [Orders API](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Orders/OrderController.php): controller · Search, index, and export order workflows. · `app/Http/Controllers/Api/Orders/OrderController.php`
- [Customers API](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Customers/CustomerController.php): controller · Customer lookup and retrieval endpoints. · `app/Http/Controllers/Api/Customers/CustomerController.php`
- [Medications API](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Medications/MedicationController.php): controller · Medication search endpoints. · `app/Http/Controllers/Api/Medications/MedicationController.php`
- [Alerts API](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Controllers/Api/Alerts/AlertController.php): controller · Alert creation and bulk dispatch endpoints. · `app/Http/Controllers/Api/Alerts/AlertController.php`
- [API response](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Helpers/ApiResponse.php): helper · Standard JSON response helper. · `app/Helpers/ApiResponse.php`
- [Role guard](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Middleware/EnsureUserHasRole.php): middleware · Enforces role-based access for privileged actions. · `app/Http/Middleware/EnsureUserHasRole.php`
- [Login request](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Requests/Auth/LoginRequest.php): validation · Validates inbound login payloads. · `app/Http/Requests/Auth/LoginRequest.php`
- [Order requests](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Requests/Orders/OrderIndexRequest.php): validation · Validates order search and export inputs. · `app/Http/Requests/Orders/OrderIndexRequest.php`
- [Medication request](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Requests/Medications/SearchMedicationRequest.php): validation · Validates medication search inputs. · `app/Http/Requests/Medications/SearchMedicationRequest.php`
- [Alert requests](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Http/Requests/Alerts/SendAlertRequest.php): validation · Validates single and bulk alert payloads. · `app/Http/Requests/Alerts/SendAlertRequest.php`

### Domain services

Business logic and notification orchestration.

- [Auth service](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/AuthService.php): service · Implements login and session/token behavior. · `app/Services/AuthService.php`
- [Order service](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/OrderService.php): service · Coordinates affected-order search and export workflows. · `app/Services/OrderService.php`
- [Customer service](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/CustomerService.php): service · Encapsulates customer-facing domain logic. · `app/Services/CustomerService.php`
- [Medication service](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/MedicationService.php): service · Encapsulates medication lookup logic. · `app/Services/MedicationService.php`
- [Alert service](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/AlertService.php): service · Creates alerts and orchestrates notification dispatch. · `app/Services/AlertService.php`
- [SMS service](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Services/SmsService.php): integration · Wraps external SMS delivery. · `app/Services/SmsService.php`
- [Alert job](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Jobs/SendAlertForOrderJob.php): queue job · Asynchronous bulk alert dispatch. · `app/Jobs/SendAlertForOrderJob.php`

### Data layer

Repositories, models, and database-backed persistence.

- [Repo bindings](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Providers/RepositoryServiceProvider.php): provider · Binds repository contracts to implementations. · `app/Providers/RepositoryServiceProvider.php`
- [Order repo](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/OrderRepository.php): repository · Order persistence and query access. · `app/Repositories/OrderRepository.php`
- [Customer repo](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/CustomerRepository.php): repository · Customer persistence and query access. · `app/Repositories/CustomerRepository.php`
- [Medication repo](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/MedicationRepository.php): repository · Medication persistence and query access. · `app/Repositories/MedicationRepository.php`
- [Alert repo](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/AlertRepository.php): repository · Alert persistence and lookup access. · `app/Repositories/AlertRepository.php`
- [User repo](https://github.com/danielcriollo/pharmacovigilance-lifefile/blob/main/app/Repositories/UserRepository.php): repository · User persistence and lookup access. · `app/Repositories/UserRepository.php`

## Connections

- Web routes → SPA shell: serves · Web route returns the SPA entry page.
- API routes → Auth API: maps · Auth endpoints are routed to the auth controller.
- API routes → Orders API: maps · Order endpoints are routed to the order controller.
- API routes → Customers API: maps · Customer endpoints are routed to the customer controller.
- API routes → Medications API: maps · Medication endpoints are routed to the medication controller.
- API routes → Alerts API: maps · Alert endpoints are routed to the alert controller.
- App entry → Router: uses · SPA entry initializes navigation.
- App entry → Store: uses · SPA entry initializes shared state.
- App entry → API client: uses · SPA entry wires the HTTP client.
- Router → Login view: loads · Router exposes the login screen.
- Router → Dashboard: loads · Router exposes the dashboard screen.
- Dashboard → UI widgets: composes · Dashboard assembles reusable workflow components.
- Login view → API client: calls · Login submits credentials through the API client.
- Dashboard → API client: calls · Dashboard issues searches and alert actions through the API client.
- Auth API → Login request: validates · Login input is validated before auth logic runs.
- Auth API → Auth service: delegates · Controller delegates authentication work to the service layer.
- Auth API → API response: returns · Controller standardizes JSON output.
- Orders API → Order requests: validates · Order query and export input are validated first.
- Orders API → Order service: delegates · Order controller delegates business logic.
- Orders API → API response: returns · Controller standardizes JSON output.
- Customers API → Customer service: delegates · Customer controller delegates business logic.
- Customers API → API response: returns · Controller standardizes JSON output.
- Medications API → Medication request: validates · Medication search input is validated.
- Medications API → Medication service: delegates · Medication controller delegates business logic.
- Medications API → API response: returns · Controller standardizes JSON output.
- Alerts API → Alert requests: validates · Single and bulk alert input is validated.
- Alerts API → Alert service: delegates · Alert controller delegates notification workflows.
- Alerts API → API response: returns · Controller standardizes JSON output.
- Orders API → Role guard: guards · Privileged order exports and related actions are role protected.
- Alerts API → Role guard: guards · Alert dispatch is role protected.
- Auth service → User repo: uses · Authentication depends on user lookup through repository abstractions.
- Order service → Order repo: uses · Order workflows query persistence through repositories.
- Order service → Customer repo: uses · Order search correlates customers through repositories.
- Order service → Medication repo: uses · Order search correlates medications through repositories.
- Customer service → Customer repo: uses · Customer logic uses repository access.
- Medication service → Medication repo: uses · Medication logic uses repository access.
- Alert service → Alert repo: uses · Alert records are persisted through repositories.
- Alert service → Order repo: uses · Alert workflows need order context.
- Alert service → SMS service: uses · Alert service triggers SMS delivery.
- Alert service → Alert job: dispatches · Bulk alerting is pushed to the queue.
- Repo bindings → Order repo: binds · Registers the order repository implementation.
- Repo bindings → Customer repo: binds · Registers the customer repository implementation.
- Repo bindings → Medication repo: binds · Registers the medication repository implementation.
- Repo bindings → Alert repo: binds · Registers the alert repository implementation.
- Repo bindings → User repo: binds · Registers the user repository implementation.
