Skip to content

feat: Power interface types and InterfaceRole #368

@ggfevans

Description

@ggfevans

Parent Epic

Part of #362 (Connection Graph Model - Port-Based Architecture)


Summary

Extend InterfaceType enum with power connector types and add InterfaceRole to distinguish inlets from outlets.

Background

The current InterfaceType enum covers network interfaces but not power connections. PDUs have power inlets and outlets that need distinct types for proper connection validation and power path traversal.

Type Definition

// Add to existing InterfaceType enum
type InterfaceType =
  // ... existing network types ...
  
  // Power Inlets (device receives power)
  | 'power-inlet-iec-c14'      // Standard server inlet
  | 'power-inlet-iec-c20'      // High-power inlet
  | 'power-inlet-nema-5-15p'   // US standard plug
  | 'power-inlet-nema-l6-30p'  // Locking 30A plug
  
  // Power Outlets (device provides power - PDUs)
  | 'power-outlet-iec-c13'     // Standard server outlet
  | 'power-outlet-iec-c19'     // High-power outlet
  | 'power-outlet-nema-5-15r'  // US standard receptacle
  | 'power-outlet-nema-5-20r'; // 20A receptacle

type InterfaceRole = 'inlet' | 'outlet' | 'bidirectional';

// Extend InterfaceTemplate
interface InterfaceTemplate {
  // ... existing fields ...
  role?: InterfaceRole;
  voltage?: number;        // e.g., 120, 208, 240
  max_amps?: number;       // e.g., 15, 20
  max_watts?: number;      // Max power draw/supply
}

Acceptance Criteria

  • Add power interface types to InterfaceType enum
  • Create InterfaceRole enum
  • Add role?: InterfaceRole to InterfaceTemplate
  • Add electrical fields: voltage, max_amps, max_watts
  • Update InterfaceTemplateSchema with new fields
  • Power interface types are color-coded (separate from network)

Test Requirements

  • Power interface types validate correctly
  • InterfaceRole validates correctly
  • PDU device type with power interfaces works
  • Electrical fields are optional and validate as numbers
  • Connection validation checks power type compatibility

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions