Skip to content

Feat: batch create endpoints for work orders and spare parts#98

Open
mukama wants to merge 2 commits into
tetherto:developfrom
mukama:feat/wo-spare-parts-batch-endpoints
Open

Feat: batch create endpoints for work orders and spare parts#98
mukama wants to merge 2 commits into
tetherto:developfrom
mukama:feat/wo-spare-parts-batch-endpoints

Conversation

@mukama

@mukama mukama commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

POST /auth/work-orders/batch

curl -X POST http://localhost:3000/auth/work-orders/batch \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": 2,
    "devices": [
      { "deviceType": "miner", "deviceModel": "whatsminer-m63s", "deviceIdentifier": "WMM63S-2024-04829" },
      { "deviceType": "miner", "deviceModel": "whatsminer-m63s", "deviceIdentifier": "WMM63S-2024-04830" },
      { "deviceType": "miner", "deviceModel": "whatsminer-m63s", "deviceIdentifier": "WMM63S-2024-04831" }
    ],
    "info": { "location": "site.miner-room" }
  }'

POST /auth/spare-parts/batch

curl -X POST http://localhost:3000/auth/spare-parts/batch \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rackId": "inventory-miner_part-psu-rack-1",
    "note": "Pallets 1-3",
    "parts": [
      { "deviceType": "psu", "deviceModel": "PSU-A", "serialNum": "SN-1" },
      { "deviceType": "psu", "deviceModel": "PSU-A", "serialNum": "SN-2" }
    ]
  }'

Comment thread workers/lib/server/schemas/work.orders.schemas.js Outdated
Replace magic enum values [3, 4] and [1, 2, 3, 4] with the existing
WORK_ORDER_TYPES constant, addressing PR tetherto#98 review feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants