Skip to content

Commit

Permalink
feat(agreement): add AgreementLink (#223)
Browse files Browse the repository at this point in the history
- added AgreementLink to Agreement
- add AgreementLink to response of:
    - GET: api/administration/companydata/companyRolesAndConsents
    - Get: /api/registration/companyRoleAgreementData

------------

Refs: CPLP-3107
Reviewed-By: Phil Schneider <[email protected]>
  • Loading branch information
qxz2mqe authored Aug 23, 2023
1 parent 3d580e2 commit 95f4be1
Show file tree
Hide file tree
Showing 11 changed files with 7,333 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ public async IAsyncEnumerable<CompanyRoleConsentViewData> GetCompanyRoleAndConse
x.DocumentId,
x.ConsentStatus == 0
? null
: x.ConsentStatus
: x.ConsentStatus,
x.AgreementLink
))
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ public record CompanyRoleConsentViewData(
IEnumerable<ConsentAgreementViewData> Agreements
);

public record ConsentAgreementViewData(Guid AgreementId, string AgreementName, Guid? DocumentId, ConsentStatusId? ConsentStatus);
public record ConsentAgreementViewData(Guid AgreementId, string AgreementName, Guid? DocumentId, ConsentStatusId? ConsentStatus, string? AgreementLink);
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public record AgreementData(
/// </summary>
/// <param name="AgreementId">Id of the agreement</param>
/// <param name="AgreementName">Name of the agreement</param>
/// <param name="AgreementLink">Link of the agreement</param>
/// <param name="DocumentIds">Ids of the documents</param>
public record AgreementDocumentData(
[property: JsonPropertyName("agreementId")] Guid AgreementId,
[property: JsonPropertyName("name")] string AgreementName,
[property: JsonPropertyName("agreementLink")] string? AgreementLink,
[property: JsonPropertyName("documentId")] Guid? DocumentId);
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public record CompanyRoleConsentData(
IEnumerable<ConsentAgreementData> Agreements
);

public record ConsentAgreementData(Guid AgreementId, string AgreementName, Guid? DocumentId, ConsentStatusId ConsentStatus);
public record ConsentAgreementData(Guid AgreementId, string AgreementName, Guid? DocumentId, ConsentStatusId ConsentStatus, string? AgreementLink);

public record ConsentStatusDetails(Guid ConsentId, Guid AgreementId, ConsentStatusId ConsentStatusId);
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public IAsyncEnumerable<AgreementDocumentData> GetAgreementsForCompanyRolesUntra
.Select(agreement => new AgreementDocumentData(
agreement.Id,
agreement.Name,
agreement.AgreementLink,
agreement.DocumentId))
.AsAsyncEnumerable();

Expand All @@ -72,6 +73,7 @@ public IAsyncEnumerable<AgreementDocumentData> GetAgreementDataForOfferType(Offe
.Select(agreement => new AgreementDocumentData(
agreement.Id,
agreement.Name,
agreement.AgreementLink,
agreement.DocumentId
))
.AsAsyncEnumerable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ public IAsyncEnumerable<CompanyRoleConsentData> GetCompanyRoleAndConsentAgreemen
assigned.AgreementId,
assigned.Agreement!.Name,
assigned.Agreement!.DocumentId,
assigned.Agreement.Consents.Where(consent => consent.CompanyId == companyId).OrderByDescending(consent => consent.DateCreated).Select(consent => consent.ConsentStatusId).FirstOrDefault()
assigned.Agreement.Consents.Where(consent => consent.CompanyId == companyId).OrderByDescending(consent => consent.DateCreated).Select(consent => consent.ConsentStatusId).FirstOrDefault(),
assigned.Agreement.AgreementLink
))))
.AsAsyncEnumerable();

Expand Down
Loading

0 comments on commit 95f4be1

Please sign in to comment.