nxtgauge-backend-rust/apps
Ashwin Kumar Sivakumar 68f659903c fix: audit_logs, tax_rules, reviews tables never existed; fix wrong column in review creation
Finished the sweep of every table referenced by live Rust code but not
created by any active migration:

- audit_logs / audit_log_changes — backs wallet::audit() (crates/wallet),
  called from every admin Tracecoin balance adjustment
  (apps/payments/src/admin.rs::adjust_credits). actor_type defaulted since
  the only caller doesn't supply it.
- tax_rules — backs the admin tax-rule CRUD in apps/payments/src/admin.rs.
  init-db.sql has a differently-named version (title/percentage/
  applicable_to); schema here matches the live code's actual columns
  (name/tax_rate/applies_to).
- reviews — backs the professional review/rating system
  (apps/users/src/handlers/reviews.rs).

Also fixed a real bug found while building the reviews schema:
admin_create_review's customer-lookup subquery selected
`lead_requests.user_id`, a column that has never existed (it's
`customer_user_id`) — would have failed on the very first review
creation attempt now that lead_requests actually exists.

Checked every other previously-flagged table (permissions, orders,
external_roles, internal_roles, kb_*, notification_*, order_items,
portfolio_images, smtp_configs, dashboard_widgets,
verification_documents) against actual Rust usage — none of them are
referenced by a real SQL query (grep hits were all Rust variable/type
names), so nothing to fix there. Full migration-chain sweep confirms
zero remaining "references a table before it's created" issues.
2026-07-21 03:05:14 +05:30
..
catering_services fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
companies fix: company profile submission stored wrapper object as verification payload 2026-07-19 22:03:36 +05:30
cron fix: company job posting, job seeker profile submission, and job applications 2026-07-21 01:00:47 +05:30
customers fix: customer document submission and profile verification 2026-07-21 01:39:25 +05:30
developers fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
employees fix(db): make three more migrations idempotent; log swallowed login DB error 2026-07-19 04:40:31 +05:30
fitness_trainers fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
gateway chore: retrigger isolated CI builds for 6 more services on bad digests 2026-07-15 03:01:39 +05:30
graphic_designers fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
job_seekers fix: company job posting, job seeker profile submission, and job applications 2026-07-21 01:00:47 +05:30
jobs chore: retrigger isolated CI builds for 6 more services on bad digests 2026-07-15 03:01:39 +05:30
leads feat: human-readable reference numbers + fix verification document visibility 2026-07-19 16:34:00 +05:30
makeup_artists fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
payments feat: generate a GST invoice automatically after a successful Tracecoin/PayU purchase 2026-07-21 03:02:47 +05:30
photographers fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
social_media_managers fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
tutors fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
ugc_content_creators fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30
users fix: audit_logs, tax_rules, reviews tables never existed; fix wrong column in review creation 2026-07-21 03:05:14 +05:30
video_editors fix: profession admin listing endpoints matched role_key in the wrong case 2026-07-21 01:28:09 +05:30