record
Address
Ensamblado: EricksonLopez.ValueObjectspublic sealed record Address : ValueObject
Hereda de: ValueObject
Represents a structured physical address composed of street, city, province, country, and postal code.
Miembros (7)
methodCreate
public static Result<Address> Create(string? street, string? city, string? province, Country country, PostalCode? postalCode = null)
Creates a validated `Address` instance from normalized address components.
- street: string?
- The street address component.
- city: string?
- The city name component.
- province: string?
- The province or state component.
- country: Country
- The country value object.
- postalCode: PostalCode?
- The optional postal code value object.
Retorna: A successful `Result<T>` containing the validated address, or a validation failure.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
propertyCity
public string City { get; }
Gets the city or municipality component.
propertyCountry
public Country Country { get; }
Gets the ISO 3166-1 alpha-2 country component.
propertyPostalCode
public PostalCode? PostalCode { get; }
Gets the optional postal or ZIP code component.
propertyProvince
public string Province { get; }
Gets the state, province, or department component.
propertyStreet
public string Street { get; }
Gets the street address component.
record
Barcode
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record Barcode : StringValueObject<Barcode>
Hereda de: StringValueObject<Barcode>
Represents a commercial or industrial barcode supporting GS1 Modulo-10 validated symbologies (GTIN-8, UPC-A / GTIN-12, EAN-13 / GTIN-13, retail variable-weight prefix 20–29, GTIN-14) and alphanumeric Code 128.
Miembros (8)
methodCreate
public static Result<Barcode> Create(string? value)
Creates a new `Barcode` instance after normalizing to uppercase and validating format rules. Numeric 8/12/13/14-digit strings validate their GS1 Modulo-10 check digit when `CreateGtin` or `Create(string?, bool)` with `enforceGs1CheckDigitForNumeric = true` is invoked.
- value: string?
- The raw barcode string representation.
Retorna: A `Result<Barcode>` containing the created instance or a validation error.
methodCreate
public static Result<Barcode> Create(string? value, bool enforceGs1CheckDigitForNumeric)
Creates a `Barcode` optionally enforcing strict GS1 Modulo-10 check-digit verification on 8, 12, 13, and 14-digit numeric barcodes.
- value: string?
- The raw barcode string representation.
- enforceGs1CheckDigitForNumeric: bool
- When `true`, rejects 8/12/13/14-digit numeric barcodes with invalid Modulo-10 check digits.
Retorna: A `Result<Barcode>` containing the validated instance or an error.
methodCreateGtin
public static Result<Barcode> CreateGtin(ReadOnlySpan<char> digits)
Creates a strictly validated numeric GS1 GTIN barcode (GTIN-8, UPC-A/12, EAN-13, or GTIN-14) verifying the Modulo-10 check digit.
- digits: ReadOnlySpan<char>
- The 8, 12, 13, or 14-digit GTIN span.
Retorna: A `Result<Barcode>` containing the validated GTIN barcode or an error.
methodCreateWeighted
public static Result<Barcode> CreateWeighted(ReadOnlySpan<char> digits)
Creates a validated 13-digit GS1 prefix 20–29 retail scale barcode after verifying its Modulo-10 check digit.
- digits: ReadOnlySpan<char>
- The 13-digit retail scale barcode span.
Retorna: A `Result<Barcode>` containing the validated scale barcode or an error.
methodIsValidGs1CheckDigit
public static bool IsValidGs1CheckDigit(ReadOnlySpan<char> digits)
Verifies the GS1 Modulo-10 check digit for an 8, 12, 13, or 14-digit numeric barcode span.
- digits: ReadOnlySpan<char>
- The candidate numeric barcode span.
Retorna: `true` if valid; otherwise `false`.
methodTryParseRetailScale
public bool TryParseRetailScale(out RetailScaleBarcodeData scaleData, RetailScaleEncodingMode mode = RetailScaleEncodingMode.AutoByPrefix29)
Attempts to extract retail scale PLU and embedded weight/price data when this barcode is a 13-digit prefix 20–29 EAN-13.
- scaleData: out RetailScaleBarcodeData
- When successful, receives the parsed `RetailScaleBarcodeData`.
- mode: RetailScaleEncodingMode
- The scale measure encoding mode.
Retorna: `true` if this barcode is a valid prefix 20–29 scale EAN-13; otherwise `false`.
propertyIsRetailScaleBarcode
public bool IsRetailScaleBarcode { get; }
Gets a value indicating whether this barcode is a 13-digit GS1 prefix 20–29 retail variable-weight or variable-price label.
propertySymbology
public BarcodeSymbology Symbology { get; }
Gets the detected barcode symbology.
enum
BarcodeSymbology
Ensamblado: EricksonLopez.ValueObjectspublic enum BarcodeSymbology
Identifies the detected barcode symbology for a validated `Barcode`.
Miembros (6)
fieldCode128
Code128 = 0
Alphanumeric industrial symbology (Code 128, GS1-128, Code 39).
fieldEan13
Ean13 = 3
13-digit GS1 GTIN-13 / EAN-13 standard item barcode with Modulo-10 check digit.
fieldGtin14
Gtin14 = 5
14-digit GS1 GTIN-14 logistics case/pallet barcode with Modulo-10 check digit.
fieldGtin8
Gtin8 = 1
8-digit GS1 GTIN-8 / EAN-8 with Modulo-10 check digit.
fieldRetailScaleEan13
RetailScaleEan13 = 4
13-digit GS1 EAN-13 in-store variable-weight / variable-price scale barcode (prefix 20–29) with Modulo-10 check digit.
fieldUpcA
UpcA = 2
12-digit GS1 GTIN-12 / UPC-A with Modulo-10 check digit.
record
BatchNumber
Ensamblado: EricksonLopez.ValueObjectspublic sealed record BatchNumber : StringValueObject<BatchNumber>
Hereda de: StringValueObject<BatchNumber>
Represents a manufacturing batch or production lot identifier for traceability. Normalized to uppercase. Rules: Required, 1–80 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: Manufacturing, Quality Control, Inventory, Food & Beverage, Pharmaceuticals.
Miembros (1)
methodCreate
public static Result<BatchNumber> Create(string? value)
Creates a new `BatchNumber` instance after validating and normalizing to uppercase.
- value: string?
- The raw batch/lot identifier string.
Retorna: A `Result<BatchNumber>` containing the created instance or a validation error.
record
BusinessDate
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct BusinessDate : IValueObject<BusinessDate>, IComparable<BusinessDate>, IComparable, IParsable<BusinessDate>, ISpanParsable<BusinessDate>, IFormattable, ISpanFormattable
Implementa: IComparable, IComparable<BusinessDate>, IFormattable, IParsable<BusinessDate>, ISpanFormattable, ISpanParsable<BusinessDate>, IValueObject<BusinessDate>
Represents a calendar date in a business domain without time or time zone components.
Miembros (17)
methodCompareTo
public int CompareTo(BusinessDate other)
Compares this business date with another business date.
- other: BusinessDate
- The other business date to compare against.
Retorna: A value indicating the relative order of the dates being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<BusinessDate> Create(DateOnly value)
Creates a validated `BusinessDate` instance from a `DateOnly`.
- value: DateOnly
- The date value to encapsulate.
Retorna: A successful `Result<T>` containing the validated business date, or a validation failure.
methodFromDateTimeOffset
public static Result<BusinessDate> FromDateTimeOffset(DateTimeOffset value)
Creates a `BusinessDate` instance from the UTC date component of a `DateTimeOffset`.
- value: DateTimeOffset
- The date and time value to extract the UTC date from.
Retorna: A successful `Result<T>` containing the validated business date.
methodParse
public static BusinessDate Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `BusinessDate`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `BusinessDate`.
methodParse
public static BusinessDate Parse(string s, IFormatProvider? provider = null)
Parses a string into a `BusinessDate`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `BusinessDate`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodToString
public string ToString(string? format, IFormatProvider? formatProvider)
Inherits documentation from `IFormattable.ToString(string?, IFormatProvider?)`.
- format: string?
- formatProvider: IFormatProvider?
methodTryFormat
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Inherits documentation from base type or interface.
- destination: Span<char>
- charsWritten: out int
- format: ReadOnlySpan<char>
- provider: IFormatProvider?
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out BusinessDate result)
Attempts to parse a span of characters into a `BusinessDate`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out BusinessDate
- When this method returns, contains the parsed business date if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out BusinessDate result)
Attempts to parse a string into a `BusinessDate`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out BusinessDate
- When this method returns, contains the parsed business date if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(BusinessDate left, BusinessDate right)
Determines whether the left business date is earlier than the right business date.
- left: BusinessDate
- The first business date to compare.
- right: BusinessDate
- The second business date to compare.
Retorna: `true` if `left` is earlier than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(BusinessDate left, BusinessDate right)
Determines whether the left business date is earlier than or equal to the right business date.
- left: BusinessDate
- The first business date to compare.
- right: BusinessDate
- The second business date to compare.
Retorna: `true` if `left` is earlier than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(BusinessDate left, BusinessDate right)
Determines whether the left business date is later than the right business date.
- left: BusinessDate
- The first business date to compare.
- right: BusinessDate
- The second business date to compare.
Retorna: `true` if `left` is later than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(BusinessDate left, BusinessDate right)
Determines whether the left business date is later than or equal to the right business date.
- left: BusinessDate
- The first business date to compare.
- right: BusinessDate
- The second business date to compare.
Retorna: `true` if `left` is later than or equal to `right`; otherwise, `false`.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this instance has been explicitly initialized and does not represent the default struct state.
propertyValue
public DateOnly Value { get; }
Gets the underlying `DateOnly` value.
record
Code
Ensamblado: EricksonLopez.ValueObjectspublic sealed record Code : StringValueObject<Code>
Hereda de: StringValueObject<Code>
Represents a generic entity code — an uppercase alphanumeric identifier with separators. Normalized to uppercase. Rules: Required, 1–60 characters, uppercase alphanumeric with `. _ / -` separators (code pattern). Stored uppercase. Used by: ERP, Inventory, POS, SaaS, Property Management, Financial ⚠️ Usage guidance (read before using): `Code` is a deliberately generic VO for domain concepts where the ubiquitous language uses the word "code" without further specificity (e.g., a department code, a category code, a warehouse location code). If your domain concept has a more specific name, prefer a purpose-built VO: - `SKU` — product stock-keeping unit - `TenantCode` — multi-tenant identifier - `DocumentNumber` — numbered document - `ReferenceNumber` — internal reference Using `Code` when a more specific VO exists weakens the Ubiquitous Language. Only use `Code` when the concept genuinely crosses multiple domains with no specific semantic.
Miembros (1)
methodCreate
public static Result<Code> Create(string? value)
Creates a new `Code` instance after validating and normalizing to uppercase.
- value: string?
- The raw entity code string representation.
Retorna: A `Result ` containing the created instance or a validation error.
record
Comment
Ensamblado: EricksonLopez.ValueObjectspublic sealed record Comment : StringValueObject<Comment>
Hereda de: StringValueObject<Comment>
Represents a collaborative comment or remark on tasks, tickets, and domain entities. Rules: Required, 1–5,000 characters. Allows standard multiline whitespace (newlines, tabs) while rejecting non-printable control characters. Used by: CRM, Project Management, Issue Tracking, Social Feeds, Approvals.
Miembros (1)
methodCreate
public static Result<Comment> Create(string? value)
Creates a new `Comment` instance after trimming and validating.
- value: string?
- The raw comment text.
Retorna: A `Result<Comment>` containing the created instance or a validation error.
record
CompanyName
Ensamblado: EricksonLopez.ValueObjectspublic sealed record CompanyName : StringValueObject<CompanyName>
Hereda de: StringValueObject<CompanyName>
Represents the legal or commercial name of a company, organization, or institution. Rules: Required, 2–180 chars, business name characters (letters, digits, spaces, `& . , ' ( ) / # @ + -`), whitespace collapsed. Used by: ERP, E-Invoicing, CRM, SaaS, Payroll, Property Management, Financial, Donations.
Miembros (1)
methodCreate
public static Result<CompanyName> Create(string? value)
Creates a new `CompanyName` instance after validating and normalizing whitespace and punctuation.
- value: string?
- The raw company name string.
Retorna: A `Result<CompanyName>` containing the created instance or a validation error.
record
ContactInfo
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct ContactInfo : IValueObject<ContactInfo>, IEquatable<ContactInfo>
Implementa: IEquatable<ContactInfo>, IValueObject<ContactInfo>
Represents validated corporate or customer contact channels (email, primary/secondary phone, and HTTP/HTTPS website), preventing invalid addresses and dangerous URI schemes (`javascript:`, `data:`, `file:`) from entering domain aggregates.
Miembros (12)
methodCreate
public static Result<ContactInfo> Create(string? email = null, string? phone = null, string? secondaryPhone = null, string? website = null)
Creates a validated `ContactInfo` instance from optional email, primary/secondary phone numbers, and HTTP/HTTPS website.
- email: string?
- Optional email address.
- phone: string?
- Optional primary phone number.
- secondaryPhone: string?
- Optional secondary/mobile phone number.
- website: string?
- Optional HTTP/HTTPS website URL.
Retorna: A `Result<ContactInfo>` containing the validated contact channels or a structured error.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodWithEmail
public Result<ContactInfo> WithEmail(string? email)
Returns a copy of this `ContactInfo` with a newly validated email address.
- email: string?
- The new email address (or `null` to clear).
Retorna: A `Result<ContactInfo>` with the updated email.
methodWithPhone
public Result<ContactInfo> WithPhone(string? phone)
Returns a copy of this `ContactInfo` with a newly validated primary phone number.
- phone: string?
- The new primary phone number (or `null` to clear).
Retorna: A `Result<ContactInfo>` with the updated phone number.
propertyEmail
public Email? Email { get; }
Gets the validated email address, if provided.
propertyEmpty
public static ContactInfo Empty { get; }
Gets an empty initialized `ContactInfo` with no contact channels set.
propertyHasAnyContact
public bool HasAnyContact { get; }
Gets a value indicating whether at least one contact channel is populated.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this struct was initialized via `Create` or `Empty`.
propertyPhone
public PhoneNumber? Phone { get; }
Gets the validated primary phone number, if provided.
propertyPrimaryPhone
public PhoneNumber? PrimaryPhone { get; }
Gets the preferred phone number (`SecondaryPhone` if present, otherwise `Phone`).
propertySecondaryPhone
public PhoneNumber? SecondaryPhone { get; }
Gets the validated secondary or mobile phone number, if provided.
propertyWebsite
public string? Website { get; }
Gets the validated normalized `http` or `https` website URL, if provided.
record
ContentType
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record ContentType : StringValueObject<ContentType>
Hereda de: StringValueObject<ContentType>
Represents a MIME content type (e.g. "application/pdf", "image/png"). Rules: 3–255 chars, lowercase media/subtype format. Used by: Document management, uploads, APIs.
Miembros (1)
methodCreate
public static Result<ContentType> Create(string? value)
Creates a new `ContentType` instance after validating and normalizing the MIME type to lowercase.
- value: string?
- The raw MIME content type string.
Retorna: A `Result<ContentType>` containing the created instance or a validation error.
record
Country
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record Country : StringValueObject<Country>
Hereda de: StringValueObject<Country>
Represents an ISO 3166-1 alpha-2 two-letter country code.
Miembros (3)
methodCreate
public static Result<Country> Create(string? value)
Creates a validated `Country` instance from an ISO 3166-1 alpha-2 code string.
- value: string?
- The two-letter country code string.
Retorna: A successful `Result<T>` containing the validated country code, or a validation failure.
methodCreateNormalized
public static Result<Country> CreateNormalized(ReadOnlySpan<char> value)
Creates a validated `Country` instance from a character span after normalizing common localized country names and ISO 3166-1 alpha-3 codes to their canonical ISO 3166-1 alpha-2 code without intermediate allocations.
- value: ReadOnlySpan<char>
- The country name or code character span.
Retorna: A successful `Result<T>` containing the normalized country code, or a validation failure.
methodCreateNormalized
public static Result<Country> CreateNormalized(string? value)
Creates a validated `Country` instance after normalizing common localized country names and ISO 3166-1 alpha-3 codes (such as `República Dominicana`, `Dominican Republic`, `DOM`, `United States`, `Estados Unidos`, `USA`) to their canonical ISO 3166-1 alpha-2 code.
- value: string?
- The country name or code string.
Retorna: A successful `Result<T>` containing the normalized country code, or a validation failure.
record
CountryCode
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct CountryCode : IValueObject<CountryCode>, IComparable<CountryCode>, IComparable, IParsable<CountryCode>, ISpanParsable<CountryCode>
Implementa: IComparable, IComparable<CountryCode>, IParsable<CountryCode>, ISpanParsable<CountryCode>, IValueObject<CountryCode>
Represents a validated ISO 3166-1 alpha-2 country code with seamless resolution to ISO alpha-3, numeric-3, and Dominican Republic DGII Formato 609 country codes via `IsoCountry`.
Miembros (34)
methodCompareTo
public int CompareTo(CountryCode other)
Inherits documentation from base type or interface.
- other: CountryCode
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<CountryCode> Create(ReadOnlySpan<char> value)
Creates a validated `CountryCode` from a character span.
- value: ReadOnlySpan<char>
- The character span containing an ISO 3166-1 code or alias.
Retorna: A `Result<CountryCode>` containing the validated code or a validation error.
methodCreate
public static Result<CountryCode> Create(string? value)
Creates a validated `CountryCode` from an ISO 3166-1 alpha-2, alpha-3, numeric-3 / DGII 609 code, or common country name.
- value: string?
- The raw country code or alias.
Retorna: A `Result<CountryCode>` containing the validated code or a validation error.
methodParse
public static CountryCode Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a character span into a `CountryCode`.
- s: ReadOnlySpan<char>
- The character span to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `CountryCode`.
methodParse
public static CountryCode Parse(string s, IFormatProvider? provider = null)
Parses a string into a `CountryCode`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `CountryCode`.
methodToIsoCountry
public IsoCountry? ToIsoCountry()
Resolves full `IsoCountry` metadata when this code exists in the standard ISO-3166 catalog.
Retorna: The matching `IsoCountry` entry, or `null` if not in the catalog.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out CountryCode result)
Attempts to parse a character span into a `CountryCode`.
- s: ReadOnlySpan<char>
- The character span to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out CountryCode
- When this method returns, contains the parsed code if valid; otherwise `default`.
Retorna: `true` if valid; otherwise `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out CountryCode result)
Attempts to parse a string into a `CountryCode`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out CountryCode
- When this method returns, contains the parsed code if valid; otherwise `default`.
Retorna: `true` if valid; otherwise `false`.
methodoperator <
public static bool operator <(CountryCode left, CountryCode right)
Determines whether `left` precedes `right` ordinally.
- left: CountryCode
- right: CountryCode
methodoperator <=
public static bool operator <=(CountryCode left, CountryCode right)
Determines whether `left` precedes or equals `right` ordinally.
- left: CountryCode
- right: CountryCode
methodoperator >
public static bool operator >(CountryCode left, CountryCode right)
Determines whether `left` follows `right` ordinally.
- left: CountryCode
- right: CountryCode
methodoperator >=
public static bool operator >=(CountryCode left, CountryCode right)
Determines whether `left` follows or equals `right` ordinally.
- left: CountryCode
- right: CountryCode
propertyAR
public static CountryCode AR { get; }
Gets the Argentina (`AR`, DGII `032`) country code.
propertyAlpha2
public string Alpha2 { get; }
Gets the ISO 3166-1 alpha-2 code (alias for `Value`).
propertyAlpha3
public string Alpha3 { get; }
Gets the ISO 3166-1 alpha-3 code when known in `IsoCountry.All`, or `string.Empty`.
propertyBR
public static CountryCode BR { get; }
Gets the Brazil (`BR`, DGII `076`) country code.
propertyCA
public static CountryCode CA { get; }
Gets the Canada (`CA`, DGII `124`) country code.
propertyCL
public static CountryCode CL { get; }
Gets the Chile (`CL`, DGII `152`) country code.
propertyCN
public static CountryCode CN { get; }
Gets the China (`CN`, DGII `156`) country code.
propertyCO
public static CountryCode CO { get; }
Gets the Colombia (`CO`, DGII `170`) country code.
propertyDO
public static CountryCode DO { get; }
Gets the Dominican Republic (`DO`, DGII `214`) country code.
propertyDgiiCode
public string DgiiCode { get; }
Gets the three-digit DGII Formato 609 country code for Dominican Republic tax reporting when known, or `string.Empty`.
propertyES
public static CountryCode ES { get; }
Gets the Spain (`ES`, DGII `724`) country code.
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this `CountryCode` is uninitialized (`default(CountryCode)`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `CountryCode` was initialized via a factory rather than `default(CountryCode)`.
propertyMX
public static CountryCode MX { get; }
Gets the Mexico (`MX`, DGII `484`) country code.
propertyNumericCode
public string NumericCode { get; }
Gets the three-digit ISO 3166-1 numeric code when known in `IsoCountry.All`, or `string.Empty`.
propertyPA
public static CountryCode PA { get; }
Gets the Panama (`PA`, DGII `591`) country code.
propertyPE
public static CountryCode PE { get; }
Gets the Peru (`PE`, DGII `604`) country code.
propertyPR
public static CountryCode PR { get; }
Gets the Puerto Rico (`PR`, DGII `630`) country code.
propertyUS
public static CountryCode US { get; }
Gets the United States (`US`, DGII `840`) country code.
propertyValue
public string Value { get; }
Gets the canonical two-letter uppercase ISO 3166-1 alpha-2 country code (e.g., `"DO"`, `"US"`).
record
CreatedBy
Ensamblado: EricksonLopez.ValueObjectspublic sealed record CreatedBy : StringValueObject<CreatedBy>
Hereda de: StringValueObject<CreatedBy>
Represents the identity of the actor who created an entity or record. Normalized to uppercase. Rules: Required, 1–120 characters, uppercase alphanumeric or human/system identifier characters. Stored uppercase. Used by: All bounded contexts (Audit trail, Multi-tenant compliance, Event Sourcing).
Miembros (1)
methodCreate
public static Result<CreatedBy> Create(string? value)
Creates a new `CreatedBy` instance after validating and normalizing the actor identifier.
- value: string?
- The raw actor identifier string.
Retorna: A `Result<CreatedBy>` containing the created instance or a validation error.
record
CurrencyCode
Ensamblado: EricksonLopez.ValueObjectspublic readonly partial record struct CurrencyCode : IValueObject<CurrencyCode>, IComparable<CurrencyCode>, IComparable, IParsable<CurrencyCode>, ISpanParsable<CurrencyCode>
Implementa: IComparable, IComparable<CurrencyCode>, IParsable<CurrencyCode>, ISpanParsable<CurrencyCode>, IValueObject<CurrencyCode>
Represents an ISO 4217 three-letter currency code.
Miembros (22)
methodCompareTo
public int CompareTo(CurrencyCode other)
Compares this currency code with another currency code based on ordinal character order.
- other: CurrencyCode
- The other currency code to compare with.
Retorna: A value indicating the relative order of the currency codes being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<CurrencyCode> Create(string? value)
Creates a validated `CurrencyCode` instance from an ISO 4217 code string.
- value: string?
- The raw three-letter currency string.
Retorna: A successful `Result<T>` containing the validated currency code, or a validation failure.
methodParse
public static CurrencyCode Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `CurrencyCode`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `CurrencyCode`.
methodParse
public static CurrencyCode Parse(string s, IFormatProvider? provider = null)
Parses a string into a `CurrencyCode`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `CurrencyCode`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out CurrencyCode result)
Attempts to parse a span of characters into a `CurrencyCode`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out CurrencyCode
- When this method returns, contains the parsed currency code if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out CurrencyCode result)
Attempts to parse a string into a `CurrencyCode`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out CurrencyCode
- When this method returns, contains the parsed currency code if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(CurrencyCode left, CurrencyCode right)
Determines whether the left currency code is less than the right currency code.
- left: CurrencyCode
- The first currency code to compare.
- right: CurrencyCode
- The second currency code to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(CurrencyCode left, CurrencyCode right)
Determines whether the left currency code is less than or equal to the right currency code.
- left: CurrencyCode
- The first currency code to compare.
- right: CurrencyCode
- The second currency code to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(CurrencyCode left, CurrencyCode right)
Determines whether the left currency code is greater than the right currency code.
- left: CurrencyCode
- The first currency code to compare.
- right: CurrencyCode
- The second currency code to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(CurrencyCode left, CurrencyCode right)
Determines whether the left currency code is greater than or equal to the right currency code.
- left: CurrencyCode
- The first currency code to compare.
- right: CurrencyCode
- The second currency code to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyBHD
public static CurrencyCode BHD { get; }
Gets the Bahraini Dinar (BHD) currency code.
propertyDOP
public static CurrencyCode DOP { get; }
Gets the Dominican Peso (DOP) currency code.
propertyDecimalPlaces
public int DecimalPlaces { get; }
Gets the standard number of decimal places defined by ISO 4217 for this currency.
propertyEUR
public static CurrencyCode EUR { get; }
Gets the Euro (EUR) currency code.
propertyGBP
public static CurrencyCode GBP { get; }
Gets the British Pound Sterling (GBP) currency code.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `CurrencyCode` instance was initialized through a factory rather than `default(CurrencyCode)`.
propertyJPY
public static CurrencyCode JPY { get; }
Gets the Japanese Yen (JPY) currency code.
propertyKWD
public static CurrencyCode KWD { get; }
Gets the Kuwaiti Dinar (KWD) currency code.
propertyUSD
public static CurrencyCode USD { get; }
Gets the United States Dollar (USD) currency code.
propertyValue
public string Value { get; }
Gets the three-letter ISO 4217 currency code string.
record
CustomerCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed record CustomerCode : StringValueObject<CustomerCode>
Hereda de: StringValueObject<CustomerCode>
Represents a unique customer, client, or account master data code. Normalized to uppercase. Rules: Required, 1–40 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: ERP, CRM, POS, Electronic Invoicing, Subscriptions.
Miembros (1)
methodCreate
public static Result<CustomerCode> Create(string? value)
Creates a new `CustomerCode` instance after validating and normalizing to uppercase.
- value: string?
- The raw customer code string.
Retorna: A `Result<CustomerCode>` containing the created instance or a validation error.
record
DateRange
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct DateRange : IValueObject<DateRange>, IComparable<DateRange>, IComparable, IParsable<DateRange>, ISpanParsable<DateRange>
Implementa: IComparable, IComparable<DateRange>, IParsable<DateRange>, ISpanParsable<DateRange>, IValueObject<DateRange>
Represents an inclusive calendar date range defined by start and end dates.
Miembros (20)
methodCompareTo
public int CompareTo(DateRange other)
Compares this date range with another date range.
- other: DateRange
- The other date range to compare against.
Retorna: A value indicating the relative order of the date ranges being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodContains
public bool Contains(DateOnly date)
Determines whether the specified date is contained within this date range.
- date: DateOnly
- The date to check.
Retorna: `true` if the date is within the inclusive range; otherwise, `false`.
methodCreate
public static Result<DateRange> Create(DateOnly start, DateOnly end)
Creates a validated `DateRange` instance with specified start and end dates.
- start: DateOnly
- The start date of the range.
- end: DateOnly
- The end date of the range.
Retorna: A successful `Result<T>` containing the validated date range, or a validation failure.
methodOverlaps
public bool Overlaps(DateRange other)
Determines whether this date range overlaps with another date range.
- other: DateRange
- The other date range to check for overlap.
Retorna: `true` if the ranges overlap; otherwise, `false`.
methodParse
public static DateRange Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `DateRange`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `DateRange`.
methodParse
public static DateRange Parse(string s, IFormatProvider? provider = null)
Parses a string into a `DateRange`.
- s: string
- The string to parse (e.g. `"[2026-01-01 .. 2026-12-31]"` or `"2026-01-01..2026-12-31"`).
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `DateRange`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out DateRange result)
Attempts to parse a span of characters into a `DateRange`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out DateRange
- When this method returns, contains the parsed range if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out DateRange result)
Attempts to parse a string into a `DateRange`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out DateRange
- When this method returns, contains the parsed range if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(DateRange left, DateRange right)
Determines whether the left date range is earlier than the right date range.
- left: DateRange
- The first date range to compare.
- right: DateRange
- The second date range to compare.
Retorna: `true` if `left` is earlier than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(DateRange left, DateRange right)
Determines whether the left date range is earlier than or equal to the right date range.
- left: DateRange
- The first date range to compare.
- right: DateRange
- The second date range to compare.
Retorna: `true` if `left` is earlier than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(DateRange left, DateRange right)
Determines whether the left date range is later than the right date range.
- left: DateRange
- The first date range to compare.
- right: DateRange
- The second date range to compare.
Retorna: `true` if `left` is later than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(DateRange left, DateRange right)
Determines whether the left date range is later than or equal to the right date range.
- left: DateRange
- The first date range to compare.
- right: DateRange
- The second date range to compare.
Retorna: `true` if `left` is later than or equal to `right`; otherwise, `false`.
propertyDaysDifference
public int DaysDifference { get; }
Gets the difference in calendar days between start and end (exclusive of boundary point).
propertyDurationInDays
public int DurationInDays { get; }
Gets the total number of calendar days spanned by the range (inclusive).
propertyEnd
public DateOnly End { get; }
Gets the ending date of the range.
propertyInclusiveDays
public int InclusiveDays { get; }
Gets the inclusive number of calendar days spanned by the range (equivalent to `DurationInDays`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this instance has been explicitly initialized and does not represent the default struct state.
propertyStart
public DateOnly Start { get; }
Gets the starting date of the range.
record
DecimalQuantity
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct DecimalQuantity : IValueObject<DecimalQuantity>, IEquatable<DecimalQuantity>, IComparable<DecimalQuantity>, IParsable<DecimalQuantity>, ISpanParsable<DecimalQuantity>
Implementa: IComparable<DecimalQuantity>, IEquatable<DecimalQuantity>, IParsable<DecimalQuantity>, ISpanParsable<DecimalQuantity>, IValueObject<DecimalQuantity>
Represents a fractional decimal quantity (e.g., `1.500` kg, `0.250` L, `2.75` m) for commercial, inventory, retail scale, and bill-of-materials domains where discrete integer `Quantity` is insufficient.
Miembros (20)
methodAdd
public Result<DecimalQuantity> Add(DecimalQuantity other)
Adds another `DecimalQuantity` to this instance.
- other: DecimalQuantity
- The quantity to add.
Retorna: A `Result<DecimalQuantity>` containing the sum.
methodCompareTo
public int CompareTo(DecimalQuantity other)
Inherits documentation from base type or interface.
- other: DecimalQuantity
methodCreate
public static Result<DecimalQuantity> Create(decimal value, int maxScale = 6)
Creates a validated non-negative `DecimalQuantity` (>= 0) with at most `maxScale` decimal places.
- value: decimal
- The non-negative decimal quantity.
- maxScale: int
- Maximum allowed decimal scale (0–6, defaults to 6).
Retorna: A `Result<DecimalQuantity>` containing the validated quantity or an error.
methodCreatePositive
public static Result<DecimalQuantity> CreatePositive(decimal value, int maxScale = 6)
Creates a validated strictly positive `DecimalQuantity` (> 0).
- value: decimal
- The strictly positive decimal quantity.
- maxScale: int
- Maximum allowed decimal scale (0–6, defaults to 6).
Retorna: A `Result<DecimalQuantity>` containing the validated quantity or an error.
methodParse
public static DecimalQuantity Parse(ReadOnlySpan<char> s, IFormatProvider? provider)
Inherits documentation from base type or interface.
- s: ReadOnlySpan<char>
- provider: IFormatProvider?
methodParse
public static DecimalQuantity Parse(string s, IFormatProvider? provider)
Inherits documentation from base type or interface.
- s: string
- provider: IFormatProvider?
methodSubtract
public Result<DecimalQuantity> Subtract(DecimalQuantity other)
Subtracts another `DecimalQuantity` from this instance, failing if the result would become negative.
- other: DecimalQuantity
- The quantity to subtract.
Retorna: A `Result<DecimalQuantity>` containing the non-negative difference or an insufficient quantity error.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out DecimalQuantity result)
Inherits documentation from base type or interface.
- s: ReadOnlySpan<char>
- provider: IFormatProvider?
- result: out DecimalQuantity
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out DecimalQuantity result)
Inherits documentation from base type or interface.
- s: string?
- provider: IFormatProvider?
- result: out DecimalQuantity
methodoperator <
public static bool operator <(DecimalQuantity left, DecimalQuantity right)
Determines whether `left` is strictly less than `right`.
- left: DecimalQuantity
- right: DecimalQuantity
methodoperator <=
public static bool operator <=(DecimalQuantity left, DecimalQuantity right)
Determines whether `left` is less than or equal to `right`.
- left: DecimalQuantity
- right: DecimalQuantity
methodoperator >
public static bool operator >(DecimalQuantity left, DecimalQuantity right)
Determines whether `left` is strictly greater than `right`.
- left: DecimalQuantity
- right: DecimalQuantity
methodoperator >=
public static bool operator >=(DecimalQuantity left, DecimalQuantity right)
Determines whether `left` is greater than or equal to `right`.
- left: DecimalQuantity
- right: DecimalQuantity
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this instance is uninitialized (`default(DecimalQuantity)`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this instance was initialized via a factory or `Zero`.
propertyIsPositive
public bool IsPositive { get; }
Gets a value indicating whether `Value` is strictly positive (> 0).
propertyIsZero
public bool IsZero { get; }
Gets a value indicating whether `Value` is zero.
propertyValue
public decimal Value { get; }
Gets the fractional decimal value.
propertyZero
public static DecimalQuantity Zero { get; }
Gets an initialized zero `DecimalQuantity`.
record
DeletedBy
Ensamblado: EricksonLopez.ValueObjectspublic sealed record DeletedBy : StringValueObject<DeletedBy>
Hereda de: StringValueObject<DeletedBy>
Represents the identity of the actor who marked an entity as deleted (soft delete). Normalized to uppercase. Rules: Required, 1–120 characters, uppercase alphanumeric or human/system identifier characters. Stored uppercase. Used by: All bounded contexts (Soft delete audit trail).
Miembros (1)
methodCreate
public static Result<DeletedBy> Create(string? value)
Creates a new `DeletedBy` instance after validating and normalizing the actor identifier.
- value: string?
- The raw actor identifier string.
Retorna: A `Result<DeletedBy>` containing the created instance or a validation error.
record
DepartmentName
Ensamblado: EricksonLopez.ValueObjectspublic sealed record DepartmentName : StringValueObject<DepartmentName>
Hereda de: StringValueObject<DepartmentName>
Represents the name of a business department, division, or organizational unit. Normalized by collapsing excessive whitespace. Rules: Required, 2–120 characters, business name characters. Used by: Human Resources, Payroll, Organization Structure, ERP, Budgeting.
Miembros (1)
methodCreate
public static Result<DepartmentName> Create(string? value)
Creates a new `DepartmentName` instance after validating and collapsing whitespace.
- value: string?
- The raw department name string.
Retorna: A `Result<DepartmentName>` containing the created instance or a validation error.
record
Description
Ensamblado: EricksonLopez.ValueObjectspublic sealed record Description : StringValueObject<Description>
Hereda de: StringValueObject<Description>
Generic description Value Object for entities across all bounded contexts. Suitable for product descriptions, task descriptions, meeting summaries, etc. Accepts any printable content; whitespace is collapsed. Rules: Required, 1–1000 chars, whitespace collapsed, no control characters. Used by: ERP, POS, E-Invoicing, Payroll, Inventory, Manufacturing, CRM, HR, Property Management, Tasks, Financial, Donations, SaaS.
Miembros (1)
methodCreate
public static Result<Description> Create(string? value)
Creates a new `Description` instance after validating and collapsing whitespace.
- value: string?
- The raw description string.
Retorna: A `Result` containing the created instance or a validation error.
enum
DimensionUnit
Ensamblado: EricksonLopez.ValueObjectspublic enum DimensionUnit
Supported linear dimension units for packaging, warehousing, and freight volumetrics.
record
DiscountRate
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct DiscountRate : IValueObject<DiscountRate>, IComparable<DiscountRate>, IComparable, IParsable<DiscountRate>, ISpanParsable<DiscountRate>, IFormattable, ISpanFormattable
Implementa: IComparable, IComparable<DiscountRate>, IFormattable, IParsable<DiscountRate>, ISpanFormattable, ISpanParsable<DiscountRate>, IValueObject<DiscountRate>
Represents a commercial discount rate percentage value between 0 and 100 inclusive.
Miembros (24)
methodApplyTo
public Money ApplyTo(Money baseAmount)
Calculates the net monetary amount remaining after applying the discount using banker's rounding.
- baseAmount: Money
- The base monetary amount before discount.
Retorna: The net `Money` remaining after discount.
methodApplyTo
public decimal ApplyTo(decimal baseAmount)
Calculates the net amount remaining after applying the discount to a base numeric value.
- baseAmount: decimal
- The base numeric amount before discount.
Retorna: The net amount remaining after applying the discount, rounded to 6 decimal places.
methodCalculateDiscount
public Money CalculateDiscount(Money baseAmount)
Calculates the absolute discount monetary amount for a specified base monetary value using banker's rounding.
- baseAmount: Money
- The base monetary value before discount.
Retorna: The calculated discount `Money` amount.
methodCalculateDiscount
public decimal CalculateDiscount(decimal baseAmount)
Calculates the absolute discount amount for a specified base numeric value.
- baseAmount: decimal
- The base monetary or numeric value.
Retorna: The calculated discount amount rounded to 6 decimal places.
methodCompareTo
public int CompareTo(DiscountRate other)
Compares this discount rate with another discount rate.
- other: DiscountRate
- The other discount rate to compare against.
Retorna: A value indicating the relative order of the discount rates being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<DiscountRate> Create(decimal value)
Creates a validated `DiscountRate` instance from a percentage value in the range [0, 100].
- value: decimal
- The discount percentage amount.
Retorna: A successful `Result<T>` containing the validated discount rate, or a validation failure.
methodParse
public static DiscountRate Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `DiscountRate`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `DiscountRate`.
methodParse
public static DiscountRate Parse(string s, IFormatProvider? provider = null)
Parses a string into a `DiscountRate`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `DiscountRate`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodToString
public string ToString(string? format, IFormatProvider? formatProvider)
Inherits documentation from `IFormattable.ToString(string?, IFormatProvider?)`.
- format: string?
- formatProvider: IFormatProvider?
methodTryFormat
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Inherits documentation from base type or interface.
- destination: Span<char>
- charsWritten: out int
- format: ReadOnlySpan<char>
- provider: IFormatProvider?
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out DiscountRate result)
Attempts to parse a span of characters into a `DiscountRate`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out DiscountRate
- When this method returns, contains the parsed discount rate if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out DiscountRate result)
Attempts to parse a string into a `DiscountRate`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out DiscountRate
- When this method returns, contains the parsed discount rate if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(DiscountRate left, DiscountRate right)
Determines whether the left discount rate is less than the right discount rate.
- left: DiscountRate
- The first discount rate to compare.
- right: DiscountRate
- The second discount rate to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(DiscountRate left, DiscountRate right)
Determines whether the left discount rate is less than or equal to the right discount rate.
- left: DiscountRate
- The first discount rate to compare.
- right: DiscountRate
- The second discount rate to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(DiscountRate left, DiscountRate right)
Determines whether the left discount rate is greater than the right discount rate.
- left: DiscountRate
- The first discount rate to compare.
- right: DiscountRate
- The second discount rate to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(DiscountRate left, DiscountRate right)
Determines whether the left discount rate is greater than or equal to the right discount rate.
- left: DiscountRate
- The first discount rate to compare.
- right: DiscountRate
- The second discount rate to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyAsFraction
public decimal AsFraction { get; }
Gets the fractional representation of the discount rate.
propertyFraction
public decimal Fraction { get; }
Gets the fractional representation of the discount rate (value divided by 100).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `DiscountRate` instance was initialized through a factory rather than `default(DiscountRate)`.
propertyIsZero
public bool IsZero { get; }
Gets a value indicating whether the discount rate is zero.
propertyValue
public decimal Value { get; }
Gets the numerical discount rate percentage.
fieldNone
public static readonly DiscountRate None
Gets a discount rate representing zero discount (0%).
record
DisplayName
Ensamblado: EricksonLopez.ValueObjectspublic sealed record DisplayName : StringValueObject<DisplayName>
Hereda de: StringValueObject<DisplayName>
Represents a user-facing display name or alias for UI presentation.
Miembros (1)
methodCreate
public static Result<DisplayName> Create(string? value)
Creates a validated `DisplayName` instance after normalizing business whitespace.
- value: string?
- The raw display name string.
Retorna: A successful `Result<T>` containing the validated display name, or a validation failure.
record
DocumentNumber
Ensamblado: EricksonLopez.ValueObjectspublic sealed record DocumentNumber : StringValueObject<DocumentNumber>
Hereda de: StringValueObject<DocumentNumber>
Represents a structured document number — the primary identity of a business document. This is the number printed on the document itself (e.g., the invoice number, purchase order number). Normalized to uppercase. Rules: Required, 1–60 chars, uppercase alphanumeric with `. _ / -` separators. Used by: E-Invoicing, ERP, Inventory, Manufacturing, Financial, Audit When to use DocumentNumber vs ReferenceNumber vs ExternalReference: - DocumentNumber: The document's OWN identifier. E.g., invoice `FAC-2026-0001`, purchase order `OC-2026-0042`, NCF sequence `B0100000001`. - ReferenceNumber: A POINTER to another document or operation within the organization. E.g., "this payment references invoice `FAC-2026-0001`", bank transfer `REF-987654`, check number `CHK-001234`. - ExternalReference: An identifier from a THIRD PARTY that the organization does not control. E.g., supplier invoice number, DGII authorization code, bank transaction ID.
Miembros (1)
methodCreate
public static Result<DocumentNumber> Create(string? value)
Creates a new `DocumentNumber` instance after validating and normalizing the document number.
- value: string?
- The raw document number string.
Retorna: A `Result<DocumentNumber>` containing the created instance or a validation error.
class
DomainException
Ensamblado: EricksonLopez.ValueObjectspublic sealed class DomainException : Exception
Hereda de: Exception
Represents errors caused by value object invariant violations and invalid domain states resulting from caller programming errors.
Miembros (3)
constructorDomainException
public DomainException(string message)
Initializes a new instance of the `DomainException` class with a specified error message.
- message: string
- The message that describes the error.
constructorDomainException
public DomainException(string message, Exception innerException)
Initializes a new instance of the `DomainException` class with a specified error message and a reference to the inner exception that is the cause of this exception.
- message: string
- The message that describes the error.
- innerException: Exception
- The exception that is the cause of the current exception.
methodThrowIf
public static void ThrowIf(bool condition, string message)
Throws a `DomainException` if the specified condition is `true`.
- condition: bool
- The condition to evaluate.
- message: string
- The message to include in the exception if thrown.
record
Email
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct Email : IValueObject<Email>, IComparable<Email>, IComparable, IParsable<Email>, ISpanParsable<Email>, IFormattable
Implementa: IComparable, IComparable<Email>, IFormattable, IParsable<Email>, ISpanParsable<Email>, IValueObject<Email>
Represents a validated RFC 5321 email address normalized to lowercase.
Miembros (24)
methodCompareTo
public int CompareTo(Email other)
Compares this email address with another email address using ordinal string comparison.
- other: Email
- The other email address to compare against.
Retorna: A value indicating the relative order of the email addresses being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<Email> Create(ReadOnlySpan<char> value)
Creates a validated `Email` instance from an email address character span.
- value: ReadOnlySpan<char>
- The raw email address character span.
Retorna: A successful `Result<T>` containing the validated email, or a validation failure.
methodCreate
public static Result<Email> Create(string? value)
Creates a validated `Email` instance from an email address string.
- value: string?
- The raw email address string.
Retorna: A successful `Result<T>` containing the validated email, or a validation failure.
methodCreateWithBlindIndex
public static Result<Email> CreateWithBlindIndex(string? value, Func<string, string>? blindIndexFactory)
Creates a validated `Email` instance and computes its deterministic blind index using the provided hash function.
- value: string?
- The raw email address string.
- blindIndexFactory: Func<string, string>?
- A deterministic hash function (such as HMAC-SHA256) that computes the blind index from the normalized email string.
Retorna: A successful `Result<T>` containing the validated email and its blind index, or a validation failure.
methodEquals
public bool Equals(Email other)
Determines whether this email address is equal to another email address by comparing their canonical normalized values.
- other: Email
- The other email address to compare against.
Retorna: `true` if both email addresses have the same canonical value; otherwise, `false`.
methodGetHashCode
public override int GetHashCode()
Inherits documentation from base type or interface.
methodMasked
public string Masked()
Returns the email address with the local mailbox portion masked for secure diagnostic logging.
Retorna: The masked email address string.
methodParse
public static Email Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into an `Email`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `Email`.
methodParse
public static Email Parse(string s, IFormatProvider? provider = null)
Parses a string into an `Email`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `Email`.
methodToMaskedString
public string ToMaskedString()
Returns the email address with the local mailbox portion masked for secure diagnostic logging per ADR-013.
Retorna: The masked email address string.
methodToString
public override string ToString()
Returns the canonical normalized email address string, ensuring round-trip fidelity with `Parse(string, IFormatProvider?)`.
Retorna: The canonical normalized email address string, or an empty string if uninitialized.
methodToString
public string ToString(string? format, IFormatProvider? formatProvider = null)
Formats the email address according to the specified format specifier. When `format` is "M" or "m", returns the masked email address per ADR-013. Otherwise, returns the canonical normalized email address string.
- format: string?
- The format specifier (e.g., "M" for masked, "G" or null for general canonical).
- formatProvider: IFormatProvider?
- An optional format provider.
Retorna: The formatted email address string.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Email result)
Attempts to parse a span of characters into an `Email`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out Email
- When this method returns, contains the parsed email if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out Email result)
Attempts to parse a string into an `Email`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out Email
- When this method returns, contains the parsed email if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(Email left, Email right)
Determines whether the left email address is less than the right email address.
- left: Email
- The first email address to compare.
- right: Email
- The second email address to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(Email left, Email right)
Determines whether the left email address is less than or equal to the right email address.
- left: Email
- The first email address to compare.
- right: Email
- The second email address to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(Email left, Email right)
Determines whether the left email address is greater than the right email address.
- left: Email
- The first email address to compare.
- right: Email
- The second email address to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(Email left, Email right)
Determines whether the left email address is greater than or equal to the right email address.
- left: Email
- The first email address to compare.
- right: Email
- The second email address to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyBlindIndex
public string BlindIndex { get; }
Gets the deterministic cryptographic blind index (e.g., HMAC-SHA256) associated with the normalized email address for searchable encryption, or an empty string if not computed.
propertyDomain
public string Domain { get; }
Gets the domain portion of the email address succeeding the `@` sign.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `Email` instance was initialized through a factory rather than `default(Email)`.
propertyLocalPart
public string LocalPart { get; }
Gets the local mailbox portion of the email address preceding the `@` sign.
propertyValue
public string Value { get; }
Gets the normalized email address string.
record
EmployeeCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed record EmployeeCode : StringValueObject<EmployeeCode>
Hereda de: StringValueObject<EmployeeCode>
Represents a unique employee, staff, or payroll identifier code. Normalized to uppercase. Rules: Required, 1–40 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: Human Resources, Payroll, Time & Attendance, ERP, Identity.
Miembros (1)
methodCreate
public static Result<EmployeeCode> Create(string? value)
Creates a new `EmployeeCode` instance after validating and normalizing to uppercase.
- value: string?
- The raw employee code string.
Retorna: A `Result<EmployeeCode>` containing the created instance or a validation error.
record
ExchangeRate
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct ExchangeRate : IValueObject<ExchangeRate>
Implementa: IValueObject<ExchangeRate>
Represents an exchange rate between two ISO 4217 currencies.
Miembros (9)
methodConvert
public Result<Money> Convert(Money amount)
Converts a `Money` amount from the source currency to the target currency, applying banker's rounding to the target currency's standard decimal places.
- amount: Money
- The monetary amount in the source currency to convert.
Retorna: A successful `Result<Money>` containing the converted amount, or a validation failure.
methodConvert
public Result<Money> Convert(Money amount, int decimals)
Converts a `Money` amount from the source currency to the target currency, applying banker's rounding to the specified target decimal scale.
- amount: Money
- The monetary amount in the source currency to convert.
- decimals: int
- The decimal scale override for the target monetary amount (between 0 and 28).
Retorna: A successful `Result<Money>` containing the converted amount in the target currency, or a validation failure.
methodCreate
public static Result<ExchangeRate> Create(CurrencyCode fromCurrency, CurrencyCode toCurrency, decimal rate)
Creates a validated `ExchangeRate` instance between two distinct currencies.
- fromCurrency: CurrencyCode
- The source currency code.
- toCurrency: CurrencyCode
- The target currency code.
- rate: decimal
- The positive exchange rate factor.
Retorna: A successful `Result<T>` containing the validated exchange rate, or a validation failure.
methodInverse
public Result<ExchangeRate> Inverse()
Calculates the inverse exchange rate converting from the target currency back to the source currency.
Retorna: A successful `Result<T>` containing the inverted exchange rate.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
propertyFromCurrency
public CurrencyCode FromCurrency { get; }
Gets the source ISO 4217 currency code.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `ExchangeRate` instance was initialized through a factory rather than `default(ExchangeRate)`.
propertyRate
public decimal Rate { get; }
Gets the numerical exchange conversion rate from source to target currency.
propertyToCurrency
public CurrencyCode ToCurrency { get; }
Gets the target ISO 4217 currency code.
record
ExternalReference
Ensamblado: EricksonLopez.ValueObjectspublic sealed record ExternalReference : StringValueObject<ExternalReference>
Hereda de: StringValueObject<ExternalReference>
Represents a reference code assigned by an external system (e.g., third-party API ID, payment gateway reference, bank transaction ID, integration correlation key). Case is preserved as-is. External systems may be case-sensitive; normalizing to uppercase would destroy information and break reconciliation with those systems. Rules: Required, 1–200 chars, leading/trailing whitespace trimmed, no control characters. No pattern restriction — external references may be UUIDs, tokens, numeric IDs, base64 strings, or any format defined by the third party. Used by: ERP, FE, CRM, SaaS, Treasury.
Miembros (1)
methodCreate
public static Result<ExternalReference> Create(string? value)
Creates a new `ExternalReference` instance after trimming leading and trailing whitespace.
- value: string?
- The raw external reference string.
Retorna: A `Result<ExternalReference>` containing the created instance or a validation error.
record
FileName
Ensamblado: EricksonLopez.ValueObjectspublic sealed record FileName : StringValueObject<FileName>
Hereda de: StringValueObject<FileName>
Represents a file system-safe file name. Rules: 1–255 chars, no characters that are invalid on Windows NTFS, Linux ext4, or common cloud storage providers (Azure Blob, S3). Used by: Document management, uploads, storage Design note: This VO does not use `System.IO.Path.GetInvalidFileNameChars()` because that method returns OS-specific results (different on Windows vs Linux), which would make domain validation non-deterministic across environments. Instead, a curated explicit set of characters is defined here that covers the union of restrictions across all target platforms. Prohibited characters (platform-union set): - ASCII control characters (0x00–0x1F) — invalid everywhere - `\ / : * ? " < > |` — invalid on Windows NTFS and many cloud providers - Null byte (0x00) — invalid on all POSIX file systems .
Miembros (2)
methodCreate
public static Result<FileName> Create(string? value)
Creates a new `FileName` instance after validating that it contains no prohibited characters.
- value: string?
- The raw file name string.
Retorna: A `Result<FileName>` containing the created instance or a validation error.
propertyExtension
public string Extension { get; }
Returns the file extension including the dot (e.g., `.pdf`).
record
FirstName
Ensamblado: EricksonLopez.ValueObjectspublic sealed record FirstName : StringValueObject<FirstName>
Hereda de: StringValueObject<FirstName>
Represents an individual's first or given name.
Miembros (1)
methodCreate
public static Result<FirstName> Create(string? value)
Creates a validated `FirstName` instance after normalizing whitespace and unicode characters.
- value: string?
- The raw first name string.
Retorna: A successful `Result<T>` containing the validated first name, or a validation failure.
record
FullName
Ensamblado: EricksonLopez.ValueObjectspublic sealed record FullName : ValueObject
Hereda de: ValueObject
Represents an individual's composite full name consisting of first, optional middle, and last name.
Miembros (7)
methodCreate
public static Result<FullName> Create(FirstName? firstName, LastName? lastName, MiddleName? middleName = null)
Creates a `FullName` instance from strongly typed name components.
- firstName: FirstName?
- The validated first name.
- lastName: LastName?
- The validated last name.
- middleName: MiddleName?
- The optional validated middle name.
Retorna: A successful `Result<T>` containing the composite full name, or a validation failure.
methodCreate
public static Result<FullName> Create(string? firstName, string? lastName, string? middleName = null)
Creates a `FullName` instance from raw name strings, validating each component.
- firstName: string?
- The raw first name string.
- lastName: string?
- The raw last name string.
- middleName: string?
- The optional raw middle name string.
Retorna: A successful `Result<T>` containing the composite full name, or a validation failure.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
propertyFirstName
public FirstName FirstName { get; }
Gets the first name component.
propertyLastName
public LastName LastName { get; }
Gets the last name component.
propertyMiddleName
public MiddleName? MiddleName { get; }
Gets the optional middle name component.
propertyValue
public string Value { get; }
Gets the complete formatted full name string.
record
GeoCoordinate
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct GeoCoordinate : IValueObject<GeoCoordinate>, IParsable<GeoCoordinate>, ISpanParsable<GeoCoordinate>
Implementa: IParsable<GeoCoordinate>, ISpanParsable<GeoCoordinate>, IValueObject<GeoCoordinate>
Immutable Value Object representing geographic coordinates on the WGS 84 ellipsoid.
Miembros (11)
methodCreate
public static Result<GeoCoordinate> Create(double latitude, double longitude)
Creates a validated `GeoCoordinate` instance.
- latitude: double
- Latitude in decimal degrees (-90 to 90).
- longitude: double
- Longitude in decimal degrees (-180 to 180).
Retorna: A `Result<GeoCoordinate>` containing the validated coordinate or a validation error.
methodDistanceToKilometers
public double DistanceToKilometers(GeoCoordinate target)
Calculates the great-circle distance to another coordinate using the Haversine formula in kilometers.
- target: GeoCoordinate
- The target coordinate.
Retorna: The distance in kilometers.
methodDistanceToMeters
public double DistanceToMeters(GeoCoordinate target)
Calculates the great-circle distance to another coordinate in meters.
- target: GeoCoordinate
- The destination coordinate.
Retorna: The calculated geodesic distance in meters.
methodParse
public static GeoCoordinate Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `GeoCoordinate`.
- s: ReadOnlySpan<char>
- The span of characters to parse in "latitude, longitude" format.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `GeoCoordinate`.
methodParse
public static GeoCoordinate Parse(string s, IFormatProvider? provider = null)
Parses a string into a `GeoCoordinate`.
- s: string
- The string to parse in "latitude, longitude" format.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `GeoCoordinate`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out GeoCoordinate result)
Attempts to parse a span of characters into a `GeoCoordinate`.
- s: ReadOnlySpan<char>
- The span of characters to parse in "latitude, longitude" format.
- provider: IFormatProvider?
- An optional format provider.
- result: out GeoCoordinate
- When this method returns, contains the parsed coordinate if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out GeoCoordinate result)
Attempts to parse a string into a `GeoCoordinate`.
- s: string?
- The string to parse in "latitude, longitude" format.
- provider: IFormatProvider?
- An optional format provider.
- result: out GeoCoordinate
- When this method returns, contains the parsed coordinate if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `GeoCoordinate` instance was initialized through a factory rather than `default(GeoCoordinate)`.
propertyLatitude
public double Latitude { get; }
Gets the latitude component in decimal degrees (-90.0 to 90.0).
propertyLongitude
public double Longitude { get; }
Gets the longitude component in decimal degrees (-180.0 to 180.0).
record
HierarchyPath
Ensamblado: EricksonLopez.ValueObjectspublic sealed record HierarchyPath : StringValueObject<HierarchyPath>
Hereda de: StringValueObject<HierarchyPath>
Immutable Value Object representing a hierarchical tree node path using the Materialized Path pattern (e.g. `/1/4/12/`).
Miembros (12)
methodAppend
public HierarchyPath Append(string childSegment)
Appends a validated child segment to the current path, returning a new `HierarchyPath`.
- childSegment: string
- The child segment to append.
Retorna: A new `HierarchyPath` with the appended segment.
methodCreate
public static Result<HierarchyPath> Create(string? value)
Creates a validated `HierarchyPath` instance from a materialized path string.
- value: string?
- The path string formatted as `/segment1/segment2/.../`.
Retorna: A `Result<HierarchyPath>` containing the validated instance or a domain validation error.
methodIsAncestorOf
public bool IsAncestorOf(HierarchyPath other)
Determines whether this path is an ancestor of the specified child path.
- other: HierarchyPath
- The target path to evaluate.
Retorna: `true` if this path is an ancestor of `other`; otherwise, `false`.
methodIsDescendantOf
public bool IsDescendantOf(HierarchyPath other)
Determines whether this path is a descendant of the specified parent path.
- other: HierarchyPath
- The target path to evaluate.
Retorna: `true` if this path is a descendant of `other`; otherwise, `false`.
methodIsDirectChildOf
public bool IsDirectChildOf(HierarchyPath parent)
Determines whether this path is a direct child of the specified parent path.
- parent: HierarchyPath
- The parent path to evaluate.
Retorna: `true` if this path is a direct child of `parent`; otherwise, `false`.
methodRoot
public static HierarchyPath Root(string? initialSegment = null)
Creates a root-level `HierarchyPath`, optionally initializing with the specified child segment.
- initialSegment: string?
- An optional root child segment (e.g. `"dept_1"` producing `"/dept_1/"`).
Retorna: A new `HierarchyPath`.
methodSanitize
public static string Sanitize(string segment)
Sanitizes an input string to be a valid path segment.
- segment: string
- The path segment to sanitize.
Retorna: The sanitized path segment string.
methodTryAppend
public Result<HierarchyPath> TryAppend(string? childSegment)
Attempts to append a child segment to the current path, returning a `Result<HierarchyPath>`.
- childSegment: string?
- The child segment to append.
Retorna: A `Result<HierarchyPath>` containing the new path or a validation error.
propertyDepth
public int Depth { get; }
Gets the hierarchy depth level (root is 0, /1/ is 1, /1/4/ is 2).
propertyIsRoot
public bool IsRoot { get; }
Gets a value indicating whether this path represents the root node.
propertyParent
public HierarchyPath? Parent { get; }
Gets the parent `HierarchyPath`, or `null` if this is the root path.
propertyRootConstant
public static HierarchyPath RootConstant { get; }
Represents the root level path constant (`/`).
record
HmacSha256Hash
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record HmacSha256Hash : StringValueObject<HmacSha256Hash>
Hereda de: StringValueObject<HmacSha256Hash>
Represents a cryptographically secure 64-character hexadecimal HMAC-SHA256 hash (e.g. for API key signatures or webhook payloads). Invariant: Must be exactly 64 hexadecimal characters, normalized to lowercase. Masked by default via `SensitiveDataAttribute` and `object.ToString()`.
Miembros (1)
methodCreate
public static Result<HmacSha256Hash> Create(string? value)
Creates a new `HmacSha256Hash` instance after validating format and length.
- value: string?
- The raw HMAC-SHA256 hash hexadecimal string.
Retorna: A `Result<HmacSha256Hash>` containing the created instance or a validation error.
interface
IValueObject
Ensamblado: EricksonLopez.ValueObjectspublic interface IValueObject
Defines a marker interface identifying a Domain-Driven Design value object.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
interface
IValueObject<TSelf>
Ensamblado: EricksonLopez.ValueObjectspublic interface IValueObject<TSelf> : IValueObject, IEquatable<TSelf> where TSelf : IValueObject<TSelf>
Implementa: IEquatable<TSelf>, IValueObject
Defines a strongly-typed contract for value objects enforcing value-based equality.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
record
IsoCountry
Ensamblado: EricksonLopez.ValueObjectspublic sealed record IsoCountry
Immutable ISO 3166-1 country descriptor enriched with Dominican Republic DGII Formato 609 foreign-payment country codes, ITU-T E.164 calling prefixes, and ISO 4217 currency codes.
Miembros (19)
methodFromCode
public static Result<IsoCountry> FromCode(string? codeOrName)
Resolves an `IsoCountry` by ISO alpha-2, alpha-3, numeric/DGII 609 code, or localized country name.
- codeOrName: string?
- The code or name to resolve.
Retorna: A `Result<IsoCountry>` containing the matched entry or a NotFound/Validation error.
methodTryGetByAlpha2
public static bool TryGetByAlpha2(string? alpha2, out IsoCountry? country)
Attempts to find an `IsoCountry` by its ISO 3166-1 alpha-2 code.
- alpha2: string?
- country: out IsoCountry?
methodTryGetByAlpha3
public static bool TryGetByAlpha3(string? alpha3, out IsoCountry? country)
Attempts to find an `IsoCountry` by its ISO 3166-1 alpha-3 code.
- alpha3: string?
- country: out IsoCountry?
methodTryGetByDgiiCode
public static bool TryGetByDgiiCode(string? dgiiCode, out IsoCountry? country)
Attempts to find an `IsoCountry` by its three-digit DGII Formato 609 / ISO numeric code.
- dgiiCode: string?
- country: out IsoCountry?
methodTryGetByName
public static bool TryGetByName(string? name, out IsoCountry? country)
Attempts to find an `IsoCountry` by its English or Spanish name.
- name: string?
- country: out IsoCountry?
propertyAll
public static IReadOnlyList<IsoCountry> All { get; }
Gets the immutable catalog of standard ISO 3166-1 countries with DGII Formato 609 codes.
propertyAlpha2
public string Alpha2 { get; }
Gets the two-letter ISO 3166-1 alpha-2 code (e.g., `"DO"`).
propertyAlpha3
public string Alpha3 { get; }
Gets the three-letter ISO 3166-1 alpha-3 code (e.g., `"DOM"`).
propertyCallingCode
public string CallingCode { get; }
Gets the ITU-T E.164 international dialing code (e.g., `"+1-809"`, `"+1"`, `"+34"`).
propertyCode
public CountryCode Code { get; }
Gets the strongly-typed `CountryCode` (`Alpha2`).
propertyCurrencyCode
public string CurrencyCode { get; }
Gets the primary ISO 4217 three-letter currency code (e.g., `"DOP"`, `"USD"`).
propertyDgiiCode
public string DgiiCode { get; }
Gets the three-digit DGII Formato 609 country code used in Dominican Republic tax filings (e.g., `"214"`).
propertyDominicanRepublic
public static IsoCountry DominicanRepublic { get; }
Gets the Dominican Republic (`DO` / `DOM` / DGII `214`) catalog entry.
propertyEnglishName
public string EnglishName { get; }
Gets the official English country name.
propertyNumericCode
public string NumericCode { get; }
Gets the three-digit ISO 3166-1 numeric code (e.g., `"214"`).
propertyPuertoRico
public static IsoCountry PuertoRico { get; }
Gets the Puerto Rico (`PR` / `PRI` / DGII `630`) catalog entry.
propertySpain
public static IsoCountry Spain { get; }
Gets the Spain (`ES` / `ESP` / DGII `724`) catalog entry.
propertySpanishName
public string SpanishName { get; }
Gets the official Spanish country name.
propertyUnitedStates
public static IsoCountry UnitedStates { get; }
Gets the United States (`US` / `USA` / DGII `840`) catalog entry.
record
LanguageCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record LanguageCode : StringValueObject<LanguageCode>
Hereda de: StringValueObject<LanguageCode>
Represents an ISO 639-1 or ISO 639-2 language code.
Miembros (1)
methodCreate
public static Result<LanguageCode> Create(string? value)
Creates a validated `LanguageCode` instance after normalizing to lowercase.
- value: string?
- The ISO 639 language code string.
Retorna: A successful `Result<T>` containing the validated language code, or a validation failure.
record
LastName
Ensamblado: EricksonLopez.ValueObjectspublic sealed record LastName : StringValueObject<LastName>
Hereda de: StringValueObject<LastName>
Represents an individual's last name or surname.
Miembros (1)
methodCreate
public static Result<LastName> Create(string? value)
Creates a validated `LastName` instance after normalizing whitespace and unicode characters.
- value: string?
- The raw last name string.
Retorna: A successful `Result<T>` containing the validated last name, or a validation failure.
record
LicenseKey
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record LicenseKey : StringValueObject<LicenseKey>
Hereda de: StringValueObject<LicenseKey>
Represents a software license key. Format: grouped uppercase alphanumeric segments separated by hyphens (e.g., `AAAA-BBBB-CCCC`). Rules: 2–9 groups, each 4–8 uppercase alphanumeric characters, separated by hyphens. Used by: SaaS BC — licensing only. Not a shared kernel VO. Security note: Use `Masked` when logging or displaying license keys to avoid exposing the full key in logs or UIs.
Miembros (2)
methodCreate
public static Result<LicenseKey> Create(string? value)
Creates a new `LicenseKey` instance after validating format and normalizing to uppercase.
- value: string?
- The raw license key string.
Retorna: A `Result<LicenseKey>` containing the created instance or a validation error.
methodMasked
public string Masked()
Returns a masked version of the license key showing only the last segment group.
Retorna: The masked license key string.
record
LocaleCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record LocaleCode : StringValueObject<LocaleCode>
Hereda de: StringValueObject<LocaleCode>
Represents a locale or culture code identifier.
Miembros (1)
methodCreate
public static Result<LocaleCode> Create(string? value)
Creates a validated `LocaleCode` instance after normalizing language and region casing.
- value: string?
- The locale identifier string.
Retorna: A successful `Result<T>` containing the validated locale code, or a validation failure.
record
MassWeight
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct MassWeight : IValueObject<MassWeight>, IComparable<MassWeight>, IComparable, IParsable<MassWeight>, ISpanParsable<MassWeight>
Implementa: IComparable, IComparable<MassWeight>, IParsable<MassWeight>, ISpanParsable<MassWeight>, IValueObject<MassWeight>
Represents a validated non-negative physical mass/weight with lossless SI and imperial unit conversions.
Miembros (28)
methodAdd
public Result<MassWeight> Add(MassWeight other)
Adds another `MassWeight` and returns the result in this instance's `Unit`.
- other: MassWeight
methodCompareTo
public int CompareTo(MassWeight other)
Inherits documentation from base type or interface.
- other: MassWeight
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodConvertTo
public MassWeight ConvertTo(WeightUnit targetUnit)
Converts this weight into `targetUnit`.
- targetUnit: WeightUnit
methodCreate
public static Result<MassWeight> Create(decimal value, WeightUnit unit = WeightUnit.Kilogram)
Creates a validated `MassWeight` instance.
- value: decimal
- Non-negative weight magnitude.
- unit: WeightUnit
- Unit of weight (defaults to `WeightUnit.Kilogram`).
Retorna: A `Result<MassWeight>` containing the validated weight or a validation failure.
methodFromGrams
public static Result<MassWeight> FromGrams(decimal grams)
Creates a validated `MassWeight` in grams.
- grams: decimal
methodFromKilograms
public static Result<MassWeight> FromKilograms(decimal kilograms)
Creates a validated `MassWeight` in kilograms.
- kilograms: decimal
methodFromOunces
public static Result<MassWeight> FromOunces(decimal ounces)
Creates a validated `MassWeight` in ounces.
- ounces: decimal
methodFromPounds
public static Result<MassWeight> FromPounds(decimal pounds)
Creates a validated `MassWeight` in pounds.
- pounds: decimal
methodParse
public static MassWeight Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a character span into a `MassWeight`.
- s: ReadOnlySpan<char>
- provider: IFormatProvider?
methodParse
public static MassWeight Parse(string s, IFormatProvider? provider = null)
Parses a string (e.g., `"12.5 kg"`, `"10 lb"`, `"500 g"`) into a `MassWeight`.
- s: string
- provider: IFormatProvider?
methodSubtract
public Result<MassWeight> Subtract(MassWeight other)
Subtracts another `MassWeight` and returns the result in this instance's `Unit`.
- other: MassWeight
methodToGrams
public decimal ToGrams()
Converts this weight to grams (`g`).
methodToKilograms
public decimal ToKilograms()
Converts this weight to kilograms (`kg`).
methodToOunces
public decimal ToOunces()
Converts this weight to ounces (`oz`).
methodToPounds
public decimal ToPounds()
Converts this weight to pounds (`lb`).
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out MassWeight result)
Attempts to parse a character span into a `MassWeight`.
- s: ReadOnlySpan<char>
- provider: IFormatProvider?
- result: out MassWeight
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out MassWeight result)
Attempts to parse a string into a `MassWeight`.
- s: string?
- provider: IFormatProvider?
- result: out MassWeight
methodoperator <
public static bool operator <(MassWeight left, MassWeight right)
Determines whether `left` is lighter than `right`.
- left: MassWeight
- right: MassWeight
methodoperator <=
public static bool operator <=(MassWeight left, MassWeight right)
Determines whether `left` is lighter than or equal to `right`.
- left: MassWeight
- right: MassWeight
methodoperator >
public static bool operator >(MassWeight left, MassWeight right)
Determines whether `left` is heavier than `right`.
- left: MassWeight
- right: MassWeight
methodoperator >=
public static bool operator >=(MassWeight left, MassWeight right)
Determines whether `left` is heavier than or equal to `right`.
- left: MassWeight
- right: MassWeight
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this instance is uninitialized (`default(MassWeight)`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this instance was initialized through a factory.
propertyUnit
public WeightUnit Unit { get; }
Gets the measurement unit.
propertyValue
public decimal Value { get; }
Gets the numeric magnitude in `Unit`.
propertyZero
public static MassWeight Zero { get; }
Gets a zero-kilogram weight instance.
record
MessageBody
Ensamblado: EricksonLopez.ValueObjectspublic sealed record MessageBody : StringValueObject<MessageBody>
Hereda de: StringValueObject<MessageBody>
Represents a rich or multiline message body for emails, CRM communications, and notifications. Rules: Required, 1–20,000 characters. Allows standard multiline whitespace (newlines, tabs) while rejecting non-printable control characters. Used by: CRM, Email Communications, Customer Service, Notifications.
Miembros (1)
methodCreate
public static Result<MessageBody> Create(string? value)
Creates a new `MessageBody` instance after trimming and validating.
- value: string?
- The raw message body text.
Retorna: A `Result<MessageBody>` containing the created instance or a validation error.
record
MiddleName
Ensamblado: EricksonLopez.ValueObjectspublic sealed record MiddleName : StringValueObject<MiddleName>
Hereda de: StringValueObject<MiddleName>
Represents an individual's middle name.
Miembros (2)
methodCreate
public static Result<MiddleName> Create(string? value)
Creates a validated `MiddleName` instance after normalizing whitespace and unicode characters.
- value: string?
- The raw middle name string.
Retorna: A successful `Result<T>` containing the validated middle name, or a validation failure.
methodCreateOptional
public static Result<MiddleName?> CreateOptional(string? value)
Creates an optional `MiddleName` instance, returning `null` if empty or whitespace.
- value: string?
- The optional raw middle name string.
Retorna: A successful `Result<T>` containing the optional middle name, or a validation failure if invalid.
record
ModifiedBy
Ensamblado: EricksonLopez.ValueObjectspublic sealed record ModifiedBy : StringValueObject<ModifiedBy>
Hereda de: StringValueObject<ModifiedBy>
Represents the identity of the actor who last modified an entity or record. Normalized to uppercase. Rules: Required, 1–120 characters, uppercase alphanumeric or human/system identifier characters. Stored uppercase. Used by: All bounded contexts (Audit trail, Multi-tenant compliance).
Miembros (1)
methodCreate
public static Result<ModifiedBy> Create(string? value)
Creates a new `ModifiedBy` instance after validating and normalizing the actor identifier.
- value: string?
- The raw actor identifier string.
Retorna: A `Result<ModifiedBy>` containing the created instance or a validation error.
record
Money
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct Money : IValueObject<Money>, IComparable<Money>, IComparable, IFormattable, ISpanFormattable, IParsable<Money>, ISpanParsable<Money>
Implementa: IComparable, IComparable<Money>, IFormattable, IParsable<Money>, ISpanFormattable, ISpanParsable<Money>, IValueObject<Money>
Represents a monetary amount denominated in a specific ISO 4217 currency.
Miembros (55)
methodAbs
public Money Abs()
Returns the absolute value of this monetary amount.
Retorna: A new `Money` instance with a non-negative amount.
methodAdd
public Result<Money> Add(Money other)
Adds another monetary amount to this instance, ensuring both amounts share the same currency.
- other: Money
- The monetary amount to add.
Retorna: A successful `Result<T>` containing the sum, or a currency mismatch error.
methodAllocate
public Money[] Allocate(params ReadOnlySpan<int> ratios)
Allocates the monetary amount proportionally across the specified integer ratios without fractional currency loss.
- ratios: params ReadOnlySpan<int>
- The positive integer ratios used to divide the amount.
Retorna: An array of `Money` instances representing each allocated portion, one per ratio. Returns an empty array if `ratios` is empty.
methodApplyDiscount
public Money ApplyDiscount(decimal percentage)
Applies a percentage discount to this monetary amount using commercial rounding (away from zero).
- percentage: decimal
- The discount percentage (e.g. 10 for 10%).
Retorna: A new `Money` instance representing the discounted amount.
methodApplyPercentage
public Money ApplyPercentage(Percentage percentage)
Applies a percentage to this monetary amount using banker's rounding.
- percentage: Percentage
- The percentage to apply.
Retorna: The calculated monetary share.
methodCalculateTax
public Money CalculateTax(decimal taxRate)
Calculates the tax amount based on the specified tax rate using commercial rounding (away from zero).
- taxRate: decimal
- The tax rate percentage (e.g. 18 for 18% ITBIS).
Retorna: A new `Money` instance representing the tax amount.
methodCompareTo
public int CompareTo(Money other)
Compares this monetary amount to another amount denominated in the same currency.
- other: Money
- The monetary amount to compare against.
Retorna: A value indicating the relative order of the amounts being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<Money> Create(decimal amount, CurrencyCode currency, int? decimals = null)
Creates a `Money` instance rounded to the specified decimal places using banker's rounding.
- amount: decimal
- The numeric monetary amount.
- currency: CurrencyCode
- The currency code value object.
- decimals: int?
- The optional number of decimal places to round to. If omitted, uses the currency's standard decimal places.
Retorna: A successful `Result<T>` containing the created monetary value, or a validation failure.
methodCreate
public static Result<Money> Create(decimal amount, string currency, int? decimals = null)
Creates a `Money` instance using a string currency code.
- amount: decimal
- The numeric monetary amount.
- currency: string
- The ISO 4217 three-letter currency string.
- decimals: int?
- The optional number of decimal places to round to.
Retorna: A successful `Result<T>` containing the created monetary value, or a validation failure.
methodCreateNonNegative
public static Result<Money> CreateNonNegative(decimal amount, CurrencyCode currency)
Creates a `Money` instance that requires a non-negative amount (greater than or equal to zero).
- amount: decimal
- The non-negative numeric amount.
- currency: CurrencyCode
- The currency code value object.
Retorna: A successful `Result<T>` containing the created monetary value, or a validation failure.
methodDOP
public static Money DOP(decimal amount)
Creates a `Money` instance denominated in Dominican Pesos (DOP).
- amount: decimal
- The numeric monetary amount.
Retorna: A `Money` instance in DOP.
methodDistribute
public Money[] Distribute(int parts)
Splits the monetary amount into equal parts, distributing any remainder pennies across initial parts.
- parts: int
- The positive number of parts to divide into.
Retorna: An array of `Money` instances representing the divided parts.
methodDivide
public Result<Money> Divide(decimal divisor)
Divides the monetary amount by a scalar divisor using monadic error handling.
- divisor: decimal
- The divisor to divide by.
Retorna: A successful `Result<Money>` containing the quotient, or a validation/division-by-zero error.
methodEUR
public static Money EUR(decimal amount)
Creates a `Money` instance denominated in Euros (EUR).
- amount: decimal
- The numeric monetary amount.
Retorna: A `Money` instance in EUR.
methodIsGreaterThan
public bool IsGreaterThan(Money other)
Determines whether this amount is strictly greater than another amount in the same currency.
- other: Money
- The monetary amount to compare with.
Retorna: `true` if this amount is greater; otherwise, `false`.
methodIsGreaterThanOrEqual
public bool IsGreaterThanOrEqual(Money other)
Determines whether this amount is greater than or equal to another amount in the same currency.
- other: Money
- The monetary amount to compare with.
Retorna: `true` if this amount is greater than or equal; otherwise, `false`.
methodIsLessThan
public bool IsLessThan(Money other)
Determines whether this amount is strictly less than another amount in the same currency.
- other: Money
- The monetary amount to compare with.
Retorna: `true` if this amount is less; otherwise, `false`.
methodIsLessThanOrEqual
public bool IsLessThanOrEqual(Money other)
Determines whether this amount is less than or equal to another amount in the same currency.
- other: Money
- The monetary amount to compare with.
Retorna: `true` if this amount is less than or equal; otherwise, `false`.
methodMultiply
public Money Multiply(decimal factor)
Multiplies the monetary amount by a scalar factor using banker's rounding.
- factor: decimal
- The multiplier factor.
Retorna: The product rounded to the currency's standard decimal places.
methodNegate
public Money Negate()
Returns the negated monetary amount.
Retorna: A new `Money` instance with the negated amount.
methodParse
public static Money Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Inherits documentation from base type or interface.
- s: ReadOnlySpan<char>
- provider: IFormatProvider?
methodParse
public static Money Parse(string s, IFormatProvider? provider = null)
Inherits documentation from base type or interface.
- s: string
- provider: IFormatProvider?
methodRound
public Money Round(int? decimals = null)
Rounds the monetary amount to the specified number of decimal places using banker's rounding (to nearest even).
- decimals: int?
- The optional decimal places to round to. If omitted, uses the currency's standard decimal places.
Retorna: A new `Money` instance with the rounded amount.
methodRoundCommercial
public Money RoundCommercial(int? decimals = null)
Rounds the monetary amount to the specified number of decimal places using commercial rounding (away from zero).
- decimals: int?
- The optional decimal places to round to. If omitted, uses the currency's standard decimal places.
Retorna: A new `Money` instance with the rounded amount.
methodRoundDop
public Money RoundDop()
Rounds Dominican Peso (DOP) amounts to 2 decimal places using `MidpointRounding.AwayFromZero` per Dominican fiscal regulations (DGII), returning non-DOP amounts unchanged.
Retorna: A new `Money` instance rounded to 2 decimal places when denominated in DOP; otherwise, this instance.
methodSubtract
public Result<Money> Subtract(Money other)
Subtracts another monetary amount from this instance, ensuring both amounts share the same currency.
- other: Money
- The monetary amount to subtract.
Retorna: A successful `Result<T>` containing the difference, or a currency mismatch error.
methodToFormattedString
public string ToFormattedString()
Formats the monetary amount using cultural currency symbols (RD$ for DOP, US$ for USD, € for EUR).
Retorna: A formatted currency string.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodToString
public string ToString(string? format, IFormatProvider? formatProvider)
Inherits documentation from `IFormattable.ToString(string?, IFormatProvider?)`.
- format: string?
- formatProvider: IFormatProvider?
methodTryApplyPercentage
public Result<Money> TryApplyPercentage(Percentage percentage)
Attempts to apply a percentage to this monetary amount using banker's rounding without throwing exceptions.
- percentage: Percentage
- The percentage to apply.
Retorna: A successful `Result<T>` containing the calculated share, or a validation error.
methodTryFormat
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Inherits documentation from base type or interface.
- destination: Span<char>
- charsWritten: out int
- format: ReadOnlySpan<char>
- provider: IFormatProvider?
methodTryMultiply
public Result<Money> TryMultiply(decimal factor)
Attempts to multiply the monetary amount by a scalar factor using banker's rounding without throwing exceptions.
- factor: decimal
- The multiplier factor.
Retorna: A successful `Result<T>` containing the product, or a validation error if out of range or uninitialized.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Money result)
Inherits documentation from base type or interface.
- s: ReadOnlySpan<char>
- provider: IFormatProvider?
- result: out Money
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out Money result)
Inherits documentation from base type or interface.
- s: string?
- provider: IFormatProvider?
- result: out Money
methodUSD
public static Money USD(decimal amount)
Creates a `Money` instance denominated in US Dollars (USD).
- amount: decimal
- The numeric monetary amount.
Retorna: A `Money` instance in USD.
methodWithTax
public Money WithTax(decimal taxRate)
Returns a new monetary amount with the calculated tax added using commercial rounding.
- taxRate: decimal
- The tax rate percentage (e.g. 18 for 18% ITBIS).
Retorna: A new `Money` instance representing the total amount including tax.
methodZero
public static Money Zero(CurrencyCode currency)
Creates a zero-value `Money` instance in the specified currency.
- currency: CurrencyCode
- The target currency code.
Retorna: A zero-value monetary amount in the specified currency.
methodoperator *
public static Money operator *(Money a, decimal b)
Multiplies a monetary amount by a decimal scalar factor.
- a: Money
- The monetary amount.
- b: decimal
- The scalar multiplier.
Retorna: The product rounded to the currency's standard decimal places.
methodoperator *
public static Money operator *(decimal a, Money b)
Multiplies a decimal scalar factor by a monetary amount.
- a: decimal
- The scalar multiplier.
- b: Money
- The monetary amount.
Retorna: The product rounded to the currency's standard decimal places.
methodoperator +
public static Money operator +(Money a, Money b)
Adds two monetary amounts having the same currency.
- a: Money
- The first monetary amount.
- b: Money
- The second monetary amount.
Retorna: The resulting sum.
methodoperator -
public static Money operator -(Money a)
Negates the specified monetary amount.
- a: Money
- The monetary amount to negate.
Retorna: The negated monetary amount.
methodoperator -
public static Money operator -(Money a, Money b)
Subtracts the second monetary amount from the first when both have the same currency.
- a: Money
- The first monetary amount.
- b: Money
- The second monetary amount to subtract.
Retorna: The resulting difference.
methodoperator <
public static bool operator <(Money a, Money b)
Determines whether the left monetary amount is less than the right monetary amount.
- a: Money
- The first monetary amount to compare.
- b: Money
- The second monetary amount to compare.
Retorna: `true` if `a` is less than `b`; otherwise, `false`.
methodoperator <=
public static bool operator <=(Money a, Money b)
Determines whether the left monetary amount is less than or equal to the right monetary amount.
- a: Money
- The first monetary amount to compare.
- b: Money
- The second monetary amount to compare.
Retorna: `true` if `a` is less than or equal to `b`; otherwise, `false`.
methodoperator >
public static bool operator >(Money a, Money b)
Determines whether the left monetary amount is greater than the right monetary amount.
- a: Money
- The first monetary amount to compare.
- b: Money
- The second monetary amount to compare.
Retorna: `true` if `a` is greater than `b`; otherwise, `false`.
methodoperator >=
public static bool operator >=(Money a, Money b)
Determines whether the left monetary amount is greater than or equal to the right monetary amount.
- a: Money
- The first monetary amount to compare.
- b: Money
- The second monetary amount to compare.
Retorna: `true` if `a` is greater than or equal to `b`; otherwise, `false`.
propertyAmount
public decimal Amount { get; }
Gets the numerical monetary amount.
propertyCurrency
public CurrencyCode Currency { get; }
Gets the ISO 4217 currency code.
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this `Money` instance is uninitialized (`default(Money)`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `Money` instance was initialized through a factory or constructor rather than `default(Money)`.
propertyIsNegative
public bool IsNegative { get; }
Gets a value indicating whether the monetary amount is strictly negative.
propertyIsPositive
public bool IsPositive { get; }
Gets a value indicating whether the monetary amount is strictly positive.
propertyIsZero
public bool IsZero { get; }
Gets a value indicating whether the monetary amount is zero.
fieldZeroUsd
public static readonly Money ZeroUsd
Gets a zero-value `Money` instance denominated in US Dollars (USD).
record
Name
Ensamblado: EricksonLopez.ValueObjectspublic sealed record Name : StringValueObject<Name>
Hereda de: StringValueObject<Name>
Represents a generic business or entity name identifier.
Miembros (1)
methodCreate
public static Result<Name> Create(string? value)
Creates a validated `Name` instance after normalizing business whitespace.
- value: string?
- The raw name string.
Retorna: A successful `Result<T>` containing the validated name, or a validation failure.
record
NationalId
Ensamblado: EricksonLopez.ValueObjectspublic sealed record NationalId : StringValueObject<NationalId>
Hereda de: StringValueObject<NationalId>
Represents a generic national identity document number for any country. Case is normalized to uppercase; format varies by country. For Dominican Cedula (11 digits) or RNC (9 digits), use `Rnc` from `EricksonLopez.ValueObjects.Fiscal.DominicanRepublic`. Rules: Required, 1–30 chars, alphanumeric with hyphens, uppercase. Used by: ERP, Payroll, CRM, HR, Property Management, KYC PII Protection: `ToString()` returns the mask string configured in `SensitiveDataAttribute` to prevent leakage in logs and traces. Access the raw value explicitly via the `Value` property.
Miembros (1)
methodCreate
public static Result<NationalId> Create(string? value)
Creates a new `NationalId` instance after validating and normalizing to uppercase.
- value: string?
- The raw national identity document number.
Retorna: A `Result<NationalId>` containing the created instance or a validation error.
record
Note
Ensamblado: EricksonLopez.ValueObjectspublic sealed record Note : StringValueObject<Note>
Hereda de: StringValueObject<Note>
Represents an internal administrative note, audit comment, or operational remark. Rules: Required, 1–5,000 characters. Allows standard multiline whitespace (newlines, tabs) while rejecting non-printable control characters. Used by: ERP, Audit, Customer Support, Project Tasks, Collections.
Miembros (1)
methodCreate
public static Result<Note> Create(string? value)
Creates a new `Note` instance after trimming and validating.
- value: string?
- The raw note text.
Retorna: A `Result` containing the created instance or a validation error.
record
OrderNumber
Ensamblado: EricksonLopez.ValueObjectspublic sealed record OrderNumber : StringValueObject<OrderNumber>
Hereda de: StringValueObject<OrderNumber>
Represents a commercial order identifier (sales order, purchase order, service order). Normalized to uppercase. Rules: Required, 1–60 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: ERP, POS, E-commerce, Procurement, Electronic Invoicing.
Miembros (1)
methodCreate
public static Result<OrderNumber> Create(string? value)
Creates a new `OrderNumber` instance after validating and normalizing to uppercase.
- value: string?
- The raw order number string.
Retorna: A `Result<OrderNumber>` containing the created instance or a validation error.
record
PassportNumber
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record PassportNumber : StringValueObject<PassportNumber>
Hereda de: StringValueObject<PassportNumber>
Represents an international passport identifier. Normalized to uppercase. Rules: Required, 5–20 uppercase alphanumeric characters. Used by: Human Resources, KYC, Travel, CRM, Immigration, Global Identity.
Miembros (1)
methodCreate
public static Result<PassportNumber> Create(string? value)
Creates a new `PassportNumber` instance after validating and normalizing to uppercase.
- value: string?
- The raw passport number string.
Retorna: A `Result<PassportNumber>` containing the created instance or a validation error.
record
PasswordHash
Ensamblado: EricksonLopez.ValueObjectspublic sealed record PasswordHash : StringValueObject<PasswordHash>
Hereda de: StringValueObject<PasswordHash>
Represents a cryptographically hashed password (argon2, bcrypt, scrypt, pbkdf2, etc.). Guarantees that raw plaintext passwords are never stored or logged in domain aggregates. Masked by default via `SensitiveDataAttribute` and `object.ToString()`.
Miembros (1)
methodCreate
public static Result<PasswordHash> Create(string? value)
Creates a new `PasswordHash` instance after validating format and length.
- value: string?
- The raw password hash string.
Retorna: A `Result<PasswordHash>` containing the created instance or a validation error.
record
Percentage
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct Percentage : IValueObject<Percentage>, IComparable<Percentage>, IComparable, IParsable<Percentage>, ISpanParsable<Percentage>, IFormattable, ISpanFormattable
Implementa: IComparable, IComparable<Percentage>, IFormattable, IParsable<Percentage>, ISpanFormattable, ISpanParsable<Percentage>, IValueObject<Percentage>
Represents a bounded percentage value between 0 and 100 inclusive.
Miembros (25)
methodApplyTo
public decimal ApplyTo(decimal baseAmount)
Calculates the percentage share of a specified base amount.
- baseAmount: decimal
- The base amount to apply the percentage to.
Retorna: The calculated portion rounded to 6 decimal places.
methodCompareTo
public int CompareTo(Percentage other)
Compares this percentage with another percentage.
- other: Percentage
- The other percentage to compare against.
Retorna: A value indicating the relative order of the percentages being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<Percentage> Create(decimal value)
Creates a validated `Percentage` instance from a numeric value in the range [0, 100].
- value: decimal
- The percentage amount between 0 and 100.
Retorna: A successful `Result<T>` containing the validated percentage, or a validation failure.
methodFromFraction
public static Result<Percentage> FromFraction(decimal fraction)
Creates a validated `Percentage` instance from a fractional value in the range [0.0, 1.0].
- fraction: decimal
- The fraction multiplier between 0.0 and 1.0.
Retorna: A successful `Result<T>` containing the validated percentage, or a validation failure.
methodParse
public static Percentage Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `Percentage`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `Percentage`.
methodParse
public static Percentage Parse(string s, IFormatProvider? provider = null)
Parses a string into a `Percentage`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `Percentage`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodToString
public string ToString(string? format, IFormatProvider? formatProvider)
Inherits documentation from `IFormattable.ToString(string?, IFormatProvider?)`.
- format: string?
- formatProvider: IFormatProvider?
methodTryFormat
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Inherits documentation from base type or interface.
- destination: Span<char>
- charsWritten: out int
- format: ReadOnlySpan<char>
- provider: IFormatProvider?
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Percentage result)
Attempts to parse a span of characters into a `Percentage`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out Percentage
- When this method returns, contains the parsed percentage if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out Percentage result)
Attempts to parse a string into a `Percentage`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out Percentage
- When this method returns, contains the parsed percentage if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodValidatePercentage
public static global::EricksonLopez.Result.Result ValidatePercentage(decimal value, string fieldName)
Validates that a decimal percentage value falls between 0 and 100 with at most 6 decimal places.
- value: decimal
- The numeric percentage value to validate.
- fieldName: string
- The name of the field used for error reporting.
Retorna: A successful `Result.Result` if valid; otherwise, a validation failure.
methodoperator <
public static bool operator <(Percentage left, Percentage right)
Determines whether the left percentage is less than the right percentage.
- left: Percentage
- The first percentage to compare.
- right: Percentage
- The second percentage to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(Percentage left, Percentage right)
Determines whether the left percentage is less than or equal to the right percentage.
- left: Percentage
- The first percentage to compare.
- right: Percentage
- The second percentage to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(Percentage left, Percentage right)
Determines whether the left percentage is greater than the right percentage.
- left: Percentage
- The first percentage to compare.
- right: Percentage
- The second percentage to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(Percentage left, Percentage right)
Determines whether the left percentage is greater than or equal to the right percentage.
- left: Percentage
- The first percentage to compare.
- right: Percentage
- The second percentage to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyAsFraction
public decimal AsFraction { get; }
Gets the fractional representation of the percentage.
propertyFraction
public decimal Fraction { get; }
Gets the fractional representation of the percentage (value divided by 100).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `Percentage` instance was initialized through a factory rather than `default(Percentage)`.
propertyIsZero
public bool IsZero { get; }
Gets a value indicating whether the percentage is zero.
propertyValue
public decimal Value { get; }
Gets the numerical percentage value between 0 and 100.
fieldFull
public static readonly Percentage Full
Gets a percentage instance representing 100%.
fieldHundred
public static readonly Percentage Hundred
Gets a percentage instance representing 100%.
fieldZero
public static readonly Percentage Zero
Gets a percentage instance representing 0%.
record
PhoneNumber
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct PhoneNumber : IValueObject<PhoneNumber>, IComparable<PhoneNumber>, IComparable, IParsable<PhoneNumber>, ISpanParsable<PhoneNumber>
Implementa: IComparable, IComparable<PhoneNumber>, IParsable<PhoneNumber>, ISpanParsable<PhoneNumber>, IValueObject<PhoneNumber>
Represents a telephone number formatted according to the E.164 international standard.
Miembros (17)
methodCompareTo
public int CompareTo(PhoneNumber other)
Compares this phone number with another phone number using ordinal string comparison.
- other: PhoneNumber
- The other phone number to compare against.
Retorna: A value indicating the relative order of the phone numbers being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<PhoneNumber> Create(ReadOnlySpan<char> value)
Creates a validated `PhoneNumber` instance from an input telephone character span.
- value: ReadOnlySpan<char>
- The raw telephone character span.
Retorna: A successful `Result<T>` containing the validated phone number, or a validation failure.
methodCreate
public static Result<PhoneNumber> Create(string? value)
Creates a validated `PhoneNumber` instance from an input telephone string.
- value: string?
- The raw telephone string.
Retorna: A successful `Result<T>` containing the validated phone number, or a validation failure.
methodParse
public static PhoneNumber Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `PhoneNumber`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `PhoneNumber`.
methodParse
public static PhoneNumber Parse(string s, IFormatProvider? provider = null)
Parses a string into a `PhoneNumber`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `PhoneNumber`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out PhoneNumber result)
Attempts to parse a span of characters into a `PhoneNumber`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out PhoneNumber
- When this method returns, contains the parsed phone number if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out PhoneNumber result)
Attempts to parse a string into a `PhoneNumber`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out PhoneNumber
- When this method returns, contains the parsed phone number if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(PhoneNumber left, PhoneNumber right)
Determines whether the left phone number is less than the right phone number.
- left: PhoneNumber
- The first phone number to compare.
- right: PhoneNumber
- The second phone number to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(PhoneNumber left, PhoneNumber right)
Determines whether the left phone number is less than or equal to the right phone number.
- left: PhoneNumber
- The first phone number to compare.
- right: PhoneNumber
- The second phone number to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(PhoneNumber left, PhoneNumber right)
Determines whether the left phone number is greater than the right phone number.
- left: PhoneNumber
- The first phone number to compare.
- right: PhoneNumber
- The second phone number to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(PhoneNumber left, PhoneNumber right)
Determines whether the left phone number is greater than or equal to the right phone number.
- left: PhoneNumber
- The first phone number to compare.
- right: PhoneNumber
- The second phone number to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyDigitsOnly
public string DigitsOnly { get; }
Gets the numerical telephone digits excluding the leading `+` prefix.
propertyFormatted
public string Formatted { get; }
Gets a human-readable formatted representation of the phone number when applicable.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `PhoneNumber` instance was initialized through a factory rather than `default(PhoneNumber)`.
propertyValue
public string Value { get; }
Gets the international telephone number string including the leading `+` prefix.
record
PhysicalDimensions
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct PhysicalDimensions : IValueObject<PhysicalDimensions>, IEquatable<PhysicalDimensions>
Implementa: IEquatable<PhysicalDimensions>, IValueObject<PhysicalDimensions>
Represents multi-unit physical package/product dimensions (`Length × Width × Height`) with optional `MassWeight`, cubic volume conversions, and IATA courier volumetric/chargeable weight calculation.
Miembros (15)
methodCalculateChargeableWeight
public Result<MassWeight> CalculateChargeableWeight(decimal dimensionalDivisor = 5000m)
Calculates the freight chargeable weight (the greater of `GrossWeight` and volumetric weight) in kilograms.
- dimensionalDivisor: decimal
- Courier dimensional divisor in `cm³/kg` (defaults to `5000`).
Retorna: A `Result<MassWeight>` containing the chargeable weight in kilograms.
methodCalculateVolumetricWeight
public Result<MassWeight> CalculateVolumetricWeight(decimal dimensionalDivisor = 5000m)
Calculates IATA / courier volumetric weight (`VolumeCm3 / dimensionalDivisor`) as a `MassWeight` in kilograms.
- dimensionalDivisor: decimal
- Courier dimensional divisor in `cm³/kg` (defaults to `5000`).
Retorna: A `Result<MassWeight>` containing the volumetric weight in kilograms.
methodConvertTo
public PhysicalDimensions ConvertTo(DimensionUnit targetUnit)
Converts linear dimensions to `targetUnit` while preserving `GrossWeight`.
- targetUnit: DimensionUnit
methodCreate
public static Result<PhysicalDimensions> Create(decimal length, decimal width, decimal height, DimensionUnit unit = DimensionUnit.Centimeter, MassWeight? grossWeight = null)
Creates a validated `PhysicalDimensions` instance.
- length: decimal
- Non-negative length.
- width: decimal
- Non-negative width.
- height: decimal
- Non-negative height.
- unit: DimensionUnit
- Linear dimension unit (defaults to `DimensionUnit.Centimeter`).
- grossWeight: MassWeight?
- Optional validated `MassWeight`.
Retorna: A `Result<PhysicalDimensions>` containing the validated dimensions or a validation error.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
propertyGrossWeight
public MassWeight? GrossWeight { get; }
Gets the optional gross physical weight.
propertyHeight
public decimal Height { get; }
Gets the height in `Unit`.
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this struct is uninitialized (`default(PhysicalDimensions)`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this struct was initialized through `Create`.
propertyLength
public decimal Length { get; }
Gets the length in `Unit`.
propertyUnit
public DimensionUnit Unit { get; }
Gets the linear measurement unit.
propertyVolume
public decimal Volume { get; }
Gets the cubic volume in `Unit³`.
propertyVolumeCm3
public decimal VolumeCm3 { get; }
Gets the cubic volume normalized to cubic centimeters (`cm³`).
propertyVolumeM3
public decimal VolumeM3 { get; }
Gets the cubic volume normalized to cubic meters (`m³`).
propertyWidth
public decimal Width { get; }
Gets the width in `Unit`.
record
PositionTitle
Ensamblado: EricksonLopez.ValueObjectspublic sealed record PositionTitle : StringValueObject<PositionTitle>
Hereda de: StringValueObject<PositionTitle>
Represents a job title, job role, or organizational position. Normalized by collapsing excessive whitespace. Rules: Required, 2–120 characters, human and business title characters. Used by: Human Resources, Payroll, Organization Chart, ERP, CRM.
Miembros (1)
methodCreate
public static Result<PositionTitle> Create(string? value)
Creates a new `PositionTitle` instance after validating and collapsing whitespace.
- value: string?
- The raw position or job title string.
Retorna: A `Result<PositionTitle>` containing the created instance or a validation error.
record
PostalCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record PostalCode : StringValueObject<PostalCode>
Hereda de: StringValueObject<PostalCode>
Represents an international postal or ZIP code.
Miembros (1)
methodCreate
public static Result<PostalCode> Create(string? value)
Creates a validated `PostalCode` instance after normalizing to uppercase.
- value: string?
- The raw postal code string.
Retorna: A successful `Result<T>` containing the validated postal code, or a validation failure.
record
ProductDimensions
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct ProductDimensions : IValueObject<ProductDimensions>, IEquatable<ProductDimensions>
Implementa: IEquatable<ProductDimensions>, IValueObject<ProductDimensions>
Represents physical product dimensions (length, width, height in centimeters and gross weight in kilograms) for warehouse bin capacity checks, courier shipping quotes, and volumetric landed-cost proration.
Miembros (12)
methodCalculateVolumetricWeightKg
public Result<decimal> CalculateVolumetricWeightKg(decimal dimensionalDivisor = 5000m)
Calculates IATA / courier volumetric weight in kilograms (`VolumeCm3 / dimensionalDivisor`).
- dimensionalDivisor: decimal
- The courier dimensional divisor (defaults to `5000` cm³/kg).
Retorna: A `Result<Decimal>` containing the volumetric weight in kilograms.
methodCreate
public static Result<ProductDimensions> Create(decimal lengthCm, decimal widthCm, decimal heightCm, decimal grossWeightKg)
Creates a validated `ProductDimensions` instance ensuring non-negative physical measurements.
- lengthCm: decimal
- Length in centimeters (>= 0).
- widthCm: decimal
- Width in centimeters (>= 0).
- heightCm: decimal
- Height in centimeters (>= 0).
- grossWeightKg: decimal
- Gross weight in kilograms (>= 0).
Retorna: A `Result<ProductDimensions>` containing the validated struct or an error.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
propertyGrossWeightKg
public decimal GrossWeightKg { get; }
Gets the gross weight in kilograms.
propertyGrossWeightLbs
public decimal GrossWeightLbs { get; }
Gets the gross weight converted to pounds (`lb`).
propertyHeightCm
public decimal HeightCm { get; }
Gets the height in centimeters.
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this struct is uninitialized (`default(ProductDimensions)`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this struct was initialized through `Create`.
propertyLengthCm
public decimal LengthCm { get; }
Gets the length in centimeters.
propertyVolumeCm3
public decimal VolumeCm3 { get; }
Gets the computed cubic volume in cubic centimeters (`cm³`).
propertyVolumeM3
public decimal VolumeM3 { get; }
Gets the computed cubic volume in cubic meters (`m³`).
propertyWidthCm
public decimal WidthCm { get; }
Gets the width in centimeters.
record
Quantity
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct Quantity : IValueObject<Quantity>, IComparable<Quantity>, IComparable, IParsable<Quantity>, ISpanParsable<Quantity>, IFormattable, ISpanFormattable
Implementa: IComparable, IComparable<Quantity>, IFormattable, IParsable<Quantity>, ISpanFormattable, ISpanParsable<Quantity>, IValueObject<Quantity>
Represents a discrete, non-negative integer quantity.
Miembros (20)
methodAdd
public Result<Quantity> Add(Quantity other)
Adds another quantity to this instance.
- other: Quantity
- The quantity to add.
Retorna: A successful `Result<T>` containing the resulting sum.
methodCompareTo
public int CompareTo(Quantity other)
Compares this quantity with another quantity.
- other: Quantity
- The other quantity to compare against.
Retorna: A value indicating the relative order of the quantities being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCreate
public static Result<Quantity> Create(int value)
Creates a validated `Quantity` instance from a non-negative integer value.
- value: int
- The discrete quantity value (greater than or equal to zero).
Retorna: A successful `Result<T>` containing the validated quantity, or a validation failure.
methodParse
public static Quantity Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `Quantity`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `Quantity`.
methodParse
public static Quantity Parse(string s, IFormatProvider? provider = null)
Parses a string into a `Quantity`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `Quantity`.
methodSubtract
public Result<Quantity> Subtract(Quantity other)
Subtracts another quantity from this instance.
- other: Quantity
- The quantity to subtract.
Retorna: A successful `Result<T>` containing the resulting quantity, or a failure if insufficient quantity.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodToString
public string ToString(string? format, IFormatProvider? formatProvider)
Inherits documentation from `IFormattable.ToString(string?, IFormatProvider?)`.
- format: string?
- formatProvider: IFormatProvider?
methodTryFormat
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Inherits documentation from base type or interface.
- destination: Span<char>
- charsWritten: out int
- format: ReadOnlySpan<char>
- provider: IFormatProvider?
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Quantity result)
Attempts to parse a span of characters into a `Quantity`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out Quantity
- When this method returns, contains the parsed quantity if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out Quantity result)
Attempts to parse a string into a `Quantity`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out Quantity
- When this method returns, contains the parsed quantity if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(Quantity left, Quantity right)
Determines whether the left quantity is less than the right quantity.
- left: Quantity
- The first quantity to compare.
- right: Quantity
- The second quantity to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(Quantity left, Quantity right)
Determines whether the left quantity is less than or equal to the right quantity.
- left: Quantity
- The first quantity to compare.
- right: Quantity
- The second quantity to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(Quantity left, Quantity right)
Determines whether the left quantity is greater than the right quantity.
- left: Quantity
- The first quantity to compare.
- right: Quantity
- The second quantity to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(Quantity left, Quantity right)
Determines whether the left quantity is greater than or equal to the right quantity.
- left: Quantity
- The first quantity to compare.
- right: Quantity
- The second quantity to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `Quantity` instance was initialized through a factory rather than `default(Quantity)`.
propertyIsZero
public bool IsZero { get; }
Gets a value indicating whether the quantity is zero.
propertyValue
public int Value { get; }
Gets the integer quantity value.
propertyZero
public static Quantity Zero { get; }
Gets a zero quantity instance.
class
RangeExtensions
Ensamblado: EricksonLopez.ValueObjectspublic static class RangeExtensions
Provides extension methods for `Range<T>` instances.
Miembros (2)
methodDays
public static int Days(this Range<DateOnly> range)
Calculates the total number of days spanned by the date range.
- range: this Range<DateOnly>
- The date range to evaluate.
Retorna: The total number of days elapsed between start and end dates.
methodDuration
public static TimeSpan Duration(this Range<DateTimeOffset> range)
Calculates the total duration spanned by the date and time range.
- range: this Range<DateTimeOffset>
- The date and time range to calculate duration for.
Retorna: The `TimeSpan` duration between start and end timestamps.
record
Range<T>
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct Range<T> : IValueObject, IComparable<Range<T>>, IComparable where T : struct, IComparable<T>, IEquatable<T>
Implementa: IComparable, IComparable<Range<T>>, IValueObject
Represents an immutable interval value object defined by inclusive start and end boundaries.
Miembros (18)
methodCompareTo
public int CompareTo(Range<T> other)
Compares this range with another range based on start boundary, followed by end boundary.
- other: Range<T>
- The other range to compare against.
Retorna: A value indicating the relative order of the ranges being compared.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodContains
public bool Contains(Range<T> other)
Determines whether another range is entirely contained within this range.
- other: Range<T>
- The other range to evaluate.
Retorna: `true` if `other` is completely contained within this range; otherwise, `false`.
methodContains
public bool Contains(T value)
Determines whether the specified value is contained within the range.
- value: T
- The value to test for containment.
Retorna: `true` if the value falls within the inclusive range boundaries; otherwise, `false`.
methodContainsHalfOpen
public bool ContainsHalfOpen(T value)
Determines whether the specified value is strictly contained within the range, excluding the upper boundary [Start, End).
- value: T
- The value to test for containment.
Retorna: `true` if `value` falls within the half-open interval [Start, End); otherwise, `false`.
methodCreate
public static Result<Range<T>> Create(T start, T end)
Creates a validated `Range<T>` instance with the specified inclusive bounds.
- start: T
- The lower boundary of the range.
- end: T
- The upper boundary of the range.
Retorna: A successful `Result<T>` containing the created range, or a validation error if `start` is greater than `end`.
methodIntersects
public bool Intersects(Range<T> other, out Range<T> intersection)
Calculates the intersection between this range and another range, if one exists.
- other: Range<T>
- The other range to intersect with.
- intersection: out Range<T>
- When this method returns, contains the overlapping range if an intersection exists; otherwise, the default value.
Retorna: `true` if an intersection exists; otherwise, `false`.
methodOverlaps
public bool Overlaps(Range<T> other)
Determines whether this range overlaps with another range.
- other: Range<T>
- The other range to check for overlap.
Retorna: `true` if the ranges share at least one common value; otherwise, `false`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodoperator <
public static bool operator <(Range<T> left, Range<T> right)
Determines whether the left range is less than the right range.
- left: Range<T>
- The first range to compare.
- right: Range<T>
- The second range to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(Range<T> left, Range<T> right)
Determines whether the left range is less than or equal to the right range.
- left: Range<T>
- The first range to compare.
- right: Range<T>
- The second range to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(Range<T> left, Range<T> right)
Determines whether the left range is greater than the right range.
- left: Range<T>
- The first range to compare.
- right: Range<T>
- The second range to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(Range<T> left, Range<T> right)
Determines whether the left range is greater than or equal to the right range.
- left: Range<T>
- The first range to compare.
- right: Range<T>
- The second range to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyEnd
public T End { get; }
Gets the upper inclusive boundary of the range.
propertyIsDegenerate
public bool IsDegenerate { get; }
Gets a value indicating whether this range is degenerate (i.e. `Start` equals `End`). In an inclusive closed interval, a degenerate range contains exactly one point.
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this range has zero measure / is degenerate (`Start` equals `End`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `Range<T>` instance was initialized through a factory rather than `default(Range{T})`.
propertyStart
public T Start { get; }
Gets the lower inclusive boundary of the range.
record
ReceiptNumber
Ensamblado: EricksonLopez.ValueObjectspublic sealed record ReceiptNumber : StringValueObject<ReceiptNumber>
Hereda de: StringValueObject<ReceiptNumber>
Represents a payment or POS transaction receipt identifier. Normalized to uppercase. Rules: Required, 1–60 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: POS, Treasury, Cash Register, ERP, Billing.
Miembros (1)
methodCreate
public static Result<ReceiptNumber> Create(string? value)
Creates a new `ReceiptNumber` instance after validating and normalizing to uppercase.
- value: string?
- The raw receipt identifier string.
Retorna: A `Result<ReceiptNumber>` containing the created instance or a validation error.
record
ReferenceNumber
Ensamblado: EricksonLopez.ValueObjectspublic sealed record ReferenceNumber : StringValueObject<ReferenceNumber>
Hereda de: StringValueObject<ReferenceNumber>
Represents an internal reference number used to correlate related documents or operations within the organization. Unlike `DocumentNumber` which is a document's own identity, a ReferenceNumber points to another entity or process. Normalized to uppercase. Rules: Required, 1–80 chars, uppercase alphanumeric with `. _ / -` separators. Used by: ERP, POS, E-Invoicing, Inventory, Manufacturing, CRM, Financial Examples: - A payment's `ReferenceNumber` = the invoice `DocumentNumber` it pays. - A bank transfer reference (e.g., `REF-987654`). - A check number (e.g., `CHK-001234`). - An ACH authorization code used to correlate a batch of payments. Key distinction: `DocumentNumber` = "I am document X." `ReferenceNumber` = "I reference document/operation X." `ExternalReference` = "A third party calls me X.".
Miembros (1)
methodCreate
public static Result<ReferenceNumber> Create(string? value)
Creates a new `ReferenceNumber` instance after validating and normalizing the reference number.
- value: string?
- The raw reference number string.
Retorna: A `Result<ReferenceNumber>` containing the created instance or a validation error.
class
RegulatoryRuleAttribute
Ensamblado: EricksonLopez.ValueObjectspublic class RegulatoryRuleAttribute : Attribute
Hereda de: Attribute
Specifies the regulatory rule identifier that governs the invariants and algorithms of a value object.
Miembros (2)
constructorRegulatoryRuleAttribute
public RegulatoryRuleAttribute(string ruleId)
Initializes a new instance of the `RegulatoryRuleAttribute` class with the specified rule identifier.
- ruleId: string
- The formal identifier of the regulatory rule.
propertyRuleId
public string RuleId { get; }
Gets the formal identifier of the regulatory rule.
record
RetailScaleBarcodeData
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct RetailScaleBarcodeData
Represents the zero-allocation parsed fields of a 13-digit GS1 prefix 20–29 variable-weight or variable-price retail scale barcode.
Miembros (8)
propertyCheckDigit
public int CheckDigit { get; }
Gets the verified Modulo-10 check digit (position 13).
propertyEmbeddedPrice
public decimal? EmbeddedPrice { get; }
Gets the decoded monetary price when `IsPriceEncoded` is `true`; otherwise `null`.
propertyEmbeddedWeight
public decimal? EmbeddedWeight { get; }
Gets the decoded weight (in kg or lb depending on mode) when `IsPriceEncoded` is `false`; otherwise `null`.
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this struct was initialized by `RetailScaleBarcodeParser`.
propertyIsPriceEncoded
public bool IsPriceEncoded { get; }
Gets a value indicating whether the embedded payload represents a monetary price rather than a physical weight.
propertyItemPlu
public string ItemPlu { get; }
Gets the 5-digit item PLU / internal article code (positions 3–7).
propertyPrefix
public int Prefix { get; }
Gets the 2-digit in-store restricted circulation prefix (`20`–`29`).
propertyRawMeasureValue
public int RawMeasureValue { get; }
Gets the raw integer value encoded in positions 8–12 (0–99999).
class
RetailScaleBarcodeParser
Ensamblado: EricksonLopez.ValueObjectspublic static class RetailScaleBarcodeParser
Zero-allocation parser and GS1 Modulo-10 checksum calculator for GTIN-8/12/13/14 and retail variable-weight/variable-price scale barcodes (EAN-13 prefixes `20`–`29`).
Miembros (3)
methodComputeGs1CheckDigit
public static int ComputeGs1CheckDigit(ReadOnlySpan<char> payloadWithoutCheckDigit)
Computes the GS1 Modulo-10 check digit (0–9) for a data payload span (7, 11, 12, or 13 digits).
- payloadWithoutCheckDigit: ReadOnlySpan<char>
- The numeric GTIN payload excluding the trailing check digit.
Retorna: The GS1 Modulo-10 check digit between 0 and 9, or `-1` if the input is empty or non-numeric.
methodIsValidGs1CheckDigit
public static bool IsValidGs1CheckDigit(ReadOnlySpan<char> digits)
Verifies the standard GS1 Modulo-10 check digit for 8, 12, 13, or 14-digit GTIN spans.
- digits: ReadOnlySpan<char>
- The candidate numeric GTIN span.
Retorna: `true` if `digits` has a valid length, contains only ASCII digits, and matches its GS1 Modulo-10 check digit.
methodParse
public static Result<RetailScaleBarcodeData> Parse(ReadOnlySpan<char> rawBarcode, RetailScaleEncodingMode mode = RetailScaleEncodingMode.AutoByPrefix29)
Parses a 13-digit EAN-13 retail scale barcode (prefixes `20`–`29`) after verifying its GS1 Modulo-10 check digit.
- rawBarcode: ReadOnlySpan<char>
- The raw 13-digit scale barcode span.
- mode: RetailScaleEncodingMode
- The weight/price encoding mode (defaults to `RetailScaleEncodingMode.AutoByPrefix29`).
Retorna: A `Result<RetailScaleBarcodeData>` containing the extracted PLU and embedded weight/price or a validation error.
enum
RetailScaleEncodingMode
Ensamblado: EricksonLopez.ValueObjectspublic enum RetailScaleEncodingMode
Specifies how the 5-digit measure payload (positions 8–12) in a prefix 20–29 retail scale EAN-13 barcode is interpreted.
Miembros (4)
fieldAutoByPrefix29
AutoByPrefix29 = 0
Interprets prefixes 20–28 as weight in grams (`value / 1000` kg) and prefix 29 as price in cents (`value / 100`).
fieldPriceCents
PriceCents = 3
Interprets the 5-digit payload as monetary price in minor currency units / cents (`0.01` precision).
fieldWeightGrams
WeightGrams = 1
Interprets the 5-digit payload as weight in grams (`0.001` kg precision).
fieldWeightHundredthsPound
WeightHundredthsPound = 2
Interprets the 5-digit payload as weight in hundredths of a pound (`0.01` lb precision).
record
SKU
Ensamblado: EricksonLopez.ValueObjectspublic sealed record SKU : StringValueObject<SKU>
Hereda de: StringValueObject<SKU>
Represents a Stock Keeping Unit — the unique product identifier for inventory tracking. Normalized to uppercase, zero embedded whitespace, with deterministic prefix+sequence generation.
Miembros (4)
methodCreate
public static Result<SKU> Create(string? value)
Creates a new `SKU` instance after validating and normalizing to uppercase.
- value: string?
- The raw stock keeping unit string.
Retorna: A `Result<SKU>` containing the created instance or a validation error.
methodGenerate
public static Result<SKU> Generate(ReadOnlySpan<char> categoryPrefix, int sequence, int padWidth = 6)
Deterministically generates an uppercase `SKU` from a category prefix span and positive sequence number.
- categoryPrefix: ReadOnlySpan<char>
- The alphanumeric category prefix span (1–16 characters).
- sequence: int
- The positive sequence number (>= 1).
- padWidth: int
- Zero-padded numeric width (1–12, defaults to 6).
Retorna: A `Result<SKU>` containing the generated SKU or a validation error.
methodGenerate
public static Result<SKU> Generate(string? categoryPrefix, int sequence, int padWidth = 6)
Deterministically generates an uppercase `SKU` from a category prefix and positive sequence number (e.g., `ELEC-000042`).
- categoryPrefix: string?
- The alphanumeric category prefix (1–16 characters).
- sequence: int
- The positive sequence number (>= 1).
- padWidth: int
- Zero-padded numeric width (1–12, defaults to 6).
Retorna: A `Result<SKU>` containing the generated SKU or a validation error.
propertyIsAutoGenerated
public bool IsAutoGenerated { get; }
Gets a value indicating whether this SKU matches an auto-generated `PREFIX-000001` numeric suffix pattern.
record
SalesChannelCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed record SalesChannelCode : StringValueObject<SalesChannelCode>
Hereda de: StringValueObject<SalesChannelCode>
Represents a commercial sales channel identifier (e.g., "WEB", "POS_STORE_01", "MOBILE_APP", "B2B_PORTAL"). Normalized to uppercase. Rules: Required, 1–40 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: POS, E-commerce, ERP, Omnichannel Sales, Analytics.
Miembros (1)
methodCreate
public static Result<SalesChannelCode> Create(string? value)
Creates a new `SalesChannelCode` instance after validating and normalizing to uppercase.
- value: string?
- The raw sales channel code string.
Retorna: A `Result<SalesChannelCode>` containing the created instance or a validation error.
class
SensitiveDataAttribute
Ensamblado: EricksonLopez.ValueObjectspublic sealed class SensitiveDataAttribute : Attribute
Hereda de: Attribute
Marks a value object, class, or property as containing sensitive data requiring redaction or masking.
Miembros (2)
constructorSensitiveDataAttribute
public SensitiveDataAttribute(string mask = "")
Initializes a new instance of the `SensitiveDataAttribute` class with an optional mask pattern.
- mask: string
- The mask string to display in place of the sensitive value. Defaults to `"***"`.
propertyMask
public string Mask { get; }
Gets the mask pattern used when displaying sensitive values.
record
SerialNumber
Ensamblado: EricksonLopez.ValueObjectspublic sealed record SerialNumber : StringValueObject<SerialNumber>
Hereda de: StringValueObject<SerialNumber>
Represents a unique manufacturing or inventory item serial number. Normalized to uppercase. Rules: Required, 1–80 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: Inventory, Fixed Assets, Manufacturing, Warranty, After-Sales Service.
Miembros (1)
methodCreate
public static Result<SerialNumber> Create(string? value)
Creates a new `SerialNumber` instance after validating and normalizing to uppercase.
- value: string?
- The raw serial number string.
Retorna: A `Result<SerialNumber>` containing the created instance or a validation error.
record
SingleValueObject<TSelf, TValue>
Ensamblado: EricksonLopez.ValueObjectspublic abstract record SingleValueObject<TSelf, TValue> : IValueObject<TSelf>, IComparable<TSelf>, IComparable where TSelf : SingleValueObject<TSelf, TValue> where TValue : notnull
Implementa: IComparable, IComparable<TSelf>, IValueObject<TSelf>
Provides a base record for value objects encapsulating a single underlying value.
Miembros (11)
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCompareTo
public int CompareTo(TSelf? other)
Compares the current instance with another instance of the same type.
- other: TSelf?
- The other value object to compare with this instance.
Retorna: A value indicating the relative order of the instances being compared.
methodEquals
public virtual bool Equals(TSelf? other)
Determines whether the current instance is equal to another instance of the same type based on value equality.
- other: TSelf?
- The other value object to compare with this instance.
Retorna: `true` if the underlying values are equal; otherwise, `false`.
methodGetHashCode
public override int GetHashCode()
Inherits documentation from base type or interface.
methodToString
public sealed override string ToString()
Inherits documentation from base type or interface.
methodexplicit operator TValue
public static explicit operator TValue(SingleValueObject<TSelf, TValue> valueObject)
Converts a `SingleValueObject<TSelf, TValue>` instance explicitly to its underlying value.
- valueObject: SingleValueObject<TSelf, TValue>
- The value object to extract the value from.
Retorna: The underlying wrapped value.
methodoperator <
public static bool operator <(SingleValueObject<TSelf, TValue>? left, SingleValueObject<TSelf, TValue>? right)
Determines whether the left operand is less than the right operand.
- left: SingleValueObject<TSelf, TValue>?
- The left value object to compare.
- right: SingleValueObject<TSelf, TValue>?
- The right value object to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(SingleValueObject<TSelf, TValue>? left, SingleValueObject<TSelf, TValue>? right)
Determines whether the left operand is less than or equal to the right operand.
- left: SingleValueObject<TSelf, TValue>?
- The left value object to compare.
- right: SingleValueObject<TSelf, TValue>?
- The right value object to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(SingleValueObject<TSelf, TValue>? left, SingleValueObject<TSelf, TValue>? right)
Determines whether the left operand is greater than the right operand.
- left: SingleValueObject<TSelf, TValue>?
- The left value object to compare.
- right: SingleValueObject<TSelf, TValue>?
- The right value object to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(SingleValueObject<TSelf, TValue>? left, SingleValueObject<TSelf, TValue>? right)
Determines whether the left operand is greater than or equal to the right operand.
- left: SingleValueObject<TSelf, TValue>?
- The left value object to compare.
- right: SingleValueObject<TSelf, TValue>?
- The right value object to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyValue
public TValue Value { get; }
Gets the encapsulated underlying value.
record
StringValueObject<TSelf>
Ensamblado: EricksonLopez.ValueObjectspublic abstract record StringValueObject<TSelf> : SingleValueObject<TSelf, string> where TSelf : StringValueObject<TSelf>
Hereda de: SingleValueObject<TSelf, string>
Provides a base record for value objects whose encapsulated state is a single normalized string.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
record
Subject
Ensamblado: EricksonLopez.ValueObjectspublic sealed record Subject : StringValueObject<Subject>
Hereda de: StringValueObject<Subject>
Represents a single-line subject, title, or topic for messages, tickets, and notifications. Normalized by collapsing excessive whitespace. Rules: Required, 1–250 characters, single-line text without control characters. Used by: CRM, Ticketing, Notifications, Email, Task Management.
Miembros (1)
methodCreate
public static Result<Subject> Create(string? value)
Creates a new `Subject` instance after validating and collapsing whitespace.
- value: string?
- The raw subject line string.
Retorna: A `Result<Subject>` containing the created instance or a validation error.
record
SupplierCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed record SupplierCode : StringValueObject<SupplierCode>
Hereda de: StringValueObject<SupplierCode>
Represents a unique supplier, vendor, or contractor master data code. Normalized to uppercase. Rules: Required, 1–40 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: ERP, Purchasing, Accounts Payable, Inventory, Logistics.
Miembros (1)
methodCreate
public static Result<SupplierCode> Create(string? value)
Creates a new `SupplierCode` instance after validating and normalizing to uppercase.
- value: string?
- The raw supplier code string.
Retorna: A `Result<SupplierCode>` containing the created instance or a validation error.
record
SwiftBic
Ensamblado: EricksonLopez.ValueObjectspublic sealed record SwiftBic : StringValueObject<SwiftBic>
Hereda de: StringValueObject<SwiftBic>
Represents a Business Identifier Code (SWIFT/BIC) compliant with ISO 9362. Formats: 8 characters (primary/head office) or 11 characters (specific branch).
Miembros (6)
methodCreate
public static Result<SwiftBic> Create(string? value)
Creates a validated `SwiftBic` instance conforming to ISO 9362 specifications.
- value: string?
- The raw 8- or 11-character SWIFT/BIC string.
Retorna: A `Result<SwiftBic>` containing the validated instance or a domain validation error.
propertyBankCode
public string BankCode { get; }
Gets the 4-letter bank identifier code.
propertyBranchCode
public string? BranchCode { get; }
Gets the 3-character branch code, or `null` if this is an 8-character head office code.
propertyCountryCode
public string CountryCode { get; }
Gets the 2-letter ISO 3166-1 alpha-2 country code.
propertyIsHeadOffice
public bool IsHeadOffice { get; }
Gets a value indicating whether this BIC represents a primary or head office (8 characters).
propertyLocationCode
public string LocationCode { get; }
Gets the 2-character location code.
record
TaxRate
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct TaxRate : IValueObject<TaxRate>, IComparable<TaxRate>, IComparable, IParsable<TaxRate>, ISpanParsable<TaxRate>, IFormattable, ISpanFormattable
Implementa: IComparable, IComparable<TaxRate>, IFormattable, IParsable<TaxRate>, ISpanFormattable, ISpanParsable<TaxRate>, IValueObject<TaxRate>
Represents a tax rate percentage value between 0 and 100 inclusive.
Miembros (22)
methodCalculateTax
public Money CalculateTax(Money baseAmount)
Calculates the tax amount for a specified monetary value using banker's rounding.
- baseAmount: Money
- The base monetary value.
Retorna: The calculated tax `Money` amount.
methodCalculateTax
public decimal CalculateTax(decimal baseAmount)
Calculates the tax amount for a specified base numeric value.
- baseAmount: decimal
- The base monetary or numeric value.
Retorna: The calculated tax amount rounded to 6 decimal places.
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCompareTo
public int CompareTo(TaxRate other)
Compares this tax rate with another tax rate.
- other: TaxRate
- The other tax rate to compare against.
Retorna: A value indicating the relative order of the tax rates being compared.
methodCreate
public static Result<TaxRate> Create(decimal value)
Creates a validated `TaxRate` instance from a percentage value in the range [0, 100].
- value: decimal
- The tax percentage amount.
Retorna: A successful `Result<T>` containing the validated tax rate, or a validation failure.
methodParse
public static TaxRate Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `TaxRate`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `TaxRate`.
methodParse
public static TaxRate Parse(string s, IFormatProvider? provider = null)
Parses a string into a `TaxRate`.
- s: string
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `TaxRate`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodToString
public string ToString(string? format, IFormatProvider? formatProvider)
Inherits documentation from `IFormattable.ToString(string?, IFormatProvider?)`.
- format: string?
- formatProvider: IFormatProvider?
methodTryFormat
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Inherits documentation from base type or interface.
- destination: Span<char>
- charsWritten: out int
- format: ReadOnlySpan<char>
- provider: IFormatProvider?
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out TaxRate result)
Attempts to parse a span of characters into a `TaxRate`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out TaxRate
- When this method returns, contains the parsed tax rate if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out TaxRate result)
Attempts to parse a string into a `TaxRate`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out TaxRate
- When this method returns, contains the parsed tax rate if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(TaxRate left, TaxRate right)
Determines whether the left tax rate is less than the right tax rate.
- left: TaxRate
- The first tax rate to compare.
- right: TaxRate
- The second tax rate to compare.
Retorna: `true` if `left` is less than `right`; otherwise, `false`.
methodoperator <=
public static bool operator <=(TaxRate left, TaxRate right)
Determines whether the left tax rate is less than or equal to the right tax rate.
- left: TaxRate
- The first tax rate to compare.
- right: TaxRate
- The second tax rate to compare.
Retorna: `true` if `left` is less than or equal to `right`; otherwise, `false`.
methodoperator >
public static bool operator >(TaxRate left, TaxRate right)
Determines whether the left tax rate is greater than the right tax rate.
- left: TaxRate
- The first tax rate to compare.
- right: TaxRate
- The second tax rate to compare.
Retorna: `true` if `left` is greater than `right`; otherwise, `false`.
methodoperator >=
public static bool operator >=(TaxRate left, TaxRate right)
Determines whether the left tax rate is greater than or equal to the right tax rate.
- left: TaxRate
- The first tax rate to compare.
- right: TaxRate
- The second tax rate to compare.
Retorna: `true` if `left` is greater than or equal to `right`; otherwise, `false`.
propertyAsFraction
public decimal AsFraction { get; }
Gets the fractional representation of the tax rate.
propertyFraction
public decimal Fraction { get; }
Gets the fractional representation of the tax rate (value divided by 100).
propertyIsExempt
public bool IsExempt { get; }
Gets a value indicating whether the tax rate is zero (tax exempt).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this `TaxRate` instance was initialized through a factory rather than `default(TaxRate)`.
propertyValue
public decimal Value { get; }
Gets the numerical tax rate percentage.
fieldExempt
public static readonly TaxRate Exempt
Gets a tax rate representing full tax exemption (0%).
record
TenantCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record TenantCode : StringValueObject<TenantCode>
Hereda de: StringValueObject<TenantCode>
Represents a tenant identifier in a multi-tenant SaaS system. DNS-friendly: lowercase letters, digits, and hyphens only. Architectural note: `TenantCode` is placed in `Shared/` (not `SaaS/`) because it is used by every bounded context (13/13 systems) as the primary multi-tenancy discriminator, making it a universal cross-cutting concern rather than a SaaS-specific concept. Rules: 3–64 chars, DNS-friendly lowercase slug (letters, digits, hyphens), must start and end with a letter or digit. Used by: All bounded contexts — universal tenancy discriminator.
Miembros (1)
methodCreate
public static Result<TenantCode> Create(string? value)
Creates a new `TenantCode` instance after validating DNS format and normalizing to lowercase.
- value: string?
- The raw tenant code string.
Retorna: A `Result<TenantCode>` containing the created instance or a validation error.
record
TimeRange
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct TimeRange : IValueObject<TimeRange>, IComparable<TimeRange>, IComparable, IParsable<TimeRange>, ISpanParsable<TimeRange>
Implementa: IComparable, IComparable<TimeRange>, IParsable<TimeRange>, ISpanParsable<TimeRange>, IValueObject<TimeRange>
Represents an immutable time-of-day interval supporting standard and overnight intervals.
Miembros (20)
methodCompareTo
public int CompareTo(object? obj)
Inherits documentation from base type or interface.
- obj: object?
methodCompareTo
public int CompareTo(TimeRange other)
Compares this time range with another time range.
- other: TimeRange
- The other time range to compare against.
Retorna: A value indicating the relative order of the time ranges being compared.
methodContains
public bool Contains(TimeOnly time)
Determines whether the specified time falls within this range.
- time: TimeOnly
- The time to evaluate.
Retorna: `true` if the time falls within the range; otherwise, `false`.
methodCreate
public static Result<TimeRange> Create(TimeOnly start, TimeOnly end, bool allowOvernight = false)
Creates a validated `TimeRange` instance with specified start and end times.
- start: TimeOnly
- The starting time of the interval.
- end: TimeOnly
- The ending time of the interval.
- allowOvernight: bool
- A value indicating whether overnight intervals (where start is after end) are permitted.
Retorna: A successful `Result<T>` containing the validated time range, or a validation failure.
methodOverlaps
public bool Overlaps(TimeRange other)
Determines whether this time range overlaps with another time range.
- other: TimeRange
- The other time range to check for overlap.
Retorna: `true` if the ranges overlap; otherwise, `false`.
methodParse
public static TimeRange Parse(ReadOnlySpan<char> s, IFormatProvider? provider = null)
Parses a span of characters into a `TimeRange`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `TimeRange`.
methodParse
public static TimeRange Parse(string s, IFormatProvider? provider = null)
Parses a string into a `TimeRange`.
- s: string
- The string to parse (e.g. `"[08:00:00 .. 17:00:00]"` or `"22:00:00..06:00:00"`).
- provider: IFormatProvider?
- An optional format provider.
Retorna: The parsed `TimeRange`.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodTryParse
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out TimeRange result)
Attempts to parse a span of characters into a `TimeRange`.
- s: ReadOnlySpan<char>
- The span of characters to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out TimeRange
- When this method returns, contains the parsed range if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodTryParse
public static bool TryParse(string? s, IFormatProvider? provider, out TimeRange result)
Attempts to parse a string into a `TimeRange`.
- s: string?
- The string to parse.
- provider: IFormatProvider?
- An optional format provider.
- result: out TimeRange
- When this method returns, contains the parsed range if successful; otherwise, default.
Retorna: `true` if parsed successfully; otherwise, `false`.
methodoperator <
public static bool operator <(TimeRange left, TimeRange right)
Determines whether the left time range is earlier than the right time range.
- left: TimeRange
- right: TimeRange
methodoperator <=
public static bool operator <=(TimeRange left, TimeRange right)
Determines whether the left time range is earlier than or equal to the right time range.
- left: TimeRange
- right: TimeRange
methodoperator >
public static bool operator >(TimeRange left, TimeRange right)
Determines whether the left time range is later than the right time range.
- left: TimeRange
- right: TimeRange
methodoperator >=
public static bool operator >=(TimeRange left, TimeRange right)
Determines whether the left time range is later than or equal to the right time range.
- left: TimeRange
- right: TimeRange
propertyCrossesMidnight
public bool CrossesMidnight { get; }
Gets a value indicating whether this range spans across midnight.
propertyDuration
public TimeSpan Duration { get; }
Gets the total elapsed duration of the time range.
propertyEnd
public TimeOnly End { get; }
Gets the ending time of the interval.
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this time range is degenerate (i.e. `Start` equals `End` and does not span across midnight).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this instance has been explicitly initialized and does not represent the default struct state.
propertyStart
public TimeOnly Start { get; }
Gets the starting time of the interval.
record
TimeZoneCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed partial record TimeZoneCode : StringValueObject<TimeZoneCode>
Hereda de: StringValueObject<TimeZoneCode>
Represents an IANA or Windows time zone identifier.
Miembros (1)
methodCreate
public static Result<TimeZoneCode> Create(string? value)
Creates a validated `TimeZoneCode` instance after normalizing whitespace.
- value: string?
- The time zone identifier string.
Retorna: A successful `Result<T>` containing the validated time zone code, or a validation failure.
record
TripleMoney
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct TripleMoney : IEquatable<TripleMoney>
Implementa: IEquatable<TripleMoney>
Represents a multi-currency monetary triplet containing Local Currency (LC), Foreign Currency (FC), and System/Consolidation Currency (SC) amounts for international multi-company accounting.
Miembros (9)
methodAdd
public TripleMoney Add(TripleMoney other)
Adds another `TripleMoney` instance to this instance component-wise.
- other: TripleMoney
- The other `TripleMoney` to add.
Retorna: The component-wise sum.
methodCreate
public static Result<TripleMoney> Create(Money localCurrency, Money foreignCurrency, Money systemCurrency)
Creates a validated `TripleMoney` instance from its three monetary components.
- localCurrency: Money
- The Local Currency monetary amount.
- foreignCurrency: Money
- The Foreign Currency monetary amount.
- systemCurrency: Money
- The System Currency monetary amount.
Retorna: A successful `Result<T>` containing the created `TripleMoney`, or a validation failure.
methodReconstitute
public static TripleMoney Reconstitute(decimal lcAmount, string lcCurrency, decimal fcAmount, string fcCurrency, decimal scAmount, string scCurrency)
Reconstitutes a `TripleMoney` instance from six persisted database columns (3 amounts + 3 ISO currency codes).
- lcAmount: decimal
- The Local Currency numeric amount.
- lcCurrency: string
- The Local Currency ISO 4217 code.
- fcAmount: decimal
- The Foreign Currency numeric amount.
- fcCurrency: string
- The Foreign Currency ISO 4217 code.
- scAmount: decimal
- The System Currency numeric amount.
- scCurrency: string
- The System Currency ISO 4217 code.
Retorna: The reconstituted `TripleMoney` instance.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
methodZero
public static TripleMoney Zero(CurrencyCode lc, CurrencyCode fc, CurrencyCode sc)
Creates a zero-valued `TripleMoney` instance for the three specified currencies.
- lc: CurrencyCode
- The Local Currency code.
- fc: CurrencyCode
- The Foreign Currency code.
- sc: CurrencyCode
- The System Currency code.
Retorna: A zero-valued `TripleMoney` instance.
propertyForeignCurrency
public Money ForeignCurrency { get; }
Gets the amount denominated in Foreign/Transaction Currency (e.g., USD, EUR).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether all three monetary components are initialized.
propertyLocalCurrency
public Money LocalCurrency { get; }
Gets the amount denominated in Local Currency (e.g., DOP).
propertySystemCurrency
public Money SystemCurrency { get; }
Gets the amount denominated in System/Consolidation Currency.
record
UnitConversionFactor
Ensamblado: EricksonLopez.ValueObjectspublic readonly record struct UnitConversionFactor : IValueObject<UnitConversionFactor>, IEquatable<UnitConversionFactor>
Implementa: IEquatable<UnitConversionFactor>, IValueObject<UnitConversionFactor>
Represents an exact rational unit-of-measure conversion factor (`Numerator / Denominator`) eliminating repeating-decimal truncation drift across packaging, inventory, and recipe conversions.
Miembros (10)
methodConvert
public Result<decimal> Convert(decimal quantity, int decimals = 6)
Converts a source quantity to the target unit using exact rational multiplication prior to rounding.
- quantity: decimal
- The quantity in source units.
- decimals: int
- The target decimal scale (0–6, defaults to 6).
Retorna: A `Result<Decimal>` containing the converted quantity.
methodCreate
public static Result<UnitConversionFactor> Create(decimal numerator, decimal denominator = 1m)
Creates a validated rational `UnitConversionFactor` from positive `numerator` and `denominator`.
- numerator: decimal
- The positive numerator.
- denominator: decimal
- The positive denominator (defaults to `1`).
Retorna: A `Result<UnitConversionFactor>` containing the validated factor or an error.
methodInvert
public Result<UnitConversionFactor> Invert()
Returns the multiplicative inverse (`Denominator / Numerator`) of this conversion factor.
Retorna: A `Result<UnitConversionFactor>` containing the inverted factor.
methodToString
public override string ToString()
Inherits documentation from base type or interface.
propertyDenominator
public decimal Denominator { get; }
Gets the positive rational denominator.
propertyIdentity
public static UnitConversionFactor Identity { get; }
Gets the identity 1:1 conversion factor (`1 / 1`).
propertyIsEmpty
public bool IsEmpty { get; }
Gets a value indicating whether this factor is uninitialized (`default(UnitConversionFactor)`).
propertyIsInitialized
public bool IsInitialized { get; }
Gets a value indicating whether this factor was initialized via a factory.
propertyNumerator
public decimal Numerator { get; }
Gets the positive rational numerator.
propertyRatio
public decimal Ratio { get; }
Gets the decimal ratio (`Numerator / Denominator`), or `0` if uninitialized.
record
ValueObject
Ensamblado: EricksonLopez.ValueObjectspublic abstract record ValueObject : DomainPrimitives.ValueObject, IValueObject
Hereda de: DomainPrimitives.ValueObjectImplementa: IValueObject
Provides a base record for composite value objects composed of multiple domain attributes.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
ValueObjectAttribute
Ensamblado: EricksonLopez.ValueObjectspublic sealed class ValueObjectAttribute : Attribute
Hereda de: Attribute
Instructs the source generator to synthesize factories, parsers, formatters, and equality for this value object.
Miembros (2)
propertyGenerateConversionOperators
public bool GenerateConversionOperators { get; set; }
Gets or sets a value indicating whether to generate implicit and explicit conversion operators to and from the underlying value.
propertyGeneratePersistenceHooks
public bool GeneratePersistenceHooks { get; set; }
Gets or sets a value indicating whether to generate persistence type handler hooks. Reserved for persistence hook synthesis in an upcoming release.
record
VehicleVin
Ensamblado: EricksonLopez.ValueObjectspublic sealed record VehicleVin : StringValueObject<VehicleVin>
Hereda de: StringValueObject<VehicleVin>
Represents a Vehicle Identification Number (VIN) compliant with ISO 3779 and ISO 3780 standards. Exactly 17 alphanumeric characters (excluding letters I, O, Q) with Modulo 11 check-digit verification at position 9.
Miembros (8)
methodCreate
public static Result<VehicleVin> Create(string? value)
Creates a validated `VehicleVin` instance according to ISO 3779 check digit specifications.
- value: string?
- The raw 17-character VIN string.
Retorna: A `Result<VehicleVin>` containing the validated instance or a domain validation error.
propertyModelYear
public int ModelYear { get; }
Gets the decoded model year from position 10, or `0` if unrecognized.
propertyVds
public string Vds { get; }
Gets the Vehicle Descriptor Section (VDS) occupying positions 4 to 9.
propertyVehicleDescriptorSection
public string VehicleDescriptorSection { get; }
Alias for `Vds`.
propertyVehicleIdentifierSection
public string VehicleIdentifierSection { get; }
Alias for `Vis`.
propertyVis
public string Vis { get; }
Gets the Vehicle Identifier Section (VIS) occupying positions 10 to 17.
propertyWmi
public string Wmi { get; }
Gets the World Manufacturer Identifier (WMI) occupying positions 1 to 3.
propertyWorldManufacturerIdentifier
public string WorldManufacturerIdentifier { get; }
Alias for `Wmi`.
record
WarehouseCode
Ensamblado: EricksonLopez.ValueObjectspublic sealed record WarehouseCode : StringValueObject<WarehouseCode>
Hereda de: StringValueObject<WarehouseCode>
Represents a warehouse, storage location, or distribution center identifier. Normalized to uppercase. Rules: Required, 1–40 characters, uppercase alphanumeric with separators (`. _ / -`). Used by: Inventory, Logistics, Supply Chain, ERP, POS.
Miembros (1)
methodCreate
public static Result<WarehouseCode> Create(string? value)
Creates a new `WarehouseCode` instance after validating and normalizing to uppercase.
- value: string?
- The raw warehouse code string.
Retorna: A `Result<WarehouseCode>` containing the created instance or a validation error.
record
WebsiteUrl
Ensamblado: EricksonLopez.ValueObjectspublic sealed record WebsiteUrl : StringValueObject<WebsiteUrl>
Hereda de: StringValueObject<WebsiteUrl>
Represents an absolute HTTP or HTTPS website URL.
Miembros (2)
methodCreate
public static Result<WebsiteUrl> Create(string? value)
Creates a validated `WebsiteUrl` instance from an absolute HTTP or HTTPS URL string.
- value: string?
- The raw website URL string.
Retorna: A successful `Result<T>` containing the validated website URL, or a validation failure.
propertyHost
public string Host { get; }
Gets the host component of the URL.
enum
WeightUnit
Ensamblado: EricksonLopez.ValueObjectspublic enum WeightUnit
Supported mass/weight units for industrial, retail scale, and logistics operations.
Miembros (6)
fieldGram
Gram = 1
Gram (`g`, 0.001 kg).
fieldKilogram
Kilogram = 2
Kilogram (`kg`, SI base unit).
fieldMetricTon
MetricTon = 3
Metric ton (`t`, 1000 kg).
fieldMilligram
Milligram = 0
Milligram (`mg`, 0.000001 kg).
fieldOunce
Ounce = 4
Avoirdupois ounce (`oz`, 0.028349523125 kg).
fieldPound
Pound = 5
Avoirdupois pound (`lb`, 0.45359237 kg).