Skip to content

Commit

Permalink
tests: adjust unit tests for companyCertificates
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil91 committed Jun 24, 2024
1 parent 4647ad6 commit f9efe8a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ private async Task HandleCompanyCertificateCreationAsync(CompanyCertificateTypeI
companyCertificateRepository.CreateCompanyCertificateAssignedSites(companyCertificate.Id, sites);
}


await portalRepositories.SaveAsync().ConfigureAwait(ConfigureAwaitOptions.None);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/********************************************************************************
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;

namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities;

public class CompaniesCertificateAssignedSite
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,28 @@
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.AuditEntities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Auditing;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Base;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
using Document = Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities.Document;

namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities;
namespace Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;

[AuditEntityV1(typeof(AuditCertificateManagement20240416))]
public class CompanyCertificate : IAuditableV1, IBaseEntity
{
private CompanyCertificate() { }

public CompanyCertificate(Guid id, DateTimeOffset validFrom, CompanyCertificateTypeId companyCertificateTypeId, CompanyCertificateStatusId companyCertificateStatusId, Guid companyId, Guid documentId) : this()
public CompanyCertificate(Guid id, DateTimeOffset? validFrom, CompanyCertificateTypeId companyCertificateTypeId, CompanyCertificateStatusId companyCertificateStatusId, Guid companyId, Guid documentId)
{
Id = id;
ValidFrom = validFrom;
CompanyCertificateTypeId = companyCertificateTypeId;
CompanyCertificateStatusId = companyCertificateStatusId;
CompanyId = companyId;
DocumentId = documentId;
CompaniesCertificateAssignedSites = new HashSet<CompaniesCertificateAssignedSite>();
}

public Guid Id { get; private set; }
public DateTimeOffset? ValidFrom { get; set; }
public DateTimeOffset? ValidTill { get; set; }
public CompanyCertificateTypeId CompanyCertificateTypeId { get; private set; }
public CompanyCertificateTypeId CompanyCertificateTypeId { get; set; }
public CompanyCertificateStatusId CompanyCertificateStatusId { get; set; }
public Guid CompanyId { get; private set; }
public Guid DocumentId { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
using System.ComponentModel.DataAnnotations;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Entities;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.PortalEntities.Enums;
using System.ComponentModel.DataAnnotations;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c05",
"valid_from": "2023-06-01 00:00:00.000000 +00:00",
"valid_till": "2024-03-23 00:00:00.000000 +00:00",
"company_certificate_type_id": 1,
"company_certificate_status_id": 1,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"document_id": "5adbdf90-c6ef-47a5-b596-2f00a731c39b",
"valid_till": "2024-03-23 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand All @@ -15,11 +15,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c06",
"valid_from": "2023-06-05 00:00:00.000000 +00:00",
"valid_till": "2024-03-15 00:00:00.000000 +00:00",
"company_certificate_type_id": 2,
"company_certificate_status_id": 1,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"document_id": "e020787d-1e04-4c0b-9c06-bd1cd44724b1",
"valid_till": "2024-03-15 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand All @@ -28,11 +28,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c07",
"valid_from": "2023-06-08 00:00:00.000000 +00:00",
"valid_till": "2024-03-25 00:00:00.000000 +00:00",
"company_certificate_type_id": 3,
"company_certificate_status_id": 1,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"document_id": "5adbdf90-c6ef-47a5-b596-2f00a731c39a",
"valid_till": "2024-03-25 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand All @@ -41,11 +41,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c08",
"valid_from": "2023-06-14 00:00:00.000000 +00:00",
"valid_till": "2024-04-09 00:00:00.000000 +00:00",
"company_certificate_type_id": 4,
"company_certificate_status_id": 1,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"document_id": "3291cae8-3c7b-4862-8cec-93ea0dc8c61e",
"valid_till": "2024-04-09 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand All @@ -54,11 +54,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c09",
"valid_from": "2023-06-13 00:00:00.000000 +00:00",
"valid_till": "2024-04-22 00:00:00.000000 +00:00",
"company_certificate_type_id": 5,
"company_certificate_status_id": 1,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"document_id": "e020787d-1e04-4c0b-9c06-bd1cd44724b2",
"valid_till": "2024-04-22 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand All @@ -67,11 +67,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c10",
"valid_from": "2023-06-11 00:00:00.000000 +00:00",
"valid_till": "2024-04-23 00:00:00.000000 +00:00",
"company_certificate_type_id": 6,
"company_certificate_status_id": 1,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"document_id": "aaf53459-c36b-408e-a805-0b406ce9751f",
"valid_till": "2024-04-23 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand All @@ -80,11 +80,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c11",
"valid_from": "2023-06-11 00:00:00.000000 +00:00",
"valid_till": "2024-04-25 00:00:00.000000 +00:00",
"company_certificate_type_id": 1,
"company_certificate_status_id": 2,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"document_id": "88793f9f-c5a4-4621-847b-3d47cd839283",
"valid_till": "2024-04-25 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand All @@ -93,11 +93,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c12",
"valid_from": "2023-06-07 00:00:00.000000 +00:00",
"valid_till": "2024-04-26 00:00:00.000000 +00:00",
"company_certificate_type_id": 2,
"company_certificate_status_id": 2,
"company_id": "2dc4249f-b5ca-4d42-bef1-7a7a950a4f87",
"document_id": "88793f9f-c5a4-4621-847b-3d47cd839283",
"valid_till": "2024-04-26 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand All @@ -106,11 +106,11 @@
{
"id": "9f5b9934-4014-4099-91e9-7b1aee696c13",
"valid_from": "2023-06-07 00:00:00.000000 +00:00",
"valid_till": "2024-04-26 00:00:00.000000 +00:00",
"company_certificate_type_id": 6,
"company_certificate_status_id": 1,
"company_id": "41fd2ab8-71cd-4546-9bef-a388d91b2542",
"company_id": "ac861325-bc54-4583-bcdc-9e9f2a38ff84",
"document_id": "aaf53459-c36b-408e-a805-0b406ce9752d",
"valid_till": "2024-04-26 00:00:00.000000 +00:00",
"external_certificate_number": null,
"issuer": null,
"trust_level": null,
Expand Down

0 comments on commit f9efe8a

Please sign in to comment.