Skip to content

Latest commit

 

History

History

COINNP.Entities

COIN Number Portability Entities

This library, available on NuGet, provides the COIN Number Porting (NP) messages as records. These messages are a close representation of the messages defined by Vereniging-COIN.Sdk.NP. This library provides functionality to make life easier in an 'idiomatic C#' way, whereas COIN's library may have a few design choices that do not always align with best practices or latest standards. This library aims to solve that, without breaking COIN's API or asking COIN to change / break their API and/or NP library.

Among others, this library:

  • Uses records (immutable) for models (i.e. NP messages and the related objects)
  • Uses correct types (like TimeSpan for Ttl, DateTimeOffset for datetime values, bools for boolean values, decimals for monetary values, actual enums for enum values like these etc.)
  • Hides Content, Seq and Repeats etc. and makes enumerable items on an object "first-class citizens" implemented as IEnumerables, for example:
    public record RangeActivation(
        string DossierId,
        string CurrentNetworkOperator,
        string OptaNr,
        DateTimeOffset PlannedDateTime,
        IEnumerable<RangeActivationItem> Items
    ) : Message(209, DossierId) { }
    
    public record RangeActivationItem(
        NumberSerie NumberSerie,
        string? PoP
    );
    Which simplifies use.
  • Is nullable aware
  • Provides NP messages that are actually serializable to/from JSON without additional work; It-just-works™ because they're plain POCO's (with the exception of Message which contains type discriminators because of it's polymorphic nature).

This library is used by COINNP.Client.