namespace ERPCore.Domain;

/// <summary>
/// Additional <c>STOCK_LEDGER.source_doc_type</c> values for manufacturing movements
/// (docs/30 §A.2). <c>source_doc_id</c> is always the <c>run_id</c>, so
/// <c>LIKE 'PRD%'</c> traces every stock movement a run caused.
/// </summary>
/// <remarks>
/// <para><b>Deviation from docs/30 §A.2 (recorded).</b> The doc proposes the long names
/// <c>ProductionIssue</c>/<c>ProductionReceipt</c>/<c>ProductionReturn</c>/
/// <c>ProductionCancelReturn</c>, but both <c>stock_ledger.SourceDocType</c> and
/// <c>journal_entry_stubs.SourceDocType</c> are <c>varchar(10)</c> and every existing
/// value is a short prefix (<c>GRN</c>, <c>TRF</c>, <c>ADJ</c>, <c>PRET</c>). Widening
/// those columns would be a second Phase-1 schema change beyond the single deviation
/// §A.1 declares (NFR-08), so the short codes below extend the existing convention
/// instead. docs/30 §A.2 and §D.5 are amended to match.</para>
/// <para>These are <b>not</b> <see cref="DocumentTypes"/> entries — production issues no
/// document per movement. The run's own document number uses
/// <see cref="DocumentTypes.Production"/> (<c>PRD-2026-00001</c>).</para>
/// </remarks>
public static class LedgerSourceTypes
{
    /// <summary>Stock consumed by a stage start (FR-MFG-10). Outbound.</summary>
    public const string ProductionIssue = "PRDI";

    /// <summary>Finished goods received at the terminal approve (FR-MFG-13). Inbound.</summary>
    public const string ProductionReceipt = "PRDR";

    /// <summary>Unconsumed material returned before receipt (FR-MFG-14). Inbound.</summary>
    public const string ProductionReturn = "PRDL";

    /// <summary>Net consumed stock returned when a run is cancelled (FR-MFG-17). Inbound.</summary>
    public const string ProductionCancelReturn = "PRDC";
}
