feat: Accommodation CRUD operations#5
Merged
janosevicsm merged 3 commits intodevelopfrom Feb 15, 2026
Merged
Conversation
Add accommodation feature surface: REST controller, service, DTOs, MapStruct mapper, JPA entities (Accommodation, Amenity) and enums, repositories, and related exceptions/exception handler. Introduce request argument resolver and role-based HandlerInterceptor (RequireRole, UserContext, UserContextResolver, RoleAuthorizationInterceptor) and WebConfig to register them. Add Flyway migration to create DB types/tables and indexes. Update build.gradle.kts to include web, JPA, Postgres, Flyway, MapStruct, Lombok, Prometheus, Zipkin/tracing and test deps. Add DB configuration to application.properties and local env variables. Also remove DataSourceAutoConfiguration exclusion and change main() visibility; update tests by removing @SpringBootTest.
Remove the Amenity entity and repository and store amenities directly on Accommodation as a List<AmenityType> backed by a text[] column. Update Accommodation entity to use @Enumerated(EnumType.STRING) with JdbcTypeCode(SqlTypes.ARRAY) and columnDefinition "text[]". Adapt mapper and service: drop the custom amenity mapping and per-entity add/remove logic, replace EntityManager and per-amenity persistence with simple list assignment and saveAndFlush, and stop marking individual amenities as deleted on soft-delete. Add Flyway migrations: V2 migrates existing amenities into an amenity_type[] column and drops the amenities table; V3 converts the column to text[] for Hibernate compatibility.
Introduce comprehensive tests and test tooling: add unit tests for AccommodationController and AccommodationService, plus an integration test using Testcontainers (Postgres) and MockMvc/RestAssured. Update build.gradle.kts to apply the JaCoCo plugin, add test dependencies (Testcontainers, Rest-Assured), and configure a jacocoTestReport (XML) to run after tests. Add application-test.properties for test profile settings and logging.
cuturic01
approved these changes
Feb 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.