forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSampleOrderLine.cs
More file actions
152 lines (108 loc) · 2.88 KB
/
SampleOrderLine.cs
File metadata and controls
152 lines (108 loc) · 2.88 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ServiceStack.DesignPatterns.Model;
namespace ServiceStack.Common.Tests.Models
{
public class SampleOrderLine
: IHasStringId
{
public string Id { get; set; }
public string OrderUrn
{
get
{
return CreateUrn(this.UserId, this.OrderId, this.OrderLineId);
}
}
public long OrderId { get; set; }
public long OrderLineId { get; set; }
public DateTime CreatedDate { get; set; }
public Guid UserId { get; set; }
public string UserName { get; set; }
public Guid ProductId { get; set; }
public string MflowUrn { get; set; }
public string ProductType { get; set; }
public string Description { get; set; }
public string UpcEan { get; set; }
public string Isrc { get; set; }
public Guid? RecommendationUserId { get; set; }
public string RecommendationUserName { get; set; }
public string SupplierKeyName { get; set; }
public string CostTierKeyName { get; set; }
public string PriceTierKeyName { get; set; }
public decimal VatRate { get; set; }
public int ProductPriceIncVat { get; set; }
public int Quantity { get; set; }
public decimal TransactionValueExVat { get; set; }
public decimal TransactionValueIncVat { get; set; }
public decimal RecommendationDiscountRate { get; set; }
public decimal DistributionDiscountRate { get; set; }
public decimal RecommendationDiscountAccruedExVat { get; set; }
public decimal DistributionDiscountAccruedExVat { get; set; }
public decimal PromoMix { get; set; }
public decimal DiscountMix { get; set; }
public decimal CashMix { get; set; }
public decimal PromoMixValueExVat { get; set; }
public decimal DiscountMixValueExVat { get; set; }
public decimal CashMixValueIncVat { get; set; }
public string ContentUrn
{
get { return this.MflowUrn; }
set { this.MflowUrn = value; }
}
public string TrackUrn
{
get;
set;
}
public string Title
{
get;
set;
}
public string ArtistUrn
{
get;
set;
}
public string ArtistName
{
get;
set;
}
public string AlbumUrn
{
get;
set;
}
public string AlbumName
{
get;
set;
}
public static string CreateUrn(Guid userId, long orderId, long orderLineId)
{
return string.Format("urn:orderline:{0}/{1}/{2}",
userId.ToString("N"), orderId, orderLineId);
}
public static SampleOrderLine Create(Guid userId)
{
return Create(userId, 1, 1);
}
public static SampleOrderLine Create(Guid userId, int orderId, int orderLineId)
{
return new SampleOrderLine {
Id = CreateUrn(userId, orderId, orderLineId),
CreatedDate = DateTime.Now,
OrderId = orderId,
OrderLineId = orderLineId,
AlbumName = "AlbumName",
CashMixValueIncVat = 0.79m / 1.15m,
TransactionValueExVat = 0.79m,
ContentUrn = "urn:content:" + Guid.NewGuid().ToString("N"),
};
}
}
}