Insane amount of refactoring of file upload; work on Expense Groups

This commit is contained in:
Rick Falkvinge
2018-02-02 15:13:16 +01:00
parent c484dc1da6
commit 11bf40c8de
21 changed files with 1097 additions and 385 deletions
+1
View File
@@ -58,6 +58,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Types\Common\BlockchainHash.cs" />
<Compile Include="Types\Financial\BasicExpenseClaimGroup.cs" />
<Compile Include="Types\Financial\BasicHotBitcoinAddress.cs" />
<Compile Include="Types\Financial\BasicHotBitcoinAddressUnspent.cs" />
<Compile Include="Types\Financial\BasicVatReport.cs" />
+4 -2
View File
@@ -8,7 +8,7 @@ namespace Swarmops.Basic.Types.Financial
/// <summary>
/// Normal constructor
/// </summary>
public BasicExpenseClaim (int expenseClaimId, int claimingPersonId, DateTime createdDateTime,
public BasicExpenseClaim (int expenseClaimId, int claimingPersonId, DateTime createdDateTime, int expenseClaimGroupId,
bool open, bool attested, bool documented, bool claimed, int organizationId,
int organizationSequenceId, int geographyId, int budgetId, DateTime expenseDate,
string description, double preApprovedAmount, Int64 amountCents, Int64 vatCents, bool repaid, bool keepSeparate)
@@ -31,13 +31,14 @@ namespace Swarmops.Basic.Types.Financial
this.VatCents = vatCents;
this.Repaid = repaid;
this.KeepSeparate = keepSeparate;
this.GroupId = expenseClaimGroupId;
}
/// <summary>
/// Copy constructor
/// </summary>
public BasicExpenseClaim (BasicExpenseClaim original)
: this (original.Identity, original.ClaimingPersonId, original.CreatedDateTime,
: this (original.Identity, original.ClaimingPersonId, original.CreatedDateTime, original.GroupId,
original.Open, original.Attested, original.Validated, original.Claimed,
original.OrganizationId, original.OrganizationSequenceId,
original.GeographyId, original.BudgetId, original.ExpenseDate, original.Description,
@@ -65,6 +66,7 @@ namespace Swarmops.Basic.Types.Financial
public bool Repaid { get; protected set; }
public bool KeepSeparate { get; protected set; }
public bool Claimed { get; protected set; }
public int GroupId { get; protected set; }
// The fields below are not just encapsulated yet
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Swarmops.Common.Enums;
using Swarmops.Common.Interfaces;
namespace Swarmops.Basic.Types.Financial
{
public class BasicExpenseClaimGroup: IHasIdentity
{
public BasicExpenseClaimGroup(int expenseClaimGroupId, DateTime createdDateTime, int createdByPersonId, bool open, ExpenseClaimGroupType groupType, string groupData)
{
this.ExpenseClaimGroupId = expenseClaimGroupId;
this.CreatedDateTime = createdDateTime;
this.CreatedByPersonId = createdByPersonId;
this.Open = open;
this.GroupType = groupType;
this.GroupData = groupData;
}
public BasicExpenseClaimGroup(BasicExpenseClaimGroup original)
: this (original.ExpenseClaimGroupId, original.CreatedDateTime, original.CreatedByPersonId, original.Open, original.GroupType, original.GroupData)
{
// copy ctor
}
public int ExpenseClaimGroupId { get; set; }
public DateTime CreatedDateTime { get; set; }
public int CreatedByPersonId { get; set; }
public bool Open { get; set; }
public ExpenseClaimGroupType GroupType { get; set; }
public string GroupData { get; set; }
public int Identity { get { return this.ExpenseClaimGroupId; } }
}
}