Commit Graph
258 Commits
Author SHA1 Message Date
asepharyana aa0b659b48 docs: SMTP fixed + Midtrans provider status in audit findings 2026-08-05 13:38:02 +07:00
asepharyana 9214b32139 feat(dimentorin): Midtrans payment provider (sandbox VA + QRIS)
- Env: MIDTRANS_MERCHANT_ID / CLIENT_KEY / SERVER_KEY (masked in Debug)
- midtrans_provider: Core API v2/charge for bank_transfer (VA BCA) and qris (gopay)
- PaymentServiceImpl: when MIDTRANS_MERCHANT_ID set -> provider=midtrans, external_ref = real VA number / QR string; falls back to manual refs otherwise
- SMTP: Google app password working (send-otp 200, OTP stored)
- E2E verified (sandbox): VA externalRef=47329093597744219189188, QRIS qr_string EMVCo, confirm->paid
- Credentials stored in BWS (dimentorin_midtrans_*, dimentorin_smtp_*)
2026-08-05 13:34:59 +07:00
asepharyana 2ea6cd3d17 docs: payment flow status in audit findings 2026-08-05 09:32:37 +07:00
asepharyana 6d5af29de8 feat(dimentorin): confirm payment auto-confirms linked session
- confirm_payment now transitions linked session pending->confirmed
- e2e verified: book -> create payment -> admin confirm -> session confirmed + payment paid
2026-08-05 09:32:04 +07:00
asepharyana 444c98074f feat(dimentorin): payment module - gateway-agnostic VA/QRIS with admin confirm
- app_payments table + PaymentEntity (amount from mentor mentoring_rate + service fee 2000)
- PaymentRepository (postgres) + PaymentServiceImpl (create/get/confirm/list)
- Routes: POST /payments/sessions/{id}/create, GET /payments/me, GET /payments/{id}, POST /payments/{id}/confirm
- confirm guarded by Admin/Admin Pembayaran role; ownership guard mentee-only view
- provider=manual default (swap midtrans/xendit later), e2e verified: VA+QRIS create, confirm 200, re-confirm 409, non-admin 403, foreign payment 403
2026-08-05 09:10:39 +07:00
asepharyana c6ed5c5c19 fix(dimentorin): verify-email validates OTP before activating user
- new app_otp_cache table + OtpCache entity (ResourceEnum::OtpCache)
- PostgresOtpRepository upsert/find/delete keyed by email
- register/resend persist otp_hash+expiry after email sent (no orphan OTP)
- verify_email validates via OtpManager::validate_otp_hash, single-use delete
- 8 unit tests pass, e2e verified: wrong OTP 400, correct OTP 200
2026-08-04 23:35:34 +07:00
asepharyana 3692b81324 feat(dimentorin): mentor stats endpoint public - total sessions, unique mentees, avg rating
- GET /mentors/{id}/stats (public, no auth)
- resolve mentor profile id -> user id in get_mentor_sessions (FK uses app_users.id)
2026-08-04 23:09:08 +07:00
asepharyana 9b5efeff87 fix(dimentorin): register mentor flow - zod regex attr, uuid id override in user & mentor repos
- Remove broken zod_rs regex() attribute (always fails, blocks password validation)
- user repo create: honor entity.id instead of silently generating new v4 (broke FK mentor.user_id)
- mentor repo create: set id explicitly (was NULL not-null violation)
2026-08-04 20:03:08 +07:00
asepharyana 1d34d29b0b feat(dimentorin): complete articles module - HTTP layer, routes, categories fix, seed 2026-08-04 19:16:45 +07:00
asepharyana 7d1078f52a fix(dimentorin): resolve mentor profile id to user id before booking session 2026-08-04 18:34:13 +07:00
asepharyana 67d3f2fced feat(dimentorin): add public mentor list & detail endpoints (verified only)
Nix Build & Deploy / build (push) Canceled after 0s
Nix Build & Deploy / deploy (push) Canceled after 0s
2026-08-04 17:55:59 +07:00
maulanasdqnandClaude Opus 4.6 b68e362a02 fix: extract user_id (UUID) from JWT instead of email in session handlers
Nix Build & Deploy / build (push) Canceled after 0s
Nix Build & Deploy / deploy (push) Canceled after 0s
All session handlers were passing the user's email to service methods
that expected a UUID, causing "Invalid user ID" errors. Now extracts
user_id from JWT claims instead.

