xync-schema 0.0.9.dev5__tar.gz → 0.0.9.dev7__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.
Files changed (19) hide show
  1. {xync_schema-0.0.9.dev5/xync_schema.egg-info → xync_schema-0.0.9.dev7}/PKG-INFO +1 -1
  2. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/xync_schema/enums.py +17 -1
  3. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/xync_schema/models.py +26 -12
  4. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7/xync_schema.egg-info}/PKG-INFO +1 -1
  5. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/.env.sample +0 -0
  6. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/.gitignore +0 -0
  7. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/.pre-commit-config.yaml +0 -0
  8. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/README.md +0 -0
  9. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/makefile +0 -0
  10. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/pyproject.toml +0 -0
  11. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/setup.cfg +0 -0
  12. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/tests/__init__.py +0 -0
  13. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/tests/test_db.py +0 -0
  14. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/xync_schema/__init__.py +0 -0
  15. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/xync_schema/xtype.py +0 -0
  16. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/xync_schema.egg-info/SOURCES.txt +0 -0
  17. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/xync_schema.egg-info/dependency_links.txt +0 -0
  18. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/xync_schema.egg-info/requires.txt +0 -0
  19. {xync_schema-0.0.9.dev5 → xync_schema-0.0.9.dev7}/xync_schema.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.0.9.dev5
3
+ Version: 0.0.9.dev7
4
4
  Summary: XyncNet project database model schema
5
5
  Author-email: Mike Artemiev <mixartemev@gmail.com>
6
6
  License: EULA
@@ -95,9 +95,25 @@ class FileType(IntEnum):
95
95
  jpeg = 10
96
96
 
97
97
 
98
+ class SynonymType(IntEnum):
99
+ name = 1
100
+ ppo = 2
101
+ from_party = 3
102
+ to_party = 4
103
+ slip_req = 5
104
+ slip_send = 6
105
+ abuser = 7
106
+ scale = 8
107
+ mtl_like = 9
108
+ bank_only = 10
109
+ no_bank = 11
110
+ cred_in_chat = 12
111
+ slavic = 13
112
+
113
+
98
114
  class Party(IntEnum):
99
115
  fst = 1
100
- lk = 2
116
+ lk = 2 # lk-photo/1-family/comment
101
117
  trd = 3
102
118
 
103
119
 
@@ -57,6 +57,7 @@ from xync_schema.enums import (
57
57
  DepType,
58
58
  Party,
59
59
  Slip,
60
+ SynonymType,
60
61
  )
61
62
 
62
63
 
@@ -77,6 +78,7 @@ class Cur(Model):
77
78
  exs: ManyToManyRelation["Ex"] = ManyToManyField("models.Ex", through="curex")
78
79
  pairs: BackwardFKRelation["Pair"]
79
80
  countries: BackwardFKRelation[Country]
81
+ synonyms: ManyToManyRelation["Synonym"]
80
82
 
81
83
  _name = {"ticker"}
82
84
 
@@ -351,29 +353,41 @@ class Agent(Model, TsTrait):
351
353
 
352
354
 
353
355
  class Cond(Model, TsTrait):
354
- party: Party = IntEnumField(Party, null=True)
356
+ raw_txt: str = CharField(4095, unique=True)
357
+ last_ver: str = CharField(4095, null=True)
358
+
359
+ ads: BackwardFKRelation["Ad"]
360
+ banks: BackwardFKRelation["CondPm"]
361
+ parsed: BackwardOneToOneRelation["CondParsed"]
362
+ sim: BackwardOneToOneRelation["Cond"]
363
+
364
+ async def sims(self):
365
+ return {self.raw_txt: await self.sim.sims()} if await self.sim else self.raw_txt
366
+
367
+
368
+ class CondParsed(Model, TsTrait):
369
+ cond: OneToOneNullableRelation[Cond] = OneToOneField("models.Cond", "parsed", null=True)
370
+ cond_id: int # new
371
+ to_party: Party = IntEnumField(Party, null=True)
372
+ from_party: Party = IntEnumField(Party, null=True)
355
373
  ppo: int = SmallIntField(null=True) # Payments per order
356
- slip: Slip = IntEnumField(Slip, null=True)
374
+ slip_req: Slip = IntEnumField(Slip, null=True)
375
+ slip_send: Slip = IntEnumField(Slip, null=True)
357
376
  abuser: bool = BooleanField(null=True) # рейт: жмет "Оплачено" сразу, "Отмена" по аппеляции
358
377
  slavic: bool = BooleanField(null=True)
359
378
  mtl_like: bool = BooleanField(null=True)
360
379
  cred_in_chat: bool = BooleanField(null=True)
361
380
  scale: int = SmallIntField(null=True)
362
- raw_txt: str = CharField(4095, unique=True)
363
- parsed: bool = BooleanField(default=False)
364
- last_ver: str = CharField(4095, null=True)
365
-
366
- sim: BackwardOneToOneRelation["Cond"]
367
- banks: BackwardFKRelation["CondPm"]
368
381
 
369
- ads: BackwardFKRelation["Ad"]
370
382
 
371
- async def sims(self):
372
- return {self.raw_txt: await self.sim.sims()} if await self.sim else self.raw_txt
383
+ class Synonym(BaseModel):
384
+ typ: SynonymType = IntEnumField(SynonymType, db_index=True)
385
+ txt: str = CharField(255, unique=True)
386
+ curs: ManyToManyRelation[Cur] = ManyToManyField("models.Cur", "synonym_cur", related_name="synonyms")
373
387
 
374
388
 
375
389
  class CondSim(BaseModel):
376
- cond: ForeignKeyRelation[Cond] = OneToOneField("models.Cond", "sim", primary_key=True)
390
+ cond: OneToOneRelation[Cond] = OneToOneField("models.Cond", "sim", primary_key=True)
377
391
  cond_id: int # new
378
392
  similarity: int = SmallIntField(db_index=True) # /1000
379
393
  cond_rel: ForeignKeyRelation[Cond] = ForeignKeyField("models.Cond", "sims_rel")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.0.9.dev5
3
+ Version: 0.0.9.dev7
4
4
  Summary: XyncNet project database model schema
5
5
  Author-email: Mike Artemiev <mixartemev@gmail.com>
6
6
  License: EULA