From 86989537b51621085a2482d12b5cf49d13cfb918 Mon Sep 17 00:00:00 2001 From: FH Date: Wed, 16 Nov 2022 11:34:36 +0100 Subject: [PATCH] documentation --- FCS.Lib.Virk.csproj | 3 ++- LivsforloebModel.cs | 10 ++++++++++ NyesteBeliggenhedsadresse.cs | 21 +++++++++++++++++++++ NyesteNavn.cs | 6 ++++++ Periode.cs | 9 +++++++++ VirksomhedMetadata.cs | 11 +++++++++++ VirksomhedsStatus.cs | 13 +++++++++++++ VrHttpRequest.cs | 12 ++++++++++++ VrQuery.cs | 18 ++++++++++++++++++ VrQueryMapper.cs | 10 ++++++++++ VrQueryValidator.cs | 9 +++++++++ VrResponseParser.cs | 8 ++++++-- VrResponseView.cs | 12 ++++++++++++ VrVatInfoMapper.cs | 13 +++++++++++++ VrVirksomhed.cs | 19 +++++++++++++++++++ 15 files changed, 171 insertions(+), 3 deletions(-) diff --git a/FCS.Lib.Virk.csproj b/FCS.Lib.Virk.csproj index c322f0e..c5cb192 100644 --- a/FCS.Lib.Virk.csproj +++ b/FCS.Lib.Virk.csproj @@ -1,4 +1,4 @@ - + 10.0 @@ -11,6 +11,7 @@ 1.0.0.100 False AGPL-3.0-or-later + True diff --git a/LivsforloebModel.cs b/LivsforloebModel.cs index df3a28a..1a8c697 100644 --- a/LivsforloebModel.cs +++ b/LivsforloebModel.cs @@ -25,9 +25,19 @@ // *********************************************************************** namespace FCS.Lib.Virk { + /// + /// Lifecycle model + /// public class LivsforloebModel { + /// + /// Last registrar update + /// public string SidstOpdateret { get; set; } = ""; + /// + /// Period + /// + /// public Periode Periode { get; set; } = new (); } } \ No newline at end of file diff --git a/NyesteBeliggenhedsadresse.cs b/NyesteBeliggenhedsadresse.cs index 39a7602..8e6c545 100644 --- a/NyesteBeliggenhedsadresse.cs +++ b/NyesteBeliggenhedsadresse.cs @@ -25,13 +25,34 @@ // *********************************************************************** namespace FCS.Lib.Virk { + /// + /// Current address + /// public class NyesteBeliggenhedsadresse { + /// + /// House number from + /// public int? HusnummerFra { get; set; } + /// + /// House number to + /// public int? HusnummerTil { get; set; } + /// + /// Zip code + /// public int? Postnummer { get; set; } + /// + /// Street name + /// public string Vejnavn { get; set; } = ""; + /// + /// CO name + /// public string CoNavn { get; set; } = ""; + /// + /// Mail district name + /// public string PostDistrikt { get; set; } = ""; } } \ No newline at end of file diff --git a/NyesteNavn.cs b/NyesteNavn.cs index db8b634..ab6e620 100644 --- a/NyesteNavn.cs +++ b/NyesteNavn.cs @@ -26,8 +26,14 @@ namespace FCS.Lib.Virk { + /// + /// Current name object + /// public class NyesteNavn { + /// + /// Name + /// public string Navn { get; set; } = ""; } } \ No newline at end of file diff --git a/Periode.cs b/Periode.cs index 370eb88..0bb22f4 100644 --- a/Periode.cs +++ b/Periode.cs @@ -25,9 +25,18 @@ // *********************************************************************** namespace FCS.Lib.Virk { + /// + /// Period object + /// public class Periode { + /// + /// Valid from + /// public string GyldigFra { get; set; } = ""; + /// + /// Valid to + /// public string GyldigTil { get; set; } = ""; } } \ No newline at end of file diff --git a/VirksomhedMetadata.cs b/VirksomhedMetadata.cs index c5b01af..fc850cc 100644 --- a/VirksomhedMetadata.cs +++ b/VirksomhedMetadata.cs @@ -25,9 +25,20 @@ // *********************************************************************** namespace FCS.Lib.Virk { + /// + /// Business meta data object + /// public class VirksomhedMetadata { + /// + /// Business current name object + /// + /// public NyesteNavn NyesteNavn { get; set; } = new(); + /// + /// Business current address object + /// + /// public NyesteBeliggenhedsadresse NyesteBeliggenhedsadresse { get; set; } = new(); } } \ No newline at end of file diff --git a/VirksomhedsStatus.cs b/VirksomhedsStatus.cs index d968c12..8028e3d 100644 --- a/VirksomhedsStatus.cs +++ b/VirksomhedsStatus.cs @@ -25,10 +25,23 @@ // *********************************************************************** namespace FCS.Lib.Virk { + /// + /// VirksomhedsStatus object + /// public class VirksomhedsStatus { + /// + /// Business last updated with registrar + /// public string SidstOpdateret { get; set; } = ""; + /// + /// Business status with registrar + /// public string Status { get; set; } = ""; + /// + /// Period object + /// + /// public Periode Periode { get; set; } = new(); } } \ No newline at end of file diff --git a/VrHttpRequest.cs b/VrHttpRequest.cs index 3e2a69a..fc61aea 100644 --- a/VrHttpRequest.cs +++ b/VrHttpRequest.cs @@ -29,8 +29,20 @@ using System.Text; namespace FCS.Lib.Virk { + /// + /// Registrar http request + /// public class VrHttpRequest { + /// + /// Async registrar http request + /// + /// + /// + /// + /// + /// VrResponseView object + /// public async Task GetResponseAsync(string endpoint, string jsonData, string auth, string userAgent) { diff --git a/VrQuery.cs b/VrQuery.cs index 82aceff..f62adaf 100644 --- a/VrQuery.cs +++ b/VrQuery.cs @@ -25,12 +25,30 @@ // *********************************************************************** namespace FCS.Lib.Virk { + /// + /// Registrar query object + /// public class VrQuery { + /// + /// Vat number + /// public string VatNumber { get; set; } = ""; + /// + /// Street name + /// public string StreetName { get; set; } = ""; + /// + /// House number + /// public string HouseNumber { get; set; } = ""; + /// + /// Zip code + /// public string ZipCode { get; set; } = ""; + /// + /// Entity name + /// public string EntityName { get; set; } = ""; } } \ No newline at end of file diff --git a/VrQueryMapper.cs b/VrQueryMapper.cs index 0ce9f5a..f031732 100644 --- a/VrQueryMapper.cs +++ b/VrQueryMapper.cs @@ -28,8 +28,18 @@ using Newtonsoft.Json.Linq; namespace FCS.Lib.Virk { + /// + /// VrQueryMapper + /// + /// Maps the VrQuery object into an Elastic Search JObject public class VrQueryMapper { + /// + /// VrMapQuery + /// + /// + /// Elastic Search JObject + /// public JObject VrMapQuery(VrQuery query) { if (string.IsNullOrWhiteSpace(query.VatNumber) && string.IsNullOrWhiteSpace(query.EntityName)) diff --git a/VrQueryValidator.cs b/VrQueryValidator.cs index a0d8fc3..1cf9c02 100644 --- a/VrQueryValidator.cs +++ b/VrQueryValidator.cs @@ -25,8 +25,17 @@ // *********************************************************************** namespace FCS.Lib.Virk { + /// + /// Query validator + /// public static class VrQueryValidator { + /// + /// Validate query + /// + /// + /// true or false + /// public static bool ValidateVrQuery(VrQuery query) { try diff --git a/VrResponseParser.cs b/VrResponseParser.cs index 6f25219..402faf8 100644 --- a/VrResponseParser.cs +++ b/VrResponseParser.cs @@ -29,13 +29,17 @@ using Newtonsoft.Json.Linq; namespace FCS.Lib.Virk { + /// + /// VrResponseParser + /// public class VrResponseParser { /// - /// parse response from danish vat registrar + /// Registrar response parser /// /// - /// + /// List of VrVirksomhed models + /// public List ParseVrResponse(string responseData) { var result = new List(); diff --git a/VrResponseView.cs b/VrResponseView.cs index 9b4689d..2b23d17 100644 --- a/VrResponseView.cs +++ b/VrResponseView.cs @@ -28,10 +28,22 @@ using System.Net; namespace FCS.Lib.Virk { + /// + /// Service response view model + /// public class VrResponseView { + /// + /// Http request status code + /// public HttpStatusCode Code { get; set; } + /// + /// boolean value indicating success + /// public bool IsSuccessStatusCode { get; set; } + /// + /// Service response as string + /// public string Message { get; set; } = ""; } } \ No newline at end of file diff --git a/VrVatInfoMapper.cs b/VrVatInfoMapper.cs index f14ea05..f629371 100644 --- a/VrVatInfoMapper.cs +++ b/VrVatInfoMapper.cs @@ -28,8 +28,21 @@ using FCS.Lib.Common; namespace FCS.Lib.Virk { + /// + /// Vr Vat Info Mapper + /// public class VrVatInfoMapper { + /// + /// Vr to CRM mapper + /// + /// + /// Vat Info Data Transfer Object + /// + /// + /// + /// + /// public VatInfoDto MapVrToCrm(VrVirksomhed vrVirk) { var c = new VatInfoDto diff --git a/VrVirksomhed.cs b/VrVirksomhed.cs index e600452..7a1805e 100644 --- a/VrVirksomhed.cs +++ b/VrVirksomhed.cs @@ -25,11 +25,30 @@ // *********************************************************************** namespace FCS.Lib.Virk { + /// + /// Business model with registrar + /// + /// JSON property 1-1 relation public class VrVirksomhed { + /// + /// Vat number + /// public string CvrNummer { get; set; } = ""; + /// + /// Status list + /// + /// public List VirksomhedsStatus { get; set; } = new (); + /// + /// Meta data + /// + /// public VirksomhedMetadata VirksomhedMetadata { get; set; } = new(); + /// + /// Company stages + /// + /// public List Livsforloeb { get; set; } = new(); } } \ No newline at end of file