Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

57382 - implement zero receipt for IT #61

Merged
merged 2 commits into from
May 15, 2023
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 @@ -7,6 +7,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="fiskaltrust.interface" Version="1.3.45" />
<PackageReference Include="fiskaltrust.interface" Version="1.3.45-ci-23135-63160" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'net6' ">
<PackageReference Include="fiskaltrust.interface" Version="1.3.45" />
<PackageReference Include="fiskaltrust.interface" Version="1.3.45-ci-23135-63160" />
<PackageReference Include="Grpc.Core" Version="2.28.1" />
<PackageReference Include="protobuf-net.Grpc.Native" Version="1.0.37" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="fiskaltrust.interface" Version="1.3.45" />
<PackageReference Include="fiskaltrust.interface" Version="1.3.45-ci-23135-63160" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="fiskaltrust.interface" Version="1.3.45" />
<PackageReference Include="fiskaltrust.interface" Version="1.3.45-ci-23135-63160" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6' ">
Expand Down
80 changes: 80 additions & 0 deletions src/fiskaltrust.ifPOS/v1/errors/SSCDErrorInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace fiskaltrust.ifPOS.v1.errors
{
/// <summary>
/// Sale items on a commercial sale document.
/// </summary>
[DataContract]
public enum SSCDErrorType
{
/// <summary>
/// General Error
/// </summary>
[EnumMember]
General = 0,
/// <summary>
/// Connection Error
/// </summary>
[EnumMember]
Connection = 1,
/// <summary>
/// Device Error
/// </summary>
[EnumMember]
Device = 2
}

/// <summary>
/// SSCDErrorInfo
/// </summary>
[DataContract]
public class SSCDErrorInfo : Exception
{
/// <summary>
/// SSCDErrorType
/// </summary>
[DataMember(Order = 10)]
public SSCDErrorType Type { get; private set; }
/// <summary>
/// SSCD Error Info
/// </summary>
[DataMember(Order = 20)]
public string Info { get; private set; }

/// <summary>
/// SSCDErrorInfo
/// </summary>
public SSCDErrorInfo(string errorInfo)
{
Info = errorInfo;
Type = SSCDErrorType.General;
}

/// <summary>
/// SSCDErrorInfo From Connection SSCDErrorType
/// </summary>
public static SSCDErrorInfo FromConnection(string errorInfo)
{
return new(errorInfo)
{
Type = SSCDErrorType.Connection
};
}

/// <summary>
/// SSCDErrorInfo From Device SSCDErrorType
/// </summary>
public static SSCDErrorInfo FromDevice(string errorInfo)
{
return new(errorInfo)
{
Type = SSCDErrorType.Device
};
}
}
}
5 changes: 3 additions & 2 deletions src/fiskaltrust.ifPOS/v1/it/Models/DailyClosingResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using fiskaltrust.ifPOS.v1.errors;
using System;
using System.Runtime.Serialization;

namespace fiskaltrust.ifPOS.v1.it
Expand All @@ -19,7 +20,7 @@ public class DailyClosingResponse
/// Information on the error, if any occurred
/// </summary>
[DataMember(Order = 20)]
public string ErrorInfo { get; set; }
public SSCDErrorInfo SSCDErrorInfo { get; set; }

/// <summary>
/// The device's current status
Expand Down
5 changes: 3 additions & 2 deletions src/fiskaltrust.ifPOS/v1/it/Models/FiscalReceiptResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using fiskaltrust.ifPOS.v1.errors;
using System;
using System.Runtime.Serialization;

namespace fiskaltrust.ifPOS.v1.it
Expand All @@ -19,7 +20,7 @@ public class FiscalReceiptResponse
/// Information on Error
/// </summary>
[DataMember(Order = 20)]
public string ErrorInfo { get; set; }
public SSCDErrorInfo SSCDErrorInfo { get; set; }

/// <summary>
/// Document datetime
Expand Down