xync-schema 0.6.73.dev18__py3-none-any.whl → 0.6.75__py3-none-any.whl
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.
- xync_schema/enums.py +12 -0
- xync_schema/models.py +24 -3
- xync_schema/types.py +1 -27
- {xync_schema-0.6.73.dev18.dist-info → xync_schema-0.6.75.dist-info}/METADATA +1 -1
- xync_schema-0.6.75.dist-info/RECORD +8 -0
- xync_schema-0.6.73.dev18.dist-info/RECORD +0 -8
- {xync_schema-0.6.73.dev18.dist-info → xync_schema-0.6.75.dist-info}/WHEEL +0 -0
- {xync_schema-0.6.73.dev18.dist-info → xync_schema-0.6.75.dist-info}/top_level.txt +0 -0
xync_schema/enums.py
CHANGED
|
@@ -82,6 +82,18 @@ class TaskType(IntEnum):
|
|
|
82
82
|
invite_approve = 1
|
|
83
83
|
|
|
84
84
|
|
|
85
|
+
class FileType(IntEnum):
|
|
86
|
+
pdf = 1
|
|
87
|
+
jpg = 2
|
|
88
|
+
png = 3
|
|
89
|
+
webp = 4
|
|
90
|
+
mov = 5
|
|
91
|
+
mp4 = 6
|
|
92
|
+
gif = 7
|
|
93
|
+
svg = 8
|
|
94
|
+
tgs = 9
|
|
95
|
+
|
|
96
|
+
|
|
85
97
|
class ExStatus(IntEnum):
|
|
86
98
|
plan = 0
|
|
87
99
|
parted = 1
|
xync_schema/models.py
CHANGED
|
@@ -17,6 +17,7 @@ from xync_schema.enums import (
|
|
|
17
17
|
PersonStatus,
|
|
18
18
|
UserStatus,
|
|
19
19
|
PmType,
|
|
20
|
+
FileType,
|
|
20
21
|
)
|
|
21
22
|
|
|
22
23
|
|
|
@@ -103,7 +104,7 @@ class Curex(BaseModel):
|
|
|
103
104
|
cur: fields.ForeignKeyRelation[Cur] = fields.ForeignKeyField("models.Cur")
|
|
104
105
|
ex: fields.ForeignKeyRelation[Ex] = fields.ForeignKeyField("models.Ex")
|
|
105
106
|
exid: str = fields.CharField(32)
|
|
106
|
-
minimum:
|
|
107
|
+
minimum: int = fields.SmallIntField(null=True)
|
|
107
108
|
rounding_scale: int = fields.SmallIntField(null=True)
|
|
108
109
|
countries: fields.ManyToManyRelation[Country] = fields.ManyToManyField(
|
|
109
110
|
"models.Country", through="curexcountry", backward_key="curexs"
|
|
@@ -187,6 +188,10 @@ class User(UserTg, TsTrait):
|
|
|
187
188
|
"models.User", related_name="proteges", null=True
|
|
188
189
|
)
|
|
189
190
|
ref_id: int | None
|
|
191
|
+
contacted_with: fields.ForeignKeyNullableRelation["User"] = fields.ForeignKeyField(
|
|
192
|
+
"models.User", related_name="contacts", null=True
|
|
193
|
+
) # who can texts this user
|
|
194
|
+
contacted_with_id: int | None
|
|
190
195
|
|
|
191
196
|
forum: fields.BackwardOneToOneRelation["Forum"]
|
|
192
197
|
created_forums: fields.BackwardFKRelation["Forum"]
|
|
@@ -196,6 +201,7 @@ class User(UserTg, TsTrait):
|
|
|
196
201
|
# fiats: fields.BackwardFKRelation["Fiat"]
|
|
197
202
|
limits: fields.BackwardFKRelation["Limit"]
|
|
198
203
|
msgs: fields.BackwardFKRelation["Msg"]
|
|
204
|
+
contacts: fields.BackwardFKRelation["User"]
|
|
199
205
|
# vpn: fields.BackwardOneToOneRelation["Vpn"]
|
|
200
206
|
# invite_requests: fields.BackwardFKRelation["Invite"]
|
|
201
207
|
# invite_approvals: fields.BackwardFKRelation["Invite"]
|
|
@@ -353,7 +359,7 @@ class Pm(Model):
|
|
|
353
359
|
bank: bool | None = fields.BooleanField(null=True)
|
|
354
360
|
|
|
355
361
|
typ: PmType | None = fields.IntEnumField(PmType, null=True)
|
|
356
|
-
logo:
|
|
362
|
+
logo: fields.ForeignKeyNullableRelation["File"] = fields.ForeignKeyField("models.File", "pm_logos", null=True)
|
|
357
363
|
|
|
358
364
|
ads: fields.ManyToManyRelation[Ad]
|
|
359
365
|
curs: fields.ManyToManyRelation[Cur]
|
|
@@ -364,7 +370,7 @@ class Pm(Model):
|
|
|
364
370
|
|
|
365
371
|
class Meta:
|
|
366
372
|
table_description = "Payment methods"
|
|
367
|
-
unique_together = (("norm", "
|
|
373
|
+
unique_together = (("norm", "country_id"), ("alias", "country_id"))
|
|
368
374
|
|
|
369
375
|
# class PydanticMeta(Model.PydanticMeta):
|
|
370
376
|
# max_recursion = 3
|
|
@@ -691,6 +697,21 @@ class Vpn(Model):
|
|
|
691
697
|
table_description = "VPNs"
|
|
692
698
|
|
|
693
699
|
|
|
700
|
+
class File(Model):
|
|
701
|
+
name: str = fields.CharField(51, null=True)
|
|
702
|
+
typ: FileType = fields.IntEnumField(FileType, null=True)
|
|
703
|
+
fid: str = fields.CharField(76, unique=True, null=True)
|
|
704
|
+
ref: bytes = fields.BinaryField(null=True)
|
|
705
|
+
size: bytes = fields.IntField()
|
|
706
|
+
created_at: datetime | None = DatetimeSecField(auto_now_add=True)
|
|
707
|
+
|
|
708
|
+
_icon = "file"
|
|
709
|
+
_name = {"name"}
|
|
710
|
+
|
|
711
|
+
class Meta:
|
|
712
|
+
table_description = "Files"
|
|
713
|
+
|
|
714
|
+
|
|
694
715
|
# class Invite(Model, TsTrait):
|
|
695
716
|
# ref: fields.ForeignKeyRelation[User] = fields.ForeignKeyField("models.User", related_name="invite_approvals")
|
|
696
717
|
# ref_id: int
|
xync_schema/types.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from pydantic import BaseModel, Field
|
|
3
|
-
from x_model.types import New
|
|
4
3
|
|
|
5
4
|
from xync_schema.enums import AdStatus, OrderStatus
|
|
6
5
|
from xync_schema import models
|
|
@@ -35,37 +34,12 @@ class PmexBank(BaseModel):
|
|
|
35
34
|
# cur_id: int
|
|
36
35
|
|
|
37
36
|
|
|
38
|
-
class CredIn(New):
|
|
39
|
-
exid: int
|
|
40
|
-
pmcur: models.Pmcur
|
|
41
|
-
actor: models.Actor
|
|
42
|
-
detail: str = ""
|
|
43
|
-
name: str = ""
|
|
44
|
-
id: int | None = None
|
|
45
|
-
banks: list[str] | None = None
|
|
46
|
-
_unq = "id", "exid", "ch", "pmcur"
|
|
47
|
-
|
|
48
|
-
class Config:
|
|
49
|
-
arbitrary_types_allowed = True
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class FiatIn(New):
|
|
53
|
-
cred: models.Cred
|
|
54
|
-
amount: float
|
|
55
|
-
id: int = None
|
|
56
|
-
target: float | None = None
|
|
57
|
-
_unq = "id", "cred"
|
|
58
|
-
|
|
59
|
-
class Config:
|
|
60
|
-
arbitrary_types_allowed = True
|
|
61
|
-
|
|
62
|
-
|
|
63
37
|
class BaseAd(BaseModel):
|
|
64
38
|
price: float
|
|
65
39
|
exid: int | None = Field(alias="id")
|
|
66
40
|
|
|
67
41
|
|
|
68
|
-
class BaseAdIn(BaseAd
|
|
42
|
+
class BaseAdIn(BaseAd):
|
|
69
43
|
min_fiat: float
|
|
70
44
|
max_fiat: float
|
|
71
45
|
direction: models.Direction
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
xync_schema/enums.py,sha256=LJme_4FsisEjXX3sDsvfB8xi6Lt0xe27FNRHEYzOUmg,12683
|
|
3
|
+
xync_schema/models.py,sha256=GAO3xwg9xA-6RWskB5amYsJ8m3hgaQSDmHhHpbEPFg8,27641
|
|
4
|
+
xync_schema/types.py,sha256=jubMlsGkaLpv1QZrInP0sEKW8SgWa6TyHENDz8OEvDM,1737
|
|
5
|
+
xync_schema-0.6.75.dist-info/METADATA,sha256=s_8szki_cHh4g6fafDnZ53gtRsX64L9GmiKjoaX8FRk,4055
|
|
6
|
+
xync_schema-0.6.75.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
7
|
+
xync_schema-0.6.75.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
|
|
8
|
+
xync_schema-0.6.75.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
xync_schema/enums.py,sha256=yNXG1ZMWKSrjS7kFMVUHpbruws5c_xO_UxswmQJPNOE,12547
|
|
3
|
-
xync_schema/models.py,sha256=Hcsg6oUnbztWgxtOjmFIwaILEvOSsCY4hbDxY860s0M,26863
|
|
4
|
-
xync_schema/types.py,sha256=fyuuiIcqrpStiCHpKB3vNMEnUhSyvMvW4bW10rK3vRY,2247
|
|
5
|
-
xync_schema-0.6.73.dev18.dist-info/METADATA,sha256=P98sxxdqQzfXNsbtAFB5eKUJYdvMhh6p8eK4dn2viRg,4061
|
|
6
|
-
xync_schema-0.6.73.dev18.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
7
|
-
xync_schema-0.6.73.dev18.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
|
|
8
|
-
xync_schema-0.6.73.dev18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|