Commit Graph
32 Commits
Author SHA1 Message Date
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
MythEclipse b429b3a9c7 postgress 2025-12-01 00:20:42 +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 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 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 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
MythEclipse d4a6c4c9ea Add new test suites for registrations and notifications; update existing tests for improved error handling and security checks
- Updated `run-tests.sh` to include new test suites for registrations and notifications.
- Modified `test-cms.sh` to skip SQL injection tests due to query timeout issues and adjusted expected status codes for XSS tests.
- Adjusted expected status codes in `test-auth.sh` for SQL injection and XSS tests; updated missing password test to return 422.
- Updated `test-roles-permissions.sh` to expect 409 for duplicate role creation.
- Changed expected status for duplicate user creation in `test-users.sh` to 409.
- Added comprehensive tests for notification endpoints in `test-notifications.sh`, including edge cases and pagination.
- Created `test-registrations.sh` to cover hackathon registration endpoints, including registration, approval, and check-in processes.
2025-10-28 10:27:19 +07:00
MythEclipse ece6499e2b feat: Implement hackathon registration module with controller, DTOs, repository, schema, and service
- Added registration_controller.rs to handle registration-related routes and logic.
- Created registration_dto.rs for data transfer objects related to registrations.
- Implemented registration_repository.rs for database interactions concerning registrations.
- Defined registration_schema.rs to represent the registration data structure.
- Developed registration_service.rs to encapsulate business logic for registrations.
- Established routes for registering, listing, updating, and checking in participants for hackathons.
- Added validation for registration requests and status updates.
- Included statistics retrieval for hackathon registrations.
2025-10-27 19:53:05 +07:00
MythEclipse 1caaa8404b a 2025-10-27 19:23:29 +07:00
MythEclipse e77797d7bb feat: Update hackathon event and submission routes to require admin permissions and adjust response descriptions 2025-10-27 17:26:53 +07:00
MythEclipse 1a36698962 feat: Improve validation logic in HackathonService by adding a helper function and using parameterized queries 2025-10-24 18:14:09 +07:00
MythEclipse 15a2ee1950 feat: Enhance hackathon submission process with additional fields and validation checks 2025-10-24 18:06:47 +07:00
MythEclipse 3fcfb3709e refactor: Clean up unused imports and improve error handling in middleware and DTOs 2025-10-23 22:44:32 +07:00
MythEclipse 6915a97d79 feat: Enhance Hackathon Timeline Management and Admin Features
- Updated HackathonTimelineCreateRequestDto to accept optional title and name fields.
- Added custom validators for HackathonPhase and date checks in hackathon_dto.rs.
- Implemented admin-sensitive data management DTOs for handling user scores and personal info.
- Introduced new admin routes for managing users, roles, and permissions in IAM module.
- Added timeline enforcement middleware to restrict access based on hackathon phases.
- Created tests for timeline enforcement and admin permissions to ensure proper access control.
- Implemented payment middleware as a placeholder for future payment processing logic.
- Enhanced audit logging middleware for improved error handling and logging.
2025-10-13 10:57:53 +07:00
MythEclipse b6b5f48055 Implement rate limiting middleware for authentication endpoints, adding security headers middleware, and comprehensive error handling. Enhance validation tests for various DTOs and ensure proper functionality of gacha credits and rolls. Add unit tests for rate limiting and security headers middleware to validate behavior under different conditions. 2025-10-11 23:23:51 +07:00
MythEclipse 884b679ba8 fix: Update string formatting in hackathon service and repository tests for consistency 2025-10-11 15:28:27 +07:00
MythEclipse 6ef624c169 feat: Enhance hackathon submission and participant management
- Updated HackathonSubmissionsSchema to use Option types for team_id, project_name, description, technologies, submission_status, and submitted_at.
- Modified seed_hackathons and seed_test_submission scripts to accommodate new optional fields.
- Added routes for participant registration and listing in hackathon_controller.
- Implemented register_participant and list_participants functions in hackathon_controller.
- Introduced HackathonParticipantSchema and corresponding DTOs for participant management.
- Enhanced HackathonRepository with CRUD operations for hackathon participants.
- Updated HackathonService to include methods for participant registration and listing.
- Refactored TeamsService to allow admin-level updates and invitations, bypassing leader-only restrictions.
- Added validation for member emails in TeamsCreateRequestDto and TeamInviteRequestDto.
2025-10-11 15:06:12 +07:00
MythEclipse c10443f881 Add minimal test for basic hackathon operations and enhance test utilities
- Introduced a new test module for hackathon-related functionality.
- Implemented a basic test for creating a hackathon using a mock repository.
- Enhanced the test utilities in `lib.rs` for better request handling and response extraction.
- Added a `ServiceClient` struct to facilitate HTTP requests in tests.
- Created a `RequestBuilder` to streamline building and sending requests with headers and JSON bodies.
2025-10-11 10:58:51 +07:00
MythEclipse 466ba3391a feat: Add seed_test_data script to populate initial test data for events, testimonials, hackathons, and mentors 2025-10-08 23:03:00 +07:00
MythEclipse 8c2527d61e Add access level descriptions to API responses across multiple controllers
- Updated event controller to specify public and admin access levels in response descriptions.
- Modified testimonials controller to indicate public access for list and detail responses.
- Enhanced mentors controller with admin access labels for various responses.
- Adjusted gacha claims and items controllers to reflect admin access in response descriptions.
- Updated hackathon controller to clarify public and admin access levels in response messages.
- Revised authentication controller to specify public access for login and registration responses.
- Enhanced admin teams controller with admin access labels for team-related responses.
- Updated users controller to clarify admin and user access levels in response descriptions.
2025-10-07 17:45:47 +07:00
MythEclipse 018124f7b3 feat: Implement permissions checks for hackathon and testimonial routes, enhancing security with header validation 2025-10-07 13:08:23 +07:00
MythEclipse 7749f6fdec feat: Add public routes for hackathons and enhance permissions checks to support both names and IDs 2025-10-05 20:23:34 +07:00
MythEclipse 3dde67a4ac Enhance test coverage for IAM module by validating all required fields in response DTOs
- Added assertions to check for non-empty fields in TokenDto, UsersSchema, PermissionsSchema, and RolesDetailItemDto.
- Ensured that all necessary fields are validated in team-related DTOs, including TeamsCreateResponseDto and TeamsDetailResponseDto.
- Improved checks for user details in UsersDetailItemDto and UsersListItemDto to ensure data integrity.
- Verified that sensitive fields are present in admin team responses and member details.
- Updated tests to ensure that created and updated timestamps are present and valid across various entities.
2025-10-05 18:16:34 +07:00
MythEclipse a32f54873b feat: Add previous winners field to hackathon schema and update related tests 2025-09-27 22:30:42 +07:00
MythEclipse af41a98111 feat: Add previous winners field to hackathon DTOs and schema 2025-09-27 21:05:34 +07:00
MythEclipse 4c435708c0 feat: Add endpoint to retrieve hackathon submissions and implement seeding for test submissions 2025-09-27 19:24:45 +07:00
MythEclipse 3e52223730 refactor: Update route parameters in hackathon controller for consistency 2025-09-27 13:40:02 +07:00
MythEclipse 01e479350b test: Add not found scenarios for hackathon, event, timeline, and submission repository operations 2025-09-27 13:16:13 +07:00
MythEclipse b0cf9817d7 feat: Implement submission retrieval and timeline validation in hackathon service 2025-09-27 13:06:55 +07:00
MythEclipse e530eba60d Add comprehensive tests for hackathon service functionality
- Implemented tests for creating, retrieving, updating, and deleting hackathons.
- Added validation tests for hackathon creation and updates.
- Included tests for hackathon events and timelines, ensuring proper handling of edge cases.
- Created tests for hackathon submissions, including validation and submission status updates.
- Organized tests into a dedicated module for better structure and maintainability.
2025-09-27 13:01:08 +07:00