## 1. Introduction

# 1. Introduction

This document provides a comprehensive overview of the current capabilities, limitations, and business requirements related to order management and CSV bulk import functionality within the target system. The scope includes functional requirements, system constraints, business drivers, and architectural boundaries as they pertain to order creation, payment processing, and notification services.

The primary business objective is to enhance operational efficiency for corporate customers by enabling the bulk import of large order volumes (ranging from 100 to 10,000 orders) via CSV files. This requirement is driven by repeated customer requests and aims to streamline business processes that are currently hindered by manual, single-entry order creation workflows. The current system only supports the creation of one order at a time through the REST API or administrative user interface, with no support for file-based (CSV, Excel) order import or batch processing capabilities. As a result, large-scale order processing is inefficient and time-consuming, requiring thousands of individual API calls for high-volume scenarios [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f], [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-155b5f4a-d232-4166-bb96-ba158f86ceb1], [KB-1603dccf-0e13-426d-a4c3-527af9e69c16], [KB-161f44bf-9450-491f-b894-1fd70c185060].

The document details the following key aspects:

- **Current System Limitations:**  
  The system does not provide any endpoints or mechanisms for CSV/file-based order import. All order creation, payment processing, and notification delivery are strictly single-entry and sequential. There is no support for batch APIs, bulk payment processing, or bulk notification delivery. Each order requires an individual API call for creation, payment, and notification, resulting in significant latency and operational inefficiency for large order volumes [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f], [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a], [KB-150eb89c-77b0-415b-a547-3ed0502eec24].

- **Business Need for Bulk Import:**  
  Multiple corporate customers have requested the ability to import large numbers of orders via CSV to improve efficiency and reduce manual workload. The lack of this capability is a significant operational bottleneck [KB-155b5f4a-d232-4166-bb96-ba158f86ceb1], [KB-1603dccf-0e13-426d-a4c3-527af9e69c16], [KB-161f44bf-9450-491f-b894-1fd70c185060].

- **Architectural Constraints:**  
  The system enforces a strict one-to-one relationship between orders and payments, with no support for grouping or correlating orders as part of a batch. There are no schema elements (e.g., batch_id, csv_source, bulk_import_group) to track or manage batch imports. All cross-service communication is synchronous REST, with no support for asynchronous or event-driven processing [KB-0f930ddc-1f3a-4014-a015-49fe1808f8d8], [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-0d7daadd-e958-4592-900a-55db91f8aa55].

- **Performance and Scalability Implications:**  
  Processing 10,000 orders requires 10,000 individual API calls, and all associated payment and notification operations are executed sequentially, resulting in extremely slow processing times for bulk operations [KB-150eb89c-77b0-415b-a547-3ed0502eec24], [KB-04a84995-0820-4319-c1582821058a], [KB-06c5403a-d177-4525-b247-1d7ae37a86b8].

- **User Interface and Experience:**  
  The current UI displays a disabled CSV import button and a banner indicating that CSV import is not implemented, reinforcing the absence of bulk import functionality [KB-16181d30-2dd3-421e-bab0-939cd85255d2].

This document serves as a foundational reference for stakeholders, architects, and developers to understand the current state, business drivers, and technical boundaries regarding order management and CSV bulk import. It is intended to inform future architectural decisions and requirements definition for the implementation of bulk order import capabilities.

**References:**  
[KB-146a6a29-932f-485d-96d6-6a92ee610336]  
[KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f]  
[KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c]  
[KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]  
[KB-150eb89c-77b0-415b-a547-3ed0502eec24]  
[KB-155b5f4a-d232-4166-bb96-ba158f86ceb1]  
[KB-1603dccf-0e13-426d-a4c3-527af9e69c16]  
[KB-161f44bf-9450-491f-b894-1fd70c185060]  
[KB-0f930ddc-1f3a-4014-a015-49fe1808f8d8]  
[KB-04a84995-0820-4319-c1582821058a]  
[KB-06c5403a-d177-4525-b247-1d7ae37a86b8]

