<!-- source-hash: 5baba845ea8aa80681fb2797d590f77a -->
This file defines the core TypeScript interfaces for managing MSP (Managed Service Provider) technology stacks, including vendor selections, cost calculations, and sharing functionality.

## Key Components

**Core Interfaces:**
- `UserStack` - Main stack entity with vendor selections and metadata
- `StackVendorSelection` - Individual vendor choice within a stack category
- `MSP` - Managed Service Provider profile with business metrics
- `StackVendor` - Extended vendor data with stack-specific properties

**Cost Analysis:**
- `StackCostCalculation` - Complete cost breakdown with savings analysis
- `CategoryCostBreakdown` - Category-level cost comparisons
- `MarginAnalysis` - MSP profit margin calculations

**API Types:**
- Request/Response interfaces for CRUD operations
- Component prop interfaces for React components
- Filter and options interfaces for data querying

**Utility Types:**
- `SelectionSource` - Tracks whether selections are AI-generated or manual
- `StackVendorType` - Distinguishes current vs alternative vendors
- `VendorSelectionState` - State management for vendor selections

## Usage Example

```typescript
// Create a new stack with vendor selections
const createStackRequest: CreateStackRequest = {
  name: "Enterprise MSP Stack",
  description: "Complete technology stack for 500+ seat MSP",
  is_public: true
};

// Add vendor selection to stack
const vendorSelection: StackVendorSelectionRequest = {
  category_slug: "psa",
  subcategory_slug: "ticketing",
  vendor_slug: "connectwise-manage",
  vendor_type: "current",
  selection_source: "manual"
};

// Calculate cost analysis
const costOptions: CostCalculationOptions = {
  seat_count: 500,
  include_implementation_costs: true,
  msp_markup_percentage: 30
};
```