Services

Track and manage pool services performed for customers

Overview

Services represent the actual work performed during appointments. Each service tracks pricing, completion status, photos, chemical readings, and notes. Services are categorized by service types and can be associated with specific customers and appointments.

List Services

Retrieve a paginated list of services with filtering options.

query InfiniteServices($first: Int!, $after: String, $filter: ServiceFilter) {
  infiniteServices(first: $first, after: $after, filter: $filter) {
    edges {
      node {
        id
        name
        price
        completedAt
        customer {
          id
          firstName
          lastName
        }
        type {
          id
          name
        }
      }
      cursor
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

# Variables
{
  "first": 20,
  "filter": {
    "customerId": "cust_456",
    "completedAtGte": "2024-01-01T00:00:00Z"
  }
}

Response:

{
  "data": {
    "infiniteServices": {
      "edges": [
        {
          "node": {
            "id": "svc_001",
            "name": "Weekly Pool Cleaning",
            "price": 75.00,
            "completedAt": "2024-01-15T10:30:00Z",
            "customer": {
              "id": "cust_456",
              "firstName": "John",
              "lastName": "Smith"
            },
            "type": {
              "id": "type_001",
              "name": "Pool Cleaning"
            }
          },
          "cursor": "eyJpZCI6InN2Y18wMDEifQ=="
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "eyJpZCI6InN2Y18wMDEifQ=="
      }
    }
  }
}

Get Single Service

Retrieve detailed information about a specific service.

query Service($selector: ServiceSelector!) {
  service(selector: $selector) {
    id
    name
    description
    price
    duration
    completedAt
    customer {
      id
      firstName
      lastName
    }
    appointment {
      id
      scheduledAt
    }
    type {
      id
      name
    }
    photos {
      id
      url
      caption
    }
    notes
    chemicalReadings {
      chlorine
      ph
      alkalinity
      temperature
    }
    createdAt
    updatedAt
  }
}

# Variables
{
  "selector": {
    "id": "svc_001"
  }
}

Response:

{
  "data": {
    "service": {
      "id": "svc_001",
      "name": "Weekly Pool Cleaning",
      "description": "Standard weekly maintenance",
      "price": 75.00,
      "duration": 45,
      "completedAt": "2024-01-15T10:30:00Z",
      "customer": {
        "id": "cust_456",
        "firstName": "John",
        "lastName": "Smith"
      },
      "appointment": {
        "id": "apt_123",
        "scheduledAt": "2024-01-15T09:00:00Z"
      },
      "type": {
        "id": "type_001",
        "name": "Pool Cleaning"
      },
      "photos": [
        {
          "id": "photo_001",
          "url": "https://storage.example.com/services/photo_001.jpg",
          "caption": "Pool after cleaning"
        }
      ],
      "notes": "Added extra chlorine due to recent rain",
      "chemicalReadings": {
        "chlorine": 2.5,
        "ph": 7.4,
        "alkalinity": 100,
        "temperature": 78
      },
      "createdAt": "2024-01-15T09:00:00Z",
      "updatedAt": "2024-01-15T10:30:00Z"
    }
  }
}

Create Service

Create a new service record.

mutation CreateService($input: CreateServiceInput!) {
  createService(input: $input) {
    id
    name
    price
    customer {
      id
      firstName
      lastName
    }
    createdAt
  }
}

# Variables
{
  "input": {
    "name": "Pool Repair",
    "description": "Filter pump replacement",
    "customerId": "cust_456",
    "typeId": "type_002",
    "price": 250.00,
    "duration": 120,
    "appointmentId": "apt_124"
  }
}

Response:

{
  "data": {
    "createService": {
      "id": "svc_002",
      "name": "Pool Repair",
      "price": 250.00,
      "customer": {
        "id": "cust_456",
        "firstName": "John",
        "lastName": "Smith"
      },
      "createdAt": "2024-01-20T14:00:00Z"
    }
  }
}

Update Service

Update a service, including marking it as complete and adding chemical readings.

mutation UpdateService($id: ID!, $input: UpdateServiceInput!) {
  updateService(id: $id, input: $input) {
    id
    name
    completedAt
    chemicalReadings {
      chlorine
      ph
      alkalinity
    }
    notes
    updatedAt
  }
}

# Variables
{
  "id": "svc_002",
  "input": {
    "completedAt": "2024-01-20T16:30:00Z",
    "chemicalReadings": {
      "chlorine": 2.8,
      "ph": 7.5,
      "alkalinity": 95,
      "temperature": 76
    },
    "notes": "Replaced filter pump. System running smoothly."
  }
}

Response:

{
  "data": {
    "updateService": {
      "id": "svc_002",
      "name": "Pool Repair",
      "completedAt": "2024-01-20T16:30:00Z",
      "chemicalReadings": {
        "chlorine": 2.8,
        "ph": 7.5,
        "alkalinity": 95
      },
      "notes": "Replaced filter pump. System running smoothly.",
      "updatedAt": "2024-01-20T16:30:00Z"
    }
  }
}

REST Endpoints

Upload service photos and export service data.

POST/services/:id/photos

Upload a photo for a service

curl -X POST "https://api.poolservicemanager.com/services/svc_001/photos" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -F "file=@photo.jpg" \
  -F "caption=Pool after cleaning"
GET/services/export/csv

Export services to CSV format

curl -X GET "https://api.poolservicemanager.com/services/export/csv?startDate=2024-01-01&endDate=2024-01-31" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -o services.csv

Field Reference

FieldTypeDescription
idID!Unique identifier
nameString!Service name
descriptionString(nullable)Service description
priceFloat!Base price
durationInt(nullable)Estimated duration in minutes
typeServiceType!Associated service type
customerCustomer(nullable)Customer this service was performed for
appointmentAppointment(nullable)Associated appointment
completedAtDateTime(nullable)When the service was completed
photos[ServicePhoto!]!Service photos
notesString(nullable)Service notes
chemicalReadingsChemicalReading(nullable)Pool chemical readings
createdAtDateTime!Creation timestamp
updatedAtDateTime!Last update timestamp