## 2. Functional Requirements

## 2. Functional Requirements

### 2.1 Order Creation

- The system must support creation of a single order at a time via REST API. Each order requires customer information (name, email) and order details (item name, quantity, unit price).  
  [KB-0e0f1dd0-0f46-4d13-a092-e3cdc6fdd205], [KB-146a6a29-932f-485d-96d6-6a92ee610336]

- The total order amount must be automatically calculated as the sum of (quantity × unit price) for all order items.  
  [KB-0e0f1dd0-0f46-4d13-a092-e3cdc6fdd205]

- Orders can only be created individually; there is no capability for bulk or batch order creation.  
  [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f]

### 2.2 Order Listing and Retrieval

- The system must provide paginated listing of orders with parameters for skip (default 0) and limit (default 20).  
  [KB-0972bd0e-7d3f-4b2c-a364-813e023a3495], [KB-0e0f1dd0-0f46-4d13-a092-e3cdc6fdd205]

- The system must support retrieval of a single order by order ID, including associated items.  
  [KB-0972bd0e-7d3f-4b2c-a364-813e023a3495], [KB-0e0f1dd0-0f46-4d13-a092-e3cdc6fdd205]

### 2.3 Order Status Management

- The system must allow updating of order status via API. Setting status to SHIPPED must trigger a shipping notification.  
  [KB-0972bd0e-7d3f-4b2c-a364-813e023a3495]

- The system must support order cancellation, which triggers refund processing via Payment Service and sends a cancellation notification via Notification Service.  
  [KB-0972bd0e-7d3f-4b2c-a364-813e023a3495], [KB-186b33d7-f985-455b-8117-0cd019912510]

### 2.4 Payment Processing

- Payment processing is performed individually per order. There is no batch payment API; each order requires a separate payment API call.  
  [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]

- Payment API request must include order_id, amount, and currency ("JPY").  
  [KB-1718c2d8-b71b-4113-9906-a6d9765958ff], [KB-186b33d7-f985-455b-8117-0cd019912510]

- Payment amount per transaction is limited to a maximum of 1,000,000 JPY.  
  [KB-01305cb3-d331-4b4b-ba02-69ada467b41d], [KB-10744011-e9ca-48b5-ac6d-4f9f3627b7e6]

- Payment processing is sequential; there is no parallel processing capability.  
  [KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf], [KB-150eb89c-77b0-415b-a547-3ed0502eec24]

- On payment failure, the order status is reverted to PENDING and the error is logged. No retry or circuit breaker mechanism is implemented.  
  [KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf], [KB-150eb89c-77b0-415b-a547-3ed0502eec24]

### 2.5 Notification Processing

- Notifications are sent individually per order. There is no bulk notification capability; each notification requires a separate API call.  
  [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a], [KB-146a6a29-932f-485d-96d6-6a92ee610336]

- Notification Service API is rate-limited to 10 requests per second.  
  [KB-01305cb3-d331-4b4b-ba02-69ada467b41d], [KB-06c5403a-d177-4525-b247-1d7ae37a86b8]

- Notification processing is sequential; there is no parallel or batch notification capability.  
  [KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf], [KB-150eb89c-77b0-415b-a547-3ed0502eec24]

### 2.6 CSV/Bulk Import Functionality

- The system does not support CSV or file-based order import. There is no endpoint or mechanism to upload and process order data from files (CSV, Excel, etc.).  
  [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f], [KB-16181d30-2dd3-421e-bab0-939cd85255d2]

- There is no UI for bulk order import (no CSV upload, drag-and-drop, or batch creation form).  
  [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f], [KB-16181d30-2dd3-421e-bab0-939cd85255d2]

- Orders table schema does not include batch_id, csv_source, or bulk_import_group fields; batch import tracking is not possible.  
  [KB-0f930ddc-1f3a-4014-a015-49fe1808f8d8], [KB-02c65582-456a-4ffe-8f7b-7d37af08e656]

### 2.7 Progress Tracking and Error Handling

