Nxtgauge Backend Services
Find a file
Ashwin Kumar Sivakumar 63fd3f5135 feat: generate a GST invoice automatically after a successful Tracecoin/PayU purchase
crates/invoice (InvoiceService, GST computation, HTML rendering) was
fully built but never wired to anything and never had its tables —
invoices/invoice_line_items/billing_profiles/invoice_number_seq never
existed in any active migration (same root cause as everything else
this session: only in scripts/init-db.sql, which the real db-migrate
job never runs). Created them, matching InvoiceService's actual
columns exactly rather than init-db.sql's older, simpler invoices
shape.

Fixed a real bug in InvoiceService::create while at it: four money
fields (total, and three line-item amounts) were bound as i64 against
columns/read-models that are i32 everywhere else — would have failed
every insert with a Postgres type mismatch the first time this code
ever actually ran against a real table.

Wired invoice generation into apps/payments' PayU verify_payment
handler (the actual success callback) — right after the wallet is
credited, a one-line-item GST invoice is generated from the purchased
package and PayU's billing fields (firstname/email/phone), using a
new INVOICE_SELLER_* env-configurable seller identity. Generation
failures are logged, not surfaced to the buyer, since the payment and
wallet credit have already succeeded by that point.

Also added the missing user-facing endpoints to fetch what got
generated: GET /api/payments/invoices (list) and
GET /api/payments/invoices/{id} (detail + line items) — previously
only admin-side invoice viewing existed.

NOTE: the frontend (nxtgauge-frontend-solid, a separate repo) has an
existing invoice-viewing page at src/routes/dashboard/wallet/invoices/
but it calls /wallet/me/invoices (no /api/ prefix) via a different,
apparently-dead API helper (api.get, not apiFetch) that every other
live page avoids — same dead-code pattern as the earlier apps/leads
discovery. The live purchase flow (CreditsPage.tsx) has no invoice UI
at all yet. Not fixed here since it's out of this repo's scope this
session — flagging for a frontend pass.
2026-07-21 03:02:47 +05:30
.cargo fix: update jsonwebtoken 9.3→10.3, add audit.toml to ignore local crate false positives, fix cache/ollama.rs compile errors 2026-05-31 18:25:38 +05:30
.forgejo fix(ci): sort registry prune by real image build time, protect current SHA 2026-07-17 05:38:27 +05:30
.gitea/workflows ci(forgejo): update backend build pipeline 2026-07-03 19:51:37 +05:30
.github/workflows ci: remove GitHub Actions workflow - using Forgejo CI exclusively 2026-07-06 04:19:40 +05:30
.mavis/plans feat: add LiteLLM support and auto-apply cron job 2026-06-14 18:00:38 +02:00
.sqlx chore: checkpoint workspace updates 2026-04-26 23:58:43 +02:00
apps feat: generate a GST invoice automatically after a successful Tracecoin/PayU purchase 2026-07-21 03:02:47 +05:30
crates feat: generate a GST invoice automatically after a successful Tracecoin/PayU purchase 2026-07-21 03:02:47 +05:30
docs feat(ai): complete AI plans/credits implementation and build tooling 2026-06-15 06:15:49 +05:30
load-tests feat(emails): complete email system with 35 branded templates and full wiring 2026-04-10 04:49:39 +02:00
scripts fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
tests fix: resolve all compilation warnings and errors across services 2026-04-07 12:52:55 +02:00
.env.example feat(emails): complete email system with 35 branded templates and full wiring 2026-04-10 04:49:39 +02:00
.env.test111 fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
.gitignore fix: track Cargo.lock (required for reproducible Docker builds) 2026-04-09 02:09:11 +02:00
cargo-deny.toml feat: extend admin/user flows with settings, verification, and approval updates 2026-04-08 22:40:54 +02:00
Cargo.lock feat: generate a GST invoice automatically after a successful Tracecoin/PayU purchase 2026-07-21 03:02:47 +05:30
Cargo.toml feat: profile photo upload, PDF resume generation, AI auto-apply, schema fixes 2026-07-02 13:31:06 +02:00
companies.pid feat: update DB schema - split users.first_name, users.last_name, roles split 2026-04-15 06:23:27 +02:00
customers.pid feat: update DB schema - split users.first_name, users.last_name, roles split 2026-04-15 06:23:27 +02:00
DEPLOYMENT_OPTIMIZATION.md feat(deployment): add optimized build system for faster deployments 2026-04-10 05:14:27 +02:00
docker-compose.yml fix(docker-compose): switch from GHCR to Forgejo registry 2026-07-06 03:52:35 +05:30
Dockerfile.base fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
Dockerfile.fast fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
Dockerfile.from-binary feat(woodpecker): use internal registry docker-registry.registry.svc.cluster.local:5000 2026-04-10 17:39:26 +02:00
Dockerfile.migrate fix(migrate): fix db-migrate build and job manifest, both broken 2026-07-19 03:07:26 +05:30
Dockerfile.optimized fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
Dockerfile.simple perf(ci): cache cargo registry and target dir across image builds 2026-07-16 21:07:33 +05:30
Dockerfile.superfast fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
Dockerfile.template fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
Dockerfile.ultrafast fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
Dockerfile.working fix: Update Dockerfiles to use ci.nxtgauge.com registry 2026-07-08 03:37:18 +05:30
gateway.pid feat: update DB schema - split users.first_name, users.last_name, roles split 2026-04-15 06:23:27 +02:00
job_seekers.pid feat: update DB schema - split users.first_name, users.last_name, roles split 2026-04-15 06:23:27 +02:00
k8s-migration-job.yaml fix(migrate): fix db-migrate build and job manifest, both broken 2026-07-19 03:07:26 +05:30
README.md trigger: force build all services with high-performance-latest tag 2026-06-12 03:45:06 +05:30
start-services.pid chore: checkpoint workspace updates 2026-04-26 23:58:43 +02:00
start-services.sh Update backend services: catering_services, companies, developers, gateway, job_seekers, photographers, social_media_managers, tutors, ugc_content_creators, users; update cache (otp, token), contracts (profession_shared, profession_state), db (job_seeker, verification), email; add revision-requested email template; update init-db.sql and start-services.sh 2026-05-08 15:34:29 +02:00
TESTING_STRATEGY.md fix: resolve all compilation warnings and errors across services 2026-04-07 12:52:55 +02:00
users.pid feat: update DB schema - split users.first_name, users.last_name, roles split 2026-04-15 06:23:27 +02:00
wir.md docs: add work implementation roadmap (wir.md) 2026-04-06 22:26:45 +02:00

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)
  • companies
  • customers
  • professionals
  • jobseekers

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_USERNAME
  • REGISTRY_PASSWORD

See .forgejo/workflows/README.md for details.

Trigger build Fri Jun 12 03:45:06 AM IST 2026