Nxtgauge Backend Services
Tracing "can a professional send a request to contact a customer" surfaced two more breaks in the same family as everything else fixed this session: 1. crates/db/migrations/20260719120000_reference_numbers.up.sql (not yet pushed) unconditionally ran `ALTER TABLE job_applications ...` and `ALTER TABLE lead_requests ...`. Neither table was ever created by any active (non .skip) migration, so this migration would fail outright on a clean apply and block every migration after it in the chain — including all of this session's other fixes. Moved the reference_number column/trigger/backfill logic for job_applications and lead_requests into their own table-creation migrations instead, where the tables are guaranteed to exist. 2. lead_requests (LeadRequestRepository, send_lead_request in profession_shared.rs, list_requests/approve_request/reject_request in apps/customers/src/handlers.rs) was only ever defined in disabled .skip migrations, and even those didn't match the columns the current Rust code reads/writes (missing professional_user_id and reference_number; `message`/`customer_user_id`-only shape instead of `remarks`/`requested_at`/`resolved_at`). Added a migration with the schema the live code actually needs. 3. Same root cause found for tracecoin_wallets/tracecoin_ledger — only ever defined in .skip migrations, and with stale column names (`type`/`reason` vs. the `transaction_type`/`reference_type` the Tracecoin reservation code in TracecoinWalletRepository actually uses. These back the credit reservation that happens when a lead request is sent. Created them with CREATE TABLE IF NOT EXISTS (safe no-op if they already exist under any name/history) plus a best-effort ADD COLUMN IF NOT EXISTS fallback for the stale-name scenario. NOTE: an already-deployed migration (20260318233000_tracecoin_ledger_immutable, already on origin) creates triggers directly on tracecoin_ledger, assuming it already exists. That migration was NOT touched here since editing already-pushed migration history is out of scope for a blind fix — if tracecoin_ledger doesn't already exist in the real database, that migration has been failing since it was deployed and needs a human to check `_sqlx_migrations` / actual schema state directly. |
||
|---|---|---|
| .cargo | ||
| .forgejo | ||
| .gitea/workflows | ||
| .github/workflows | ||
| .mavis/plans | ||
| .sqlx | ||
| apps | ||
| crates | ||
| docs | ||
| load-tests | ||
| scripts | ||
| tests | ||
| .env.example | ||
| .env.test111 | ||
| .gitignore | ||
| cargo-deny.toml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| companies.pid | ||
| customers.pid | ||
| DEPLOYMENT_OPTIMIZATION.md | ||
| docker-compose.yml | ||
| Dockerfile.base | ||
| Dockerfile.fast | ||
| Dockerfile.from-binary | ||
| Dockerfile.migrate | ||
| Dockerfile.optimized | ||
| Dockerfile.simple | ||
| Dockerfile.superfast | ||
| Dockerfile.template | ||
| Dockerfile.ultrafast | ||
| Dockerfile.working | ||
| gateway.pid | ||
| job_seekers.pid | ||
| k8s-migration-job.yaml | ||
| README.md | ||
| start-services.pid | ||
| start-services.sh | ||
| TESTING_STRATEGY.md | ||
| users.pid | ||
| wir.md | ||
NXTGAUGE Backend Rust
Rust migration target for nxtgauge-nov-2025-backend, preserving the same microservices and request flow.
Target Service Topology
gateway(HTTP API)users(identity, runtime roles, onboarding, approvals)companiescustomersprofessionalsjobseekers
Migration Policy
- Keep contracts stable (REST + proto semantics).
- Keep runtime-config and onboarding schema behavior unchanged during parity phases.
- Replace service implementations one by one.
See docs/MIGRATION_MASTER_PLAN.md for full staged plan.
CI (Woodpecker)
Required secrets:
REGISTRY_USERNAMEREGISTRY_PASSWORD
See .forgejo/workflows/README.md for details.