- The system does not provide progress tracking for batch operations, as batch operations are not supported.  
  [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a], [KB-0e28e3cb-6977-43b1-ba8e-1ed80f2de11e]

- There is no mechanism for partial failure handling in batch operations.  
  [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]

### 2.8 Cross-Service Integration

- All inter-service API calls (Order → Payment → Notification) are synchronous REST over HTTP, with timeouts of 30 seconds for payment and 10 seconds for notification/webhook.  
  [KB-0d7daadd-e958-4592-900a-55db91f8aa55], [KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf], [KB-1718c2d8-b71b-4113-9906-a6d9765958ff]

- Each cross-service API call carries a single order_id per request; bulk payloads are not supported.  
  [KB-01305cb3-d331-4b4b-ba02-69ada467b41d]

---

**Summary Table of Key Functional Requirements**

| Requirement Area        | Functional Requirement                                                                                   | Source Reference                                      |
|------------------------|----------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| Order Creation         | Single order creation only; customer info and order details required                                     | [KB-0e0f1dd0-0f46-4d13-a092-e3cdc6fdd205], [KB-146a6a29-932f-485d-96d6-6a92ee610336] |
| Order Listing          | Paginated listing, single order retrieval                                                                | [KB-0972bd0e-7d3f-4b2c-a364-813e023a3495], [KB-0e0f1dd0-0f46-4d13-a092-e3cdc6fdd205]  |
| Order Status           | Status update, cancellation triggers refund and notification                                             | [KB-0972bd0e-7d3f-4b2c-a364-813e023a3495], [KB-186b33d7-f985-455b-8117-0cd019912510]  |
| Payment Processing     | Individual payment per order, max 1,000,000 JPY, sequential, no retry/circuit breaker                    | [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf]  |
| Notification           | Individual notification per order, rate limit 10/sec, sequential                                         | [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c], [KB-06c5403a-d177-4525-b247-1d7ae37a86b8]   |
| CSV/Bulk Import        | Not supported; no UI, no API, no schema for batch tracking                                               | [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-0f930ddc-1f3a-4014-a015-49fe1808f8d8]   |
| Progress/Error         | No progress tracking or partial failure handling for batch operations                                    | [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]             |
| Cross-Service Calls    | Synchronous REST, single order_id per call, sequential                                                   | [KB-0d7daadd-e958-4592-900a-55db91f8aa55], [KB-01305cb3-d331-4b4b-ba02-69ada467b41d]   |

---

**Note:** All requirements are strictly based on the provided context. No bulk order import, batch payment, or batch notification functionality is present in the current system.  
All references are cited per ISO-29148 requirements.

## 3. Non-Functional Requirements

# 3. Non-Functional Requirements

This section defines the non-functional requirements for the system, including performance, security, reliability, and system limitations. All requirements are derived exclusively from the provided context.

---

## 3.1 Performance Requirements

### 3.1.1 API Response Time and Throughput

| Metric                      | Target                    | Measurement              |
|-----------------------------|---------------------------|--------------------------|
| API response time (p50)     | < 200ms                   | Application metrics      |
| API response time (p95)     | < 500ms                   | Application metrics      |
| API response time (p99)     | < 1,000ms                 | Application metrics      |
| Page load time (initial)    | < 2 seconds               | Lighthouse measurement   |
| Page load time (subsequent) | < 1 second                | Client-side metrics      |
| System availability         | 99.9% (8.77 hrs/year max) | Uptime monitoring        |
| Concurrent users            | 500+ simultaneous         | Load testing             |
| Database query time (avg)   | < 100ms                   | RDS Performance Insights |
| API throughput              | > 1,000 req/min           | Load testing             |

[KB-0d9e59c7-0414-46c2-b302-2f4cbc1e9e88]

### 3.1.2 Bulk and Batch Processing Performance

