Skip to content

feat: Accommodation CRUD operations#5

Merged
janosevicsm merged 3 commits intodevelopfrom
feature/crud
Feb 15, 2026
Merged

feat: Accommodation CRUD operations#5
janosevicsm merged 3 commits intodevelopfrom
feature/crud

Conversation

@janosevicsm
Copy link
Contributor

No description provided.

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.
@janosevicsm janosevicsm self-assigned this Feb 15, 2026
@janosevicsm janosevicsm merged commit 9aec01c into develop Feb 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments