update headers
This commit is contained in:
parent
cee66f9052
commit
cb06ebcd73
9 changed files with 339 additions and 305 deletions
|
@ -1,25 +1,25 @@
|
|||
// ***********************************************************************
|
||||
// Assembly : FCS.Lib.BrReg
|
||||
// Author : FH
|
||||
// Created : 04-06-2022
|
||||
//
|
||||
// Last Modified By : FH
|
||||
// Last Modified On : 04-06-2022
|
||||
// Author : fhdk
|
||||
// Created : 2022 12 17 13:33
|
||||
//
|
||||
// Last Modified By: fhdk
|
||||
// Last Modified On : 2023 03 14 09:16
|
||||
// ***********************************************************************
|
||||
// <copyright file="BrAddressModel.cs" company="">
|
||||
// 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 file="BrAddressModel.cs" company="FCS">
|
||||
// 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]
|
||||
// </copyright>
|
||||
// <summary></summary>
|
||||
// ***********************************************************************
|
||||
|
@ -37,26 +37,32 @@ public class BrAddressModel
|
|||
/// entity country
|
||||
/// </summary>
|
||||
public string Land { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// entity country code
|
||||
/// </summary>
|
||||
public string Landkode { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// entity zip code
|
||||
/// </summary>
|
||||
public string Postnummer { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// entity postal name
|
||||
/// </summary>
|
||||
public string Poststed { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// entity address
|
||||
/// </summary>
|
||||
public List<string> Adresse { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// entity municipal
|
||||
/// </summary>
|
||||
public string Kommune { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// entity municipal identification
|
||||
/// </summary>
|
||||
|
|
|
@ -1,72 +1,78 @@
|
|||
// ***********************************************************************
|
||||
// Assembly : FCS.Lib.BrReg
|
||||
// Author : FH
|
||||
// Created : 04-06-2022
|
||||
//
|
||||
// Last Modified By : FH
|
||||
// Last Modified On : 04-06-2022
|
||||
// Author : fhdk
|
||||
// Created : 2022 12 17 13:33
|
||||
//
|
||||
// Last Modified By: fhdk
|
||||
// Last Modified On : 2023 03 14 09:16
|
||||
// ***********************************************************************
|
||||
// <copyright file="BrCompanyModel.cs" company="">
|
||||
// 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 file="BrCompanyModel.cs" company="FCS">
|
||||
// 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]
|
||||
// </copyright>
|
||||
// <summary></summary>
|
||||
// ***********************************************************************
|
||||
|
||||
namespace FCS.Lib.BrReg
|
||||
namespace FCS.Lib.BrReg;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class BrCompanyModel
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// Entity vat number
|
||||
/// </summary>
|
||||
public class BrCompanyModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity vat number
|
||||
/// </summary>
|
||||
public string Organisasjonsnummer { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Entity name
|
||||
/// </summary>
|
||||
public string Navn { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Entity deletion date
|
||||
/// </summary>
|
||||
public string Slettedato { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Entity business type
|
||||
/// </summary>
|
||||
public BrCompanyTypeModel Organisasjonsform { get; set; } = new();
|
||||
/// <summary>
|
||||
/// entity postal address
|
||||
/// </summary>
|
||||
public BrAddressModel Postadresse { get; set; } = new();
|
||||
/// <summary>
|
||||
/// entity business address
|
||||
/// </summary>
|
||||
public BrAddressModel Forretningsadresse { get; set; } = new();
|
||||
/// <summary>
|
||||
/// entity out-of-business flag
|
||||
/// </summary>
|
||||
public bool Konkurs { get; set; }
|
||||
/// <summary>
|
||||
/// entity to be closed flag
|
||||
/// </summary>
|
||||
public bool UnderAvvikling { get; set; }
|
||||
/// <summary>
|
||||
/// entity to be force closed
|
||||
/// </summary>
|
||||
public bool UnderTvangsavviklingEllerTvangsopplosning { get; set; }
|
||||
public string Organisasjonsnummer { get; set; } = "";
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Entity name
|
||||
/// </summary>
|
||||
public string Navn { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Entity deletion date
|
||||
/// </summary>
|
||||
public string Slettedato { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Entity business type
|
||||
/// </summary>
|
||||
public BrCompanyTypeModel Organisasjonsform { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// entity postal address
|
||||
/// </summary>
|
||||
public BrAddressModel Postadresse { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// entity business address
|
||||
/// </summary>
|
||||
public BrAddressModel Forretningsadresse { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// entity out-of-business flag
|
||||
/// </summary>
|
||||
public bool Konkurs { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// entity to be closed flag
|
||||
/// </summary>
|
||||
public bool UnderAvvikling { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// entity to be force closed
|
||||
/// </summary>
|
||||
public bool UnderTvangsavviklingEllerTvangsopplosning { get; set; }
|
||||
}
|
|
@ -1,28 +1,29 @@
|
|||
// ***********************************************************************
|
||||
// Assembly : FCS.Lib.BrReg
|
||||
// Author : FH
|
||||
// Created : 04-06-2022
|
||||
//
|
||||
// Last Modified By : FH
|
||||
// Last Modified On : 04-06-2022
|
||||
// Author : fhdk
|
||||
// Created : 2022 12 17 13:33
|
||||
//
|
||||
// Last Modified By: fhdk
|
||||
// Last Modified On : 2023 03 14 09:16
|
||||
// ***********************************************************************
|
||||
// <copyright file="BrCompanyTypeModel.cs" company="">
|
||||
// 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 file="BrCompanyTypeModel.cs" company="FCS">
|
||||
// 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]
|
||||
// </copyright>
|
||||
// <summary></summary>
|
||||
// ***********************************************************************
|
||||
|
||||
namespace FCS.Lib.BrReg;
|
||||
|
||||
/// <summary>
|
||||
|
@ -34,10 +35,12 @@ public class BrCompanyTypeModel
|
|||
/// BrReg business code
|
||||
/// </summary>
|
||||
public string Kode { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// BrReg description
|
||||
/// </summary>
|
||||
public string Beskrivelse { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// BrReg discontinued
|
||||
/// </summary>
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
// ***********************************************************************
|
||||
// Assembly : FCS.Lib.Virk
|
||||
// Author : FH
|
||||
// Created : 02-21-2022
|
||||
//
|
||||
// Last Modified By : FH
|
||||
// Last Modified On : 04-06-2022
|
||||
// Assembly : FCS.Lib.BrReg
|
||||
// Author : fhdk
|
||||
// Created : 2022 12 17 13:33
|
||||
//
|
||||
// Last Modified By: fhdk
|
||||
// Last Modified On : 2023 03 14 09:16
|
||||
// ***********************************************************************
|
||||
// <copyright file="BrHttpRequest.cs" company="FCS">
|
||||
// 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]
|
||||
// </copyright>
|
||||
// <summary></summary>
|
||||
// ***********************************************************************
|
||||
|
@ -27,36 +27,34 @@
|
|||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FCS.Lib.BrReg
|
||||
namespace FCS.Lib.BrReg;
|
||||
|
||||
/// <summary>
|
||||
/// Class BrHttpRequest
|
||||
/// </summary>
|
||||
public class BrHttpRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Class BrHttpRequest
|
||||
/// Async http request
|
||||
/// </summary>
|
||||
public class BrHttpRequest
|
||||
/// <param name="endpoint"></param>
|
||||
/// <param name="userAgent"></param>
|
||||
/// <returns><see cref="BrResponseView"/></returns>
|
||||
public async Task<BrResponseView> GetResponseAsync(string endpoint, string userAgent)
|
||||
{
|
||||
/// <summary>
|
||||
/// Async http request
|
||||
/// </summary>
|
||||
/// <param name="endpoint"></param>
|
||||
/// <param name="userAgent"></param>
|
||||
/// <returns><see cref="BrResponseView"/></returns>
|
||||
public async Task<BrResponseView> GetResponseAsync(string endpoint, string userAgent)
|
||||
using var client = new HttpClient();
|
||||
using var brRequest = new HttpRequestMessage(HttpMethod.Get, endpoint);
|
||||
|
||||
brRequest.Headers.Add("User-Agent", userAgent);
|
||||
|
||||
var response = await client.SendAsync(brRequest).ConfigureAwait(true);
|
||||
var jsonResult = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
|
||||
|
||||
return new BrResponseView
|
||||
{
|
||||
using var client = new HttpClient();
|
||||
using var brRequest = new HttpRequestMessage(HttpMethod.Get, endpoint);
|
||||
|
||||
brRequest.Headers.Add("User-Agent", userAgent);
|
||||
|
||||
var response = await client.SendAsync(brRequest).ConfigureAwait(true);
|
||||
var jsonResult = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
|
||||
|
||||
return new BrResponseView
|
||||
{
|
||||
Code = response.StatusCode,
|
||||
IsSuccessStatusCode = response.IsSuccessStatusCode,
|
||||
Message = jsonResult
|
||||
};
|
||||
}
|
||||
Code = response.StatusCode,
|
||||
IsSuccessStatusCode = response.IsSuccessStatusCode,
|
||||
Message = jsonResult
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,30 @@
|
|||
namespace FCS.Lib.BrReg;
|
||||
// ***********************************************************************
|
||||
// Assembly : FCS.Lib.BrReg
|
||||
// Author : fhdk
|
||||
// Created : 2022 12 17 13:33
|
||||
//
|
||||
// Last Modified By: fhdk
|
||||
// Last Modified On : 2023 03 14 09:16
|
||||
// ***********************************************************************
|
||||
// <copyright file="BrRegQuery.cs" company="FCS">
|
||||
// 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]
|
||||
// </copyright>
|
||||
// <summary></summary>
|
||||
// ***********************************************************************
|
||||
|
||||
namespace FCS.Lib.BrReg;
|
||||
|
||||
/// <summary>
|
||||
/// BrRegQuery
|
||||
|
@ -9,5 +35,4 @@ public class BrRegQuery
|
|||
/// Vat number
|
||||
/// </summary>
|
||||
public string VatNumber { get; set; }
|
||||
|
||||
}
|
|
@ -1,46 +1,45 @@
|
|||
// ***********************************************************************
|
||||
// Assembly : FCS.Lib.Virk
|
||||
// Author : FH
|
||||
// Created : 02-21-2022
|
||||
//
|
||||
// Last Modified By : FH
|
||||
// Last Modified On : 04-06-2022
|
||||
// Assembly : FCS.Lib.BrReg
|
||||
// Author : fhdk
|
||||
// Created : 2022 12 17 13:33
|
||||
//
|
||||
// Last Modified By: fhdk
|
||||
// Last Modified On : 2023 03 14 09:16
|
||||
// ***********************************************************************
|
||||
// <copyright file="BrResponseParser.cs" company="FCS">
|
||||
// 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]
|
||||
// </copyright>
|
||||
// <summary></summary>
|
||||
// ***********************************************************************
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace FCS.Lib.BrReg
|
||||
namespace FCS.Lib.BrReg;
|
||||
|
||||
/// <summary>
|
||||
/// Class BrResponseParser
|
||||
/// </summary>
|
||||
public class BrResponseParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Class BrResponseParser
|
||||
/// Parse response to BrCompanyModel
|
||||
/// </summary>
|
||||
public class BrResponseParser
|
||||
/// <param name="responseData"></param>
|
||||
/// <returns><see cref="BrCompanyModel"/></returns>
|
||||
public BrCompanyModel ParseBrResponse(string responseData)
|
||||
{
|
||||
/// <summary>
|
||||
/// Parse response to BrCompanyModel
|
||||
/// </summary>
|
||||
/// <param name="responseData"></param>
|
||||
/// <returns><see cref="BrCompanyModel"/></returns>
|
||||
public BrCompanyModel ParseBrResponse(string responseData)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<BrCompanyModel>(responseData);
|
||||
}
|
||||
return JsonConvert.DeserializeObject<BrCompanyModel>(responseData);
|
||||
}
|
||||
}
|
|
@ -1,49 +1,50 @@
|
|||
// ***********************************************************************
|
||||
// Assembly : FCS.Lib.Virk
|
||||
// Author : FH
|
||||
// Created : 02-21-2022
|
||||
//
|
||||
// Last Modified By : FH
|
||||
// Last Modified On : 04-06-2022
|
||||
// Assembly : FCS.Lib.BrReg
|
||||
// Author : fhdk
|
||||
// Created : 2022 12 17 13:33
|
||||
//
|
||||
// Last Modified By: fhdk
|
||||
// Last Modified On : 2023 03 14 09:16
|
||||
// ***********************************************************************
|
||||
// <copyright file="BrResponseView.cs" company="FCS">
|
||||
// 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]
|
||||
// </copyright>
|
||||
// <summary></summary>
|
||||
// ***********************************************************************
|
||||
|
||||
using System.Net;
|
||||
|
||||
namespace FCS.Lib.BrReg
|
||||
namespace FCS.Lib.BrReg;
|
||||
|
||||
/// <summary>
|
||||
/// Class BrResponseView
|
||||
/// </summary>
|
||||
public class BrResponseView
|
||||
{
|
||||
/// <summary>
|
||||
/// Class BrResponseView
|
||||
/// http response status code
|
||||
/// </summary>
|
||||
public class BrResponseView
|
||||
{
|
||||
/// <summary>
|
||||
/// http response status code
|
||||
/// </summary>
|
||||
public HttpStatusCode Code { get; set; }
|
||||
/// <summary>
|
||||
/// Flag indicating success
|
||||
/// </summary>
|
||||
public bool IsSuccessStatusCode { get; set; }
|
||||
/// <summary>
|
||||
/// Response message
|
||||
/// </summary>
|
||||
public string Message { get; set; } = "";
|
||||
}
|
||||
public HttpStatusCode Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Flag indicating success
|
||||
/// </summary>
|
||||
public bool IsSuccessStatusCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Response message
|
||||
/// </summary>
|
||||
public string Message { get; set; } = "";
|
||||
}
|
|
@ -1,25 +1,25 @@
|
|||
// ***********************************************************************
|
||||
// Assembly : FCS.Lib.Virk
|
||||
// Author : FH
|
||||
// Created : 02-21-2022
|
||||
//
|
||||
// Last Modified By : FH
|
||||
// Last Modified On : 04-06-2022
|
||||
// Assembly : FCS.Lib.BrReg
|
||||
// Author : fhdk
|
||||
// Created : 2022 12 17 13:33
|
||||
//
|
||||
// Last Modified By: fhdk
|
||||
// Last Modified On : 2023 03 14 09:16
|
||||
// ***********************************************************************
|
||||
// <copyright file="BrVatInfoMapper.cs" company="FCS">
|
||||
// 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]
|
||||
// </copyright>
|
||||
// <summary></summary>
|
||||
// ***********************************************************************
|
||||
|
@ -28,96 +28,92 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using FCS.Lib.Common;
|
||||
|
||||
namespace FCS.Lib.BrReg
|
||||
namespace FCS.Lib.BrReg;
|
||||
|
||||
/// <summary>
|
||||
/// Class BrVatInfoMapper
|
||||
/// </summary>
|
||||
public class BrVatInfoMapper
|
||||
{
|
||||
/// <summary>
|
||||
/// Class BrVatInfoMapper
|
||||
/// Map BrCompanyModel to CRM
|
||||
/// </summary>
|
||||
public class BrVatInfoMapper
|
||||
/// <param name="brCompany"></param>
|
||||
/// <returns><see cref="VatInfoDto"/></returns>
|
||||
/// <see cref="BrCompanyModel"/>
|
||||
/// <see cref="VatState"/>
|
||||
/// <see cref="LifeCycle"/>
|
||||
/// <see cref="TimeFrame"/>
|
||||
public VatInfoDto MapBrToCrm(BrCompanyModel brCompany)
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Map BrCompanyModel to CRM
|
||||
/// </summary>
|
||||
/// <param name="brCompany"></param>
|
||||
/// <returns><see cref="VatInfoDto"/></returns>
|
||||
/// <see cref="BrCompanyModel"/>
|
||||
/// <see cref="VatState"/>
|
||||
/// <see cref="LifeCycle"/>
|
||||
/// <see cref="TimeFrame"/>
|
||||
public VatInfoDto MapBrToCrm(BrCompanyModel brCompany)
|
||||
return new VatInfoDto
|
||||
{
|
||||
return new VatInfoDto
|
||||
Name = brCompany.Navn,
|
||||
Address = string.Join(", ", brCompany.Forretningsadresse.Adresse),
|
||||
City = brCompany.Forretningsadresse.Poststed,
|
||||
RequestDate = $"{DateTime.Now:yyyy-MM-dd}",
|
||||
ZipCode = brCompany.Forretningsadresse.Postnummer,
|
||||
VatNumber = brCompany.Organisasjonsnummer,
|
||||
States = new List<VatState>
|
||||
{
|
||||
Name = brCompany.Navn,
|
||||
Address = string.Join(", ", brCompany.Forretningsadresse.Adresse),
|
||||
City = brCompany.Forretningsadresse.Poststed,
|
||||
RequestDate = $"{DateTime.Now:yyyy-MM-dd}",
|
||||
ZipCode = brCompany.Forretningsadresse.Postnummer,
|
||||
VatNumber = brCompany.Organisasjonsnummer,
|
||||
States = new List<VatState>
|
||||
new()
|
||||
{
|
||||
new()
|
||||
LastUpdate = "",
|
||||
State = MapBrVatState(brCompany).HasFolded ? "LUKKET" : "NORMAL",
|
||||
TimeFrame = new TimeFrame
|
||||
{
|
||||
LastUpdate = "",
|
||||
State = MapBrVatState(brCompany).HasFolded ? "LUKKET" : "NORMAL",
|
||||
TimeFrame = new TimeFrame
|
||||
{
|
||||
StartDate = "",
|
||||
EndDate = ""
|
||||
}
|
||||
}
|
||||
},
|
||||
LifeCycles = new List<LifeCycle>
|
||||
{
|
||||
new()
|
||||
{
|
||||
TimeFrame = new TimeFrame
|
||||
{
|
||||
EndDate = "NN",
|
||||
StartDate = "NN"
|
||||
}
|
||||
StartDate = "",
|
||||
EndDate = ""
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Map BrCompanyModel to VatStateInfo
|
||||
/// </summary>
|
||||
/// <param name="brCompany"></param>
|
||||
/// <returns><see cref="VatStateInfo"/></returns>
|
||||
public VatStateInfo MapBrVatState(BrCompanyModel brCompany)
|
||||
{
|
||||
if (brCompany == null)
|
||||
},
|
||||
LifeCycles = new List<LifeCycle>
|
||||
{
|
||||
return new VatStateInfo
|
||||
new()
|
||||
{
|
||||
RequestDate = DateTime.Now
|
||||
};
|
||||
TimeFrame = new TimeFrame
|
||||
{
|
||||
EndDate = "NN",
|
||||
StartDate = "NN"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var c = new VatStateInfo
|
||||
/// <summary>
|
||||
/// Map BrCompanyModel to VatStateInfo
|
||||
/// </summary>
|
||||
/// <param name="brCompany"></param>
|
||||
/// <returns><see cref="VatStateInfo"/></returns>
|
||||
public VatStateInfo MapBrVatState(BrCompanyModel brCompany)
|
||||
{
|
||||
if (brCompany == null)
|
||||
return new VatStateInfo
|
||||
{
|
||||
Name = brCompany.Navn,
|
||||
VatNumber = brCompany.Organisasjonsnummer,
|
||||
RequestDate = DateTime.Now,
|
||||
VatNumberValid = true
|
||||
RequestDate = DateTime.Now
|
||||
};
|
||||
|
||||
if (brCompany.Konkurs || brCompany.UnderAvvikling || brCompany.UnderTvangsavviklingEllerTvangsopplosning)
|
||||
c.HasFolded = true;
|
||||
var c = new VatStateInfo
|
||||
{
|
||||
Name = brCompany.Navn,
|
||||
VatNumber = brCompany.Organisasjonsnummer,
|
||||
RequestDate = DateTime.Now,
|
||||
VatNumberValid = true
|
||||
};
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(brCompany.Organisasjonsform.Utgaatt))
|
||||
c.HasFolded = true;
|
||||
if (brCompany.Konkurs || brCompany.UnderAvvikling || brCompany.UnderTvangsavviklingEllerTvangsopplosning)
|
||||
c.HasFolded = true;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(brCompany.Slettedato))
|
||||
c.HasFolded = true;
|
||||
if (!string.IsNullOrWhiteSpace(brCompany.Organisasjonsform.Utgaatt))
|
||||
c.HasFolded = true;
|
||||
|
||||
if (c.HasFolded)
|
||||
c.VatNumberValid = false;
|
||||
if (!string.IsNullOrWhiteSpace(brCompany.Slettedato))
|
||||
c.HasFolded = true;
|
||||
|
||||
return c;
|
||||
}
|
||||
if (c.HasFolded)
|
||||
c.VatNumberValid = false;
|
||||
|
||||
return c;
|
||||
}
|
||||
}
|
|
@ -17,5 +17,5 @@ using System.Runtime.InteropServices;
|
|||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("8D850197-78DB-4D16-A91F-E5BB6E8880A7")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.23023.0820")]
|
||||
[assembly: AssemblyFileVersion("1.0.23023.0820")]
|
||||
[assembly: AssemblyVersion("1.0.23077.1334")]
|
||||
[assembly: AssemblyFileVersion("1.0.23077.1334")]
|
Loading…
Reference in a new issue