update headers

This commit is contained in:
Frede Hundewadt 2023-03-21 07:07:55 +01:00
parent 8a5a527788
commit 6f2079fd64
14 changed files with 313 additions and 297 deletions

View file

@ -1,28 +1,29 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 03-31-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 03-31-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="LivsforloebModel.cs" company="FCS.Lib.Virk"> // <copyright file="LivsforloebModel.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the GNU Affero General Public License // 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] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
namespace FCS.Lib.Virk namespace FCS.Lib.Virk
{ {
/// <summary> /// <summary>
@ -34,10 +35,11 @@ namespace FCS.Lib.Virk
/// Last registrar update /// Last registrar update
/// </summary> /// </summary>
public string SidstOpdateret { get; set; } = ""; public string SidstOpdateret { get; set; } = "";
/// <summary> /// <summary>
/// Period /// Period
/// </summary> /// </summary>
/// <see cref="Periode"/> /// <see cref="Periode"/>
public Periode Periode { get; set; } = new (); public Periode Periode { get; set; } = new();
} }
} }

View file

@ -1,28 +1,29 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="NyesteBeliggenhedsadresse.cs" company="FCS"> // <copyright file="NyesteBeliggenhedsadresse.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
namespace FCS.Lib.Virk namespace FCS.Lib.Virk
{ {
/// <summary> /// <summary>
@ -34,22 +35,27 @@ namespace FCS.Lib.Virk
/// House number from /// House number from
/// </summary> /// </summary>
public int? HusnummerFra { get; set; } public int? HusnummerFra { get; set; }
/// <summary> /// <summary>
/// House number to /// House number to
/// </summary> /// </summary>
public int? HusnummerTil { get; set; } public int? HusnummerTil { get; set; }
/// <summary> /// <summary>
/// Zip code /// Zip code
/// </summary> /// </summary>
public int? Postnummer { get; set; } public int? Postnummer { get; set; }
/// <summary> /// <summary>
/// Street name /// Street name
/// </summary> /// </summary>
public string Vejnavn { get; set; } = ""; public string Vejnavn { get; set; } = "";
/// <summary> /// <summary>
/// CO name /// CO name
/// </summary> /// </summary>
public string CoNavn { get; set; } = ""; public string CoNavn { get; set; } = "";
/// <summary> /// <summary>
/// Mail district name /// Mail district name
/// </summary> /// </summary>

View file

@ -1,25 +1,25 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="NyesteNavn.cs" company="FCS"> // <copyright file="NyesteNavn.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************

View file

@ -1,28 +1,29 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="Periode.cs" company="FCS"> // <copyright file="Periode.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
namespace FCS.Lib.Virk namespace FCS.Lib.Virk
{ {
/// <summary> /// <summary>
@ -34,6 +35,7 @@ namespace FCS.Lib.Virk
/// Valid from /// Valid from
/// </summary> /// </summary>
public string GyldigFra { get; set; } = ""; public string GyldigFra { get; set; } = "";
/// <summary> /// <summary>
/// Valid to /// Valid to
/// </summary> /// </summary>

View file

@ -1,28 +1,29 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VirksomhedMetadata.cs" company="FCS"> // <copyright file="VirksomhedMetadata.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
namespace FCS.Lib.Virk namespace FCS.Lib.Virk
{ {
/// <summary> /// <summary>
@ -35,6 +36,7 @@ namespace FCS.Lib.Virk
/// </summary> /// </summary>
/// <see cref="NyesteNavn"/> /// <see cref="NyesteNavn"/>
public NyesteNavn NyesteNavn { get; set; } = new(); public NyesteNavn NyesteNavn { get; set; } = new();
/// <summary> /// <summary>
/// Business current address object /// Business current address object
/// </summary> /// </summary>

View file

@ -1,28 +1,29 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VirksomhedsStatus.cs" company="FCS"> // <copyright file="VirksomhedsStatus.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
namespace FCS.Lib.Virk namespace FCS.Lib.Virk
{ {
/// <summary> /// <summary>
@ -34,10 +35,12 @@ namespace FCS.Lib.Virk
/// Business last updated with registrar /// Business last updated with registrar
/// </summary> /// </summary>
public string SidstOpdateret { get; set; } = ""; public string SidstOpdateret { get; set; } = "";
/// <summary> /// <summary>
/// Business status with registrar /// Business status with registrar
/// </summary> /// </summary>
public string Status { get; set; } = ""; public string Status { get; set; } = "";
/// <summary> /// <summary>
/// Period object /// Period object
/// </summary> /// </summary>

View file

@ -1,25 +1,25 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VrHttpRequest.cs" company="FCS"> // <copyright file="VrHttpRequest.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
@ -66,5 +66,4 @@ namespace FCS.Lib.Virk
}; };
} }
} }
} }