- **No batch or bulk order creation:** All order creation is single-entry only. Bulk or batch order creation capabilities do not exist. Orders must be created one at a time via the REST API. [KB-146a6a29-932f-485d-96d6-6a92ee610336]
- **No CSV/file-based import:** There is no endpoint or mechanism to upload and process order data from files (CSV, Excel, etc.). [KB-146a6a29-932f-485d-96d6-6a92ee610336]
- **Payment processing is single-transaction:** No batch payment API exists. Each order requires an individual payment API call. [KB-146a6a29-932f-485d-96d6-6a92ee610336]
- **Notification processing is single-message:** Notifications are sent individually per order. No bulk notification capability exists. Each notification requires a separate API call. [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]
- **Service calls are sequential:** Order creation flow (Order → Payment → Notification) executes sequentially. No parallel processing of payment and notification. [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]
- **No progress tracking for batch operations:** The system has no mechanism to track progress of multi-item operations because no batch operations exist. [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]

---

## 3.2 Security Requirements

### 3.2.1 Authentication and Authorization

| Feature                 | Implementation                             | Priority   |
|-------------------------|--------------------------------------------|------------|
| Authentication          | OAuth 2.0 Resource Server + Azure AD       | Critical   |
| Authorization           | Method-level @PreAuthorize with SpEL       | Critical   |
| CSRF Protection         | SameSite cookies + CSRF tokens             | High       |
| CORS Policy             | Whitelist-based origin validation          | High       |
| Content Security Policy | Strict CSP headers                         | High       |
| Rate Limiting           | Bucket4j with Redis backend                | Medium     |
| Input Validation        | Bean Validation + custom validators        | Critical   |
| Output Encoding         | OWASP Java Encoder                         | Critical   |
| Session Management      | Stateless (JWT) with Redis token blacklist | Critical   |
| Dependency Scanning     | OWASP Dependency-Check in CI/CD            | High       |

[KB-0910e88e-c115-4412-a137-d96b5c1a2082]

### 3.2.2 Multi-Factor Authentication (MFA)

| Access Scenario              | MFA Method               | Fallback Method    |
|------------------------------|--------------------------|--------------------|
| Web application login        | TOTP (Authenticator App) | SMS (backup)       |
| VPN remote access            | TOTP                     | Hardware token     |
| AWS Console access           | FIDO2 / U2F              | TOTP               |
| Administrative actions       | Step-up TOTP             | Manager override   |
| PHI bulk export              | Step-up TOTP             | Not available      |
| Emergency break-glass access | Physical token           | Dual authorization |

[KB-131c1759-15a3-44df-a1d7-6ebd04de62ff]

### 3.2.3 Error Handling and Information Disclosure

- **Error responses in production must NEVER contain:** PHI, stack traces, SQL queries, internal file paths, server names, or framework version information. Violations are treated as security incidents. [KB-10300d8a-a98a-4726-9be3-3957c2fe7bf4], [KB-140ca7f3-3348-4419-b06b-89561882a35e]

### 3.2.4 Data Security

| Control                          | Implementation                        | HIPAA Reference    |
|----------------------------------|---------------------------------------|--------------------|
| Encryption at rest (database)    | AWS RDS encryption (AES-256)          | §164.312(a)(2)(iv) |
| Encryption at rest (files)       | S3 SSE-KMS (AES-256)                  | §164.312(a)(2)(iv) |
| Encryption at rest (field-level) | JPA AttributeConverter + AES-256-GCM  | §164.312(a)(2)(iv) |
| Encryption in transit            | TLS 1.3 (all communications)          | §164.312(e)(1)     |
| Key Management                   | AWS KMS (customer-managed CMKs)       | §164.312(a)(2)(iv) |
| Data masking (dev/test)          | Faker-based synthetic data pipeline   | §164.514(b)(2)     |

[KB-116f84fb-2eec-4493-9762-414a92624981]

---

## 3.3 Reliability and Availability

