feat: add repair timeline read APIs
This commit is contained in:
1 parent
f6a2512e23
commit
36a0caecd8
16 files changed
+1562
-9
No files matched your search
@@ -88,7 +88,7 @@ health_json="$(cat "${health_file}")"
|
||||
|
||||
echo "Checking migrations and required schema..."
|
||||
current_revision="$("${compose[@]}" exec -T backend alembic current 2>/dev/null)"
|
||||
[[ "${current_revision}" == *"0010_begin_repair"* ]]
|
||||
[[ "${current_revision}" == *"0011_repair_timeline"* ]]
|
||||
|
||||
missing_tables="$(
|
||||
"${compose[@]}" exec -T postgres sh -c \
|
||||
@@ -197,6 +197,29 @@ begin_repair_response="$(curl --fail --silent -b "${technician_cookie}" \
|
||||
'{"miner_id":"00000000-0000-0000-0000-000000000981","reason":"CONTROL_BOARD"}'
|
||||
)" == "409" ]]
|
||||
|
||||
smoke_repair_id="$(
|
||||
printf '%s' "${begin_repair_response}" \
|
||||
| python3 -c 'import json, sys; print(json.load(sys.stdin)["data"]["repair_id"])'
|
||||
)"
|
||||
[[ -n "${smoke_repair_id}" ]]
|
||||
readonly_repair_detail="$(
|
||||
curl --fail --silent -b "${readonly_cookie}" \
|
||||
"${base_url}/api/repairs/${smoke_repair_id}"
|
||||
)"
|
||||
[[ "${readonly_repair_detail}" == *'"miner_asset_id":"SMOKE-REPAIR-001"'* ]]
|
||||
[[ "${readonly_repair_detail}" == *'"miner_lifecycle":"in_repair"'* ]]
|
||||
[[ "${readonly_repair_detail}" == *'"latest_event_sequence":2'* ]]
|
||||
readonly_repair_events="$(
|
||||
curl --fail --silent -b "${readonly_cookie}" \
|
||||
"${base_url}/api/repairs/${smoke_repair_id}/events"
|
||||
)"
|
||||
[[ "${readonly_repair_events}" == *'"sequence":1'* ]]
|
||||
[[ "${readonly_repair_events}" == *'"sequence":2'* ]]
|
||||
[[ "${readonly_repair_events}" == *'"event_type":"REPAIR_STARTED"'* ]]
|
||||
[[ "${readonly_repair_events}" == *'"event_type":"INITIAL_NOTE"'* ]]
|
||||
[[ "$(status_for "${technician_cookie}" GET /api/repairs/queue)" == "200" ]]
|
||||
[[ "$(status_for "${technician_cookie}" GET /api/repairs/parts-summary)" == "200" ]]
|
||||
|
||||
room_status="$(status_for "${technician_cookie}" POST /api/rooms '{"name":"Role Matrix Test Room"}')"
|
||||
[[ "${room_status}" == "200" || "${room_status}" == "201" ]]
|
||||
|
||||
|
||||
Reference in new issue
Block a user