xync-db 0.24.1__tar.gz → 0.24.3.dev5__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_db-0.24.1 → xync_db-0.24.3.dev5}/PKG-INFO +1 -1
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/models/CLAUDE.md +1 -1
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/models/__init__.py +14 -17
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/.gitignore +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/README.md +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/pyproject.toml +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/__init__.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/config.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/enums.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/exceptions.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/graph.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/i18n.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/login_store.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/logo.png +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/CLAUDE.md +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/__init__.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/0001_initial.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/0002_triggers.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/0003_seed.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/__init__.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/__init__.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/a_actor_seed.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/a_bin_seed.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/a_city_seed.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/a_country_seed.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/a_tg_seed.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/b_htx_seed.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/c_net_seed.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/cities.json +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/countries.json +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/ranges.csv +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/migrations/models/seed/xync_files.sql +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/py.typed +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/shared.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/typs/__init__.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/typs/db/__init__.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/typs/db/actor.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/typs/db/ad.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/typs/db/common.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/typs/db/cred.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/typs/db/order.py +0 -0
- {xync_db-0.24.1 → xync_db-0.24.3.dev5}/src/xync_db/typs/db/pm.py +0 -0
|
@@ -78,7 +78,7 @@ Re-exported models from `x_auth`: `Username`, `Proxy`, `Dc`, `Fcm`, `App`, `Sess
|
|
|
78
78
|
- `CondParsed` = structured parse result: `from_party` / `to_party` (`PartyType`: с чьего / на чей счёт идёт платёж
|
|
79
79
|
покупателя), `lk` (лк банка на руках: True — требование к тейкеру, False — есть у мейкера), `cash_cities` (`City`
|
|
80
80
|
кэш-обменника / встречи — m2m `cond_cities`, их может быть несколько), `ppo`, `slip` (`Slip`) — требует/шлёт понятно из направления объявы, abuse flags,
|
|
81
|
-
`fix_amounts` (int[] — фиксированные суммы входа в единицах валюты, как и `scale`;
|
|
81
|
+
`fix_amounts` (int[] — фиксированные суммы входа в единицах валюты, как и `scale`; при `scale` от 2 — пусто: суммы лишь его примеры),
|
|
82
82
|
`trans_type` (`TransType` — способ расчёта: sbp/card/atm_qr или не перевод — mobile/topup/pay), `is_intermediary`
|
|
83
83
|
(мейкер-посредник «треугол»), `intermed_forbid` (тейкер-треугол: True — мейкер с ними не работает, False — работает),
|
|
84
84
|
linked bank `Pm`s
|
|
@@ -1650,7 +1650,7 @@ class CondParsed(Model, TsTrait):
|
|
|
1650
1650
|
mtl_like: bool = BooleanField(null=True)
|
|
1651
1651
|
scale: int = SmallIntField(null=True)
|
|
1652
1652
|
# фиксированные суммы входа, что требует мейкер («заходить строго на 2085»), в единицах валюты — как scale;
|
|
1653
|
-
#
|
|
1653
|
+
# при scale от 2 — пусто: суммы лишь его примеры (`cond_ai.schema.fields`)
|
|
1654
1654
|
fix_amounts: list[int] | None = ArrayField("INT", null=True)
|
|
1655
1655
|
bank_side: bool = BooleanField(null=True) # False - except these banks, True - only this banks
|
|
1656
1656
|
trans_type: TransType | None = IntEnumField(TransType, null=True) # способ расчёта: из названных — наибольший
|
|
@@ -2463,30 +2463,27 @@ class Card(Model):
|
|
|
2463
2463
|
unique_together = (("bin", "num"),)
|
|
2464
2464
|
|
|
2465
2465
|
@staticmethod
|
|
2466
|
-
def
|
|
2467
|
-
"""
|
|
2466
|
+
def _luhn_sum(digits: str, doubled: int) -> int:
|
|
2467
|
+
"""Сумма Луна: удваивается каждая вторая цифра с конца, начиная с индекса `doubled` (0 или 1)."""
|
|
2468
2468
|
total = 0
|
|
2469
|
-
for i, ch in enumerate(reversed(
|
|
2469
|
+
for i, ch in enumerate(reversed(digits)):
|
|
2470
2470
|
d = int(ch)
|
|
2471
|
-
if i % 2 ==
|
|
2471
|
+
if i % 2 == doubled:
|
|
2472
2472
|
d *= 2
|
|
2473
2473
|
if d > 9:
|
|
2474
2474
|
d -= 9
|
|
2475
2475
|
total += d
|
|
2476
|
-
return total
|
|
2476
|
+
return total
|
|
2477
2477
|
|
|
2478
|
-
@
|
|
2479
|
-
def
|
|
2478
|
+
@classmethod
|
|
2479
|
+
def _luhn_ok(cls, number: str) -> bool:
|
|
2480
|
+
"""Проверка полного номера карты по Луну (контрольная цифра — последняя)."""
|
|
2481
|
+
return cls._luhn_sum(number, 1) % 10 == 0
|
|
2482
|
+
|
|
2483
|
+
@classmethod
|
|
2484
|
+
def _luhn_check_digit(cls, partial: str) -> int:
|
|
2480
2485
|
"""Контрольная цифра Луна для номера БЕЗ неё (`partial` = полный номер минус последняя цифра)."""
|
|
2481
|
-
|
|
2482
|
-
for i, ch in enumerate(reversed(partial)):
|
|
2483
|
-
d = int(ch)
|
|
2484
|
-
if i % 2 == 0:
|
|
2485
|
-
d *= 2
|
|
2486
|
-
if d > 9:
|
|
2487
|
-
d -= 9
|
|
2488
|
-
total += d
|
|
2489
|
-
return (10 - total % 10) % 10
|
|
2486
|
+
return (10 - cls._luhn_sum(partial, 0) % 10) % 10
|
|
2490
2487
|
|
|
2491
2488
|
@classmethod
|
|
2492
2489
|
async def from_number(cls, number: str) -> Card:
|
|
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
|
|
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
|
|
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
|