View file

@ -1,28 +1,29 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VrQuery.cs" company="FCS"> // <copyright file="VrQuery.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
namespace FCS.Lib.Virk namespace FCS.Lib.Virk
{ {
/// <summary> /// <summary>
@ -34,18 +35,22 @@ namespace FCS.Lib.Virk
/// Vat number /// Vat number
/// </summary> /// </summary>
public string VatNumber { get; set; } = ""; public string VatNumber { get; set; } = "";
/// <summary> /// <summary>
/// Street name /// Street name
/// </summary> /// </summary>
public string StreetName { get; set; } = ""; public string StreetName { get; set; } = "";
/// <summary> /// <summary>
/// House number /// House number
/// </summary> /// </summary>
public string HouseNumber { get; set; } = ""; public string HouseNumber { get; set; } = "";
/// <summary> /// <summary>
/// Zip code /// Zip code
/// </summary> /// </summary>
public string ZipCode { get; set; } = ""; public string ZipCode { get; set; } = "";
/// <summary> /// <summary>
/// Entity name /// Entity name
/// </summary> /// </summary>

View file

@ -1,25 +1,25 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VrQueryMapper.cs" company="FCS"> // <copyright file="VrQueryMapper.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
@ -44,7 +44,6 @@ namespace FCS.Lib.Virk
{ {
// lookup based on address // lookup based on address
if (string.IsNullOrWhiteSpace(query.VatNumber) && string.IsNullOrWhiteSpace(query.EntityName)) if (string.IsNullOrWhiteSpace(query.VatNumber) && string.IsNullOrWhiteSpace(query.EntityName))
{
return new JObject( return new JObject(
new JProperty("_source", new JProperty("_source",
new JArray( new JArray(
@ -80,10 +79,8 @@ namespace FCS.Lib.Virk
new JProperty("_name", "husnummerFra")))))) new JProperty("_name", "husnummerFra"))))))
)))))), )))))),
new JProperty("size", 50)); new JProperty("size", 50));
}
// vat number query // vat number query
if (string.IsNullOrWhiteSpace(query.EntityName)) if (string.IsNullOrWhiteSpace(query.EntityName))
{
return new JObject( return new JObject(
new JProperty("_source", new JProperty("_source",
new JArray( new JArray(
@ -99,11 +96,10 @@ namespace FCS.Lib.Virk
"Vrvirksomhed.livsforloeb") "Vrvirksomhed.livsforloeb")
), ),
new JProperty("query", new JProperty("query",
new JObject(new JProperty("term", new JObject(new JProperty("term",
new JObject(new JProperty("Vrvirksomhed.cvrNummer", query.VatNumber)))) new JObject(new JProperty("Vrvirksomhed.cvrNummer", query.VatNumber))))
) )
); );
}
query.EntityName = query.EntityName.Replace("A/S", "").Trim().Replace(" ", " AND ").Replace("-", " AND "); query.EntityName = query.EntityName.Replace("A/S", "").Trim().Replace(" ", " AND ").Replace("-", " AND ");
// name query // name query
@ -123,14 +119,13 @@ namespace FCS.Lib.Virk
), ),
new JProperty("query", new JProperty("query",
new JObject(new JProperty("query_string", new JObject(new JProperty("query_string",
new JObject( new JObject(
new JProperty("default_field", "Vrvirksomhed.virksomhedMetadata.nyesteNavn.navn"), new JProperty("default_field", "Vrvirksomhed.virksomhedMetadata.nyesteNavn.navn"),
new JProperty("query", query.EntityName) new JProperty("query", query.EntityName)
) )
) )
)), )),
new JProperty("size", 50)); new JProperty("size", 50));
} }
} }
} }

