diff --git a/LivsforloebModel.cs b/LivsforloebModel.cs index b5d70ec..3e6ee25 100644 --- a/LivsforloebModel.cs +++ b/LivsforloebModel.cs @@ -1,28 +1,29 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 03-31-2022 -// -// Last Modified By : FH -// Last Modified On : 03-31-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** -// -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see [https://www.gnu.org/licenses] +// +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** + namespace FCS.Lib.Virk { /// @@ -34,10 +35,11 @@ namespace FCS.Lib.Virk /// Last registrar update /// public string SidstOpdateret { get; set; } = ""; + /// /// Period /// /// - public Periode Periode { get; set; } = new (); + public Periode Periode { get; set; } = new(); } } \ No newline at end of file diff --git a/NyesteBeliggenhedsadresse.cs b/NyesteBeliggenhedsadresse.cs index 760ac3d..55561bc 100644 --- a/NyesteBeliggenhedsadresse.cs +++ b/NyesteBeliggenhedsadresse.cs @@ -1,28 +1,29 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** + namespace FCS.Lib.Virk { /// @@ -34,22 +35,27 @@ namespace FCS.Lib.Virk /// 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 /// diff --git a/NyesteNavn.cs b/NyesteNavn.cs index acbc4f8..6aa6ce9 100644 --- a/NyesteNavn.cs +++ b/NyesteNavn.cs @@ -1,25 +1,25 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** diff --git a/Periode.cs b/Periode.cs index 5da9f0a..1d3eacb 100644 --- a/Periode.cs +++ b/Periode.cs @@ -1,28 +1,29 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** + namespace FCS.Lib.Virk { /// @@ -34,6 +35,7 @@ namespace FCS.Lib.Virk /// Valid from /// public string GyldigFra { get; set; } = ""; + /// /// Valid to /// diff --git a/VirksomhedMetadata.cs b/VirksomhedMetadata.cs index fe9cc96..e29fbd5 100644 --- a/VirksomhedMetadata.cs +++ b/VirksomhedMetadata.cs @@ -1,28 +1,29 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** + namespace FCS.Lib.Virk { /// @@ -35,6 +36,7 @@ namespace FCS.Lib.Virk /// /// public NyesteNavn NyesteNavn { get; set; } = new(); + /// /// Business current address object /// diff --git a/VirksomhedsStatus.cs b/VirksomhedsStatus.cs index 2ea3017..2ebeee7 100644 --- a/VirksomhedsStatus.cs +++ b/VirksomhedsStatus.cs @@ -1,28 +1,29 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** + namespace FCS.Lib.Virk { /// @@ -34,10 +35,12 @@ namespace FCS.Lib.Virk /// Business last updated with registrar /// public string SidstOpdateret { get; set; } = ""; + /// /// Business status with registrar /// public string Status { get; set; } = ""; + /// /// Period object /// diff --git a/VrHttpRequest.cs b/VrHttpRequest.cs index e9ca61e..22f9605 100644 --- a/VrHttpRequest.cs +++ b/VrHttpRequest.cs @@ -1,25 +1,25 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** @@ -66,5 +66,4 @@ namespace FCS.Lib.Virk }; } } -} - +} \ No newline at end of file diff --git a/VrQuery.cs b/VrQuery.cs index bffb552..294e5d9 100644 --- a/VrQuery.cs +++ b/VrQuery.cs @@ -1,28 +1,29 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** + namespace FCS.Lib.Virk { /// @@ -34,18 +35,22 @@ namespace FCS.Lib.Virk /// 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 /// diff --git a/VrQueryMapper.cs b/VrQueryMapper.cs index 1b8d4bb..d74cbe5 100644 --- a/VrQueryMapper.cs +++ b/VrQueryMapper.cs @@ -1,25 +1,25 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** @@ -44,7 +44,6 @@ namespace FCS.Lib.Virk { // lookup based on address if (string.IsNullOrWhiteSpace(query.VatNumber) && string.IsNullOrWhiteSpace(query.EntityName)) - { return new JObject( new JProperty("_source", new JArray( @@ -80,10 +79,8 @@ namespace FCS.Lib.Virk new JProperty("_name", "husnummerFra")))))) )))))), new JProperty("size", 50)); - } // vat number query if (string.IsNullOrWhiteSpace(query.EntityName)) - { return new JObject( new JProperty("_source", new JArray( @@ -99,11 +96,10 @@ namespace FCS.Lib.Virk "Vrvirksomhed.livsforloeb") ), new JProperty("query", - new JObject(new JProperty("term", + new JObject(new JProperty("term", new JObject(new JProperty("Vrvirksomhed.cvrNummer", query.VatNumber)))) - ) - ); - } + ) + ); query.EntityName = query.EntityName.Replace("A/S", "").Trim().Replace(" ", " AND ").Replace("-", " AND "); // name query @@ -123,14 +119,13 @@ namespace FCS.Lib.Virk ), new JProperty("query", new JObject(new JProperty("query_string", - new JObject( - new JProperty("default_field", "Vrvirksomhed.virksomhedMetadata.nyesteNavn.navn"), - new JProperty("query", query.EntityName) + new JObject( + new JProperty("default_field", "Vrvirksomhed.virksomhedMetadata.nyesteNavn.navn"), + new JProperty("query", query.EntityName) ) ) - )), + )), new JProperty("size", 50)); - } } } \ No newline at end of file diff --git a/VrQueryValidator.cs b/VrQueryValidator.cs index be2522a..0295d7d 100644 --- a/VrQueryValidator.cs +++ b/VrQueryValidator.cs @@ -1,28 +1,29 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** + namespace FCS.Lib.Virk { /// @@ -41,7 +42,8 @@ namespace FCS.Lib.Virk try { // Precise lookup - if (!string.IsNullOrWhiteSpace(query.VatNumber) || !string.IsNullOrWhiteSpace(query.EntityName)) return true; + if (!string.IsNullOrWhiteSpace(query.VatNumber) || !string.IsNullOrWhiteSpace(query.EntityName)) + return true; // Address lookup return !string.IsNullOrWhiteSpace(query.StreetName) && !string.IsNullOrWhiteSpace(query.HouseNumber) diff --git a/VrResponseParser.cs b/VrResponseParser.cs index f696b0a..9c87953 100644 --- a/VrResponseParser.cs +++ b/VrResponseParser.cs @@ -1,25 +1,25 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** @@ -43,33 +43,33 @@ namespace FCS.Lib.Virk public List ParseVrResponse(string responseData) { var result = new List(); - + var cvrObject = JObject.Parse(responseData); - - var numHits = (int) cvrObject.SelectToken("hits")?.SelectToken("total")!; - + + var numHits = (int)cvrObject.SelectToken("hits")?.SelectToken("total")!; + if (numHits == 0) return result; - + var cvrHits = cvrObject.SelectToken("hits")?.SelectToken("hits"); - + for (var i = 0; i < numHits; i++) - { try { - var cObject = cvrHits?[i]?["_source"] != null ? (JObject?)cvrHits[i]?["_source"]?["Vrvirksomhed"] : null; + var cObject = cvrHits?[i]?["_source"] != null + ? (JObject?)cvrHits[i]?["_source"]?["Vrvirksomhed"] + : null; var jsonString = JsonConvert.SerializeObject(cObject); var o = JsonConvert.DeserializeObject(jsonString); - if(o != null) + if (o != null) result.Add(o); } catch { return result; } - } return result; } diff --git a/VrResponseView.cs b/VrResponseView.cs index 946423d..e1e2d91 100644 --- a/VrResponseView.cs +++ b/VrResponseView.cs @@ -1,25 +1,25 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** @@ -37,10 +37,12 @@ namespace FCS.Lib.Virk /// Http request status code /// public HttpStatusCode Code { get; set; } + /// /// boolean value indicating success /// public bool IsSuccessStatusCode { get; set; } + /// /// Service response as string /// diff --git a/VrVatInfoMapper.cs b/VrVatInfoMapper.cs index d4ac371..675bd88 100644 --- a/VrVatInfoMapper.cs +++ b/VrVatInfoMapper.cs @@ -1,25 +1,25 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** -// -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** @@ -58,7 +58,6 @@ namespace FCS.Lib.Virk }; if (vrVirk.VirksomhedsStatus.Any()) - { foreach (var cs in vrVirk.VirksomhedsStatus.Select(vrStatus => new VatState { State = vrStatus.Status, @@ -66,20 +65,16 @@ namespace FCS.Lib.Virk TimeFrame = new TimeFrame { StartDate = vrStatus.Periode.GyldigFra, - EndDate = !string.IsNullOrWhiteSpace(vrStatus.Periode.GyldigTil) ? vrStatus.Periode.GyldigTil : "" + EndDate = !string.IsNullOrWhiteSpace(vrStatus.Periode.GyldigTil) + ? vrStatus.Periode.GyldigTil + : "" } })) - { c.States.Add(cs); - } - } else - { c.States.Add(new VatState()); - } if (vrVirk.Livsforloeb.Any()) - { foreach (var lc in vrVirk.Livsforloeb.Select( vrCourse => new LifeCycle { @@ -87,18 +82,15 @@ namespace FCS.Lib.Virk TimeFrame = new TimeFrame { StartDate = vrCourse.Periode.GyldigFra, - EndDate = !string.IsNullOrWhiteSpace(vrCourse.Periode.GyldigTil) ? vrCourse.Periode.GyldigTil : "" + EndDate = !string.IsNullOrWhiteSpace(vrCourse.Periode.GyldigTil) + ? vrCourse.Periode.GyldigTil + : "" } } - )) - { + )) c.LifeCycles.Add(lc); - } - } else - { c.LifeCycles.Add(new LifeCycle()); - } if (!string.IsNullOrWhiteSpace(c.States[c.States.Count - 1].State)) return c; @@ -107,7 +99,9 @@ namespace FCS.Lib.Virk c.States[sc].LastUpdate = c.LifeCycles[lcc].LastUpdate; c.States[sc].TimeFrame.StartDate = c.LifeCycles[lcc].TimeFrame.StartDate; c.States[sc].TimeFrame.EndDate = c.LifeCycles[lcc].TimeFrame.EndDate; - c.States[sc].State = string.IsNullOrWhiteSpace(c.LifeCycles[c.LifeCycles.Count - 1].TimeFrame.EndDate) ? "NORMAL" : "LUKKET"; + c.States[sc].State = string.IsNullOrWhiteSpace(c.LifeCycles[c.LifeCycles.Count - 1].TimeFrame.EndDate) + ? "NORMAL" + : "LUKKET"; return c; } } diff --git a/VrVirksomhed.cs b/VrVirksomhed.cs index d586b6b..c803956 100644 --- a/VrVirksomhed.cs +++ b/VrVirksomhed.cs @@ -1,28 +1,29 @@ // *********************************************************************** // Assembly : FCS.Lib.Virk -// Author : FH -// Created : 02-21-2022 -// -// Last Modified By : FH -// Last Modified On : 02-24-2022 +// Author : inno +// Created : 2022 12 17 13:33 +// +// Last Modified By : inno +// Last Modified On : 2023 03 14 09:16 // *********************************************************************** // -// Copyright (C) 2022 FCS Frede's Computer Services. -// This program is free software: you can redistribute it and/or modify -// it under the terms of the Affero GNU General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// Affero GNU General Public License for more details. -// -// You should have received a copy of the Affero GNU General Public License -// along with this program. If not, see [https://www.gnu.org/licenses/agpl-3.0.en.html] +// Copyright (C) 2022-2023 FCS Frede's Computer Services. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see [https://www.gnu.org/licenses] // // // *********************************************************************** + namespace FCS.Lib.Virk { /// @@ -35,16 +36,19 @@ namespace FCS.Lib.Virk /// Vat number /// public string CvrNummer { get; set; } = ""; + /// /// Status list /// /// - public List VirksomhedsStatus { get; set; } = new (); + public List VirksomhedsStatus { get; set; } = new(); + /// /// Meta data /// /// public VirksomhedMetadata VirksomhedMetadata { get; set; } = new(); + /// /// Company stages ///