BatchGravityReadings - BevvyTech/BrewskiDocs GitHub Wiki

Batch Gravity Readings

Method Path Description
GET /batch/:batchId/gravity List gravity readings for a batch (chronological).
POST /batch/:batchId/gravity Append a gravity reading to a batch.
PUT /batch/:batchId/gravity/:readingId Update a gravity reading.
DELETE /batch/:batchId/gravity/:readingId Remove a gravity reading.
  • Auth: Requires membership of the batch’s team (any active member may read/write).

Reading Shape

{
  "id": "e67c...",
  "batchId": "b2410...",
  "recordedAt": "2025-02-11T08:45:00.000Z",
  "temperature": 18.4,
  "gravity": 1.014,
  "type": "SG",
  "createdAt": "2025-02-11T08:45:02.000Z",
  "updatedAt": "2025-02-11T08:45:02.000Z"
}

POST /batch/:batchId/gravity

  • Body (required unless noted):
    {
      "recordedAt": "2025-02-11T08:45:00Z",
      "temperature": 18.4,
      "gravity": 1.014,
      "type": "SG"
    }
    • recordedAt is required (ISO 8601 timestamp including timezone).
    • gravity is required and must be a decimal specific gravity reading.
    • temperature (°C) is optional and may be omitted or set to null.
    • type defaults to OG on subsequent readings, but the first reading for each batch is automatically saved as SG. Valid values: OG, SG, FG.

PUT /batch/:batchId/gravity/:readingId

  • Provide any subset of the fields above. Gravity values must remain numeric; recordedAt must be parseable as an ISO 8601 timestamp. Setting temperature to null clears the stored temperature. Sending type: "FG" promotes the reading to final gravity and the service keeps the batch’s starting gravity in sync.

DELETE /batch/:batchId/gravity/:readingId

  • Permanently removes the record and returns 204 No Content.
⚠️ **GitHub.com Fallback** ⚠️