@aiao/rxdb-test 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/FileLarge.d.ts +339 -0
- package/dist/entities/FileLarge.js +77 -0
- package/dist/entities/FileNode.d.ts +335 -0
- package/dist/entities/FileNode.js +77 -0
- package/dist/entities/MenuLarge.d.ts +294 -0
- package/dist/entities/MenuLarge.js +41 -0
- package/dist/entities/MenuSimple.d.ts +290 -0
- package/dist/entities/MenuSimple.js +41 -0
- package/dist/entities/Todo.d.ts +165 -0
- package/dist/entities/Todo.js +34 -0
- package/dist/entities/TypeDemo.d.ts +264 -0
- package/dist/entities/TypeDemo.js +101 -0
- package/dist/entities/index.d.ts +14 -1655
- package/dist/entities/index.js +6 -360
- package/dist/graph/index.d.ts +1 -2
- package/dist/graph/index.js +1 -1
- package/dist/shop/Attribute.d.ts +359 -0
- package/dist/shop/Attribute.js +50 -0
- package/dist/shop/AttributeValue.d.ts +366 -0
- package/dist/shop/AttributeValue.js +51 -0
- package/dist/shop/Category.d.ts +280 -0
- package/dist/shop/Category.js +41 -0
- package/dist/shop/IdCard.d.ts +237 -0
- package/dist/shop/IdCard.js +43 -0
- package/dist/shop/Order.d.ts +270 -0
- package/dist/shop/Order.js +58 -0
- package/dist/shop/OrderItem.d.ts +293 -0
- package/dist/shop/OrderItem.js +64 -0
- package/dist/shop/Product.d.ts +321 -0
- package/dist/shop/Product.js +47 -0
- package/dist/shop/SKU.d.ts +343 -0
- package/dist/shop/SKU.js +63 -0
- package/dist/shop/SKUAttributes.d.ts +306 -0
- package/dist/shop/SKUAttributes.js +56 -0
- package/dist/shop/User.d.ts +269 -0
- package/dist/shop/User.js +74 -0
- package/dist/shop/index.d.ts +22 -2980
- package/dist/shop/index.js +10 -528
- package/dist/system/RxDBBranch.d.ts +396 -0
- package/dist/system/RxDBBranch.js +106 -0
- package/dist/system/RxDBChange.d.ts +361 -0
- package/dist/system/RxDBChange.js +123 -0
- package/dist/system/RxDBMigration.d.ts +167 -0
- package/dist/system/RxDBMigration.js +40 -0
- package/dist/system/RxDBSync.d.ts +339 -0
- package/dist/system/RxDBSync.js +122 -0
- package/dist/system/index.d.ts +9 -1240
- package/dist/system/index.js +4 -384
- package/package.json +3 -3
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityBase, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, IEntity, ITreeEntity, NumberRules, RelationDateRules, RelationEntitiesObservable, RelationEntityObservable, RelationExistsRules, RelationStringRules, RelationUUIDRules, RuleGroupBase, StringRules, UUID, UUIDRules } from '@aiao/rxdb';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* rule
|
|
6
|
+
*/
|
|
7
|
+
declare type SKURule = UUIDRules<SKU, 'id'>
|
|
8
|
+
| DateRules<SKU, 'createdAt'>
|
|
9
|
+
| DateRules<SKU, 'updatedAt'>
|
|
10
|
+
| StringRules<SKU, 'createdBy'>
|
|
11
|
+
| StringRules<SKU, 'updatedBy'>
|
|
12
|
+
| StringRules<SKU, 'code'>
|
|
13
|
+
| NumberRules<SKU, 'price'>
|
|
14
|
+
| NumberRules<SKU, 'stock'>
|
|
15
|
+
| UUIDRules<SKU, 'productId'>
|
|
16
|
+
| RelationExistsRules<'attributes', SKUAttributesRuleGroup>
|
|
17
|
+
| RelationUUIDRules<'attributes.id', UUID>
|
|
18
|
+
| RelationDateRules<'attributes.createdAt', Date>
|
|
19
|
+
| RelationDateRules<'attributes.updatedAt', Date>
|
|
20
|
+
| RelationStringRules<'attributes.createdBy', string | null>
|
|
21
|
+
| RelationStringRules<'attributes.updatedBy', string | null>
|
|
22
|
+
| UUIDRules<SKUAttributes, 'skuId'>
|
|
23
|
+
| UUIDRules<SKUAttributes, 'attributeId'>
|
|
24
|
+
| UUIDRules<SKUAttributes, 'valueId'>
|
|
25
|
+
| RelationUUIDRules<'attributes.attribute.id', UUID>
|
|
26
|
+
| RelationDateRules<'attributes.attribute.createdAt', Date>
|
|
27
|
+
| RelationDateRules<'attributes.attribute.updatedAt', Date>
|
|
28
|
+
| RelationStringRules<'attributes.attribute.createdBy', string | null>
|
|
29
|
+
| RelationStringRules<'attributes.attribute.updatedBy', string | null>
|
|
30
|
+
| RelationStringRules<'attributes.attribute.name', string>
|
|
31
|
+
| RelationUUIDRules<'attributes.attribute.values.id', UUID>
|
|
32
|
+
| RelationDateRules<'attributes.attribute.values.createdAt', Date>
|
|
33
|
+
| RelationDateRules<'attributes.attribute.values.updatedAt', Date>
|
|
34
|
+
| RelationStringRules<'attributes.attribute.values.createdBy', string | null>
|
|
35
|
+
| RelationStringRules<'attributes.attribute.values.updatedBy', string | null>
|
|
36
|
+
| RelationStringRules<'attributes.attribute.values.name', string>
|
|
37
|
+
| UUIDRules<AttributeValue, 'attributeId'>
|
|
38
|
+
| RelationUUIDRules<'attributes.attribute.values.skuAttributeValues.id', UUID>
|
|
39
|
+
| RelationDateRules<'attributes.attribute.values.skuAttributeValues.createdAt', Date>
|
|
40
|
+
| RelationDateRules<'attributes.attribute.values.skuAttributeValues.updatedAt', Date>
|
|
41
|
+
| RelationStringRules<'attributes.attribute.values.skuAttributeValues.createdBy', string | null>
|
|
42
|
+
| RelationStringRules<'attributes.attribute.values.skuAttributeValues.updatedBy', string | null>
|
|
43
|
+
| RelationUUIDRules<'attributes.attribute.skuAttributes.id', UUID>
|
|
44
|
+
| RelationDateRules<'attributes.attribute.skuAttributes.createdAt', Date>
|
|
45
|
+
| RelationDateRules<'attributes.attribute.skuAttributes.updatedAt', Date>
|
|
46
|
+
| RelationStringRules<'attributes.attribute.skuAttributes.createdBy', string | null>
|
|
47
|
+
| RelationStringRules<'attributes.attribute.skuAttributes.updatedBy', string | null>
|
|
48
|
+
| RelationUUIDRules<'attributes.value.id', UUID>
|
|
49
|
+
| RelationDateRules<'attributes.value.createdAt', Date>
|
|
50
|
+
| RelationDateRules<'attributes.value.updatedAt', Date>
|
|
51
|
+
| RelationStringRules<'attributes.value.createdBy', string | null>
|
|
52
|
+
| RelationStringRules<'attributes.value.updatedBy', string | null>
|
|
53
|
+
| RelationStringRules<'attributes.value.name', string>
|
|
54
|
+
| RelationUUIDRules<'attributes.value.attribute.id', UUID>
|
|
55
|
+
| RelationDateRules<'attributes.value.attribute.createdAt', Date>
|
|
56
|
+
| RelationDateRules<'attributes.value.attribute.updatedAt', Date>
|
|
57
|
+
| RelationStringRules<'attributes.value.attribute.createdBy', string | null>
|
|
58
|
+
| RelationStringRules<'attributes.value.attribute.updatedBy', string | null>
|
|
59
|
+
| RelationStringRules<'attributes.value.attribute.name', string>
|
|
60
|
+
| RelationUUIDRules<'attributes.value.attribute.values.id', UUID>
|
|
61
|
+
| RelationDateRules<'attributes.value.attribute.values.createdAt', Date>
|
|
62
|
+
| RelationDateRules<'attributes.value.attribute.values.updatedAt', Date>
|
|
63
|
+
| RelationStringRules<'attributes.value.attribute.values.createdBy', string | null>
|
|
64
|
+
| RelationStringRules<'attributes.value.attribute.values.updatedBy', string | null>
|
|
65
|
+
| RelationStringRules<'attributes.value.attribute.values.name', string>
|
|
66
|
+
| RelationUUIDRules<'attributes.value.attribute.skuAttributes.id', UUID>
|
|
67
|
+
| RelationDateRules<'attributes.value.attribute.skuAttributes.createdAt', Date>
|
|
68
|
+
| RelationDateRules<'attributes.value.attribute.skuAttributes.updatedAt', Date>
|
|
69
|
+
| RelationStringRules<'attributes.value.attribute.skuAttributes.createdBy', string | null>
|
|
70
|
+
| RelationStringRules<'attributes.value.attribute.skuAttributes.updatedBy', string | null>
|
|
71
|
+
| RelationUUIDRules<'attributes.value.skuAttributeValues.id', UUID>
|
|
72
|
+
| RelationDateRules<'attributes.value.skuAttributeValues.createdAt', Date>
|
|
73
|
+
| RelationDateRules<'attributes.value.skuAttributeValues.updatedAt', Date>
|
|
74
|
+
| RelationStringRules<'attributes.value.skuAttributeValues.createdBy', string | null>
|
|
75
|
+
| RelationStringRules<'attributes.value.skuAttributeValues.updatedBy', string | null>
|
|
76
|
+
| RelationExistsRules<'product', ProductRuleGroup>
|
|
77
|
+
| RelationUUIDRules<'product.id', UUID>
|
|
78
|
+
| RelationDateRules<'product.createdAt', Date>
|
|
79
|
+
| RelationDateRules<'product.updatedAt', Date>
|
|
80
|
+
| RelationStringRules<'product.createdBy', string | null>
|
|
81
|
+
| RelationStringRules<'product.updatedBy', string | null>
|
|
82
|
+
| RelationStringRules<'product.name', string>
|
|
83
|
+
| RelationStringRules<'product.description', string | null>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* RuleGroupBase
|
|
87
|
+
*/
|
|
88
|
+
export declare type SKURuleGroup = RuleGroupBase<typeof SKU,
|
|
89
|
+
|'id'
|
|
90
|
+
|'createdAt'
|
|
91
|
+
|'updatedAt'
|
|
92
|
+
|'createdBy'
|
|
93
|
+
|'updatedBy'
|
|
94
|
+
|'code'
|
|
95
|
+
|'price'
|
|
96
|
+
|'stock'
|
|
97
|
+
|'productId'
|
|
98
|
+
|'attributes'
|
|
99
|
+
|'attributes.id'
|
|
100
|
+
|'attributes.createdAt'
|
|
101
|
+
|'attributes.updatedAt'
|
|
102
|
+
|'attributes.createdBy'
|
|
103
|
+
|'attributes.updatedBy'
|
|
104
|
+
|'skuId'
|
|
105
|
+
|'attributeId'
|
|
106
|
+
|'valueId'
|
|
107
|
+
|'attributes.attribute.id'
|
|
108
|
+
|'attributes.attribute.createdAt'
|
|
109
|
+
|'attributes.attribute.updatedAt'
|
|
110
|
+
|'attributes.attribute.createdBy'
|
|
111
|
+
|'attributes.attribute.updatedBy'
|
|
112
|
+
|'attributes.attribute.name'
|
|
113
|
+
|'attributes.attribute.values.id'
|
|
114
|
+
|'attributes.attribute.values.createdAt'
|
|
115
|
+
|'attributes.attribute.values.updatedAt'
|
|
116
|
+
|'attributes.attribute.values.createdBy'
|
|
117
|
+
|'attributes.attribute.values.updatedBy'
|
|
118
|
+
|'attributes.attribute.values.name'
|
|
119
|
+
|'attributeId'
|
|
120
|
+
|'attributes.attribute.values.skuAttributeValues.id'
|
|
121
|
+
|'attributes.attribute.values.skuAttributeValues.createdAt'
|
|
122
|
+
|'attributes.attribute.values.skuAttributeValues.updatedAt'
|
|
123
|
+
|'attributes.attribute.values.skuAttributeValues.createdBy'
|
|
124
|
+
|'attributes.attribute.values.skuAttributeValues.updatedBy'
|
|
125
|
+
|'skuId'
|
|
126
|
+
|'attributeId'
|
|
127
|
+
|'valueId'
|
|
128
|
+
|'attributes.attribute.skuAttributes.id'
|
|
129
|
+
|'attributes.attribute.skuAttributes.createdAt'
|
|
130
|
+
|'attributes.attribute.skuAttributes.updatedAt'
|
|
131
|
+
|'attributes.attribute.skuAttributes.createdBy'
|
|
132
|
+
|'attributes.attribute.skuAttributes.updatedBy'
|
|
133
|
+
|'skuId'
|
|
134
|
+
|'attributeId'
|
|
135
|
+
|'valueId'
|
|
136
|
+
|'attributes.value.id'
|
|
137
|
+
|'attributes.value.createdAt'
|
|
138
|
+
|'attributes.value.updatedAt'
|
|
139
|
+
|'attributes.value.createdBy'
|
|
140
|
+
|'attributes.value.updatedBy'
|
|
141
|
+
|'attributes.value.name'
|
|
142
|
+
|'attributeId'
|
|
143
|
+
|'attributes.value.attribute.id'
|
|
144
|
+
|'attributes.value.attribute.createdAt'
|
|
145
|
+
|'attributes.value.attribute.updatedAt'
|
|
146
|
+
|'attributes.value.attribute.createdBy'
|
|
147
|
+
|'attributes.value.attribute.updatedBy'
|
|
148
|
+
|'attributes.value.attribute.name'
|
|
149
|
+
|'attributes.value.attribute.values.id'
|
|
150
|
+
|'attributes.value.attribute.values.createdAt'
|
|
151
|
+
|'attributes.value.attribute.values.updatedAt'
|
|
152
|
+
|'attributes.value.attribute.values.createdBy'
|
|
153
|
+
|'attributes.value.attribute.values.updatedBy'
|
|
154
|
+
|'attributes.value.attribute.values.name'
|
|
155
|
+
|'attributeId'
|
|
156
|
+
|'attributes.value.attribute.skuAttributes.id'
|
|
157
|
+
|'attributes.value.attribute.skuAttributes.createdAt'
|
|
158
|
+
|'attributes.value.attribute.skuAttributes.updatedAt'
|
|
159
|
+
|'attributes.value.attribute.skuAttributes.createdBy'
|
|
160
|
+
|'attributes.value.attribute.skuAttributes.updatedBy'
|
|
161
|
+
|'skuId'
|
|
162
|
+
|'attributeId'
|
|
163
|
+
|'valueId'
|
|
164
|
+
|'attributes.value.skuAttributeValues.id'
|
|
165
|
+
|'attributes.value.skuAttributeValues.createdAt'
|
|
166
|
+
|'attributes.value.skuAttributeValues.updatedAt'
|
|
167
|
+
|'attributes.value.skuAttributeValues.createdBy'
|
|
168
|
+
|'attributes.value.skuAttributeValues.updatedBy'
|
|
169
|
+
|'skuId'
|
|
170
|
+
|'attributeId'
|
|
171
|
+
|'valueId'
|
|
172
|
+
|'product'
|
|
173
|
+
|'product.id'
|
|
174
|
+
|'product.createdAt'
|
|
175
|
+
|'product.updatedAt'
|
|
176
|
+
|'product.createdBy'
|
|
177
|
+
|'product.updatedBy'
|
|
178
|
+
|'product.name'
|
|
179
|
+
|'product.description',
|
|
180
|
+
SKURule>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* OrderByField
|
|
184
|
+
*/
|
|
185
|
+
declare type SKUOrderByField = "id" | "createdAt" | "updatedAt" | "createdBy" | "updatedBy" | "code" | "price" | "stock";
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 静态类型
|
|
189
|
+
*/
|
|
190
|
+
export interface SKUStaticTypes {
|
|
191
|
+
/**
|
|
192
|
+
* id 类型
|
|
193
|
+
*/
|
|
194
|
+
idType: UUID;
|
|
195
|
+
/**
|
|
196
|
+
* 查询选项
|
|
197
|
+
*/
|
|
198
|
+
getOptions: UUID;
|
|
199
|
+
/**
|
|
200
|
+
* 查询选项
|
|
201
|
+
*/
|
|
202
|
+
findOneOrFailOptions: FindOneOrFailOptions<typeof SKU,SKURuleGroup,SKUOrderByField>;
|
|
203
|
+
/**
|
|
204
|
+
* 查询选项
|
|
205
|
+
*/
|
|
206
|
+
findOptions: FindOptions<typeof SKU,SKURuleGroup,SKUOrderByField>;
|
|
207
|
+
/**
|
|
208
|
+
* 查询选项
|
|
209
|
+
*/
|
|
210
|
+
findOneOptions: FindOneOptions<typeof SKU,SKURuleGroup,SKUOrderByField>;
|
|
211
|
+
/**
|
|
212
|
+
* 查询选项
|
|
213
|
+
*/
|
|
214
|
+
findAllOptions: FindAllOptions<typeof SKU,SKURuleGroup,SKUOrderByField>;
|
|
215
|
+
/**
|
|
216
|
+
* 查询选项
|
|
217
|
+
*/
|
|
218
|
+
findByCursorOptions: FindByCursorOptions<typeof SKU,SKURuleGroup,SKUOrderByField>;
|
|
219
|
+
/**
|
|
220
|
+
* 查询选项
|
|
221
|
+
*/
|
|
222
|
+
countOptions: CountOptions<typeof SKU,SKURuleGroup>;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* 初始化数据
|
|
227
|
+
*/
|
|
228
|
+
export interface SKUInitData {
|
|
229
|
+
/**
|
|
230
|
+
* SKU编码
|
|
231
|
+
*/
|
|
232
|
+
code?: string;
|
|
233
|
+
/**
|
|
234
|
+
* 价格
|
|
235
|
+
*/
|
|
236
|
+
price?: number;
|
|
237
|
+
/**
|
|
238
|
+
* 库存
|
|
239
|
+
*/
|
|
240
|
+
stock?: number;
|
|
241
|
+
/**
|
|
242
|
+
* 所属产品 id
|
|
243
|
+
*/
|
|
244
|
+
productId?: UUID;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* 库存单元
|
|
249
|
+
*/
|
|
250
|
+
export declare class SKU extends EntityBase implements IEntity {
|
|
251
|
+
static [ENTITY_STATIC_TYPES]: SKUStaticTypes;
|
|
252
|
+
/**
|
|
253
|
+
* 属性列表
|
|
254
|
+
*/
|
|
255
|
+
readonly attributes$: RelationEntitiesObservable<SKUAttributes>;
|
|
256
|
+
/**
|
|
257
|
+
* 所属产品
|
|
258
|
+
*/
|
|
259
|
+
readonly product$: RelationEntityObservable<typeof Product>;
|
|
260
|
+
/**
|
|
261
|
+
* SKU编码
|
|
262
|
+
*/
|
|
263
|
+
code: string;
|
|
264
|
+
/**
|
|
265
|
+
* 价格
|
|
266
|
+
*/
|
|
267
|
+
price: number;
|
|
268
|
+
/**
|
|
269
|
+
* 所属产品 id
|
|
270
|
+
*/
|
|
271
|
+
productId: UUID;
|
|
272
|
+
/**
|
|
273
|
+
* 库存
|
|
274
|
+
*/
|
|
275
|
+
stock: number;
|
|
276
|
+
/**
|
|
277
|
+
* 初始化数据
|
|
278
|
+
* @param initData 初始化数据
|
|
279
|
+
*/
|
|
280
|
+
constructor(initData?: SKUInitData);
|
|
281
|
+
/**
|
|
282
|
+
* 统计实体数量
|
|
283
|
+
* @param options 查询选项
|
|
284
|
+
* @example
|
|
285
|
+
* SKU.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
|
|
286
|
+
*/
|
|
287
|
+
static count(options: CountOptions<typeof SKU,SKURuleGroup>): Observable<number>;
|
|
288
|
+
/**
|
|
289
|
+
* 查询多个实体
|
|
290
|
+
* @param options 查询选项
|
|
291
|
+
* @example
|
|
292
|
+
* SKU.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
|
|
293
|
+
*/
|
|
294
|
+
static find(options: FindOptions<typeof SKU,SKURuleGroup,SKUOrderByField>): Observable<SKU[]>;
|
|
295
|
+
/**
|
|
296
|
+
* 查询所有实体
|
|
297
|
+
* @param options 查询选项
|
|
298
|
+
* @example
|
|
299
|
+
* SKU.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
300
|
+
*/
|
|
301
|
+
static findAll(options: FindAllOptions<typeof SKU,SKURuleGroup,SKUOrderByField>): Observable<SKU[]>;
|
|
302
|
+
/**
|
|
303
|
+
* 游标分页查询
|
|
304
|
+
* @param options 查询选项
|
|
305
|
+
* @example
|
|
306
|
+
* SKU.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
|
|
307
|
+
*/
|
|
308
|
+
static findByCursor(options: FindByCursorOptions<typeof SKU,SKURuleGroup,SKUOrderByField>): Observable<SKU[]>;
|
|
309
|
+
/**
|
|
310
|
+
* 查询单个实体,未找到时返回 undefined
|
|
311
|
+
* @param options 查询选项
|
|
312
|
+
* @example
|
|
313
|
+
* SKU.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
314
|
+
*/
|
|
315
|
+
static findOne(options: FindOneOptions<typeof SKU,SKURuleGroup,SKUOrderByField>): Observable<SKU | undefined>;
|
|
316
|
+
/**
|
|
317
|
+
* 查询单个实体,未找到时抛出错误
|
|
318
|
+
* @param options 查询选项
|
|
319
|
+
* @example
|
|
320
|
+
* SKU.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
|
|
321
|
+
*/
|
|
322
|
+
static findOneOrFail(options: FindOneOrFailOptions<typeof SKU,SKURuleGroup,SKUOrderByField>): Observable<SKU>;
|
|
323
|
+
/**
|
|
324
|
+
* 根据 ID 获取单个实体
|
|
325
|
+
* @param options 查询选项
|
|
326
|
+
* @example
|
|
327
|
+
* SKU.get('123').subscribe(entity => console.log(entity));
|
|
328
|
+
*/
|
|
329
|
+
static get(options: UUID): Observable<SKU>;
|
|
330
|
+
/**
|
|
331
|
+
* 删除
|
|
332
|
+
*/
|
|
333
|
+
remove(): Promise<SKU>;
|
|
334
|
+
/**
|
|
335
|
+
* 重置数据
|
|
336
|
+
*/
|
|
337
|
+
reset(): void;
|
|
338
|
+
/**
|
|
339
|
+
* 保存
|
|
340
|
+
*/
|
|
341
|
+
save(): Promise<SKU>;
|
|
342
|
+
}
|
|
343
|
+
|
package/dist/shop/SKU.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Entity, EntityBase, PropertyType, RelationKind, __decorateClass } from '@aiao/rxdb';
|
|
2
|
+
let SKU = class extends EntityBase {};
|
|
3
|
+
SKU = __decorateClass(
|
|
4
|
+
[
|
|
5
|
+
Entity({
|
|
6
|
+
name: "SKU",
|
|
7
|
+
tableName: "sku",
|
|
8
|
+
displayName: "库存单元",
|
|
9
|
+
properties: [
|
|
10
|
+
{
|
|
11
|
+
name: "code",
|
|
12
|
+
type: PropertyType.string,
|
|
13
|
+
displayName: "SKU编码",
|
|
14
|
+
columnName: "code"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "price",
|
|
18
|
+
type: PropertyType.integer,
|
|
19
|
+
displayName: "价格",
|
|
20
|
+
columnName: "price"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "stock",
|
|
24
|
+
type: PropertyType.integer,
|
|
25
|
+
displayName: "库存",
|
|
26
|
+
columnName: "stock"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
relations: [
|
|
30
|
+
{
|
|
31
|
+
name: "attributes",
|
|
32
|
+
displayName: "属性列表",
|
|
33
|
+
kind: RelationKind.ONE_TO_MANY,
|
|
34
|
+
mappedEntity: "SKUAttributes",
|
|
35
|
+
mappedProperty: "sku",
|
|
36
|
+
mappedNamespace: "public",
|
|
37
|
+
onDelete: "CASCADE",
|
|
38
|
+
onUpdate: "RESTRICT"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "product",
|
|
42
|
+
displayName: "所属产品",
|
|
43
|
+
kind: RelationKind.MANY_TO_ONE,
|
|
44
|
+
mappedEntity: "Product",
|
|
45
|
+
mappedProperty: "skus",
|
|
46
|
+
mappedNamespace: "public",
|
|
47
|
+
onDelete: "RESTRICT",
|
|
48
|
+
onUpdate: "RESTRICT",
|
|
49
|
+
columnName: "productId"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
repository: "Repository",
|
|
53
|
+
namespace: "public",
|
|
54
|
+
indexes: [],
|
|
55
|
+
computedProperties: [],
|
|
56
|
+
extends: [
|
|
57
|
+
"EntityBase"
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
],
|
|
61
|
+
SKU
|
|
62
|
+
);
|
|
63
|
+
export { SKU };
|