Adding
This commit is contained in:
+10
-9
@@ -1,15 +1,16 @@
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.DataTransfer;
|
||||
|
||||
public class MemberOptInInformation
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.DataTransfer
|
||||
{
|
||||
public MemberOptInInformation(MemberOptInSettings settings, bool hasPendingUpdates)
|
||||
public class MemberOptInInformation
|
||||
{
|
||||
MemberOptinSettings = settings;
|
||||
HasPendingUpdates = hasPendingUpdates;
|
||||
}
|
||||
public MemberOptInInformation(MemberOptInSettings settings, bool hasPendingUpdates)
|
||||
{
|
||||
MemberOptinSettings = settings;
|
||||
HasPendingUpdates = hasPendingUpdates;
|
||||
}
|
||||
|
||||
public MemberOptInSettings MemberOptinSettings { get; set; }
|
||||
public bool HasPendingUpdates { get; set; }
|
||||
public MemberOptInSettings MemberOptinSettings { get; set; }
|
||||
public bool HasPendingUpdates { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+6
-5
@@ -1,9 +1,10 @@
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
|
||||
public class ApplicationUser
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public UserType UserType { get; set; }
|
||||
public class ApplicationUser
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public UserType UserType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+20
-19
@@ -1,26 +1,27 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
|
||||
public static class DeliveryPreference
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities
|
||||
{
|
||||
public const string Paper = "Paper";
|
||||
public const string Electronic = "Electronic";
|
||||
public const string Hold = "Hold";
|
||||
public const string Microfiche = "Microfiche";
|
||||
|
||||
public static string MapMailCodeToPreference(string mailCode)
|
||||
public static class DeliveryPreference
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(mailCode)) return "";
|
||||
public const string Paper = "Paper";
|
||||
public const string Electronic = "Electronic";
|
||||
public const string Hold = "Hold";
|
||||
public const string Microfiche = "Microfiche";
|
||||
|
||||
switch (mailCode)
|
||||
public static string MapMailCodeToPreference(string mailCode)
|
||||
{
|
||||
case "3":
|
||||
return DeliveryPreference.Hold;
|
||||
case "4":
|
||||
return DeliveryPreference.Microfiche;
|
||||
case "5":
|
||||
return DeliveryPreference.Electronic;
|
||||
default:
|
||||
return DeliveryPreference.Paper;
|
||||
if (string.IsNullOrWhiteSpace(mailCode)) return "";
|
||||
|
||||
switch (mailCode)
|
||||
{
|
||||
case "3":
|
||||
return DeliveryPreference.Hold;
|
||||
case "4":
|
||||
return DeliveryPreference.Microfiche;
|
||||
case "5":
|
||||
return DeliveryPreference.Electronic;
|
||||
default:
|
||||
return DeliveryPreference.Paper;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-8
@@ -2,13 +2,14 @@ using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
|
||||
public class DnaAuditProcess
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities
|
||||
{
|
||||
public int ProcessId { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public DnaAuditProcessType DnaProcessType { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
public int ConsecutiveFailures { get; set; }
|
||||
public class DnaAuditProcess
|
||||
{
|
||||
public int ProcessId { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public DnaAuditProcessType DnaProcessType { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
public int ConsecutiveFailures { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -1,8 +1,9 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
|
||||
public interface IMemberPreferences
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities
|
||||
{
|
||||
Task Add(MemberPreference preferenceChange);
|
||||
public interface IMemberPreferences
|
||||
{
|
||||
Task Add(MemberPreference preferenceChange);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-11
@@ -2,18 +2,19 @@ using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Models;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
|
||||
public class MemberPreference : Auditable
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities
|
||||
{
|
||||
public MemberPreference()
|
||||
public class MemberPreference : Auditable
|
||||
{
|
||||
}
|
||||
public MemberPreference()
|
||||
{
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
public string UserId { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public PreferenceType Preference { get; set; }
|
||||
public string Value { get; set; }
|
||||
public string LegalReference { get; set; }
|
||||
public int Id { get; set; }
|
||||
public string UserId { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public PreferenceType Preference { get; set; }
|
||||
public string Value { get; set; }
|
||||
public string LegalReference { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+9
-8
@@ -2,13 +2,14 @@ using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities;
|
||||
|
||||
public class XdiBatchItem
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public BatchState BatchState { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
public class XdiBatchItem
|
||||
{
|
||||
public string UserId { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public BatchState BatchState { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Entities
|
||||
{
|
||||
public class XdiBatchProcessInfo
|
||||
{
|
||||
[Key]
|
||||
public int XdiBatchProcessInfoId { get; set; }
|
||||
public DateTime StartTimeStamp { get; set; }
|
||||
public DateTime EndTimeStamp { get; set; }
|
||||
public XdiBatchProcessStatus XdiBatchProcessStatus { get; set; }
|
||||
public int BatchTotal { get; set; }
|
||||
public string ApiResponse { get; set; }
|
||||
}
|
||||
}
|
||||
+6
-5
@@ -1,7 +1,8 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
public enum BatchState
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums
|
||||
{
|
||||
New,
|
||||
TransferPending
|
||||
public enum BatchState
|
||||
{
|
||||
New,
|
||||
TransferPending
|
||||
}
|
||||
}
|
||||
|
||||
+7
-6
@@ -1,8 +1,9 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
public enum DnaAuditProcessType
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums
|
||||
{
|
||||
DNAAgreement,
|
||||
DNAAccounts,
|
||||
DNAOrganization
|
||||
public enum DnaAuditProcessType
|
||||
{
|
||||
DNAAgreement = 0,
|
||||
DNAAccounts = 1,
|
||||
DNAOrganization = 2
|
||||
}
|
||||
}
|
||||
|
||||
+6
-5
@@ -1,7 +1,8 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
public enum EmailStatus
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums
|
||||
{
|
||||
FailingDelivery,
|
||||
DeliveredSuccessfully
|
||||
public enum EmailStatus
|
||||
{
|
||||
FailingDelivery,
|
||||
DeliveredSuccessfully
|
||||
}
|
||||
}
|
||||
|
||||
+10
-9
@@ -1,11 +1,12 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
public enum PreferenceType
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums
|
||||
{
|
||||
ENotification,
|
||||
EStatements,
|
||||
UnifiedOptIn,
|
||||
ENotificationsEmail,
|
||||
EStatementsEmail,
|
||||
UnifiedOptInEmail
|
||||
public enum PreferenceType
|
||||
{
|
||||
ENotification,
|
||||
EStatements,
|
||||
UnifiedOptIn,
|
||||
ENotificationsEmail,
|
||||
EStatementsEmail,
|
||||
UnifiedOptInEmail
|
||||
}
|
||||
}
|
||||
|
||||
+7
-6
@@ -1,8 +1,9 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
public enum UserType
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums
|
||||
{
|
||||
Associate,
|
||||
Member,
|
||||
System
|
||||
public enum UserType
|
||||
{
|
||||
Associate,
|
||||
Member,
|
||||
System
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums
|
||||
{
|
||||
public enum XdiBatchProcessStatus
|
||||
{
|
||||
InProgress,
|
||||
Failed,
|
||||
Completed
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -1,10 +1,10 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
public enum XdiFileType
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Enums
|
||||
{
|
||||
DeleteMember,
|
||||
AddMemberElectronic,
|
||||
UpdateMemberToElectronic,
|
||||
UpdateMemberToPrint,
|
||||
UpdateMemberEmail
|
||||
public enum XdiFileType
|
||||
{
|
||||
AddMemberElectronic,
|
||||
UpdateMemberToElectronic,
|
||||
UpdateMemberToPrint,
|
||||
UpdateMemberEmail
|
||||
}
|
||||
}
|
||||
|
||||
+12
-5
@@ -1,14 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<AssemblyVersion>1.2.3</AssemblyVersion>
|
||||
<FileVersion>1.2.3</FileVersion>
|
||||
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<Version>1.0.1</Version>
|
||||
<Description>
|
||||
1.0.0 - Initial Creation.
|
||||
1.0.1 - Add XdiBatchProcessRequest.
|
||||
</Description>
|
||||
<PackageReleaseNotes>
|
||||
1.0.0 - Initial Creation.
|
||||
1.0.1 - Add XdiBatchProcessRequest.
|
||||
</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="LCU.Api.Internal.FTPLib" Version="2.2.0" />
|
||||
<PackageReference Include="LCU.Library.Internal.ApiResponse" Version="3.4.1" />
|
||||
<PackageReference Include="LCU.Library.Internal.CoreApiWrapperModel" Version="2.26.0" />
|
||||
<PackageReference Include="LCU.Library.Internal.LcuMassTransitModels" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
+12
-11
@@ -2,16 +2,17 @@ using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Models;
|
||||
|
||||
public abstract class Auditable
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Models
|
||||
{
|
||||
public string CreatedBy { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public UserType CreatedByType { get; set; }
|
||||
public string LastUpdatedBy { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public UserType LastUpdatedByType { get; set; }
|
||||
public abstract class Auditable
|
||||
{
|
||||
public string CreatedBy { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public UserType CreatedByType { get; set; }
|
||||
public string LastUpdatedBy { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public UserType LastUpdatedByType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -1,6 +1,7 @@
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Models;
|
||||
|
||||
public interface IAuditableChanges
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Models
|
||||
{
|
||||
void SystemModified(Auditable entity, string modifiedBy);
|
||||
public interface IAuditableChanges
|
||||
{
|
||||
void SystemModified(Auditable entity, string modifiedBy);
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
using LCU.Library.Internal.ApiResponse.Models;
|
||||
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Requests
|
||||
{
|
||||
public class DnaAuditProcessRequest : ReturnResponse
|
||||
{
|
||||
public DnaAuditProcessType DnaAuditProcessType { get; set; }
|
||||
public int LookBackMinutes { get; set; }
|
||||
public int NumberOfAllowedConsecutiveFailures { get; set; }
|
||||
}
|
||||
}
|
||||
+36
-35
@@ -3,56 +3,57 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Requests;
|
||||
|
||||
public class MemberOptinRequest : IValidatableObject
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Requests
|
||||
{
|
||||
[Required] public string UserId { get; set; }
|
||||
public string Email { get; set; }
|
||||
[Required] public string Value { get; set; }
|
||||
[Required] public string LegalReference { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
public class MemberOptinRequest : IValidatableObject
|
||||
{
|
||||
var results = new List<ValidationResult>();
|
||||
[Required] public string UserId { get; set; }
|
||||
public string Email { get; set; }
|
||||
[Required] public string Value { get; set; }
|
||||
[Required] public string LegalReference { get; set; }
|
||||
|
||||
if (!string.Equals(Value, DeliveryPreference.Electronic, StringComparison.InvariantCultureIgnoreCase) &&
|
||||
!string.Equals(Value, DeliveryPreference.Paper, StringComparison.InvariantCultureIgnoreCase))
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
results.Add(new ValidationResult(
|
||||
$"Invalid Option for Unified Opt-In Preference",
|
||||
new[] { "Value" }));
|
||||
}
|
||||
var results = new List<ValidationResult>();
|
||||
|
||||
if (string.Equals(Value, DeliveryPreference.Electronic, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Email))
|
||||
if (!string.Equals(Value, DeliveryPreference.Electronic, StringComparison.InvariantCultureIgnoreCase) &&
|
||||
!string.Equals(Value, DeliveryPreference.Paper, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
results.Add(new ValidationResult("Email is required when Opting in", new[] { "Email" }));
|
||||
results.Add(new ValidationResult(
|
||||
$"Invalid Option for Unified Opt-In Preference",
|
||||
new[] { "Value" }));
|
||||
}
|
||||
else
|
||||
|
||||
if (string.Equals(Value, DeliveryPreference.Electronic, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
try
|
||||
if (string.IsNullOrWhiteSpace(Email))
|
||||
{
|
||||
var unused = new System.Net.Mail.MailAddress(Email);
|
||||
results.Add(new ValidationResult("Email is required when Opting in", new[] { "Email" }));
|
||||
}
|
||||
catch
|
||||
else
|
||||
{
|
||||
results.Add(new ValidationResult("Invalid Email Format", new[] { "Email" }));
|
||||
try
|
||||
{
|
||||
var unused = new System.Net.Mail.MailAddress(Email);
|
||||
}
|
||||
catch
|
||||
{
|
||||
results.Add(new ValidationResult("Invalid Email Format", new[] { "Email" }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
public bool IsElectronicRequest()
|
||||
{
|
||||
return string.Equals(Value, DeliveryPreference.Electronic, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
public bool IsElectronicRequest()
|
||||
{
|
||||
return string.Equals(Value, DeliveryPreference.Electronic, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
public bool IsPaperRequest()
|
||||
{
|
||||
return string.Equals(Value, DeliveryPreference.Paper, StringComparison.InvariantCultureIgnoreCase);
|
||||
public bool IsPaperRequest()
|
||||
{
|
||||
return string.Equals(Value, DeliveryPreference.Paper, StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-12
@@ -2,17 +2,18 @@ using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Requests;
|
||||
|
||||
public class MemberPreferenceRequest
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Requests
|
||||
{
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
[Required]
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public PreferenceType Preference { get; set; }
|
||||
[Required]
|
||||
public string Value { get; set; }
|
||||
[Required]
|
||||
public string LegalReference { get; set; }
|
||||
public class MemberPreferenceRequest
|
||||
{
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
[Required]
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public PreferenceType Preference { get; set; }
|
||||
[Required]
|
||||
public string Value { get; set; }
|
||||
[Required]
|
||||
public string LegalReference { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
using LCU.Library.Internal.ApiResponse.Models;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Requests
|
||||
{
|
||||
public class XdiBatchProcessRequest : ReturnResponse
|
||||
{
|
||||
public string XdiAppendFileRootBasePath { get; set; }
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using LCU.Library.Internal.ApiResponse.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LCU.Library.Internal.MemberPreferencesApiModels.Responses
|
||||
{
|
||||
public class RequestResponse
|
||||
{
|
||||
public RequestResponse()
|
||||
{
|
||||
MessageStack = new List<string>();
|
||||
IsSuccessful = true;
|
||||
ReturnResponse = null;
|
||||
}
|
||||
public RequestResponse(ReturnResponse response)
|
||||
{
|
||||
MessageStack = new List<string>();
|
||||
IsSuccessful = true;
|
||||
ReturnResponse = response;
|
||||
}
|
||||
public RequestResponse(ReturnResponse response, bool success, List<string> messages)
|
||||
{
|
||||
MessageStack = messages;
|
||||
IsSuccessful = success;
|
||||
ReturnResponse = response;
|
||||
}
|
||||
|
||||
public List<string> MessageStack { get; set; }
|
||||
public bool IsSuccessful { get; set; }
|
||||
public ReturnResponse ReturnResponse { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user