- **System availability:** 99.9% uptime (maximum 8.77 hours downtime per year). [KB-0d9e59c7-0414-46c2-b302-2f4cbc1e9e88]
- **No retry or circuit breaker on cross-service calls:** Failures are logged but not retried. [KB-01305cb3-d331-4b4b-ba02-69ada467b41d], [KB-150eb89c-77b0-415b-a547-3ed0502eec24]
- **No batch error handling:** If one item in a batch fails, there is no mechanism to continue processing the remaining items, as batch operations are not supported. [KB-04a84995-0820-4319-9d26-c1582821058a]
- **All inter-service communication is synchronous REST over HTTP:** No message broker, event bus, or asynchronous channels. [KB-0d7daadd-e958-4592-900a-55db91f8aa55]

---

## 3.4 System Limitations

| ID      | Limitation                                                                                                   | Impact Area          | Severity   |
|---------|--------------------------------------------------------------------------------------------------------------|----------------------|------------|
| LIM-001 | Order creation is single-entry only. No bulk or batch order creation capability exists.                      | Order Service        | High       |
| LIM-002 | No CSV/file-based order import functionality.                                                                | Order Service        | High       |
| LIM-003 | Payment processing handles one transaction at a time. No batch payment API exists.                           | Payment Service      | High       |
| LIM-004 | Notifications are sent individually per order. No bulk notification capability exists.                        | Notification Service | Medium     |
| LIM-005 | Cross-service calls are sequential. No parallel processing of payment and notification.                       | All Services         | Medium     |
| LIM-006 | No progress tracking for batch operations. No mechanism to track progress of multi-item operations.           | All Services         | Medium     |

[KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]

---

## 3.5 Data Retention and Audit

- **Audit log retention:** Authentication, PHI access, modification, administrative, and security events are retained for 7-8 years depending on event type, with tiered hot/warm/cold storage. [KB-059dda76-1df0-4539-a60b-e504ba4e11ea]
- **Audit controls:** Comprehensive audit logging is required for all PHI access and modification events. [KB-05741ca9-5822-4eb0-91b0-d660322e06d0]

---

## 3.6 Compliance

- **HIPAA Compliance:** All security, privacy, and audit requirements must be met, including encryption, access control, audit trail, and breach notification. [KB-0f3989d4-36c1-4054-923c-c250f04c3ec3], [KB-116f84fb-2eec-4493-9762-414a92624981]
- **PHI in responses:** All responses containing PHI must include `Cache-Control: no-store` and `Pragma: no-cache` headers to prevent client-side caching. [KB-16e42083-f456-49c3-527af9e69c16]

---

## 3.7 Versioning

- **API versioning:** Only major versions are included in the URL (e.g., /v1/patients). Minor and patch changes are backward-compatible. Deprecation notice is a minimum of 6 months before version retirement. Maximum of 2 active versions at any time. [KB-10300d8a-a98a-4726-9be3-3957c2fe7bf4], [KB-140ca7f3-3348-4419-b06b-89561882a35e]

---

If additional non-functional requirements are needed, please provide further context.

## 4. Architecture

## 4. Architecture

### 4.1 Overview

The current system architecture for order management and related services is based on a microservices model, with REST API interfaces connecting three primary backend services: Order Service, Payment Service, and Notification Service. The frontend is implemented as a React single-page application (SPA) that interacts with these backend services exclusively via synchronous REST calls. There is no message broker, event bus, or asynchronous communication channel in place. [KB-050d0be4-11bc-4945-80e4-1e3a1d85fc99], [KB-0d7daadd-e958-4592-900a-55db91f8aa55]

### 4.2 System Components

#### Backend Services

- **Order Service**: Handles creation, retrieval, update, and cancellation of orders. Only single-entry order creation is supported; bulk or batch order creation is not available. [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c]
- **Payment Service**: Processes payments for individual orders. Batch payment APIs are not supported; each order requires a separate API call for payment processing. [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]
- **Notification Service**: Sends notifications (e.g., order confirmation emails) individually per order. There is no bulk notification capability; each notification requires a separate API call. [KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]

#### Frontend

- **React SPA**: Provides the web management interface for order operations. Features include single order creation, client-side filtering and sorting, and order detail views. Bulk import functionality (CSV upload, drag-and-drop, batch creation form) is not implemented; related UI elements are disabled or display warnings. [KB-16181d30-2dd3-421e-bab0-939cd85255d2], [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f]