Fixed: get_my_sessions, post_book_session, put_update_session_status,
post_submit_feedback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 21:00:32 +07:00
maulanasdqnandClaude Opus 4.6 db44c5a51f feat: add roadmap CRUD module to CMS
New endpoints under /v1/landing/cms:
- GET /roadmap — public, paginated list
- GET /roadmap/detail/{id} — public, detail
- POST /roadmap/vote/{id} — public, increment votes
- POST /roadmap/create — protected (Administrator)
- PATCH /roadmap/update/{id} — protected (Administrator)
- DELETE /roadmap/delete/{id} — protected (Administrator)

Table: roadmap_items (id, title, description, status, votes, is_deleted, created_at, updated_at)
Status values: upcoming, in_progress, completed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 21:42:15 +07:00
maulanasdqnandClaude Opus 4.6 6570bbf752 fix: add all frontend origins to default CORS allowed list
Added backoffice, hackathon, qr, and infra subdomains to the default
CORS_ALLOWED_ORIGINS. Previously only gacha, imphnen.dev, and
dimentorin were allowed, causing Network Error on other apps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 16:04:48 +07:00
maulanasdqnandClaude Opus 4.6 5667a0d608 feat: add include query param and sessions to unified /me endpoint
GET /v1/iam/users/me now supports ?include=hackathon,qr,mentor,sessions
to control which module profiles are returned. Omitting the param
returns all modules. Also added dimentorin sessions data.

Examples:
  /v1/iam/users/me                        → all modules
  /v1/iam/users/me?include=hackathon      → only hackathon profile
  /v1/iam/users/me?include=mentor,sessions → mentor + sessions only

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 12:28:55 +07:00
maulanasdqnandClaude Opus 4.6 a4bbc73c7e feat: unify /me endpoint to aggregate all module profiles
GET /v1/iam/users/me now returns hackathon, QR, and mentor profiles
alongside the core IAM user data. Module-specific profiles are
included as optional fields when the user exists in those modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 09:47:27 +07:00
maulanasdqnandClaude Opus 4.6 729335014f fix: use correct Swagger security scheme name across all modules
Changed "bearer_auth" to "Bearer" in utoipa security annotations
for QR and Hackathon handlers to match the registered SecurityAddon
scheme name. Fixes Swagger UI not sending Authorization header.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 00:11:01 +07:00
maulanasdqnandClaude Opus 4.6 852e9652ee fix: correct middleware layer ordering in QR routes
Same issue as hackathon routes - qr_auth_middleware needs Arc<PgPool>
from Extension but was outermost layer. Swapped order so pool is
available when middleware runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 23:32:39 +07:00
maulanasdqnandClaude Opus 4.6 f225ee8969 fix: correct middleware layer ordering in hackathon routes
The hackathon_auth_middleware requires Arc<PgPool> from Extension,
but was applied as the outermost layer (running before Extension(pool)
was injected). Swapped layer order so pool Extension is outermost,
making it available when the auth middleware runs.

