Class OmieContractInfo
A Service Contract of Omie as callers consume it: the number the user knows, the validity period and the negotiated value, with the dates already parsed. Projected from the listing so no caller has to deal with Omie's dd/MM/yyyy strings or with which key carries what.
public sealed record OmieContractInfo : IEquatable<OmieContractInfo>
- Inheritance
-
OmieContractInfo
- Implements
- Inherited Members
Constructors
OmieContractInfo(long, string?, long, DateOnly?, DateOnly?, decimal?, IReadOnlyDictionary<long, decimal>)
A Service Contract of Omie as callers consume it: the number the user knows, the validity period and the negotiated value, with the dates already parsed. Projected from the listing so no caller has to deal with Omie's dd/MM/yyyy strings or with which key carries what.
public OmieContractInfo(long ContractCode, string? ContractNumber, long ClientCode, DateOnly? ValidFrom, DateOnly? ValidTo, decimal? MonthlyValue, IReadOnlyDictionary<long, decimal> UnitValueByServiceCode)
Parameters
ContractCodelongOmie's internal identifier (nCodCtr).
ContractNumberstringThe contract number as the user reads it in Omie (cNumCtr).
ClientCodelongClient the contract belongs to (nCodCli).
ValidFromDateOnly?Start of the validity period; null when Omie sent none.
ValidToDateOnly?End of the validity period; null on contracts with no end date.
MonthlyValuedecimal?Negotiated monthly value; null when Omie sent none.
UnitValueByServiceCodeIReadOnlyDictionary<long, decimal>Negotiated unit price of each service in the contract, keyed by Omie's service identifier (
nCodServico) — the same key the service catalog uses, so a caller holding a service code can ask what this client pays for it. Empty when the contract carries no items.
Properties
ClientCode
Client the contract belongs to (nCodCli).
public long ClientCode { get; init; }
Property Value
ContractCode
Omie's internal identifier (nCodCtr).
public long ContractCode { get; init; }
Property Value
ContractNumber
The contract number as the user reads it in Omie (cNumCtr).
public string? ContractNumber { get; init; }
Property Value
MonthlyValue
Negotiated monthly value; null when Omie sent none.
public decimal? MonthlyValue { get; init; }
Property Value
UnitValueByServiceCode
Negotiated unit price of each service in the contract, keyed by Omie's service identifier (nCodServico) —
the same key the service catalog uses, so a caller holding a service code can ask what this client pays for it.
Empty when the contract carries no items.
public IReadOnlyDictionary<long, decimal> UnitValueByServiceCode { get; init; }
Property Value
ValidFrom
Start of the validity period; null when Omie sent none.
public DateOnly? ValidFrom { get; init; }
Property Value
ValidTo
End of the validity period; null on contracts with no end date.
public DateOnly? ValidTo { get; init; }
Property Value
Methods
UnitValueOf(long)
What this contract charges for a service, or null when the service is not in it — which is the normal case: a contract covers the services that were negotiated, and the rest stay on the standard price list.
public decimal? UnitValueOf(long serviceCode)
Parameters
serviceCodelong