feat: add global system notices and Beijing order time display
Deploy olons-server production / deploy (push) Successful in 3m12s
Deploy olons-server production / deploy (push) Successful in 3m12s
This commit is contained in:
@@ -438,8 +438,13 @@ func allowedActions(row store.TaskOrder) []string {
|
||||
switch row.OrderStatus {
|
||||
case 2:
|
||||
var snapshot map[string]any
|
||||
if json.Unmarshal(row.RuleSnapshot, &snapshot) == nil && snapshot["dispatch_mode"] == "manual" {
|
||||
return []string{"submit", "contact_support"}
|
||||
if json.Unmarshal(row.RuleSnapshot, &snapshot) == nil {
|
||||
if snapshot["balance_shortage_pending"] == true {
|
||||
return []string{"contact_support"}
|
||||
}
|
||||
if snapshot["dispatch_mode"] == "manual" {
|
||||
return []string{"submit", "contact_support"}
|
||||
}
|
||||
}
|
||||
return []string{"contact_support"}
|
||||
case 3, 5, 6, 8:
|
||||
|
||||
@@ -170,3 +170,12 @@ func TestOrdersRejectsUnknownStatus(t *testing.T) {
|
||||
t.Fatalf("expected status error, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAllowedActionsBalancePendingOrderCannotBeSubmitted(t *testing.T) {
|
||||
row := store.TaskOrder{OrderStatus: 2, RuleSnapshot: json.RawMessage(`{"dispatch_mode":"manual","balance_shortage_pending":true}`)}
|
||||
for _, action := range allowedActions(row) {
|
||||
if action == "submit" {
|
||||
t.Fatal("余额不足待处理订单不应允许提交")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user