# DBIS Volume II Documentation

This directory contains documentation for DBIS Expansion Volume II: Constitutional, Regulatory, Quantum Security, and Sovereign Risk Frameworks.

## Modules

### 1. Constitution & Governance
- **Location**: `src/core/governance/constitution/`
- **Services**: `constitution.service.ts`, `governance.service.ts`, `dispute-resolution.service.ts`
- **API Routes**: `/api/constitution`
- **Documentation**: [constitution.md](./constitution.md)

### 2. Quantum-Safe Cryptography
- **Location**: `src/infrastructure/quantum/`
- **Services**: `quantum-crypto.service.ts`, `migration-roadmap.service.ts`, `pqc-key-manager.service.ts`
- **API Routes**: (Internal services, no direct API)
- **Documentation**: [quantum-security.md](./quantum-security.md)

### 3. Sovereign Risk Index (SRI)
- **Location**: `src/core/risk/sri/`
- **Services**: `sri-calculator.service.ts`, `sri-monitor.service.ts`, `sri-enforcement.service.ts`
- **API Routes**: `/api/sri`
- **Documentation**: [sri.md](./sri.md)

### 4. Accounting & Reporting Standards
- **Location**: `src/core/accounting/`
- **Services**: `accounting-standards.service.ts`, `reporting-engine.service.ts`, `valuation.service.ts`
- **API Routes**: (Internal services, no direct API)
- **Documentation**: [accounting.md](./accounting.md)

### 5. Instant Settlement Network (ISN)
- **Location**: `src/core/settlement/isn/`
- **Services**: `isn-routing.service.ts`, `smart-clearing.service.ts`, `atomic-settlement.service.ts`
- **API Routes**: `/api/isn`
- **Documentation**: [isn.md](./isn.md)

### 6. RegTech Framework
- **Location**: `src/core/compliance/regtech/`
- **Services**: `supervision-engine.service.ts`, `dashboard.service.ts`, `sandbox.service.ts`
- **API Routes**: `/api/regtech`
- **Documentation**: [regtech.md](./regtech.md)

### 7. Internal Operations & HR
- **Location**: `src/core/operations/`
- **Services**: `role-management.service.ts`, `credentialing.service.ts`, `crisis-management.service.ts`
- **API Routes**: `/api/operations`
- **Documentation**: [operations.md](./operations.md)

## Database Schema

All Volume II models are defined in `prisma/schema.prisma`. Key models include:

- **Constitution**: `ConstitutionArticle`, `GovernanceBody`, `VotingRecord`, `DisputeResolution`
- **Quantum**: `QuantumMigrationPhase`, `CryptographicKey`, `MigrationAudit`
- **SRI**: `SovereignRiskIndex`, `SRIInput`, `SRIEnforcement`
- **Accounting**: `ConsolidatedStatement`, `SovereignReport`, `ValuationRule`
- **ISN**: `SettlementRoute`, `AtomicSettlement`, `SyntheticSettlementUnit`
- **RegTech**: `SupervisionRule`, `SupervisoryDashboard`, `ComplianceSandbox`
- **Operations**: `DbisRole`, `EmployeeCredential`, `CrisisProtocol`

## Integration

Volume II modules integrate with existing DBIS core services:

- **Rulebook Service**: References constitutional articles for eligibility checks
- **Risk Service**: Uses SRI for counterparty credit scoring and liquidity risk assessment
- **AML Service**: Integrates with RegTech supervision engine for behavior monitoring
- **Treasury Service**: Provides LCR/NSFR data to SRI calculator and checks SRI enforcement

## API Documentation

Full API documentation is available via Swagger UI at `/api-docs` when the server is running.

