import { PriceValue } from './price-value';
import { VatValue } from './vat-value';

// TODO: [Type System Refactoring - Medium Priority] Flatten nested price structure
// Current: 3-level nesting (Price → PriceValue → value), all optional (Complexity: 7/10)
// Target: Flat structure with required core fields
//
// Current structure:
//   interface Price {
//     value?: PriceValue;  // Optional nested
//     vat?: VatValue;      // Optional nested
//   }
//   - Requires: price?.value?.value to access actual price
//   - No runtime validation (all fields optional)
//   - 13 duplicate definitions across domains
//
// Proposed structure:
//   interface Price {
//     value: number;              // Required
//     vatType: VatType;           // Required
//     currency?: string;          // Optional
//     currencySymbol?: string;    // Optional
//     vatValue?: number;          // Optional
//     vatInPercent?: number;      // Optional
//     vatLabel?: string;          // Optional
//   }
//
// Benefits:
//   - 70% less nesting (price.value instead of price?.value?.value)
//   - Required fields prevent undefined access errors
//   - Single canonical definition (not 13 duplicates)
//   - Better runtime validation
//   - Simpler adapters (128 lines → ~40 lines)
//
// Migration strategy:
//   1. Create canonical Price in common/data-access
//   2. Adapters convert nested API format → flat format
//   3. Update schemas to enforce required fields
//   4. Remove domain-specific duplicates
//
// ⚠️ IMPORTANT: Requires backend API coordination
// Effort: ~8-10 hours | Impact: High | Risk: Medium
// See: complexity-analysis.md (TypeScript Section, Issue 2 & 4)
export interface Price {
  value?: PriceValue;
  vat?: VatValue;
}