#### Data Storage

- Each service maintains its own data store. For audit and compliance, logs are stored in PostgreSQL, CloudWatch, and Elasticsearch. [KB-1a54c453-d6ee-488f-bbdc-311c467a9661]

### 4.3 Communication Patterns

| Pattern         | Purpose                      | Timeout                    |
|-----------------|-----------------------------|----------------------------|
| Synchronous REST| All inter-service calls      | 30s (Payment), 10s (Notification/Webhook) |
| Webhook (REST)  | Payment → Order status update| 10s                        |

All service calls are executed sequentially. For example, order creation involves: saving the order, processing payment, then sending notification, each step waiting for the previous to complete. There is no parallel processing or queue-based handling. [KB-0d7daadd-e958-4592-900a-55db91f8aa55], [KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf], [KB-150eb89c-77b0-415b-a547-3ed0502eec24]

### 4.4 Architectural Constraints

| ID      | Limitation                                                                                                  | Impact Area          | Severity   |
|---------|-------------------------------------------------------------------------------------------------------------|----------------------|------------|
| LIM-001 | Order creation is single-entry only. No bulk or batch order creation capability exists.                     | Order Service        | High       |
| LIM-002 | No CSV/file-based order import functionality. No endpoint or mechanism to upload and process order data.    | Order Service        | High       |
| LIM-003 | Payment processing handles one transaction at a time. No batch payment API exists.                          | Payment Service      | High       |
| LIM-004 | Notifications are sent individually per order. No bulk notification capability exists.                      | Notification Service | Medium     |
| LIM-005 | Cross-service calls are sequential. No parallel processing of payment and notification.                     | All Services         | Medium     |
| LIM-006 | No progress tracking for batch operations. No mechanism to track multi-item operations.                     | All Services         | Medium     |

[KB-146a6a29-932f-485d-96d6-6a92ee610336], [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f], [KB-0a7d4d64-4d48-4214-94eb-2f3f278ec66a]

Additional constraints:
- **No bulk import UI**: No CSV upload, no drag-and-drop, no batch creation form. [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f]
- **N+1 API pattern**: No list-all endpoints; frontend must make individual calls for each payment and notification. [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f]
- **Client-side aggregation only**: Dashboard statistics are computed in the browser, not on the backend. [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f]
- **No real-time updates**: Polling-based, no WebSocket. [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f]
- **Single-language (Japanese)**: No i18n framework. [KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f]

### 4.5 Data Model Constraints

- **Orders Table**: No batch_id, csv_source, or bulk_import_group columns. There is no mechanism to track which orders belong to a batch import. [KB-0f930ddc-1f3a-4014-a015-49fe1808f8d8]
- **Payments Table**: 1:1 unique constraint between order_id and payment. No batch grouping possible. [KB-11739ab0-b209-41e4-b73e-7d7e0c4338b2]
- **Amount Limit**: Maximum 1,000,000 JPY per transaction. [KB-01305cb3-d331-4b4b-ba02-69ada467b41d], [KB-10744011-e9ca-48b5-ac6d-4f9f3627b7e6]

### 4.6 Service-Level Interfaces

#### Order Service → Payment Service

| Item         | Value                                             |
|--------------|---------------------------------------------------|
| Endpoint     | POST /api/v1/payments                             |
| Trigger      | Order creation                                    |
| Payload      | {"order_id": N, "amount": N.N, "currency": "JPY"} |
| Timeout      | 30 seconds                                        |
| On Failure   | Order status reverted to PENDING                  |

[KB-1718c2d8-b71b-4113-9906-a6d9765958ff], [KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf]

#### Order Service → Notification Service

| Item         | Value                                             |
|--------------|---------------------------------------------------|
| Endpoint     | POST /api/v1/notifications/email                  |
| Trigger      | Order creation                                    |
| Payload      | {"order_id": N, "email": "customer@example.com"}  |
| Rate Limit   | 10 notifications/second                           |
| On Failure   | Error logged; no retry                            |

