Checking in types for BasicOutboundComms / -Recipients

This commit is contained in:
Rick Falkvinge
2013-06-10 20:32:42 +00:00
parent cafb5e924c
commit f15425920a
5 changed files with 154 additions and 118 deletions
+3
View File
@@ -56,7 +56,10 @@
<Compile Include="Enums\CommunicationType.cs" />
<Compile Include="Enums\ExternalActivityType.cs" />
<Compile Include="Enums\OrganizationFinancialAccountType.cs" />
<Compile Include="Enums\OutboundCommPriority.cs" />
<Compile Include="Types\BasicBallot.cs" />
<Compile Include="Types\Communications\BasicOutboundComm.cs" />
<Compile Include="Types\Communications\BasicOutboundCommRecipient.cs" />
<Compile Include="Types\Financial\BasicCashAdvance.cs" />
<Compile Include="Types\BasicCommunicationTurnaround.cs" />
<Compile Include="Types\BasicElection.cs" />
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Swarmops.Basic.Enums
{
public enum OutboundCommPriority
{
Unknown = 0,
/// <summary>
/// Priority 1 of 7 (highest).
/// </summary>
Highest = 32,
/// <summary>
/// Priority 2 of 7 (second highest).
/// </summary>
High = 64,
/// <summary>
/// Priority 3 of 7 (just above normal priority).
/// </summary>
Elevated = 96,
/// <summary>
/// Priority 4 of 7 (normal and default).
/// </summary>
Normal = 128,
/// <summary>
/// Priority 5 of 7 (just below normal priority).
/// </summary>
Lowered = 160,
/// <summary>
/// Priority 6 of 7 (second lowest).
/// </summary>
Low = 192,
/// <summary>
/// Priority 7 of 7 (lowest).
/// </summary>
Lowest = 224
}
}
@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Swarmops.Basic.Enums;
using Swarmops.Basic.Interfaces;
namespace Swarmops.Basic.Types.Communications
{
public class BasicOutboundComm: IHasIdentity
{
public BasicOutboundComm (int outboundCommId, int senderPersonId, int organizationId, DateTime createdDateTime, string resolverClass, string recipientDataXml, bool resolved, DateTime resolvedDateTime, OutboundCommPriority priority, string transmitterClass, string payloadXml,
bool open, DateTime startTransmitDateTime, DateTime closedDateTime, int recipientCount, int recipientsSuccess, int recipientsFail)
{
this.OutboundCommId = outboundCommId;
this.SenderPersonId = senderPersonId; // should we include a "fromPersonId" in basedata too, when deputies are sending on behalf of avatars?
this.OrganizationId = organizationId;
this.CreatedDateTime = createdDateTime;
this.ResolverClass = resolverClass;
this.RecipientDataXml = recipientDataXml;
this.Resolved = resolved;
this.ResolvedDateTime = resolvedDateTime;
this.Priority = priority;
this.TransmitterClass = transmitterClass;
this.PayloadXml = payloadXml;
this.Open = open;
this.StartTransmitDateTime = startTransmitDateTime;
this.ClosedDateTime = closedDateTime;
this.RecipientCount = recipientCount;
this.RecipientsSuccess = recipientsSuccess;
this.RecipeintsFail = recipientsFail;
}
public BasicOutboundComm (BasicOutboundComm original) :
this (original.OutboundCommId, original.SenderPersonId, original.OrganizationId, original.CreatedDateTime, original.ResolverClass, original.RecipientDataXml, original.Resolved, original.ResolvedDateTime, original.Priority, original.TransmitterClass, original.PayloadXml,
original.Open, original.StartTransmitDateTime, original.ClosedDateTime, original.RecipientCount, original.RecipientsSuccess, original.RecipeintsFail)
{
// copy ctor
}
public int OutboundCommId { get; private set; }
public int SenderPersonId { get; private set; }
public int OrganizationId { get; private set; }
public DateTime CreatedDateTime { get; private set; }
public string ResolverClass { get; private set; }
public string RecipientDataXml { get; private set; }
public bool Resolved { get; protected set; }
public DateTime ResolvedDateTime { get; protected set; }
public OutboundCommPriority Priority { get; private set; }
public string TransmitterClass { get; private set; }
public string PayloadXml { get; private set; }
public bool Open { get; protected set; }
public DateTime StartTransmitDateTime { get; protected set; }
public DateTime ClosedDateTime { get; protected set; }
public int RecipientCount { get; protected set; }
public int RecipientsSuccess { get; protected set; }
public int RecipeintsFail { get; protected set; }
#region Implementation of IHasIdentity
public int Identity
{
get { return this.OutboundCommId; }
}
#endregion
}
}
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Swarmops.Basic.Interfaces;
namespace Swarmops.Basic.Types.Communications
{
public class BasicOutboundCommRecipient: IHasIdentity
{
public BasicOutboundCommRecipient (int outboundCommRecipientId, int outboundCommId, int personId, bool open, bool success, string failReason)
{
this.OutboundCommRecipientId = outboundCommRecipientId;
this.OutboundCommId = outboundCommId;
this.PersonId = personId;
this.Open = open;
this.Success = success;
this.FailReason = failReason;
}
public int OutboundCommRecipientId { get; private set; }
public int OutboundCommId { get; private set; }
public int PersonId { get; private set; }
public bool Open { get; protected set; }
public bool Success { get; protected set; }
public string FailReason { get; protected set; }
#region Implementation of IHasIdentity
public int Identity
{
get { return this.OutboundCommRecipientId; }
}
#endregion
}
}