Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CodexaCP/DG_APK/llms.txt

Use this file to discover all available pages before exploring further.

StatusPalette is a static helper class in Handheld.Helpers that centralises every display decision for WMS document statuses. Rather than scattering color strings and label logic across individual views, all three concerns — badge color, short label, and post-block detection — live in one place. The helper is used across the Receipts, Shipments, and Item Inquiry screens.
StatusPalette is used across Receipts, Shipments, and Item Inquiry views. Any change to status display — new status codes, color adjustments, or label updates — should be made exclusively in this class to keep the UI consistent.

Full class signature

namespace Handheld.Helpers;

public static class StatusPalette
{
    public static string GetBadgeColor(string? status);
    public static string GetShortLabel(string? status);
    public static bool   IsPostBlocked(string? status);
    public static string Normalize(string? status);
}

Normalize

public static string Normalize(string? status) =>
    string.IsNullOrWhiteSpace(status)
        ? "PENDING"
        : status.Trim().ToUpperInvariant();
Normalize is the foundation of all three other methods — each one calls it first. The rules are:
  • null, empty string, or whitespace-only → "PENDING"
  • Any other value → trimmed and uppercased
This means "posted", " POSTED ", and "Posted" all map identically. Callers never need to pre-normalize status strings.

GetBadgeColor

public static string GetBadgeColor(string? status)
Returns a CSS hex color string suitable for use in badge backgrounds or Color.FromArgb calls.
public static string GetBadgeColor(string? status)
{
    var normalized = Normalize(status);

    return normalized switch
    {
        "OPEN"               => "#2563EB",
        "RELEASED"           => "#2563EB",
        "REL"                => "#2563EB",
        "POSTED"             => "#16A34A",
        "CLOSED"             => "#16A34A",
        "DONE"               => "#16A34A",
        "ERROR"              => "#DC2626",
        "PENDING"            => "#F59E0B",
        "RECV"               => "#F59E0B",
        "SHIP"               => "#F59E0B",
        "PARTIAL"            => "#F59E0B",
        "PART"               => "#F97316",
        "PARTIALLY RECEIVED" => "#F97316",
        "PARTIALLY SHIPPED"  => "#F97316",
        "PARTIALLY POSTED"   => "#F59E0B",
        "RECEIVING"          => "#F59E0B",
        "SHIPPING"           => "#F59E0B",
        _                    => "#475569"
    };
}

Color reference

HexTailwind equivalentMeaning
#2563EBblue-600Active / in-progress (OPEN, RELEASED)
#16A34Agreen-600Completed / finalized (POSTED, CLOSED, DONE)
#DC2626red-600Error state
#F59E0Bamber-500Pending / partial attention needed
#F97316orange-500Partially processed (stronger warning)
#475569slate-600Unknown / unrecognized status

GetShortLabel

public static string GetShortLabel(string? status)
Returns a short abbreviation (≤ 4 characters) for use in compact badge chips, list row indicators, and anywhere the full status string does not fit.
public static string GetShortLabel(string? status)
{
    var normalized = Normalize(status);

    return normalized switch
    {
        "RELEASED"           => "Rel",
        "RECEIVING"          => "Recv",
        "SHIPPING"           => "Ship",
        "PARTIAL"            => "Part",
        "PARTIALLY RECEIVED" => "Part",
        "PARTIALLY SHIPPED"  => "Part",
        "PARTIALLY POSTED"   => "Part",
        "POSTED"             => "Done",
        "CLOSED"             => "Done",
        "PENDING"            => "Pend",
        "OPEN"               => "Open",
        _ => normalized.Length <= 4 ? normalized : normalized[..4]
    };
}
For unrecognized statuses the fallback rule is: if the normalized string is already 4 characters or fewer, return it as-is; otherwise return the first 4 characters. This means a backend status like "HOLD" renders as "HOLD", while "INREVIEW" renders as "INRE".

IsPostBlocked

public static bool IsPostBlocked(string? status)
Returns true when the document status means it has already been finalized and cannot be posted again.
public static bool IsPostBlocked(string? status)
{
    var normalized = Normalize(status);
    return normalized is "POSTED" or "CLOSED";
}
Use this guard in view-models before calling any PostAsync operation to give the user a clear “already posted” message without making a network call.

Status reference table

The table below summarises every explicitly handled status and its display values.
Status (normalized)Badge colorHexShort labelPost blocked
OPENBlue#2563EBOpen
RELEASEDBlue#2563EBRel
RELBlue#2563EBREL ¹
PENDINGAmber#F59E0BPend
RECEIVINGAmber#F59E0BRecv
SHIPPINGAmber#F59E0BShip
RECVAmber#F59E0BRECV ¹
SHIPAmber#F59E0BSHIP ¹
PARTIALAmber#F59E0BPart
PARTIALLY POSTEDAmber#F59E0BPart
PARTOrange#F97316PART ¹
PARTIALLY RECEIVEDOrange#F97316Part
PARTIALLY SHIPPEDOrange#F97316Part
POSTEDGreen#16A34ADone
CLOSEDGreen#16A34ADone
DONEGreen#16A34ADONE ¹
ERRORRed#DC2626ERRO ¹
(unknown)Slate#475569first 4 chars
¹ These statuses do not have an explicit GetShortLabel case; the fallback rule applies (≤ 4 chars as-is, else first 4).

Usage example

// In a view-model or converter:
var color = StatusPalette.GetBadgeColor(receipt.Status);   // "#F97316"
var label = StatusPalette.GetShortLabel(receipt.Status);   // "Part"
var blocked = StatusPalette.IsPostBlocked(receipt.Status); // false

if (blocked)
{
    ErrorMessage = "Este documento ya fue posteado.";
    return;
}
// Normalizing a raw API value before comparison:
var normalized = StatusPalette.Normalize(apiResponse.Status); // "PARTIALLY RECEIVED"

Build docs developers (and LLMs) love