xync-schema 0.6.73.dev17__tar.gz → 0.6.74__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.
- {xync_schema-0.6.73.dev17/xync_schema.egg-info → xync_schema-0.6.74}/PKG-INFO +1 -1
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/xync_schema/enums.py +12 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/xync_schema/models.py +22 -6
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/xync_schema/types.py +1 -27
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74/xync_schema.egg-info}/PKG-INFO +1 -1
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/.env.sample +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/.gitignore +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/.pre-commit-config.yaml +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/README.md +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/makefile +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/pyproject.toml +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/setup.cfg +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/tests/__init__.py +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/tests/test_db.py +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/xync_schema/__init__.py +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/xync_schema.egg-info/SOURCES.txt +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/xync_schema.egg-info/dependency_links.txt +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/xync_schema.egg-info/requires.txt +0 -0
- {xync_schema-0.6.73.dev17 → xync_schema-0.6.74}/xync_schema.egg-info/top_level.txt +0 -0
|
@@ -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
|
|
@@ -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"
|
|
@@ -314,7 +315,7 @@ class Ad(Model, TsTrait):
|
|
|
314
315
|
max_fiat: float = fields.FloatField()
|
|
315
316
|
detail: str | None = fields.CharField(4095, null=True)
|
|
316
317
|
auto_msg: str | None = fields.CharField(255, null=True)
|
|
317
|
-
status: AdStatus = fields.IntEnumField(AdStatus,
|
|
318
|
+
status: AdStatus = fields.IntEnumField(AdStatus, default=AdStatus.active)
|
|
318
319
|
|
|
319
320
|
maker: fields.ForeignKeyRelation[Actor] = fields.ForeignKeyField("models.Actor", "my_ads")
|
|
320
321
|
maker_id: int
|
|
@@ -350,10 +351,10 @@ class Pm(Model):
|
|
|
350
351
|
alias: str | None = fields.CharField(63, null=True)
|
|
351
352
|
extra: str | None = fields.CharField(63, null=True)
|
|
352
353
|
ok: bool = fields.BooleanField(default=True)
|
|
353
|
-
bank: bool = fields.BooleanField(null=True)
|
|
354
|
+
bank: bool | None = fields.BooleanField(null=True)
|
|
354
355
|
|
|
355
356
|
typ: PmType | None = fields.IntEnumField(PmType, null=True)
|
|
356
|
-
logo:
|
|
357
|
+
logo: fields.ForeignKeyNullableRelation["File"] = fields.ForeignKeyField("models.File", "pm_logos", null=True)
|
|
357
358
|
|
|
358
359
|
ads: fields.ManyToManyRelation[Ad]
|
|
359
360
|
curs: fields.ManyToManyRelation[Cur]
|
|
@@ -364,7 +365,7 @@ class Pm(Model):
|
|
|
364
365
|
|
|
365
366
|
class Meta:
|
|
366
367
|
table_description = "Payment methods"
|
|
367
|
-
unique_together = (("norm", "
|
|
368
|
+
unique_together = (("norm", "country_id"), ("alias", "country_id"))
|
|
368
369
|
|
|
369
370
|
# class PydanticMeta(Model.PydanticMeta):
|
|
370
371
|
# max_recursion = 3
|
|
@@ -454,7 +455,7 @@ class Cred(Model):
|
|
|
454
455
|
|
|
455
456
|
class Meta:
|
|
456
457
|
table_description = "Currency accounts"
|
|
457
|
-
unique_together = (("
|
|
458
|
+
unique_together = (("person_id", "pmcur_id", "detail"),)
|
|
458
459
|
|
|
459
460
|
|
|
460
461
|
class CredEx(Model):
|
|
@@ -691,6 +692,21 @@ class Vpn(Model):
|
|
|
691
692
|
table_description = "VPNs"
|
|
692
693
|
|
|
693
694
|
|
|
695
|
+
class File(Model):
|
|
696
|
+
name: str = fields.CharField(51, null=True)
|
|
697
|
+
typ: FileType = fields.IntEnumField(FileType, null=True)
|
|
698
|
+
fid: str = fields.CharField(76, unique=True, null=True)
|
|
699
|
+
ref: bytes = fields.BinaryField(null=True)
|
|
700
|
+
size: bytes = fields.IntField()
|
|
701
|
+
created_at: datetime | None = DatetimeSecField(auto_now_add=True)
|
|
702
|
+
|
|
703
|
+
_icon = "file"
|
|
704
|
+
_name = {"name"}
|
|
705
|
+
|
|
706
|
+
class Meta:
|
|
707
|
+
table_description = "Files"
|
|
708
|
+
|
|
709
|
+
|
|
694
710
|
# class Invite(Model, TsTrait):
|
|
695
711
|
# ref: fields.ForeignKeyRelation[User] = fields.ForeignKeyField("models.User", related_name="invite_approvals")
|
|
696
712
|
# ref_id: int
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|