Merge pull request #1609 from xtuple/4_5_x
[xtuple] / node-datasource / lib / ext / models.js
1 /*jshint indent:2, curly:true, eqeqeq:true, immed:true, latedef:true,
2 newcap:true, noarg:true, regexp:true, undef:true, strict:true, trailing:true,
3 white:true*/
4 /*global SYS:true, XM:true, Backbone:true, _:true */
5
6 (function () {
7   "use strict";
8
9   /**
10     @class
11
12     @extends XM.SimpleModel
13   */
14   SYS.ClientCodeRelation = XM.SimpleModel.extend({
15
16     recordType: 'SYS.ClientCodeRelation'
17
18   });
19
20   /**
21     @class
22
23     @extends XM.SimpleModel
24   */
25   SYS.ClientCode = XM.SimpleModel.extend({
26
27     recordType: 'SYS.ClientCode'
28
29   });
30
31   SYS.CustomerEmailProfile = XM.SimpleModel.extend({
32     recordType: 'SYS.CustomerEmailProfile'
33   });
34
35   /**
36     @class
37
38     @extends XM.SimpleModel
39   */
40   SYS.Extension = XM.SimpleModel.extend({
41     recordType: 'SYS.Extension'
42   });
43
44   SYS.File = XM.SimpleModel.extend({
45     recordType: 'SYS.File'
46   });
47
48   /**
49     @class
50
51     @extends XM.SimpleModel
52   */
53   SYS.Oauth2client = XM.SimpleModel.extend({
54
55     recordType: 'SYS.Oauth2client'
56
57   });
58
59   /**
60     @class
61
62     @extends XM.SimpleModel
63   */
64   SYS.Oauth2clientRedirs = XM.SimpleModel.extend({
65
66     recordType: 'SYS.Oauth2clientRedirs'
67
68   });
69
70   /**
71     @class
72
73     @extends XM.SimpleModel
74   */
75   SYS.Oauth2token = XM.SimpleModel.extend({
76
77     recordType: 'SYS.Oauth2token'
78
79   });
80
81   SYS.ReportDefinition = XM.SimpleModel.extend({
82     recordType: 'SYS.ReportDefinition'
83   });
84
85   /**
86     @class
87
88     @extends XM.SimpleModel
89   */
90   SYS.SessionStore = XM.SimpleModel.extend({
91     /** @scope SYS.SessionStore.prototype */
92
93     recordType: 'SYS.SessionStore',
94
95     idAttribute: 'id',
96
97     autoFetchId: false
98
99   });
100
101   /**
102     @class
103
104     @extends XM.SimpleModel
105   */
106   SYS.User = XM.SimpleModel.extend({
107     /** @scope SYS.User.prototype */
108
109     recordType: 'SYS.User'
110
111   });
112
113   /**
114     @class
115
116     @extends XM.SimpleModel
117   */
118   SYS.UserAccountRole = XM.SimpleModel.extend({
119     /** @scope SYS.UserAccountRole.prototype */
120
121     recordType: 'SYS.UserAccountRole'
122
123   });
124
125   /**
126     @class
127
128     @extends XM.SimpleModel
129   */
130   SYS.CreditCard = XM.SimpleModel.extend(/** @lends SYS.CreditCard.prototype */{
131
132     recordType: 'SYS.CreditCard',
133
134     idAttribute: 'uuid'
135
136   });
137
138   /**
139     @class
140
141     @extends XM.SimpleModel
142   */
143   SYS.CreditCardPayment = XM.SimpleModel.extend(/** @lends SYS.CreditCardPayment.prototype */{
144
145     recordType: 'SYS.CreditCardPayment',
146
147     idAttribute: "id",
148
149     autoFetchId: true
150
151   });
152
153   _.extend(SYS.CreditCardPayment, {
154
155     AUTHORIZED: "A",
156
157     CAPTURE: "C",
158
159     CHARGED: "C",
160
161     CREDIT: "R",
162
163     DECLINED: "D",
164
165     ERROR: "X",
166
167     REVERSE: "V",
168
169     VOID: "V"
170
171   });
172
173
174   /**
175     @class
176
177     @extends XM.SimpleModel
178   */
179   SYS.SalesOrderPayment = XM.SimpleModel.extend(/** @lends SYS.SalesOrderPayment.prototype */{
180
181     recordType: 'SYS.SalesOrderPayment',
182
183     idAttribute: "uuid"
184
185   });
186
187   /**
188     @class
189
190     @extends XM.SimpleModel
191   */
192   SYS.Recover = XM.SimpleModel.extend(/** @lends SYS.Recover.prototype */{
193
194     recordType: 'SYS.Recover',
195
196     idAttribute: 'id'
197
198   });
199
200   // ..........................................................
201   // COLLECTIONS
202   //
203
204   /**
205     @class
206
207     @extends XM.Collection
208   */
209   SYS.ClientCodeRelationCollection = XM.Collection.extend({
210
211     model: SYS.ClientCodeRelation
212
213   });
214
215   /**
216     @class
217
218     @extends XM.Collection
219   */
220   SYS.Oauth2clientCollection = XM.Collection.extend({
221
222     model: SYS.Oauth2client
223
224   });
225
226   /**
227     @class
228
229     @extends XM.Collection
230   */
231   SYS.Oauth2clientRedirsCollection = XM.Collection.extend({
232
233     model: SYS.Oauth2clientRedirs
234
235   });
236   /**
237     @class
238
239     @extends XM.Collection
240   */
241   SYS.Oauth2tokenCollection = XM.Collection.extend({
242
243     model: SYS.Oauth2token
244
245   });
246
247   SYS.ExtensionCollection = XM.Collection.extend({
248     model: SYS.Extension
249   });
250
251   SYS.FileCollection = XM.Collection.extend({
252     model: SYS.File
253   });
254
255   /**
256     @class
257
258     @extends XM.Collection
259   */
260   SYS.UserCollection = XM.Collection.extend({
261     /** @scope SYS.UserCollection.prototype */
262
263     model: SYS.User
264
265   });
266
267   /**
268     @class
269
270     @extends XM.Collection
271   */
272   SYS.RecoverCollection = XM.Collection.extend({
273     /** @scope SYS.RecoverCollection.prototype */
274
275     model: SYS.Recover
276
277   });
278
279   SYS.ReportDefinitionCollection = XM.Collection.extend({
280
281     model: SYS.ReportDefinition
282
283   });
284 }());