-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.rb
123 lines (102 loc) · 2.24 KB
/
models.rb
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
# Account
{
owner: 1, # id of user in uis system
points_amount: 100,
creation_date: '',
transactions: [ instances of Transaction ],
applications: [ instances of Application ],
orders: [ instances of Order ]
}
# Transaction
{
id: 123,
amount: 100,
amount_to_spend: 100,
receiving_date: '',
expiration_date: '',
status: '', # active/expired/spent
}
# Application
{
_id: 123,
author: 1, # id of user in uis system,
type: '', # personal/group
personal: {
work: {
activity: 'instance of Activity',
amount: 1, # null for permanent activity
}
},
group: {
work: [
{
actor: 1, # if of user in uis system
activity: 'instance of Activity',
amount: 1, # null for permanent
}
]
},
files: [
{
_id: 123,
filename: 'asd.jpg'
}
],
comment: '',
status: '', # in_process/rejected/approved/rework
creation_date: ''
}
# ApplicationsArchive
{
author: 1, # // id of user in accounts microservice
application_id: 123, # // application id
status: 'rejected' # // or 'approved'
}
# ApplicationsInWork
{
author: 1, # // id of user in accounts microservice
application_id: 123, # // application id
status: 'in_process' # // or 'rework'
}
#
# Order
{
account: 'account id',
items: [ instances of ShopItem ],
total_price: 100,
status: '' # in_process, approved, rejected, waiting_to_process, rejected_by_contributor, deleted
}
# Activity
{
title: '',
type: '', # hourly/quantity/permanent
category: 'instance of Category',
comment: '',
for_approval: '',
price: 100 # price for one hour, for permanent action or for one action
}
# Category
{
title: ''
}
# Approved_apps
{
token: ''
}
# Administrator
{
user: 1, # id of user in uis system
applications: [instance of Application]
}
# Item
{
name: '',
category: 'instance of ItemCategory',
description: '',
quantity: 1,
price: 100
}
# ItemCategory
{
title: ''
}