Commit graph

39 commits

Author SHA1 Message Date
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
Ashwin Kumar
ec34423b86 feat(phase1): wire email notifications, shared email crate, AppState for services
- Create crates/email shared Mailer with 18+ templates (auth, approvals, jobs, leads, tracecoins)
- users/mail.rs now re-exports from shared crate (lettre dep removed)
- Wire password changed/reset emails in users auth handlers
- Wire profile approval/rejection emails in users approvals handlers (company, customer, all 9 professional types)
- Wire job approved/rejected emails in users approvals handlers
- Wire requirement approved email in users approvals handlers
- Add AppState (pool + mail) to companies service; wire submit_job and update_application_status emails
- Add AppState (pool + mail) to customers service; wire submit_requirement, approve_request, reject_request emails (incl. contact-exchange on lead acceptance)
- Add AppState (pool + storage) to job_seekers service with resume upload multipart handler
- Wire lead cancellation and accepted-leads handlers in contracts/profession_shared.rs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 01:42:48 +02:00
Ashwin Kumar
4a233843f6 Update users handlers for config and management endpoints 2026-03-30 04:52:27 +02:00
Ashwin Kumar
b602c8df53 feat(runtime-config): derive enabled modules from internal role permissions 2026-03-27 21:34:28 +01:00
Ashwin Kumar
7dec3e85fb feat(users): admin runtime configs + external roles + employees APIs 2026-03-27 21:25:31 +01:00
Ashwin Kumar
3b28d9fd36 feat: add designation management CRUD backend
Full CRUD handler for designations with department JOIN, employee count,
level/can_manage_team/can_approve fields, and migration to extend the
minimal designations table with all management columns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 19:20:55 +01:00
Ashwin Kumar
89d9e3b861 chore: sync local changes 2026-03-26 20:58:43 +01:00
Ashwin Kumar
a7a0854a5b Fix environment variable exports in start-services 2026-03-26 00:36:14 +01:00
Ashwin Kumar
0be46d328a feat: add phase 2 dashboard metrics api 2026-03-25 23:55:44 +01:00
Ashwin Kumar
d49a29b965 chore: cleanup — remove stub professionals app, empty crates, unused import
- Delete apps/professionals (all stub handlers returning mock data, shadowed
  by individual profession services on ports 8085-8093)
- Delete empty crate dirs: crates/config, crates/errors, crates/observability
  (already removed from Cargo.toml workspace members, stale directories)
- Delete empty apps/jobseekers dir (duplicate of apps/job_seekers)
- Remove unused Uri import from gateway main.rs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 23:35:30 +01:00
Ashwin Kumar
e1ea3f5ffe Align role handlers and shared profession contract updates 2026-03-25 23:03:12 +01:00
Ashwin Kumar
b82f294331 chore: checkpoint current workspace changes 2026-03-25 22:15:07 +01:00
Ashwin Kumar
ac27184ae2 feat(approvals): add GET /submission/{user_id} handler for admin submission viewer
Returns user info + onboarding state progress_json for a given user and
roleKey, enabling the admin panel to display full onboarding form answers
during approval review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:34:49 +01:00
Ashwin Kumar
91534d74c0 chore: checkpoint current workspace changes 2026-03-22 15:55:29 +01:00
Ashwin Kumar
cb36e2fa7d fix(seed): align upsert conflict targets with partial unique indexes 2026-03-21 15:17:59 +01:00
Ashwin Kumar
3b6d0f4951 feat(backend): enforce profile approvals and complete migration approval flows 2026-03-19 00:30:23 +01:00
Ashwin Kumar
9764a7acdd feat: commit remaining service files, migrations, and model updates
- gateway, companies, customers, job_seekers apps updated
- users config/mod/mail handlers
- auth middleware and jwt crate updates
- db models: user, config, mod updates
- all remaining migrations: portfolio, notifications, reviews, kb, support, coupons, onboarding states

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 22:59:47 +01:00
Ashwin Kumar
bb8155dd27 feat: add Redis for OTP, auth tokens, rate limiting, lead dedup and marketplace cache
- Add crates/cache with client, otp, rate_limit, token, lead, jobs modules
- OTP tokens stored in Redis (15-min TTL, single-use GETDEL on verify)
- Refresh tokens stored in Redis (30-day TTL) — removed DB storage
- Password reset tokens stored in Redis (1-hour TTL, single-use)
- Rate limiting: register (10/hr), login (10/15min), OTP resend (3/hr), lead (5/hr), job post (20/hr)
- Lead request deduplication: 24-hour Redis lock per professional+requirement pair
- Marketplace listings cached in Redis (5-min TTL per profession+page+limit)
- Add ProfessionState{pool, redis} to contracts crate, replacing bare PgPool in all 9 profession apps
- All profession handlers and main.rs updated to use ProfessionState
- REDIS_URL env var (default: redis://127.0.0.1:6379) used across all services
- Fix profession model struct name mangling in 6 handlers (MakeupArtistRepository etc.)
- Add custom_data JSONB migration for all 9 profession profile tables
- Add onboarding_state model and repository (save_progress, complete, is_complete)
- Add onboarding handler accepting roleKey:String (not role_id:UUID) for frontend compat

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 22:58:42 +01:00
Ashwin Kumar
5640cd4ee5 feat: complete rust microservices migration with real db logic 2026-03-17 20:42:51 +01:00
Ashwin Kumar
20684655d7 chore: bootstrap rust backend workspace and migration master plan 2026-03-16 22:23:58 +01:00