feat: enhance draw processing and ticket validation logic

- Added a new function to check if the hall is awaiting draw processing, improving the draw status handling.
- Implemented validation for roll numbers in ticket orders, ensuring compliance with specified formats.
- Enhanced the draft line issue reasoning to provide detailed feedback on invalid ticket entries.
- Updated HallDrawPanel and related components to utilize the new draw processing checks and improve user notifications.
- Added new translations for draw processing and ticket validation messages in multiple languages.
This commit is contained in:
2026-05-25 16:44:00 +08:00
parent 3bcbf7d256
commit 3b83c6627c
10 changed files with 356 additions and 61 deletions

View File

@@ -7,9 +7,15 @@ export function ticketStatusDisplay(
t?: (key: string, options?: { defaultValue?: string; status?: string }) => string,
): { label: string; dotClass: string; ring?: boolean } {
const total = winMinor + jackpotMinor;
if (status === "success" || status === "pending_draw") {
if (
status === "pending_draw" ||
status === "placed" ||
status === "partial_failed" ||
status === "pending_confirm" ||
status === "partial_pending_confirm"
) {
return {
label: t?.(status === "pending_draw" ? "ticketStatus.pending_draw" : "ticketStatus.success") ?? status,
label: t?.("ticketStatus.pending_draw") ?? status,
dotClass: "bg-sky-500",
};
}

View File

@@ -30,7 +30,7 @@ import { cn } from "@/lib/utils";
import type { TicketItemListRow } from "@/types/api/ticket-items";
const ORDERS_PAGE_SIZE = 20;
const STATUS_OPTIONS = ["pending_draw", "success", "settled_win", "settled_lose", "failed"] as const;
const STATUS_OPTIONS = ["pending_draw", "pending_payout", "settled_win", "settled_lose", "failed"] as const;
function parseYmd(value: string): Date | undefined {
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);