Commit graph

119 commits

Author SHA1 Message Date
Ashwin Kumar
d151653ab1 chore: trigger rebuild 2026-04-09 21:51:17 +02:00
Ashwin Kumar
4fbc8d8b1f chore: trigger CI rebuild 2026-04-09 13:51:11 +02:00
Ashwin Kumar
73d167c333 fix: add OpenSSL static linking for musl builds
Added openssl-libs-static and OPENSSL_STATIC=1 environment variable
to fix reqwest/native-tls compilation errors with musl target.

Changes:
- Install openssl-libs-static in builder
- Set OPENSSL_STATIC=1 and OPENSSL_DIR=/usr
- Ensures OpenSSL is statically linked for all services
2026-04-09 11:59:57 +02:00
Ashwin Kumar
5b4e8fe908 refactor: use Alpine Linux with static musl binaries for all services
Switched from Debian to Alpine Linux for significant improvements:
- Image size: ~5MB vs ~100MB (95% smaller)
- Security: Minimal attack surface, no glibc vulnerabilities
- Static linking: No glibc version issues ever again
- Uses rust:alpine builder with x86_64-unknown-linux-musl target
- Static binaries with RUSTFLAGS='-C target-feature=+crt-static'

Fixes the GLIBC_2.38 error permanently by avoiding glibc entirely.
2026-04-09 11:51:57 +02:00
Ashwin Kumar
219960399b fix: update Dockerfiles to use debian:trixie-slim for glibc 2.38+ compatibility
Fixed glibc version mismatch between rust:latest builder (glibc 2.38+)
and debian:bookworm-slim runtime (glibc 2.36). This was causing:
- ./companies: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.38 not found
- ./payments: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.38 not found
- Similar errors for users service

Updated all 19 service Dockerfiles + Dockerfile.template to use
debian:trixie-slim which includes glibc 2.38+.
2026-04-09 11:48:46 +02:00
Ashwin Kumar
3e557e54e8 fix: convert all remaining SQLx macros in handlers to runtime API 2026-04-09 08:11:26 +02:00
Ashwin Kumar
83c62a1c5e fix: convert all SQLx macros to runtime API, remove SQLX_OFFLINE requirement 2026-04-09 07:40:15 +02:00
Ashwin Kumar
58eff5ce63 fix: regenerate SQLx cache and fix type annotation errors in offline mode 2026-04-09 07:01:31 +02:00
Ashwin Kumar
466b972e9f ci: trigger pipeline 2026-04-09 06:34:19 +02:00
Ashwin Kumar
1d3d07f001 fix: add Docker Hub login + switch runtime to AWS ECR Public to avoid rate limits 2026-04-09 06:26:01 +02:00
Ashwin Kumar
085b3169f6 fix: limit CARGO_BUILD_JOBS=2 to reduce OOM during parallel matrix builds 2026-04-09 05:55:50 +02:00
Ashwin Kumar
329f650079 fix: add SQLx offline cache and SQLX_OFFLINE=true for Docker builds 2026-04-09 05:46:32 +02:00
Ashwin Kumar
a2fa6cfbb9 fix: use rust:latest image tag (1.88 tag does not exist yet) 2026-04-09 05:34:07 +02:00
Ashwin Kumar
594086bdb0 fix: remove invalid build.rustdoc key from cargo config 2026-04-09 04:50:08 +02:00
Ashwin Kumar
1ffb489266 ci: trigger pipeline 2026-04-09 03:09:41 +02:00
Ashwin Kumar
a6ebbeb3f9 ci: trigger pipeline 2026-04-09 03:00:18 +02:00
Ashwin Kumar
e16d28a405 fix: track Cargo.lock (required for reproducible Docker builds) 2026-04-09 02:09:11 +02:00
Ashwin Kumar
3318a0aec1 fix: bump Rust to 1.88 to satisfy dependency toolchain requirements 2026-04-09 01:49:34 +02:00
Ashwin Kumar
0a067bcb7b fix: add libssl-dev and Cargo.lock to all service Dockerfiles 2026-04-09 01:43:28 +02:00
Ashwin Kumar
4b4a45f90d fix: bump Rust to 1.85 to support required dependency features 2026-04-09 01:23:44 +02:00
Ashwin Kumar
5d0c65bded ci: trigger pipeline 2026-04-09 01:16:49 +02:00
Ashwin Kumar
e924aaf5cb ci: pin docker-buildx to 5.0.0 to match PLUGINS_PRIVILEGED allowlist 2026-04-09 01:11:18 +02:00
Ashwin Kumar
4adab13314 ci: trigger pipeline 2026-04-09 01:10:06 +02:00
Ashwin Kumar
2afad6cb95 ci: revert privileged flag 2026-04-09 01:03:39 +02:00
Ashwin Kumar
2def9d056b ci: add privileged flag for docker-buildx plugin 2026-04-09 01:01:56 +02:00
Ashwin Kumar
b90243f89f ci: trigger pipeline 2026-04-09 01:00:59 +02:00
Ashwin Kumar
235c5fce76 ci: add Woodpecker CI matrix pipeline and missing cron Dockerfile
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 00:09:04 +02:00
Ashwin Kumar
3b52e71c75 chore: remove workflow file for current token permissions 2026-04-08 22:41:17 +02:00
Ashwin Kumar
2ded64e71b feat: extend admin/user flows with settings, verification, and approval updates 2026-04-08 22:40:54 +02:00
Ashwin Kumar
23c2edd567 feat: improve startup and routing
- Create scripts/init-db.sql for DB schema initialization
- Enhance start-services.sh to auto-initialize DB if needed
- Fix users admin handler: change root route from '/users' to '/' to avoid double prefix
- Remove deprecated handlers (departments/designations/employees) from users service
- Add missing admin route mappings for users and approval/case endpoints in gateway
- Update gateway to correctly handle /api/admin/users, /api/admin/approvals, etc.
- Update .env.example and docs