View file

@ -1,28 +1,29 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VrQueryValidator.cs" company="FCS"> // <copyright file="VrQueryValidator.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
namespace FCS.Lib.Virk namespace FCS.Lib.Virk
{ {
/// <summary> /// <summary>
@ -41,7 +42,8 @@ namespace FCS.Lib.Virk
try try
{ {
// Precise lookup // 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 // Address lookup
return !string.IsNullOrWhiteSpace(query.StreetName) return !string.IsNullOrWhiteSpace(query.StreetName)
&& !string.IsNullOrWhiteSpace(query.HouseNumber) && !string.IsNullOrWhiteSpace(query.HouseNumber)

View file

@ -1,25 +1,25 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VrResponseParser.cs" company="FCS"> // <copyright file="VrResponseParser.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
@ -43,33 +43,33 @@ namespace FCS.Lib.Virk
public List<VrVirksomhed> ParseVrResponse(string responseData) public List<VrVirksomhed> ParseVrResponse(string responseData)
{ {
var result = new List<VrVirksomhed>(); var result = new List<VrVirksomhed>();
var cvrObject = JObject.Parse(responseData); var cvrObject = JObject.Parse(responseData);
var numHits = (int) cvrObject.SelectToken("hits")?.SelectToken("total")!; var numHits = (int)cvrObject.SelectToken("hits")?.SelectToken("total")!;
if (numHits == 0) if (numHits == 0)
return result; return result;
var cvrHits = cvrObject.SelectToken("hits")?.SelectToken("hits"); var cvrHits = cvrObject.SelectToken("hits")?.SelectToken("hits");
for (var i = 0; i < numHits; i++) for (var i = 0; i < numHits; i++)
{
try 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 jsonString = JsonConvert.SerializeObject(cObject);
var o = JsonConvert.DeserializeObject<VrVirksomhed>(jsonString); var o = JsonConvert.DeserializeObject<VrVirksomhed>(jsonString);
if(o != null) if (o != null)
result.Add(o); result.Add(o);
} }
catch catch
{ {
return result; return result;
} }
}
return result; return result;
} }

View file

@ -1,25 +1,25 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VrResponseView.cs" company="FCS"> // <copyright file="VrResponseView.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
@ -37,10 +37,12 @@ namespace FCS.Lib.Virk
/// Http request status code /// Http request status code
/// </summary> /// </summary>
public HttpStatusCode Code { get; set; } public HttpStatusCode Code { get; set; }
/// <summary> /// <summary>
/// boolean value indicating success /// boolean value indicating success
/// </summary> /// </summary>
public bool IsSuccessStatusCode { get; set; } public bool IsSuccessStatusCode { get; set; }
/// <summary> /// <summary>
/// Service response as string /// Service response as string
/// </summary> /// </summary>

View file

@ -1,25 +1,25 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VrCvrMapper.cs" company="FCS"> // <copyright file="VrVatInfoMapper.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
@ -58,7 +58,6 @@ namespace FCS.Lib.Virk
}; };
if (vrVirk.VirksomhedsStatus.Any()) if (vrVirk.VirksomhedsStatus.Any())
{
foreach (var cs in vrVirk.VirksomhedsStatus.Select(vrStatus => new VatState foreach (var cs in vrVirk.VirksomhedsStatus.Select(vrStatus => new VatState
{ {
State = vrStatus.Status, State = vrStatus.Status,
@ -66,20 +65,16 @@ namespace FCS.Lib.Virk
TimeFrame = new TimeFrame TimeFrame = new TimeFrame
{ {
StartDate = vrStatus.Periode.GyldigFra, 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); c.States.Add(cs);
}
}
else else
{
c.States.Add(new VatState()); c.States.Add(new VatState());
}
if (vrVirk.Livsforloeb.Any()) if (vrVirk.Livsforloeb.Any())
{
foreach (var lc in vrVirk.Livsforloeb.Select( foreach (var lc in vrVirk.Livsforloeb.Select(
vrCourse => new LifeCycle vrCourse => new LifeCycle
{ {
@ -87,18 +82,15 @@ namespace FCS.Lib.Virk
TimeFrame = new TimeFrame TimeFrame = new TimeFrame
{ {
StartDate = vrCourse.Periode.GyldigFra, 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); c.LifeCycles.Add(lc);
}
}
else else
{
c.LifeCycles.Add(new LifeCycle()); c.LifeCycles.Add(new LifeCycle());
}
if (!string.IsNullOrWhiteSpace(c.States[c.States.Count - 1].State)) return c; 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].LastUpdate = c.LifeCycles[lcc].LastUpdate;
c.States[sc].TimeFrame.StartDate = c.LifeCycles[lcc].TimeFrame.StartDate; c.States[sc].TimeFrame.StartDate = c.LifeCycles[lcc].TimeFrame.StartDate;
c.States[sc].TimeFrame.EndDate = c.LifeCycles[lcc].TimeFrame.EndDate; 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; return c;
} }
} }

View file

@ -1,28 +1,29 @@
// *********************************************************************** // ***********************************************************************
// Assembly : FCS.Lib.Virk // Assembly : FCS.Lib.Virk
// Author : FH // Author : inno
// Created : 02-21-2022 // Created : 2022 12 17 13:33
// //
// Last Modified By : FH // Last Modified By : inno
// Last Modified On : 02-24-2022 // Last Modified On : 2023 03 14 09:16
// *********************************************************************** // ***********************************************************************
// <copyright file="VrVirksomhed.cs" company="FCS"> // <copyright file="VrVirksomhed.cs" company="FCS">
// Copyright (C) 2022 FCS Frede's Computer Services. // Copyright (C) 2022-2023 FCS Frede's Computer Services.
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the Affero GNU General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// Affero GNU General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the Affero GNU General Public License // 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/agpl-3.0.en.html] // along with this program. If not, see [https://www.gnu.org/licenses]
// </copyright> // </copyright>
// <summary></summary> // <summary></summary>
// *********************************************************************** // ***********************************************************************
namespace FCS.Lib.Virk namespace FCS.Lib.Virk
{ {
/// <summary> /// <summary>
@ -35,16 +36,19 @@ namespace FCS.Lib.Virk
/// Vat number /// Vat number
/// </summary> /// </summary>
public string CvrNummer { get; set; } = ""; public string CvrNummer { get; set; } = "";
/// <summary> /// <summary>
/// Status list /// Status list
/// </summary> /// </summary>
/// <see cref="VirksomhedsStatus"/> /// <see cref="VirksomhedsStatus"/>
public List<VirksomhedsStatus> VirksomhedsStatus { get; set; } = new (); public List<VirksomhedsStatus> VirksomhedsStatus { get; set; } = new();
/// <summary> /// <summary>
/// Meta data /// Meta data
/// </summary> /// </summary>
/// <see cref="VirksomhedMetadata"/> /// <see cref="VirksomhedMetadata"/>
public VirksomhedMetadata VirksomhedMetadata { get; set; } = new(); public VirksomhedMetadata VirksomhedMetadata { get; set; } = new();
/// <summary> /// <summary>
/// Company stages /// Company stages
/// </summary> /// </summary>