Cosmos.Types.Contactos 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Cosmos.Types.Contactos --version 1.1.0
                    
NuGet\Install-Package Cosmos.Types.Contactos -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cosmos.Types.Contactos" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cosmos.Types.Contactos" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Cosmos.Types.Contactos" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cosmos.Types.Contactos --version 1.1.0
                    
#r "nuget: Cosmos.Types.Contactos, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cosmos.Types.Contactos@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cosmos.Types.Contactos&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Cosmos.Types.Contactos&version=1.1.0
                    
Install as a Cake Tool

Cosmos.Types.Contactos

NuGet

Contacto — Value Object de contacto para el ERP Cosmos: nombre, rol (catálogo embebido de 7 roles) y al menos un medio de contacto (correos y/o teléfonos). Pensado para viajar dentro de eventos event-sourced (JSONB) aguas abajo.

Instalación

dotnet add package Cosmos.Types.Contactos

Uso

using Cosmos.Types.Contactos;
using Cosmos.Types.CorreosElectronicos;
using Cosmos.Types.Telefonos;

var correo = CorreoElectronico.Crear("ventas@acme.co").Valor;
var telefono = Telefono.Crear("+57", "3001234567").Valor;
var rol = Rol.Crear("comercial").Valor;   // rol del vocabulario embebido

var resultado = Contacto.Crear(
    nombre: "Acme S.A.S.",
    rol: rol,
    correos: [correo],
    telefonos: [telefono]);

if (resultado.EsExitoso)
    UsarContacto(resultado.Valor);
else
    foreach (var error in resultado.Errores)
        Console.WriteLine(error.Codigo);   // V01, V04, V05, …

El rol llega como Rol tipado (no un string): su obligatoriedad y validez quedan implícitas en el tipo. Para listar los roles disponibles (frontends) usá Rol.Listar(). Un contacto sin ningún correo ni teléfono es inválido.

Rehidratación (deserialización)

La construcción válida es solo vía Crear(...). Al deserializar un evento histórico el VO se rehidrata crudo ([JsonConstructor]), sin validar: un valor que ya no cumple las reglas actuales igual se rehidrata.

Dependencias

  • Cosmos.Types.Abstractions (kernel: Result<T>)
  • Cosmos.Types.CorreosElectronicos
  • Cosmos.Types.Telefonos

Requiere net10.0.

Documentación

Licencia

Uso interno del ERP Cosmos.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.1 134 6/30/2026
1.1.0 98 6/24/2026