-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInvoiceData.cs
92 lines (69 loc) · 2.58 KB
/
InvoiceData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using AIDocumentPipeline.Shared.Serialization;
namespace AIDocumentPipeline.Invoices;
public class InvoiceData
{
public string? InvoiceNumber { get; set; }
public string? PurchaseOrderNumber { get; set; }
public string? CustomerName { get; set; }
public string? CustomerAddress { get; set; }
[JsonConverter(typeof(UtcDateTimeConverter))]
public DateTime? DeliveryDate { get; set; }
[JsonConverter(typeof(UtcDateTimeConverter))]
public DateTime? PayableBy { get; set; }
public IEnumerable<InvoiceDataProduct>? Products { get; set; }
public IEnumerable<InvoiceDataProduct>? Returns { get; set; }
public double? TotalQuantity { get; set; }
public double? TotalPrice { get; set; }
public IEnumerable<InvoiceDataSignature>? ProductsSignatures { get; set; }
public IEnumerable<InvoiceDataSignature>? ReturnsSignatures { get; set; }
public static InvoiceData Empty => new()
{
InvoiceNumber = string.Empty,
PurchaseOrderNumber = string.Empty,
CustomerName = string.Empty,
CustomerAddress = string.Empty,
DeliveryDate = DateTime.MinValue,
PayableBy = DateTime.MinValue,
Products =
new List<InvoiceDataProduct>
{
new()
{
Id = string.Empty,
Description = string.Empty,
UnitPrice = 0.0,
Quantity = 0.0,
Total = 0.0
}
},
Returns =
new List<InvoiceDataProduct> { new() { Id = string.Empty, Quantity = 0.0, Reason = string.Empty } },
TotalQuantity = 0,
TotalPrice = 0,
ProductsSignatures =
new List<InvoiceDataSignature>
{
new() { Type = "Customer", Name = string.Empty, IsSigned = false },
new() { Type = "Driver", Name = string.Empty, IsSigned = false }
},
ReturnsSignatures = new List<InvoiceDataSignature>
{
new() { Type = string.Empty, Name = string.Empty, IsSigned = false }
}
};
public class InvoiceDataProduct
{
public string? Id { get; set; }
public string? Description { get; set; }
public double? UnitPrice { get; set; }
public double Quantity { get; set; }
public double? Total { get; set; }
public string? Reason { get; set; }
}
public class InvoiceDataSignature
{
public string? Type { get; set; }
public string? Name { get; set; }
public bool? IsSigned { get; set; }
}
}