Commit Graph

137 Commits

Author SHA1 Message Date
Ruslan Bakiev
a3c9c3e189 Store EGRUL JSON in Mongo and parse PDFs 2026-01-14 21:12:05 +07:00
Ruslan Bakiev
9b12bdd414 Add meltano tap-egrul + update submodules
- Add meltano/ with tap-egrul extractor for EGRUL data
- tap-egrul calls egrul-agent API for PDF scraping
- Update exchange, orders, webapp submodules
2026-01-11 16:14:41 +07:00
Ruslan Bakiev
9d05386337 Update exchange and orders submodules 2026-01-09 01:11:22 +07:00
Ruslan Bakiev
46eec3e06b Update submodules (webapp, geo) 2026-01-08 16:49:47 +07:00
Ruslan Bakiev
77a345dfa6 Update submodules (UI improvements, backend filters) 2026-01-08 10:43:15 +07:00
Ruslan Bakiev
7121c69599 Add nearest_nodes tool for coordinate-based node search 2026-01-08 00:37:30 +07:00
Ruslan Bakiev
2605b1a3b4 refactor: use GEO search param instead of client-side filtering 2026-01-07 22:01:50 +07:00
Ruslan Bakiev
b93e7859e8 chore: update submodules (teams + webapp) - address edit page 2026-01-07 16:21:15 +07:00
Ruslan Bakiev
69ff0ffe5b Update billing submodule (add Infisical env vars) 2026-01-07 10:06:56 +07:00
Ruslan Bakiev
6fba01ad51 Update billing submodule 2026-01-07 09:55:07 +07:00
Ruslan Bakiev
ac33950f87 Update submodules with webhook URLs 2026-01-07 09:45:46 +07:00
Ruslan Bakiev
e8c67b50bd Convert webapp and backends to submodules from Gitea 2026-01-07 09:33:15 +07:00
Ruslan Bakiev
582c3ccdd9 Allow finding offers at any search phase (rail not required)
Offers can be found at any stage of the search:
- Directly from destination (1 edge)
- After 1 auto edge
- At rail station
- After rail + 1 auto

Rail is not mandatory - search expands radius until offers found.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 12:41:51 +07:00
Ruslan Bakiev
cc12895ab8 Fix findProductRoutes: limit auto segments to 1 edge each
Business rule: auto can only be 1 edge at start and end of route.
- end_auto → end_auto_done after 1 auto edge
- rail → start_auto_done after 1 auto edge
- Remove MAX_AUTO_DISTANCE_KM/MAX_AUTO_TIME_SECONDS constraints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 12:18:18 +07:00
Ruslan Bakiev
dfeba64305 Remove self from standalone helper functions
These functions are now called directly, not as class methods.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 12:03:31 +07:00
Ruslan Bakiev
d348f80bbb Fix self.method calls in Graphene resolver
Graphene can pass None as self for root queries. Call helper functions
directly instead of via self.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 11:46:21 +07:00
Ruslan Bakiev
52ebc53383 Skip migrations for geo Docker startup 2026-01-06 11:09:13 +07:00
Ruslan Bakiev
24fc5230da Fix Django Dockerfile env and Poetry install 2026-01-06 11:04:41 +07:00
Ruslan Bakiev
c23efe0746 Unify Django Docker startup 2026-01-06 10:48:55 +07:00
Ruslan Bakiev
f4c2d65588 Add Dockerfiles for backends and webapp 2026-01-06 10:29:53 +07:00
Ruslan Bakiev
09033bb162 Fix findProductRoutes: add offer phase to find product offers
- Add 'offer' transport_type transition in allowed_next_phase()
- Include 'offer' in fetch_neighbors() types for start_auto phase
- Enables algorithm to traverse: destination → auto → rail → auto → offer
2026-01-06 10:10:12 +07:00
Ruslan Bakiev
2e7b5ac39e Refine product route search for constrained auto-rail-auto paths 2026-01-05 19:55:52 +07:00
Ruslan Bakiev
e4aed8e7ff Add --product filter to seed_exchange 2026-01-05 18:26:35 +07:00
Ruslan Bakiev
11e550977a Fix seed_exchange: fetch all hubs and filter by country in Python 2026-01-05 17:17:53 +07:00
Ruslan Bakiev
450ff73dbe Fix geo GraphQL URL in seed_exchange 2026-01-05 16:59:06 +07:00
Ruslan Bakiev
8c1bceb0b1 Fix seed_exchange: fetch product UUIDs from Odoo instead of hardcoded slugs 2026-01-05 16:45:52 +07:00
Ruslan Bakiev
f32a7d5b6e Add OfferService for workflow-based offer creation
- Add offers/services.py with OfferService class
- Add Django admin action 'Sync to graph' for offers
- Update seed_exchange for African cocoa belt hubs
- Seed can now create offers via Temporal workflow
2026-01-05 10:30:54 +07:00
Ruslan Bakiev
1208ffc153 Rename Supplier to SupplierProfile in Exchange
- Rename model class Supplier → SupplierProfile (keep db_table='suppliers')
- Add backwards compatibility alias Supplier = SupplierProfile
- Rename GraphQL type SupplierType → SupplierProfileType
- Rename queries: getSuppliers → getSupplierProfiles, etc.
- Update admin, apps, management commands
2026-01-05 10:11:00 +07:00
Ruslan Bakiev
5b40cde8da Add codeName to teamTransactions from OperationCode table
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 09:25:29 +07:00
Ruslan Bakiev
3dbd44fe82 Add teamTransactions from TigerBeetle
- Add get_account_transfers() to TigerBeetle client
- Update team_schema to return real transactions from TigerBeetle
- Include direction (credit/debit) and counterparty UUID

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 13:12:13 +07:00
Ruslan Bakiev
dae2605fe2 Refactor billing: Django as wrapper for TigerBeetle
- Remove Operation and TransactionReason models (transactions in TigerBeetle only)
- Add OperationCode model (справочник кодов операций)
- Add ServiceAccount model (bank, revenue accounts)
- Simplify AccountType to USER/SERVICE only
- Update M2M schema: createTransaction mutation, operationCodes/serviceAccounts queries
- Update Team schema: teamBalance from TigerBeetle directly
- Add migration 0003_refactor_models

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 12:52:26 +07:00
Ruslan Bakiev
0219d95ec9 Fix TigerBeetle DNS resolution in Python client 2026-01-04 12:47:27 +07:00
Ruslan Bakiev
4d3e011740 Use poetry install --no-root in billing image 2026-01-04 12:00:11 +07:00
Ruslan Bakiev
655d8d3949 Fix billing Dockerfile README copy 2026-01-04 11:49:26 +07:00
Ruslan Bakiev
1bd87eb1b8 Fix K_SHORTEST_PATHS AQL syntax: add ANY direction modifier
The ArangoDB K_SHORTEST_PATHS function requires a direction modifier
(OUTBOUND/INBOUND/ANY) before the keyword. Without it, the query fails
with syntax error.

