-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathModels.cs
More file actions
190 lines (158 loc) · 5.33 KB
/
Models.cs
File metadata and controls
190 lines (158 loc) · 5.33 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
using System;
using ServiceStack;
using ServiceStack.DataAnnotations;
namespace Chinook.ServiceModel.Types;
[Icon(Svg = Icons.Albums)]
public class Albums
{
[AutoIncrement]
public long AlbumId { get; set; }
[Required]
[Format(Method = "stylize", Options = "{cls:'text-rose-500'}")]
public string Title { get; set; }
[Ref(Model = nameof(Artists), RefId = nameof(ArtistId), RefLabel = nameof(Artists.Name))]
public long ArtistId { get; set; }
}
[Icon(Svg = Icons.Artists)]
public class Artists
{
[AutoIncrement]
public long ArtistId { get; set; }
public string Name { get; set; }
}
[Icon(Svg = Icons.Customers)]
public class Customers
{
[AutoIncrement]
public long CustomerId { get; set; }
[Computed]
public string DisplayName => FirstName + " " + LastName;
[Required]
public string FirstName { get; set; }
[Required]
public string LastName { get; set; }
[Ref(Model = nameof(Employees), RefId = nameof(Employees.EmployeeId), RefLabel = nameof(Employees.LastName))]
public long? SupportRepId { get; set; }
public string Company { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
public string PostalCode { get; set; }
[Format(FormatMethods.LinkPhone)]
public string Phone { get; set; }
[Format(FormatMethods.LinkPhone)]
public string Fax { get; set; }
[Required]
[Format(FormatMethods.LinkEmail)]
public string Email { get; set; }
}
[Icon(Svg = Icons.Employees)]
public class Employees
{
[AutoIncrement]
public long EmployeeId { get; set; }
[Required]
public string LastName { get; set; }
[Required]
public string FirstName { get; set; }
public string Title { get; set; }
[Ref(Model = nameof(Employees), RefId = nameof(EmployeeId), RefLabel = nameof(LastName))]
public long? ReportsTo { get; set; }
public DateTime? BirthDate { get; set; }
public DateTime? HireDate { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
public string PostalCode { get; set; }
[Format(FormatMethods.LinkPhone)]
public string Phone { get; set; }
[Format(FormatMethods.LinkPhone)]
public string Fax { get; set; }
[Format(FormatMethods.LinkEmail, Options = "{subject:'Call Help Desk'}")]
public string Email { get; set; }
}
[Icon(Svg = Icons.Genres)]
public class Genres
{
[AutoIncrement]
public long GenreId { get; set; }
public string Name { get; set; }
}
[Icon(Svg = Icons.InvoiceItems)]
[Alias("invoice_items")]
public class InvoiceItems
{
[AutoIncrement]
public long InvoiceLineId { get; set; }
[Ref(Model = nameof(Invoices), RefId = nameof(InvoiceId), RefLabel = nameof(Invoices.BillingAddress))]
public long InvoiceId { get; set; }
[Ref(Model = nameof(Tracks), RefId = nameof(TrackId), RefLabel = nameof(Tracks.Name))]
public long TrackId { get; set; }
[Format(FormatMethods.Currency)]
public decimal UnitPrice { get; set; }
public long Quantity { get; set; }
}
[Icon(Svg = Icons.Invoices)]
public class Invoices
{
[AutoIncrement]
public long InvoiceId { get; set; }
[Ref(Model = nameof(Customers), RefId = nameof(CustomerId), RefLabel = nameof(Customers.DisplayName))]
public long CustomerId { get; set; }
public DateTime InvoiceDate { get; set; }
[Format(FormatMethods.Currency)]
public decimal Total { get; set; }
public string BillingAddress { get; set; }
public string BillingCity { get; set; }
public string BillingState { get; set; }
public string BillingCountry { get; set; }
public string BillingPostalCode { get; set; }
}
[Icon(Svg = Icons.MediaTypes)]
[Alias("media_types")]
public class MediaTypes
{
[AutoIncrement]
public long MediaTypeId { get; set; }
public string Name { get; set; }
}
[Icon(Svg = Icons.Playlists)]
public class Playlists
{
[AutoIncrement]
public long PlaylistId { get; set; }
public string Name { get; set; }
}
[Icon(Svg = Icons.Tracks)]
public class Tracks
{
[AutoIncrement]
public long TrackId { get; set; }
[Required]
[Format(Method = "stylize", Options = "{cls:'text-rose-500'}")]
public string Name { get; set; }
[Ref(Model = nameof(Albums), RefId = nameof(AlbumId), RefLabel = nameof(Albums.Title))]
[References(typeof(Albums))]
public long? AlbumId { get; set; }
[Ref(Model = nameof(MediaTypes), RefId = nameof(MediaTypeId), RefLabel = nameof(Name))]
[References(typeof(MediaTypes))]
public long MediaTypeId { get; set; }
[Ref(Model = nameof(Genres), RefId = nameof(GenreId), RefLabel = nameof(Name))]
[References(typeof(Genres))]
public long? GenreId { get; set; }
public string Composer { get; set; }
[IntlDateTime(Minute = DatePart.Digits2, Second = DatePart.Digits2, FractionalSecondDigits = 3)]
public long Milliseconds { get; set; }
[Format(FormatMethods.Bytes)]
public long? Bytes { get; set; }
[IntlNumber(Currency = NumberCurrency.USD)]
public decimal UnitPrice { get; set; }
[Reference]
public Albums Album { get; set; }
[Reference]
public MediaTypes MediaType { get; set; }
[Reference]
public Genres Genre { get; set; }
}