Skip to content

Commit

Permalink
Add TaxReductionAmounts property to TaxReduction
Browse files Browse the repository at this point in the history
ref #275
  • Loading branch information
adamelfstrom committed Sep 20, 2023
1 parent 79d7eec commit cfb2835
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
6 changes: 5 additions & 1 deletion FortnoxSDK/Entities/Tax Reductions/TaxReduction.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Fortnox.SDK.Serialization;
using Newtonsoft.Json;

Expand All @@ -7,7 +8,6 @@ namespace Fortnox.SDK.Entities;
[Entity(SingularName = "TaxReduction", PluralName = "TaxReductions")]
public class TaxReduction
{

///<summary> Direct URL to the record </summary>
[ReadOnly]
[JsonProperty("@url")]
Expand Down Expand Up @@ -80,4 +80,8 @@ public class TaxReduction
[ReadOnly]
[JsonProperty]
public string VoucherYear { get; private set; }

///<summary> List of tax reduction amounts </summary>
[JsonProperty]
public IList<TaxReductionAmount>? TaxReductionAmounts { get; set; }

Check warning on line 86 in FortnoxSDK/Entities/Tax Reductions/TaxReduction.cs

View workflow job for this annotation

GitHub Actions / build

The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
}
14 changes: 14 additions & 0 deletions FortnoxSDK/Entities/Tax Reductions/TaxReductionAmount.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Newtonsoft.Json;

namespace Fortnox.SDK.Entities;

public class TaxReductionAmount
{
///<summary> Asked amount </summary>
[JsonProperty]
public double AskedAmount { get; set; }

///<summary> Tax reduction work type </summary>
[JsonProperty]
public TaxReductionWorkType WorkType { get; set; }
}
15 changes: 15 additions & 0 deletions FortnoxSDK/Entities/Tax Reductions/TaxReductionWorkType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Runtime.Serialization;

namespace Fortnox.SDK.Entities;

public enum TaxReductionWorkType
{
[EnumMember(Value = "SOLARCELLS")]
SolarCells,

[EnumMember(Value = "STORAGESELFPRODUCEDELECTRICITY")]
StorageSelfProducedElectricity,

[EnumMember(Value = "CHARGINGSTATIONELECTRICVEHICLE")]
ChargingStationElectricVehicle
}

0 comments on commit cfb2835

Please sign in to comment.