These changes enable running the stack without Docker and fix admin panel routing.
2026-04-07 22:12:37 +02:00
Ashwin Kumar
7928e21a21 fix: resolve all compilation warnings and errors across services
- Remove duplicate departments/designations/employees handlers from users service (already in employees service)
- Fix all 9 profession admin handlers to use correct DB schema (display_name, bio, location, custom_data)
- Fix companies admin handler to match CompanyProfile DB model with all fields
- Fix customers admin handler to match Requirement model with preferred_date
- Fix missing serde_json imports and type annotations in admin handlers
- Add #[allow(dead_code)] for intentionally unused structs/fields
- Add test infrastructure: auth crypto tests (2 passing), test directory structure
- Zero compilation warnings across all services
2026-04-07 12:52:55 +02:00
Ashwin Kumar
3716f60806 docs: add work implementation roadmap (wir.md)
Full plan for completing all pending features across backend, frontend,
and admin. Includes Beeceptor mock payment endpoints, Wave 1-5 breakdown,
file-level implementation details, and parallelization strategy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 22:26:45 +02:00
Ashwin Kumar
7457af5e3f feat: add admin leads endpoint and fix routing
- Customers service: add admin.rs with GET /api/admin/leads returning requirements with customer info
- Update customers main.rs to mount admin router at /api/admin/leads (instead of /api/admin/requirements)
- Gateway: route /api/admin/leads to customers service; remove /api/admin/requirements routing
- This enables Leads Management page to fetch all platform requirements
- Removed redundant /admin/requirements list page from frontend (kept detail page)
2026-04-06 19:23:47 +02:00
Ashwin Kumar
2c0c979c91 feat: add admin APIs for jobs, applications, and all 9 professions
- Companies service: add GET /api/admin/jobs and GET /api/admin/applications
- Gateway: route /api/admin/applications to companies; add routing for all 9 profession admin endpoints
- For each profession service (photographers, makeup_artists, tutors, developers, video_editors, graphic_designers, social_media_managers, fitness_trainers, catering_services):
  - Create admin.rs with list and detail endpoints that join with users
  - Update main.rs to mount admin router under /api/admin/<profession>
- Admin endpoints enable cross-platform visibility of all professionals by internal staff
2026-04-06 19:08:38 +02:00
Ashwin Kumar
13643ffb1b feat(companies): add admin jobs and applications list endpoints
- Add AdminJobRow and AdminApplicationRow response structs
- Implement GET /api/admin/jobs with company join and applications count
- Implement GET /api/admin/applications with applicant and job details
- Gateway routing update will follow
2026-04-06 18:56:23 +02:00
Ashwin Kumar
d996131890 feat: add activity logs audit endpoint, payment notifications, gateway routing
- Add activity_logs handler with paginated admin API
- Register /api/admin/activity-logs route in users service
- Add gateway routing for activity-logs to users service
- Trigger notification on successful tracecoin purchase
- Update handlers mod to include activity_logs module
2026-04-06 18:23:04 +02:00
Ashwin Kumar
ab25f7a994 feat(users): profile save, submit-for-verification, verification status endpoints
- profile.rs: GET/PATCH /api/profile, POST /api/profile/submit-for-verification,
  GET /api/me/verification-status — all role-aware, guards against duplicate pending
- verifications.rs: add POST /api/admin/verifications/:id/request-documents,
  fix RoleRepository/wallet_id match arm type errors
