xync-schema 0.6.34__tar.gz → 0.6.36__tar.gz

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.
@@ -0,0 +1,267 @@
1
+ Metadata-Version: 2.1
2
+ Name: xync-schema
3
+ Version: 0.6.36
4
+ Summary: XyncNet project database model schema
5
+ Author-email: Mike Artemiev <mixartemev@gmail.com>
6
+ License: EULA
7
+ Project-URL: Homepage, https://gitlab.com/xync/back/schema
8
+ Project-URL: Repository, https://gitlab.com/xync/back/schema
9
+ Requires-Python: >=3.12
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: xtg-auth
12
+ Provides-Extra: dev
13
+ Requires-Dist: build; extra == "dev"
14
+ Requires-Dist: pytest-asyncio; extra == "dev"
15
+ Requires-Dist: twine; extra == "dev"
16
+
17
+ ## INSTALL
18
+ ```bash
19
+ # Create python virtual environment
20
+ python3 -m venv venv
21
+ # Activate this environment
22
+ source venv/bin/activate
23
+ # Install dependencies
24
+ pip install -r requirements.dev.txt
25
+
26
+ # Create pg db
27
+ createdb --U username -W dbname
28
+ ## set password for db user
29
+
30
+ # Copy .env file from sample template
31
+ cp .env.sample .env
32
+ ## set your pg creds in .env file
33
+ ```
34
+
35
+ ## TEST
36
+ ```bash
37
+ pytest
38
+ ```
39
+
40
+
41
+ ### pre-commit
42
+ You can done `commit` only after `pytest` will done success.
43
+ Pre-commit script stored in `.git/hooks/pre-commit` file; current script is:
44
+ ```shell
45
+ #!/bin/sh
46
+ pytest
47
+ ```
48
+
49
+ ### Relations
50
+ ```mermaid
51
+ classDiagram
52
+ direction BT
53
+ class node21 {
54
+ timestamp(0) with time zone created_at
55
+ timestamp(0) with time zone updated_at
56
+ double precision price
57
+ double precision maxFiat
58
+ double precision minFiat
59
+ varchar(4095) detail
60
+ varchar(255) autoMsg
61
+ smallint status /* defActive: 0\nactive: 1\ntwo: 2\nold: 3\nfour: 4\nnotFound: 9 */
62
+ integer agent_id
63
+ smallint direction_id
64
+ bigint id
65
+ }
66
+ class node14 {
67
+ bigint ad_id
68
+ integer pm_id
69
+ integer id
70
+ }
71
+ class node8 {
72
+ timestamp(0) with time zone created_at
73
+ timestamp(0) with time zone updated_at
74
+ integer exid
75
+ jsonb auth
76
+ smallint ex_id
77
+ bigint user_id
78
+ integer id
79
+ }
80
+ class node1 {
81
+ smallint type_ /* spot: 1\nearn: 2\nfound: 3 */
82
+ double precision free
83
+ double precision freeze
84
+ double precision lock
85
+ double precision target
86
+ integer agent_id
87
+ smallint coin_id
88
+ integer id
89
+ }
90
+ class coin {
91
+ varchar(15) ticker
92
+ double precision rate
93
+ boolean is_fiat
94
+ smallint id
95
+ }
96
+ class node22 {
97
+ varchar(31) exid
98
+ boolean p2p
99
+ smallint coin_id
100
+ smallint ex_id
101
+ integer id
102
+ }
103
+ class country {
104
+ integer code
105
+ varchar(3) short
106
+ varchar(63) name
107
+ smallint cur_id
108
+ smallint id
109
+ }
110
+ class node19 {
111
+ varchar(3) ticker
112
+ double precision rate
113
+ varchar(63) country
114
+ smallint id
115
+ }
116
+ class node15 {
117
+ varchar(31) exid
118
+ boolean p2p
119
+ smallint cur_id
120
+ smallint ex_id
121
+ integer id
122
+ }
123
+ class curexcountry {
124
+ integer curexs
125
+ smallint country_id
126
+ }
127
+ class node2 {
128
+ boolean sell
129
+ integer total
130
+ smallint pair_id
131
+ smallint id
132
+ }
133
+ class node5 {
134
+ varchar(31) name
135
+ varchar(63) host /* With no protocol 'https://' */
136
+ varchar(63) host_p2p /* With no protocol 'https://' */
137
+ varchar(63) url_login /* With no protocol 'https://' */
138
+ smallint type_ /* p2p: 1\ncex: 2\nmain: 3\ndex: 4\nfutures: 8 */
139
+ varchar(511) logo
140
+ smallint id
141
+ }
142
+ class node13 {
143
+ varchar(127) detail
144
+ varchar(127) name
145
+ double precision amount
146
+ double precision target
147
+ smallint country_id
148
+ integer pmcur_id
149
+ bigint user_id
150
+ integer id
151
+ }
152
+ class node10 {
153
+ integer exid
154
+ smallint ex_id
155
+ integer fiat_id
156
+ integer id
157
+ }
158
+ class node3 {
159
+ integer amount
160
+ integer unit
161
+ integer level
162
+ boolean income
163
+ bigint added_by_id
164
+ integer pmcur_id
165
+ integer id
166
+ }
167
+ class node16 {
168
+ timestamp(0) with time zone created_at
169
+ timestamp(0) with time zone updated_at
170
+ double precision amount
171
+ smallint status /* zero: 0\nactive: 1\ntwo: 2\nthree: 3\ndone: 4\nfifth: 5\ncanc... */
172
+ timestamp(0) with time zone notify_pay_at
173
+ timestamp(0) with time zone confirm_pay_at
174
+ bigint ad_id
175
+ integer fiat_id
176
+ integer taker_id
177
+ bigint id
178
+ }
179
+ class node9 {
180
+ timestamp(0) with time zone created_at
181
+ timestamp(0) with time zone updated_at
182
+ double precision fee
183
+ smallint coin_id
184
+ smallint cur_id
185
+ smallint ex_id
186
+ smallint id
187
+ }
188
+ class node6 {
189
+ varchar(63) name
190
+ smallint rank
191
+ smallint type_ /* bank: 0\nweb_wallet: 1\ncash: 2\ngift_card: 3\ncredit_card: 4 */
192
+ varchar(127) logo
193
+ boolean multiAllow
194
+ integer id
195
+ }
196
+ class node12 {
197
+ smallint cur_id
198
+ integer pm_id
199
+ integer id
200
+ }
201
+ class pmcurex {
202
+ boolean blocked
203
+ smallint ex_id
204
+ integer pmcur_id
205
+ integer id
206
+ }
207
+ class pmex {
208
+ varchar(31) exid
209
+ smallint ex_id
210
+ integer pm_id
211
+ integer id
212
+ }
213
+ class node11 {
214
+ smallint action /* order_request: 1\norder_request_ask: -1\ncancel_request: 2\nr... */
215
+ boolean ok
216
+ timestamp(0) with time zone updated_at
217
+ smallint ex_id
218
+ integer id
219
+ }
220
+ class user {
221
+ timestamp(0) with time zone created_at
222
+ timestamp(0) with time zone updated_at
223
+ smallint role /* READER: 4\nWRITER: 2\nMANAGER: 6\nADMIN: 7 */
224
+ smallint status /* CREATOR: 5\nADMINISTRATOR: 4\nMEMBER: 3\nRESTRICTED: 2\nLEFT:... */
225
+ varchar(95) username
226
+ bigint ref_id
227
+ bigint id
228
+ }
229
+
230
+ node21 --> node8 : agent_id-id
231
+ node21 --> node2 : direction_id-id
232
+ node14 --> node21 : ad_id-id
233
+ node14 --> node6 : pm_id-id
234
+ node8 --> node5 : ex_id-id
235
+ node8 --> user : user_id-id
236
+ node1 --> node8 : agent_id-id
237
+ node1 --> coin : coin_id-id
238
+ node22 --> coin : coin_id-id
239
+ node22 --> node5 : ex_id-id
240
+ country --> node19 : cur_id-id
241
+ node15 --> node19 : cur_id-id
242
+ node15 --> node5 : ex_id-id
243
+ curexcountry --> country : country_id-id
244
+ curexcountry --> node15 : curexs-id
245
+ node2 --> node9 : pair_id-id
246
+ node13 --> country : country_id-id
247
+ node13 --> node12 : pmcur_id-id
248
+ node13 --> user : user_id-id
249
+ node10 --> node5 : ex_id-id
250
+ node10 --> node13 : fiat_id-id
251
+ node3 --> node12 : pmcur_id-id
252
+ node3 --> user : added_by_id-id
253
+ node16 --> node21 : ad_id-id
254
+ node16 --> node8 : taker_id-id
255
+ node16 --> node13 : fiat_id-id
256
+ node9 --> coin : coin_id-id
257
+ node9 --> node19 : cur_id-id
258
+ node9 --> node5 : ex_id-id
259
+ node12 --> node19 : cur_id-id
260
+ node12 --> node6 : pm_id-id
261
+ pmcurex --> node5 : ex_id-id
262
+ pmcurex --> node12 : pmcur_id-id
263
+ pmex --> node5 : ex_id-id
264
+ pmex --> node6 : pm_id-id
265
+ node11 --> node5 : ex_id-id
266
+ user --> user : ref_id-id
267
+ ```
@@ -0,0 +1,251 @@
1
+ ## INSTALL
2
+ ```bash
3
+ # Create python virtual environment
4
+ python3 -m venv venv
5
+ # Activate this environment
6
+ source venv/bin/activate
7
+ # Install dependencies
8
+ pip install -r requirements.dev.txt
9
+
10
+ # Create pg db
11
+ createdb --U username -W dbname
12
+ ## set password for db user
13
+
14
+ # Copy .env file from sample template
15
+ cp .env.sample .env
16
+ ## set your pg creds in .env file
17
+ ```
18
+
19
+ ## TEST
20
+ ```bash
21
+ pytest
22
+ ```
23
+
24
+
25
+ ### pre-commit
26
+ You can done `commit` only after `pytest` will done success.
27
+ Pre-commit script stored in `.git/hooks/pre-commit` file; current script is:
28
+ ```shell
29
+ #!/bin/sh
30
+ pytest
31
+ ```
32
+
33
+ ### Relations
34
+ ```mermaid
35
+ classDiagram
36
+ direction BT
37
+ class node21 {
38
+ timestamp(0) with time zone created_at
39
+ timestamp(0) with time zone updated_at
40
+ double precision price
41
+ double precision maxFiat
42
+ double precision minFiat
43
+ varchar(4095) detail
44
+ varchar(255) autoMsg
45
+ smallint status /* defActive: 0\nactive: 1\ntwo: 2\nold: 3\nfour: 4\nnotFound: 9 */
46
+ integer agent_id
47
+ smallint direction_id
48
+ bigint id
49
+ }
50
+ class node14 {
51
+ bigint ad_id
52
+ integer pm_id
53
+ integer id
54
+ }
55
+ class node8 {
56
+ timestamp(0) with time zone created_at
57
+ timestamp(0) with time zone updated_at
58
+ integer exid
59
+ jsonb auth
60
+ smallint ex_id
61
+ bigint user_id
62
+ integer id
63
+ }
64
+ class node1 {
65
+ smallint type_ /* spot: 1\nearn: 2\nfound: 3 */
66
+ double precision free
67
+ double precision freeze
68
+ double precision lock
69
+ double precision target
70
+ integer agent_id
71
+ smallint coin_id
72
+ integer id
73
+ }
74
+ class coin {
75
+ varchar(15) ticker
76
+ double precision rate
77
+ boolean is_fiat
78
+ smallint id
79
+ }
80
+ class node22 {
81
+ varchar(31) exid
82
+ boolean p2p
83
+ smallint coin_id
84
+ smallint ex_id
85
+ integer id
86
+ }
87
+ class country {
88
+ integer code
89
+ varchar(3) short
90
+ varchar(63) name
91
+ smallint cur_id
92
+ smallint id
93
+ }
94
+ class node19 {
95
+ varchar(3) ticker
96
+ double precision rate
97
+ varchar(63) country
98
+ smallint id
99
+ }
100
+ class node15 {
101
+ varchar(31) exid
102
+ boolean p2p
103
+ smallint cur_id
104
+ smallint ex_id
105
+ integer id
106
+ }
107
+ class curexcountry {
108
+ integer curexs
109
+ smallint country_id
110
+ }
111
+ class node2 {
112
+ boolean sell
113
+ integer total
114
+ smallint pair_id
115
+ smallint id
116
+ }
117
+ class node5 {
118
+ varchar(31) name
119
+ varchar(63) host /* With no protocol 'https://' */
120
+ varchar(63) host_p2p /* With no protocol 'https://' */
121
+ varchar(63) url_login /* With no protocol 'https://' */
122
+ smallint type_ /* p2p: 1\ncex: 2\nmain: 3\ndex: 4\nfutures: 8 */
123
+ varchar(511) logo
124
+ smallint id
125
+ }
126
+ class node13 {
127
+ varchar(127) detail
128
+ varchar(127) name
129
+ double precision amount
130
+ double precision target
131
+ smallint country_id
132
+ integer pmcur_id
133
+ bigint user_id
134
+ integer id
135
+ }
136
+ class node10 {
137
+ integer exid
138
+ smallint ex_id
139
+ integer fiat_id
140
+ integer id
141
+ }
142
+ class node3 {
143
+ integer amount
144
+ integer unit
145
+ integer level
146
+ boolean income
147
+ bigint added_by_id
148
+ integer pmcur_id
149
+ integer id
150
+ }
151
+ class node16 {
152
+ timestamp(0) with time zone created_at
153
+ timestamp(0) with time zone updated_at
154
+ double precision amount
155
+ smallint status /* zero: 0\nactive: 1\ntwo: 2\nthree: 3\ndone: 4\nfifth: 5\ncanc... */
156
+ timestamp(0) with time zone notify_pay_at
157
+ timestamp(0) with time zone confirm_pay_at
158
+ bigint ad_id
159
+ integer fiat_id
160
+ integer taker_id
161
+ bigint id
162
+ }
163
+ class node9 {
164
+ timestamp(0) with time zone created_at
165
+ timestamp(0) with time zone updated_at
166
+ double precision fee
167
+ smallint coin_id
168
+ smallint cur_id
169
+ smallint ex_id
170
+ smallint id
171
+ }
172
+ class node6 {
173
+ varchar(63) name
174
+ smallint rank
175
+ smallint type_ /* bank: 0\nweb_wallet: 1\ncash: 2\ngift_card: 3\ncredit_card: 4 */
176
+ varchar(127) logo
177
+ boolean multiAllow
178
+ integer id
179
+ }
180
+ class node12 {
181
+ smallint cur_id
182
+ integer pm_id
183
+ integer id
184
+ }
185
+ class pmcurex {
186
+ boolean blocked
187
+ smallint ex_id
188
+ integer pmcur_id
189
+ integer id
190
+ }
191
+ class pmex {
192
+ varchar(31) exid
193
+ smallint ex_id
194
+ integer pm_id
195
+ integer id
196
+ }
197
+ class node11 {
198
+ smallint action /* order_request: 1\norder_request_ask: -1\ncancel_request: 2\nr... */
199
+ boolean ok
200
+ timestamp(0) with time zone updated_at
201
+ smallint ex_id
202
+ integer id
203
+ }
204
+ class user {
205
+ timestamp(0) with time zone created_at
206
+ timestamp(0) with time zone updated_at
207
+ smallint role /* READER: 4\nWRITER: 2\nMANAGER: 6\nADMIN: 7 */
208
+ smallint status /* CREATOR: 5\nADMINISTRATOR: 4\nMEMBER: 3\nRESTRICTED: 2\nLEFT:... */
209
+ varchar(95) username
210
+ bigint ref_id
211
+ bigint id
212
+ }
213
+
214
+ node21 --> node8 : agent_id-id
215
+ node21 --> node2 : direction_id-id
216
+ node14 --> node21 : ad_id-id
217
+ node14 --> node6 : pm_id-id
218
+ node8 --> node5 : ex_id-id
219
+ node8 --> user : user_id-id
220
+ node1 --> node8 : agent_id-id
221
+ node1 --> coin : coin_id-id
222
+ node22 --> coin : coin_id-id
223
+ node22 --> node5 : ex_id-id
224
+ country --> node19 : cur_id-id
225
+ node15 --> node19 : cur_id-id
226
+ node15 --> node5 : ex_id-id
227
+ curexcountry --> country : country_id-id
228
+ curexcountry --> node15 : curexs-id
229
+ node2 --> node9 : pair_id-id
230
+ node13 --> country : country_id-id
231
+ node13 --> node12 : pmcur_id-id
232
+ node13 --> user : user_id-id
233
+ node10 --> node5 : ex_id-id
234
+ node10 --> node13 : fiat_id-id
235
+ node3 --> node12 : pmcur_id-id
236
+ node3 --> user : added_by_id-id
237
+ node16 --> node21 : ad_id-id
238
+ node16 --> node8 : taker_id-id
239
+ node16 --> node13 : fiat_id-id
240
+ node9 --> coin : coin_id-id
241
+ node9 --> node19 : cur_id-id
242
+ node9 --> node5 : ex_id-id
243
+ node12 --> node19 : cur_id-id
244
+ node12 --> node6 : pm_id-id
245
+ pmcurex --> node5 : ex_id-id
246
+ pmcurex --> node12 : pmcur_id-id
247
+ pmex --> node5 : ex_id-id
248
+ pmex --> node6 : pm_id-id
249
+ node11 --> node5 : ex_id-id
250
+ user --> user : ref_id-id
251
+ ```