Skip to content

Commit

Permalink
EMBCESSMOD-5552: actual agreement date fix (#2344)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephweinkam authored Jun 12, 2024
1 parent ae5c266 commit 6d870b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ess/src/API/EMBC.ESS/Resources/Teams/Mappings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Mappings()
.ForMember(d => d.era_externalsystemtype, opts => opts.MapFrom(s => (int)ExternalSystemOptionSet.Bceid))
.ForMember(d => d.era_externalsystemusername, opts => opts.MapFrom(s => s.UserName))
.ForMember(d => d.era_electronicaccessagreementaccepteddate, opts => opts.MapFrom(s => s.AgreementSignDate.HasValue ?
s.AgreementSignDate.Value.ToPST().Date
new DateTime(s.AgreementSignDate.Value.Year, s.AgreementSignDate.Value.Month, s.AgreementSignDate.Value.Day, 0, 0, 0, 0, DateTimeKind.Utc)
: (DateTime?)null))
.ForMember(d => d.era_label, opts => opts.MapFrom(s => string.IsNullOrEmpty(s.Label) ? -1 : (int)Enum.Parse<TeamUserLabelOptionSet>(s.Label)))
.ForMember(d => d.era_role, opts => opts.MapFrom(s => string.IsNullOrEmpty(s.Role) ? (int?)null : (int)Enum.Parse<TeamUserRoleOptionSet>(s.Role)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public async Task CanCreateMember()
existingMember.ExternalUserId.ShouldBe(newMember.ExternalUserId);
existingMember.IsActive.ShouldBe(newMember.IsActive);
existingMember.LastSuccessfulLogin.ShouldBe(newMember.LastSuccessfulLogin);
existingMember.AgreementSignDate.ShouldBe(now.ToPST().Date);
existingMember.AgreementSignDate.ShouldBe(newMember.AgreementSignDate.Value.Date);
existingMember.Label.ShouldBe(newMember.Label);
existingMember.Role.ShouldBe(newMember.Role);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using EMBC.ESS.Shared.Contracts;
using EMBC.ESS.Shared.Contracts.Teams;
using EMBC.Responders.API.Services;
using EMBC.Utilities.Extensions;
using EMBC.Utilities.Messaging;
using EMBC.Utilities.Telemetry;
using Microsoft.AspNetCore.Authorization;
Expand Down Expand Up @@ -143,7 +144,7 @@ public async Task<IActionResult> SignAgreement()
}

// Set the Agreement Sign Date
currentMember.AgreementSignDate = DateTime.UtcNow;
currentMember.AgreementSignDate = DateTime.UtcNow.ToPST();

// Update current user
await messagingClient.Send(new SaveTeamMemberCommand
Expand Down

0 comments on commit 6d870b7

Please sign in to comment.