Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Chore/change to ignore reservation #326

Merged
merged 6 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ private MultipartFormDataContent CorrespondenceToFormData(BaseCorrespondenceExt
{ new StringContent(correspondence.Content.MessageSummary), "correspondence.content.MessageSummary" },
{ new StringContent(correspondence.Content.MessageBody), "correspondence.content.MessageBody" },
{ new StringContent(correspondence.Content.Language), "correspondence.content.Language" },
{ new StringContent((correspondence.IsReservable ?? false).ToString()), "correspondence.isReservable" },
{ new StringContent((correspondence.IgnoreReservation ?? false).ToString()), "correspondence.IgnoreReservation" },
};
if (correspondence.Notification != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public CorrespondenceBuilder CreateCorrespondence()
{"culpa_852", "2"},
{"anim5", "3"}
},
IsReservable = true
IgnoreReservation = false
},
Recipients = new List<string>(){
"0192:991825827", // org number
Expand Down

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions altinn-correspondence-postman-collection.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions altinn-correspondence-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
"$ref": "#/components/schemas/InitializeCorrespondenceNotificationExt"
}
},
"Correspondence.IsReservable": {
"Correspondence.IgnoreReservation": {
"type": "boolean"
},
"Recipients": {
Expand Down Expand Up @@ -432,7 +432,7 @@
"Correspondence.Notifications": {
"style": "form"
},
"Correspondence.IsReservable": {
"Correspondence.IgnoreReservation": {
"style": "form"
},
"Recipients": {
Expand Down Expand Up @@ -998,7 +998,7 @@
},
"nullable": true
},
"isReservable": {
"IgnoreReservation": {
"type": "boolean",
"nullable": true
}
Expand Down Expand Up @@ -1197,7 +1197,7 @@
},
"nullable": true
},
"isReservable": {
"IgnoreReservation": {
"type": "boolean",
"nullable": true
},
Expand Down Expand Up @@ -1386,7 +1386,7 @@
},
"nullable": true
},
"isReservable": {
"IgnoreReservation": {
"type": "boolean",
"nullable": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal static CorrespondenceDetailsExt MapToExternal(GetCorrespondenceDetailsR
ExternalReferences = correspondenceDetails.ExternalReferences != null ? ExternalReferenceMapper.MapListToExternal(correspondenceDetails.ExternalReferences) : new List<ExternalReferenceExt>(),
ResourceId = correspondenceDetails.ResourceId.ToString(),
VisibleFrom = correspondenceDetails.VisibleFrom,
IsReservable = correspondenceDetails.IsReservable,
IgnoreReservation = correspondenceDetails.IgnoreReservation,
MarkedUnread = correspondenceDetails.MarkedUnread,
AllowSystemDeleteAfter = correspondenceDetails.AllowSystemDeleteAfter,
DueDateTime = correspondenceDetails.DueDateTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal static CorrespondenceOverviewExt MapToExternal(GetCorrespondenceOvervie
AllowSystemDeleteAfter = correspondenceOverview.AllowSystemDeleteAfter,
DueDateTime = correspondenceOverview.DueDateTime,
PropertyList = correspondenceOverview.PropertyList,
IsReservable = correspondenceOverview.IsReservable
IgnoreReservation = correspondenceOverview.IgnoreReservation
};
return Correspondence;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal static InitializeCorrespondencesRequest MapToRequest(BaseCorrespondence
DueDateTime = initializeCorrespondenceExt.DueDateTime,
PropertyList = initializeCorrespondenceExt.PropertyList,
ReplyOptions = initializeCorrespondenceExt.ReplyOptions != null ? CorrespondenceReplyOptionsMapper.MapListToEntities(initializeCorrespondenceExt.ReplyOptions) : new List<CorrespondenceReplyOptionEntity>(),
IsReservable = initializeCorrespondenceExt.IsReservable,
IgnoreReservation = initializeCorrespondenceExt.IgnoreReservation,
ExternalReferences = initializeCorrespondenceExt.ExternalReferences != null ? ExternalReferenceMapper.MapListToEntities(initializeCorrespondenceExt.ExternalReferences) : new List<ExternalReferenceEntity>(),
Statuses = new List<CorrespondenceStatusEntity>(),
Created = DateTimeOffset.UtcNow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal static MigrateCorrespondenceRequest MapToRequest(MigrateCorrespondenceE
DueDateTime = migrateCorrespondenceExt.CorrespondenceData.Correspondence.DueDateTime,
PropertyList = migrateCorrespondenceExt.CorrespondenceData.Correspondence.PropertyList,
ReplyOptions = migrateCorrespondenceExt.CorrespondenceData.Correspondence.ReplyOptions != null ? CorrespondenceReplyOptionsMapper.MapListToEntities(migrateCorrespondenceExt.CorrespondenceData.Correspondence.ReplyOptions) : new List<CorrespondenceReplyOptionEntity>(),
IsReservable = migrateCorrespondenceExt.CorrespondenceData.Correspondence.IsReservable,
IgnoreReservation = migrateCorrespondenceExt.CorrespondenceData.Correspondence.IgnoreReservation,
ExternalReferences = migrateCorrespondenceExt.CorrespondenceData.Correspondence.ExternalReferences != null ? ExternalReferenceMapper.MapListToEntities(migrateCorrespondenceExt.CorrespondenceData.Correspondence.ExternalReferences) : new List<ExternalReferenceEntity>(),
Created = DateTimeOffset.UtcNow,
Content = migrateCorrespondenceExt.CorrespondenceData.Correspondence.Content != null ? new CorrespondenceContentEntity
Expand Down
4 changes: 2 additions & 2 deletions src/Altinn.Correspondence.API/Models/BaseCorrespondenceExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public class BaseCorrespondenceExt
/// <summary>
/// Specifies whether the correspondence can override reservation against digital comminication in KRR
/// </summary>
[JsonPropertyName("isReservable")]
public bool? IsReservable { get; set; }
[JsonPropertyName("IgnoreReservation")]
public bool? IgnoreReservation { get; set; }
}

[AttributeUsage(AttributeTargets.Property)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ await _correspondenceStatusRepository.AddCorrespondenceStatus(new Correspondence
ExternalReferences = correspondence.ExternalReferences ?? new List<ExternalReferenceEntity>(),
ResourceId = correspondence.ResourceId,
VisibleFrom = correspondence.VisibleFrom,
IsReservable = correspondence.IsReservable == null || correspondence.IsReservable.Value,
IgnoreReservation = correspondence.IgnoreReservation ?? false,
MarkedUnread = correspondence.MarkedUnread,
AllowSystemDeleteAfter = correspondence.AllowSystemDeleteAfter,
DueDateTime = correspondence.DueDateTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class GetCorrespondenceDetailsResponse

public DateTimeOffset VisibleFrom { get; set; }

public bool IsReservable { get; set; }
public bool IgnoreReservation { get; set; }

public bool? MarkedUnread { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ await _correspondenceStatusRepository.AddCorrespondenceStatus(new Correspondence
Notifications = correspondence.Notifications ?? new List<CorrespondenceNotificationEntity>(),
ExternalReferences = correspondence.ExternalReferences ?? new List<ExternalReferenceEntity>(),
VisibleFrom = correspondence.VisibleFrom,
IsReservable = correspondence.IsReservable == null || correspondence.IsReservable.Value,
IgnoreReservation = correspondence.IgnoreReservation ?? false,
MarkedUnread = correspondence.MarkedUnread,
AllowSystemDeleteAfter = correspondence.AllowSystemDeleteAfter,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class GetCorrespondenceOverviewResponse

public DateTimeOffset VisibleFrom { get; set; }

public bool IsReservable { get; set; }
public bool IgnoreReservation { get; set; }

public bool? MarkedUnread { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public async Task<OneOf<InitializeCorrespondencesResponse, Error>> Process(Initi
DueDateTime = request.Correspondence.DueDateTime,
PropertyList = request.Correspondence.PropertyList.ToDictionary(x => x.Key, x => x.Value),
ReplyOptions = request.Correspondence.ReplyOptions,
IsReservable = request.Correspondence.IsReservable,
IgnoreReservation = request.Correspondence.IgnoreReservation,
Statuses = new List<CorrespondenceStatusEntity>(){
new CorrespondenceStatusEntity
{
Expand Down Expand Up @@ -263,7 +263,7 @@ private List<NotificationOrderRequest> CreateNotifications(NotificationRequest n
}
var notificationOrder = new NotificationOrderRequest
{
IgnoreReservation = !correspondence.IsReservable,
IgnoreReservation = correspondence.IgnoreReservation,
Recipients = new List<Recipient>{
new Recipient{
OrganizationNumber = orgNr,
Expand All @@ -290,7 +290,7 @@ private List<NotificationOrderRequest> CreateNotifications(NotificationRequest n
{
notifications.Add(new NotificationOrderRequest
{
IgnoreReservation = !correspondence.IsReservable,
IgnoreReservation = correspondence.IgnoreReservation,
Recipients = new List<Recipient>{
new Recipient{
OrganizationNumber = orgNr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class CorrespondenceEntity
[MaxLength(6, ErrorMessage = "Notifications can contain at most 6 notifcations")]
public List<CorrespondenceNotificationEntity> Notifications { get; set; } = new List<CorrespondenceNotificationEntity>();

public bool? IsReservable { get; set; }
public bool? IgnoreReservation { get; set; }

public bool? MarkedUnread { get; set; }

Expand Down
Loading
Loading