- coupons.rs: fix update_discount missing match block and i64/i32 type mismatch
- main.rs: mount /api/profile and /api/me verification-status routers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 17:20:49 +02:00
Ashwin Kumar
f3487ccff9 feat: verify payments with wallet credit, coupon validation, profile approval enhancements
- payments service: add DB persistence, wallet credit & ledger on verify
- users: coupons validate endpoint, coupon usage validation
- users: trigger_activation: assign user_role, credit 250 TC, ledger, notification
- users: add_notes: send document request notification
- fix employees port conflict
- update gateway payments route
- misc: add promotions and notifications on approval
2026-04-06 08:24:08 +02:00
Ashwin Kumar
cb53b68f49 feat: complete backend implementation - payments service, admin endpoints, auth guards, submit-for-verification for all roles
- Add payments service proxying to Beeceptor mock gateway (create-order, verify, status)
- Add companies admin approve/reject/suspend + get detail endpoints
- Apply require_admin auth guards to all employee/department/designation handlers
- Add submit-for-verification endpoint to all 12 roles (10 professions + job seekers + customers + companies)
- Fix port conflict (employees moved from 8085 to 8096)
- Add submit_for_verification methods to all profile repositories
2026-04-06 06:19:10 +02:00
Ashwin Kumar
5cd00b74bc feat: implement user verification system and database migrations 2026-04-06 03:39:41 +02:00
Ashwin Kumar
d5cfef0fa6 chore: update service startup script 2026-04-06 01:47:10 +02:00
Ashwin Kumar
89b055b329 Add UGC Content Creator microservice (10th professional role)
- New service at apps/ugc_content_creators (port 8095)
- DB model + repository in crates/db/src/models/ugc_content_creator.rs
- Migration: ugc_content_creator_profiles table with platforms, content_niches,
  content_formats, follower_count, handles, and standard status/timestamps
- Contracts: is_professional_profile_approved() handles UGC_CONTENT_CREATOR case
- Gateway: routes /api/ugc-content-creators to new service
- Workspace Cargo.toml updated with new member

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 21:14:02 +02:00
Ashwin Kumar
f9995586e2 chore: sync latest dashboard and role flow updates 2026-04-05 16:52:01 +02:00
Ashwin Kumar
5451ff5657 Fix users service startup panic — route syntax and admin login
- All /:param routes converted to /{param} (Axum v0.8 breaking change)
- admin.rs, kb.rs, reviews.rs, support.rs, pricing.rs, coupons.rs fixed
- employees app routes fixed (departments, designations, employees handlers)
- kb.rs multiline route definitions also fixed
- Users service now boots successfully

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 02:32:46 +02:00
Ashwin Kumar
3935277fb7 Fix backend compile errors after schema migrations
- employees.rs: rewrite for new standalone schema (email/password_hash,
  no user_id/role_id FK — matches 20260402030000 migration)
- migration: DROP old employees table before CREATE (old schema incompatible)
- pricing.rs: merge if-else sqlx::query! branches into single nullable param query
- kb.rs: fix target_roles Option<Vec<String>> unwrap, category_id Some() wrapping
- support.rs: fix .or() call with non-optional user_email (use Some())
- roles.rs: fix employees JOIN from role_id (deleted) to role_code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 02:25:47 +02:00
Ashwin Kumar
73629fa935 Fix pricing handler field name compatibility with admin UI
- Accept 'role' alias for 'role_key' and 'tracecoin_amount' alias for 'tracecoins_amount'
- Expose both field names in PackageDto so admin UI and user frontend both work

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 18:15:42 +02:00
Ashwin Kumar
2312f5dfdc Add public packages endpoint and register in gateway
- pricing.rs: public GET /api/packages?role= for user-facing package list
- main.rs: nest /api/packages public route
- gateway: route /api/packages to users service

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 18:11:44 +02:00
Ashwin Kumar
d900c361d8 Add reviews, coupons, discounts, pricing packages, and reports handlers
- handlers/reviews.rs: admin CRUD for /api/admin/reviews (list, create, patch status, delete)
- handlers/coupons.rs: admin CRUD for /api/admin/coupons and /api/admin/discounts
- handlers/pricing.rs: admin CRUD for /api/admin/tracecoin-packages + /api/admin/reports/{users,revenue}
- handlers/dashboard.rs: replace all hardcoded fake data with real DB queries (registrations per day, revenue per week, live KPIs including pending approvals and total revenue)
- Migrations: extend reviews table (nullable FKs + admin fields), add coupons.title/role_keys, create discounts table
- gateway: route new admin paths to users service

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 18:09:50 +02:00
Ashwin Kumar
96f9da2cdb feat: add KB and support ticket system
- 2 new migrations: summary/tags columns on kb_articles, description/requester fields on support_tickets
- handlers/kb.rs: public routes (GET /api/kb/categories|articles|articles/:slug) + admin CRUD (/api/admin/kb/*)
- handlers/support.rs: user ticket routes + admin support-cases CRUD with internal notes
- Registered all new routes in users service main.rs
- Gateway resolve_upstream: /api/kb/*, /api/support/*, /api/admin/kb/*, /api/admin/support-cases/* → users service
- scripts/seed_kb.sql: 8 categories, 28 full-length published articles covering all user roles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 13:36:12 +02:00
Ashwin Kumar
446b6322de feat(admin): wire management modules to live backend and add UGC role 2026-04-02 13:09:43 +02:00