[KB-05a9aed3-6a71-4c74-ac19-6bfec293268b], [KB-1718c2d8-b71b-4113-9906-a6d9765958ff]

### 4.7 Performance Characteristics

- **Sequential Processing**: Steps in order creation (save, payment, notification) are executed sequentially. For large volumes (e.g., 10,000 orders), this results in significant latency due to the lack of parallelism. [KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf], [KB-150eb89c-77b0-415b-a547-3ed0502eec24]
- **Notification Rate Limiting**: 10 notifications/second; sending 10,000 notifications requires at least 17 minutes. [KB-01305cb3-d331-4b4b-ba02-69ada467b41d], [KB-06c5403a-d177-4525-b247-1d7ae37a86b8]
- **No Retry/Circuit Breaker**: Failures in cross-service calls are logged but not retried; there is no circuit breaker implementation. [KB-01305cb3-d331-4b4b-ba02-69ada467b41d], [KB-150eb89c-77b0-415b-a547-3ed0502eec24]

### 4.8 Security and Compliance

- **Error Handling**: Production error responses must not contain PHI, stack traces, SQL queries, internal file paths, server names, or framework version information. [KB-10300d8a-a98a-4726-9be3-3957c2fe7bf4], [KB-140ca7f3-cf60-4021-9822-34a48d940c94]
- **Data Protection**: All responses containing PHI must include Cache-Control: no-store and Pragma: no-cache headers. [KB-16e42083-f456-49a3-959d-419cdb9fc31d]
- **Audit Logging**: Comprehensive audit logs are maintained for all PHI access and modification events. [KB-122ffdd6-c824-4443-8d2b-baab3d94a6ec], [KB-1a54c453-d6ee-488f-bbdc-311c467a9661]

### 4.9 Architectural Diagrams

#### Backend Service Diagram (Excerpt)

```
┌────────────┐    ┌──────────────┐    ┌──────────────────┐
│ Order      │    │ Payment      │    │ Notification     │
│ Service    │    │ Service      │    │ Service          │
└────────────┘    └──────────────┘    └──────────────────┘
       │                │                   │
       └───────────────►│                   │
           REST API     │                   │
                        └──────────────────►│
                            REST API        │
                                            │
```
[KB-050d0be4-11bc-4945-80e4-1e3a1d85fc99], [KB-0d7daadd-e958-4592-900a-55db91f8aa55]

---

**References:**  
[KB-050d0be4-11bc-4945-80e4-1e3a1d85fc99],  
[KB-0d7daadd-e958-4592-900a-55db91f8aa55],  
[KB-146a6a29-932f-485d-96d6-6a92ee610336],  
[KB-05b70fbd-4026-4ac9-b1e2-e21dabe7da5c],  
[KB-0a36efdc-f63e-4c6b-8191-220e34d8af3f],  
[KB-16181d30-2dd3-421e-bab0-939cd85255d2],  
[KB-033639ab-c6f8-4f72-a373-bf76d05dd6cf],  
[KB-150eb89c-77b0-415b-a547-3ed0502eec24],  
[KB-06c5403a-d177-4525-b247-1d7ae37a86b8],  
[KB-0f930ddc-1f3a-4014-a015-49fe1808f8d8],  
[KB-11739ab0-b209-41e4-b73e-7d7e0c4338b2],  
[KB-1718c2d8-b71b-4113-9906-a6d9765958ff],  
[KB-05a9aed3-6a71-4c74-ac19-6bfec293268b],  
[KB-10300d8a-a98a-4726-9be3-3957c2fe7bf4],  
[KB-140ca7f3-cf60-4021-9822-34a48d940c94],  
[KB-16e42083-f456-49a3-959d-419cdb9fc31d],  
[KB-122ffdd6-c824-4443-8d2b-baab3d94a6ec],  
[KB-1a54c453-d6ee-488f-bbdc-311c467a9661]