Rebuild CCS case workflow

This commit is contained in:
hz
2026-07-23 04:43:02 -05:00
parent 489b9c3d7c
commit 8e216eac32
13 changed files with 1374 additions and 690 deletions
+25 -3
View File
@@ -54,8 +54,8 @@ func load_cases() -> void:
_send("cases", HTTPClient.METHOD_GET, "/cases")
func create_attempt(case_external_id: String, mode: String) -> void:
_send("attempt", HTTPClient.METHOD_POST, "/attempts", {"caseExternalId": case_external_id, "mode": mode})
func create_attempt(case_external_id: String, _mode: String = "timed") -> void:
_send("attempt", HTTPClient.METHOD_POST, "/attempts", {"caseExternalId": case_external_id, "mode": "timed"})
func load_active() -> void:
@@ -77,6 +77,15 @@ func send_command(type: String, code: String = "", minutes: int = 0) -> void:
"minutes": minutes
})
func send_batch(commands: Array) -> void:
if attempt.is_empty() or commands.is_empty():
return
_send("attempt", HTTPClient.METHOD_POST, "/attempts/%s/commands/batch" % str(attempt.get("id", "")).uri_encode(), {
"commandId": "%d-%d" % [Time.get_ticks_usec(), randi()],
"expectedRevision": int(attempt.get("revision", 0)),
"commands": commands
})
func search_orders(query: String) -> void:
if query.strip_edges().length() < 2:
@@ -169,7 +178,20 @@ func abandon() -> void:
func deadline_unix() -> float:
var value := str(attempt.get("finalOrdersDeadlineUtc", attempt.get("deadlineUtc", "")))
var raw: Variant = attempt.get("finalOrdersDeadlineUtc", null)
if raw == null or str(raw).is_empty() or str(raw) == "<null>":
raw = attempt.get("deadlineUtc", "")
var value := str(raw)
return 0.0 if value.is_empty() or value == "<null>" else float(Time.get_unix_time_from_datetime_string(value))
func hard_deadline_unix() -> float:
var raw: Variant = attempt.get("hardDeadlineUtc", null)
if raw == null or str(raw).is_empty() or str(raw) == "<null>":
raw = attempt.get("finalOrdersDeadlineUtc", null)
if raw == null or str(raw).is_empty() or str(raw) == "<null>":
raw = attempt.get("deadlineUtc", "")
var value := str(raw)
return 0.0 if value.is_empty() or value == "<null>" else float(Time.get_unix_time_from_datetime_string(value))