> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corrdata.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Types

> GraphQL type definitions for CorrData

## Enums

### AssetType

```graphql theme={null}
enum AssetType {
  PIPELINE
  SEGMENT
  TEST_STATION
  RECTIFIER
  EQUIPMENT
  ANODE_BED
}
```

### EventSeverity

```graphql theme={null}
enum EventSeverity {
  INFO
  WARNING
  CRITICAL
}
```

### QualityFlag

```graphql theme={null}
enum QualityFlag {
  GOOD
  SUSPECT
  BAD
}
```

### MeasurementSource

```graphql theme={null}
enum MeasurementSource {
  MANUAL
  AUTOMATED
  IMPORT
  CALCULATED
}
```

### WorkOrderStatus

```graphql theme={null}
enum WorkOrderStatus {
  PENDING
  ASSIGNED
  IN_PROGRESS
  COMPLETED
  CANCELLED
}
```

### FailureType

```graphql theme={null}
enum FailureType {
  COMPLETE
  DEGRADED
  INTERMITTENT
}
```

### ConflictResolution

```graphql theme={null}
enum ConflictResolution {
  SKIP
  UPDATE
  CREATE_NEW
}
```

## Object Types

### Asset

```graphql theme={null}
type Asset {
  id: UUID!
  tenantId: UUID!
  name: String!
  assetType: AssetType!
  externalId: String
  parentId: UUID
  geometry: GeoJSON
  attributes: JSON
  createdAt: DateTime!
  updatedAt: DateTime!

  # Relationships
  parent: Asset
  children: [Asset!]!
  measurements(limit: Int): [Measurement!]!
  events(limit: Int): [Event!]!
  riskScore: Float
}
```

### Measurement

```graphql theme={null}
type Measurement {
  id: UUID!
  assetId: UUID!
  assetType: AssetType!
  measurementType: String!
  value: Float!
  unit: String!
  recordedAt: DateTime!
  recordedBy: UUID
  source: MeasurementSource!
  quality: QualityFlag!
  metadata: JSON

  # Relationships
  asset: Asset!
}
```

### Event

```graphql theme={null}
type Event {
  id: UUID!
  assetId: UUID!
  eventType: String!
  severity: EventSeverity!
  title: String!
  description: String
  occurredAt: DateTime!
  resolvedAt: DateTime
  acknowledgedAt: DateTime
  acknowledgedBy: UUID
  metadata: JSON

  # Relationships
  asset: Asset!
}
```

### Pipeline

```graphql theme={null}
type Pipeline {
  id: UUID!
  name: String!
  operator: String
  productType: String
  geometry: GeoJSON
  attributes: JSON

  # Relationships
  segments: [Segment!]!
  totalMiles: Float
  riskScore: Float
}
```

### Segment

```graphql theme={null}
type Segment {
  id: UUID!
  pipelineId: UUID!
  name: String!
  startMilePost: Float
  endMilePost: Float
  diameterInches: Float
  wallThickness: Float
  material: String
  coatingType: String
  installDate: Date
  geometry: GeoJSON

  # Relationships
  pipeline: Pipeline!
  testStations: [TestStation!]!
  rectifiers: [Rectifier!]!
  riskScore: Float
}
```

### TestStation

```graphql theme={null}
type TestStation {
  id: UUID!
  segmentId: UUID!
  name: String!
  stationType: String
  milePost: Float
  geometry: GeoJSON

  # Relationships
  segment: Segment!
  lastReading: Measurement
  readings(limit: Int): [Measurement!]!
}
```

### Rectifier

```graphql theme={null}
type Rectifier {
  id: UUID!
  segmentId: UUID!
  name: String!
  manufacturer: String
  model: String
  ratedOutputAmps: Float
  ratedOutputVolts: Float
  installDate: Date
  geometry: GeoJSON

  # Current readings
  currentOutput: Float
  voltageOutput: Float
  status: String

  # Relationships
  segment: Segment!
  protectedSegments: [Segment!]!
}
```

### PipelineSummary

```graphql theme={null}
type PipelineSummary {
  totalAssets: Int!
  totalPipelines: Int!
  totalSegments: Int!
  totalTestStations: Int!
  totalRectifiers: Int!
  assetsByType: [AssetCount!]!
  recentEvents: [Event!]!
  measurementStats: [MeasurementStats!]!
}
```

### ImpactAnalysis

```graphql theme={null}
type ImpactAnalysis {
  affectedAssets: [AffectedAsset!]!
  totalAffectedSegments: Int!
  totalAffectedMiles: Float!
  estimatedRepairTime: String
  recommendations: [String!]!
}
```

### RelationshipGraph

```graphql theme={null}
type RelationshipGraph {
  nodes: [GraphNode!]!
  edges: [GraphEdge!]!
}

type GraphNode {
  id: UUID!
  name: String!
  assetType: AssetType!
  riskScore: Float
}

type GraphEdge {
  source: UUID!
  target: UUID!
  relationshipType: String!
}
```

## Input Types

### CreateAssetInput

```graphql theme={null}
input CreateAssetInput {
  name: String!
  assetType: AssetType!
  externalId: String
  parentId: UUID
  segmentId: UUID
  geometry: GeoJSONInput
  attributes: JSON
}
```

### UpdateAssetInput

```graphql theme={null}
input UpdateAssetInput {
  name: String
  externalId: String
  geometry: GeoJSONInput
  attributes: JSON
}
```

### RecordMeasurementInput

```graphql theme={null}
input RecordMeasurementInput {
  assetId: UUID!
  measurementType: String!
  value: Float!
  unit: String!
  recordedAt: DateTime
  source: MeasurementSource
  quality: QualityFlag
  metadata: JSON
}
```

### CreateEventInput

```graphql theme={null}
input CreateEventInput {
  assetId: UUID!
  eventType: String!
  severity: EventSeverity!
  title: String!
  description: String
  occurredAt: DateTime
  metadata: JSON
}
```

### StartImportInput

```graphql theme={null}
input StartImportInput {
  sourceType: ImportSourceType!
  sourceUrl: String
  fileId: UUID
  targetAssetType: AssetType!
  fieldMapping: JSON!
  conflictResolution: ConflictResolution!
  syncSchedule: String
}
```

## Scalar Types

```graphql theme={null}
# Universally unique identifier
scalar UUID

# ISO 8601 date-time string
scalar DateTime

# ISO 8601 date string
scalar Date

# Arbitrary JSON object
scalar JSON

# GeoJSON geometry object
scalar GeoJSON
```

### GeoJSON Examples

**Point:**

```json theme={null}
{
  "type": "Point",
  "coordinates": [-97.123, 32.456]
}
```

**LineString:**

```json theme={null}
{
  "type": "LineString",
  "coordinates": [
    [-97.123, 32.456],
    [-97.234, 32.567],
    [-97.345, 32.678]
  ]
}
```