Fixes 500 errors on all /v1/hackathon/* authenticated endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 22:21:30 +07:00
maulanasdqnandClaude Opus 4.6 4ee00f1fe5 fix: resolve permission UUIDs to names in role DTO
The build_role_dto function was using permission UUIDs as both id and
name fields. Now resolves UUIDs to human-readable names via
PermissionsEnum::iter() lookup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:52:50 +07:00
maulanasdqnandClaude Sonnet 4.6 d014a94ea4 feat: add response examples to all hackathon and QR swagger endpoints
Each endpoint now shows a realistic JSON example (data wrapper + version)
so developers can see the exact response shape without calling the API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 02:37:06 +07:00
maulanasdqnandClaude Sonnet 4.6 e1bc336baa feat: add utoipa path annotations to hackathon and QR handlers, register in swagger
All hackathon endpoints (/v1/hackathon/*) and QR endpoints (/v1/qr/*)
are now visible in the Swagger UI at /docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 01:22:38 +07:00
maulanasdqnandClaude Sonnet 4.6 8144ab40e9 fix: update remaining /v1/users path to /v1/iam/users in swagger
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 00:46:56 +07:00
maulanasdqnandClaude Sonnet 4.6 76201d8d3e feat: add module prefixes to all routes and load all modules in swagger
Route structure:
  /v1/iam/auth/*         (was /v1/auth/*)
  /v1/iam/users/*        (was /v1/users/*)
  /v1/iam/roles/*        (was /v1/roles/*)
  /v1/iam/permissions/*  (was /v1/permissions/*)
  /v1/landing/cms/events/*        (was /v1/cms/landing/events/*)
  /v1/landing/cms/testimonials/*  (was /v1/cms/landing/testimonials/*)
  /v1/dimentorin/mentors/*   (was /v1/mentors/*)
  /v1/dimentorin/sessions/*  (was /v1/sessions/*)
  /v1/gacha/*            (unchanged)
  /v1/hackathon/*        (unchanged)
  /v1/qr/*               (unchanged)

Swagger: add gacha_credits endpoints which were missing from OpenAPI spec.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 00:26:29 +07:00
maulanasdqnandClaude Sonnet 4.6 c38b718eb4 fix: migrate all route path params from :param to {param} syntax
Axum 0.8+ requires {param} capture group syntax.
:param style was causing runtime panic on startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 23:56:59 +07:00
maulanasdqnandClaude Sonnet 4.6 222495472a ci: allow deploy on workflow_dispatch trigger
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 23:26:38 +07:00
maulanasdqnandClaude Sonnet 4.6 12db8cc6b4 ci: fix SSH pipe drop on long nixos-rebuild, add workflow_dispatch
- Add ServerAliveInterval=30/ServerAliveCountMax=40 to prevent broken
  pipe during nixos-rebuild switch (up to 20min keepalive)
- Remove continue-on-error so deploy failures are visible
- Add workflow_dispatch trigger for manual reruns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 22:44:10 +07:00
maulanasdqnandClaude Sonnet 4.6 331a4a4e88 feat: v0.3.0 — standardize codebase, centralize infra, merge QR into CMS
- Enforce axum best practices across all 13 workspace crates
  (max 200 LOC/file, no comments, no unwrap, clean architecture)
- Fix domain→infrastructure dependency inversions in imphnen-iam and imphnen-dimentorin
- Extract imphnen-storage (MinIO) and imphnen-email (Lettre) as standalone crates
- Centralize all config in ENV struct: CDN_URL, CORS_ALLOWED_ORIGINS
- Centralize SMTP through imphnen-email; remove dead HackathonConfig
- Centralize database: QR crate now shares main DB pool (single DATABASE_URL)
- Rename QR users table to qr_users to avoid collision with main users table
- Merge imphnen-qr into imphnen-cms/src/qr (13 crates, down from 14)
- Restructure imphnen-hackathon flat modules into clean architecture
- Remove all stale env vars from .env.example (SurrealDB, QR_JWT, Hackathon infra)
- Fix Dockerfile to include all current workspace crates
- Bump all crate versions 0.2.0 → 0.3.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 22:29:08 +07:00
maulanasdqnandClaude Sonnet 4.6 2ae43b3bcc refactor: centralize auth system across all modules
All modules now use the main IAM JWT (ACCESS_TOKEN_SECRET) for authentication,
removing three separate auth systems (hackathon Supabase, hackathon JWT, QR JWT).

Changes:
- hackathon: replace HackathonJwtService with decode_access_token() from imphnen-libs
  - remove entire src/auth/ (Supabase signup/login/GitHub/forgot-reset)
  - remove common/hackathon_jwt.rs, common/supabase_client.rs
  - remove Supabase from HackathonConfig (JWT, GitHub OAuth, Supabase anon/service keys)
  - replace Supabase Storage with MinioService from imphnen-libs
  - all route jwt params removed; hackathon_router takes MinioService instead
- qr: replace QrJwtService with decode_access_token() from imphnen-libs
  - remove entire src/auth/ (register/login/Google OAuth/refresh)
  - remove common/qr_jwt.rs, src/config.rs
  - qr_auth_middleware now lazy-upserts users into QR DB on first access
  - qr_router(pool) — no config needed
- gateway: create MinioService once and pass to hackathon_router; qr_router simplified

Users now register/login via /v1/auth/* and use the same JWT for all endpoints.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 16:33:02 +07:00
maulanasdqnandClaude Sonnet 4.6 4bba182ea3 feat: migrate imphnen-backend-qr into workspace as imphnen-qr crate
Ports the Go QR campaign overlay service to a self-contained Rust crate
nested at /v1/qr/... in the gateway.

Features:
- Auth: register, login, Google OAuth, JWT refresh (bcrypt compat with Go DB)
- Users: profile management + admin CRUD (list/role/delete)
- Campaigns: create (auto-generates QR PNG via qrcode crate), list,
  activate, delete; process-image endpoint overlays active campaign QR
  onto uploaded images (bottom-right corner, image crate)
- QR pool connects to imphnen_qr database via QR_DATABASE_URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 16:03:39 +07:00
maulanasdqnandClaude Sonnet 4.6 5715e75593 fix: remove unused imports in imphnen-hackathon
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 15:47:23 +07:00
maulanasdqnandClaude Sonnet 4.6 11442c6285 feat: migrate imphnen-backend-hackathon into workspace as imphnen-hackathon crate
Consolidates the standalone hackathon backend (16 crates) into a single
imphnen-hackathon crate following the existing clean architecture patterns.
All endpoints are exposed under /v1/hackathon/ via the gateway.

Features migrated:
- Auth: Supabase-based signup/login/GitHub OAuth/password reset (own JWT)
- Users: profile management with team listing
- Teams: CRUD with city validation, deadline enforcement, invite system
- Invitations: team member invitations with accept/reject flow
- Join Requests: team join request workflow
- Chat: team messaging with author/leader delete permissions
- Submissions: project submission lifecycle (draft→pending→submitted)
- Storage: Supabase Storage file upload endpoints
- Certificates: public user certificate data endpoint
- Winners: public winners listing
- Admin: admin-only CRUD for all entities

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 15:15:00 +07:00
maulanasdqn 05a5b39195 fix: pre-fetch swagger-ui assets for Nix sandbox build 2026-04-02 14:09:26 +07:00
maulanasdqn 052fee4b78 chore: update nixpkgs to 2026-04-01 (Rust 1.85+ for edition2024) 2026-04-02 14:04:50 +07:00
maulanasdqn c825a78c6f ci: trigger nix build & deploy pipeline 2026-04-02 14:01:02 +07:00
maulanasdqnandClaude Sonnet 4.6 c4280e9953 ci: replace legacy workflows with nix-build.yml
Switch from cargo-based build + SCP deploy to Nix build + Cachix +
infra flake.lock update pattern, matching imphnen-frontend-service.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 13:49:57 +07:00
maulanasdqnandClaude Sonnet 4.6 30128a8fe2 nix: expose overlay and NixOS module for infrastructure deployment
- Fix default.nix to build from workspace (imphnen-backend/Cargo.toml)
- Add overlays.default adding pkgs.imphnen-backend
- Add nixosModules.backend via nixos-module.nix
- NixOS module defines systemd service on port 8081 with environmentFile

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 13:44:23 +07:00
maulanasdqnandClaude Sonnet 4.6 e432a1a743 refactor: migrate to clean architecture with trait-based DI (v0.2.0)
Complete architectural overhaul across all 12 crates:

- Replace validator crate with zod-rs for all DTO validation
- Replace manual pagination with paginator-rs/paginator-sea-orm
- Migrate all modules (iam, cms, gacha, dimentorin) to clean architecture:
  domain → application → infrastructure layers
- Introduce trait-based DI (Arc<dyn Trait>) at every layer for repositories and services
- Delete all v1/ legacy SurrealDB-era code across every crate
- Replace opaque response helpers with typed IntoResponse structs (ApiSuccess, ApiCreated, ApiPaginated, ApiMessage)
- Remove dual_mode_repository, migration_validation_errors, validator.rs dead code
- Zero cargo clippy warnings; release build clean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v0.2.0
2026-04-02 13:39:52 +07:00
Maulana SodiqinandGitHub 1b3366d735 Merge pull request #47 from IMPHNEN/feat/postgress
postgress
2026-01-15 14:20:18 +07:00
MythEclipse b429b3a9c7 postgress 2025-12-01 00:20:42 +07:00
Maulana SodiqinandGitHub 6fe495eed1 Merge pull request #46 from IMPHNEN/submissions
Submissions
2025-10-29 17:13:16 +07:00
MythEclipse 97c2fce7be Refactor API endpoints for consistency and clarity
- Updated route paths for hackathon submissions, notifications, registrations, and teams to include more descriptive actions (e.g., "update", "create", "delete").
- Removed deprecated routes and adjusted corresponding test cases to reflect new endpoint structures.
- Enhanced test scripts to ensure compatibility with updated API routes and improved error handling for OTP resend functionality.
- Adjusted server startup script for better Windows compatibility and streamlined process management.
2025-10-29 14:27:07 +07:00
MythEclipse 98c46611fb refactor: Update deployment script for Rust binaries with improved comments and error handling 2025-10-28 21:58:49 +07:00
MythEclipse fbfe3dcd51 refactor: Remove unused imports and clean up status update logic in hackathon service and controller 2025-10-28 19:57:43 +07:00
MythEclipse 5cc5a3dfe1 feat: Implement hackathon status change functionality with audit logging
- Added HackathonStatusChangeRequestDto for status change requests.
- Implemented update_hackathon_status method in HackathonRepository to handle status updates.
- Enhanced HackathonService to validate and process status changes, including audit logging.
- Introduced HackathonAuditLogSchema to track changes and actions related to hackathons.
- Created HackathonAuditRepository for managing audit logs.
- Added validation functions for hackathon operations, including dates, organizers, and prizes.
- Implemented atomic service for creating hackathons with timelines and events, ensuring all-or-nothing behavior.
- Updated mod.rs to include new modules for audit logging and validation.
2025-10-28 19:55:38 +07:00
MythEclipse 95ae55c9df refactor: Simplify string conversion for hackathon and timeline attributes in seed test submission 2025-10-28 18:47:52 +07:00
MythEclipse f7ca67d720 feat: Add contact fields to hackathon and submission data; update registration service to handle string ID 2025-10-28 17:34:03 +07:00
MythEclipse 02421e9bc2 fix: Remove unused HeaderMap import from payment middleware 2025-10-28 14:59:26 +07:00
MythEclipse 5e2b0d3caf feat: Add session counting methods for mentors and users; enhance registration queries with related data 2025-10-28 14:57:20 +07:00
MythEclipse b9a51ce6cc feat: Enhance validation and permissions handling across controllers
- Added `ValidatedJson` extractor for automatic JSON validation in `events_controller.rs`, `testimonials_controller.rs`, `mentors_controller.rs`, `gacha_items_controller.rs`, and `hackathon_controller.rs`.
- Replaced manual permission checks with `require_permissions!` and `require_auth!` macros in relevant controllers to streamline permission handling.
- Introduced `sanitization` utilities in `sanitization.rs` for improved input sanitization.
- Added `permission_macros.rs` to encapsulate permission checking logic and reduce boilerplate.
- Updated dependencies in `Cargo.toml` to include `serde_json` and `validator`.
- Implemented error handling improvements in `notification_service.rs` for better response management.
2025-10-28 14:04:41 +07:00