Ref: https://docs.arangodb.com/3.12/aql/graphs/k-shortest-paths/
2026-01-04 11:03:11 +07:00
Ruslan Bakiev
e36addef2c Unify billing and tigerbeetle compose 2026-01-04 10:41:56 +07:00
Ruslan Bakiev
0990ace730 Add invitations field to TeamWithMembers GraphQL type 2026-01-04 10:35:17 +07:00
Ruslan Bakiev
22762b5578 Fix: call staticmethod _build_routes via Query class, not self 2026-01-04 10:15:04 +07:00
Ruslan Bakiev
d0e532595b Fix error handling in M2M schema for non-TigerBeetle exceptions
Handle both TB errors (with .code) and Python exceptions (without .code)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 00:36:05 +07:00
Ruslan Bakiev
c849602be5 Simplify createTransfer API: from/to instead of debit/credit, hardcode ledger
- fromAccountId, toAccountId instead of debitAccountId, creditAccountId
- ledger hardcoded to 1 (RUB)
- Keep code for inter-service coordination

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 23:49:21 +07:00
Ruslan Bakiev
e3bf0e8215 Remove tigerbeetle_account_id column - use UUID.int property instead
UUID is 128-bit, BigIntegerField is 64-bit. Use computed property instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 23:30:08 +07:00
Ruslan Bakiev
77a436f254 Fix Account creation in M2M schema - set tigerbeetle_account_id
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 23:25:33 +07:00
Ruslan Bakiev
d47a0d7374 Remove TB_ENABLED check - TigerBeetle is required for billing
TigerBeetle runs with --privileged and billing service has CAP_SYS_ADMIN
for io_uring support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 23:14:12 +07:00
Ruslan Bakiev
1841b67ad7 geo: add find_product_routes query 2026-01-03 17:11:43 +07:00
Ruslan Bakiev
9135251ea9 Disable TigerBeetle by default to prevent io_uring crash
TigerBeetle Python client requires io_uring which is disabled in most
containerized environments. The import itself causes a process crash.

Added TB_ENABLED env var (default: false) - TigerBeetle is only imported
when explicitly enabled. API returns empty results instead of crashing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 17:08:49 +07:00
Ruslan Bakiev
1c773e0ddc Remove public endpoint from KYC backend
KYC is auth-only: user must be logged in to create/view requests.
No public endpoint needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 16:57:14 +07:00
Ruslan Bakiev
aca82a213e Remove team endpoint from KYC backend
KYC is user-only flow: user creates application → workflow runs → team created.
No team endpoint needed.

Backend:
- Remove /graphql/team/ route
- Remove TeamGraphQLView and TeamJWTMiddleware
- Delete team_schema.py

Frontend:
- Remove kycTeam Apollo client
- Remove team:kyc mapping

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 16:54:12 +07:00
Ruslan Bakiev
25f5ef5a30 Fix TigerBeetle lazy initialization to prevent crash on import
The TigerBeetle Python client crashes when io_uring is not available
(common in containerized environments). Fixed by:

- Making TigerBeetle import lazy in admin.py (import inside methods)
- Making client connection lazy (only connect on first actual use)
- Simplified admin actions to use new create_accounts/create_transfers API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 16:00:34 +07:00
Ruslan Bakiev
2aa6d11db3 Add Billing API with M2M/Team schema separation and frontend
Backend changes:
- Create separate schemas: m2m_schema.py (internal) and team_schema.py (teams:member scope)
- Add teamBalance query (TigerBeetle lookup) and teamTransactions query
- Add TeamGraphQLView with BillingJWTMiddleware
- Add /graphql/team/ endpoint, remove old schema.py

Frontend changes:
- Add Billing to Sidebar navigation
- Create billing page with balance display and transactions list
- Add GraphQL operations for billing
- Add i18n keys for billing (ru/en)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 13:20:48 +07:00
Ruslan Bakiev
dccb9bb121 Fix selectedLocation resolver safety and regenerate GraphQL types
- Use getattr in resolve_selectedLocation to handle missing fields gracefully
- Regenerate GraphQL codegen with selectedLocation in GetMe response
2026-01-03 12:29:38 +07:00