| scalar DateTime | |
| scalar JSON | |
| enum Namespace { | |
| infrastructure | |
| satellite | |
| # ... other namespaces | |
| } | |
| type Location { | |
| lat: Float | |
| lon: Float | |
| } | |
| type Provenance { | |
| source: String! | |
| license: String | |
| retrieved_at: DateTime! | |
| } | |
| type Infrastructure { | |
| id: ID! | |
| location: Location! | |
| roadCondition: String | |
| severity: Int | |
| lastReportedAt: DateTime | |
| provenance: Provenance | |
| } | |
| # Pothole / Fault object | |
| type InfrastructureFault { | |
| id: ID! | |
| namespace: Namespace! | |
| type: String! | |
| timestamp: DateTime! | |
| location: Location! | |
| severity: Int! | |
| confirmed: Boolean! | |
| images: [String] | |
| provenance: Provenance! | |
| } | |
| type Payout { | |
| id: ID! | |
| faultId: ID! | |
| amountMinorUnits: Int! | |
| currency: String! | |
| payeeId: String! | |
| status: String! | |
| createdAt: DateTime! | |
| settledAt: DateTime | |
| txRef: String | |
| } | |
| type Query { | |
| infraFault(id: ID!): InfrastructureFault | |
| listInfraFaults(limit: Int, offset: Int): [InfrastructureFault!] | |
| payoutsForFault(faultId: ID!): [Payout!] | |
| } | |
| input IngestFaultInput { | |
| namespace: Namespace! | |
| type: String! | |
| timestamp: DateTime! | |
| location: JSON! | |
| severity: Int! | |
| images: [String] | |
| provenance: JSON | |
| } | |
| type Mutation { | |
| ingestFault(input: IngestFaultInput!): InfrastructureFault! | |
| confirmFault(id: ID!, confirmed: Boolean!): InfrastructureFault! | |
| createPayout(faultId: ID!, amountMinorUnits: Int!, currency: String!, payeeId: String!): Payout! | |
| settlePayout(payoutId: ID!): Payout! | |
| } | |
| type Subscription { | |
| faultCreated: InfrastructureFault! | |
| faultConfirmed: InfrastructureFault! | |
| payoutUpdated: Payout! | |
| } | |