Repository navigation
Feat/44 create dtos product management - #55
Merged
Merged
Conversation
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.
Work performed
Category→Ingredient/Allergen→Dish): full CRUD (service + controller + tests) for the four entities, using the existing*Translationpattern for multi-language names/descriptions.Order/OrderItem): order creation, item add/remove, status transitions (PENDING → IN_PROGRESS → READY → SERVED → CLOSED, with cancellation) and query endpoints, with business-rule guards (session must be open, dish must be available, closed/cancelled orders are no longer modifiable)./api/kitchen/queueendpoint — orders still pending preparation (PENDING/IN_PROGRESS), sorted oldest-first, separate from the general "active orders" view.Invoice): create/read endpoints to close and pay a served order (CASH/CARD/TRANSFER), enforcing one invoice per order.Order↔OrderItem,Dish↔OrderItem,Invoice↔Order) caused infinite mutual recursion (StackOverflowError) the moment those relations were used; added identity/containment guards, mirroring the existing safe pattern inCategory.addDish.SessionController's@PreAuthorizechecks used non-existent role literals ('CAJA','COCINA') instead of the realRoleNamevalues (CASHIER,KITCHEN), silently locking cashier/kitchen users out of endpoints the security filter chain otherwise allowed them.JwtUtilTestoverrodejwt.secret/jwt.expiration, butJwtUtilreadsapp.jwt.secret/app.jwt.expiration— the test's Spring context never resolved and the test silently failed to start./errorexplicitly permitted, so an unmatched route surfaces as a real 404 instead of a misleading 401 from the auth entry point..env, injected intoapplication.propertiesviaspring.config.import=optional:file:.env[.properties]; fixed a blanket*.properties/*.ymlrule in.gitignorethat was silently excluding the (secret-free)application.propertiesfrom version control; removed the staleapplication.properties.example.DevDataSeeder(profiledevonly) bootstraps the roles catalog and a firstADMINaccount, so a fresh clone isn't stuck in a chicken-and-egg state (register requiresADMIN, but noADMINexists yet);database/test-data.sqlseeds a full menu, tables, sessions, orders and one user per role for manual testing.Dockerfile(Maven 21 build → JRE 21 Alpine runtime, non-root user) and rootdocker-compose.yml(MySQL + app, healthcheck-gated startup); added the missing.mvn/wrapper/maven-wrapper.properties(./mvnwand the Docker build would otherwise fail on a fresh clone).@SpringBootTestcontext test) against a MySQL service container, then verifies the Docker image builds.docs/with one file per module (entities, business rules, endpoints), plus updated rootREADME.mdanddatabase/README.md.Files created/modified
Menu (Category/Ingredient/Allergen/Dish)
constants/LocaleConstants.java,constants/ApiPaths.java,constants/SecurityConstants.java,constants/ExceptionConstants.javamodels/entities/{Category,Ingredient,Allergen,Dish}.java(+ translation entities)mappers/{Category,Ingredient,Allergen,Dish}Mapper.javaservices/{Category,Ingredient,Allergen,Dish}Service.java+services/impl/*ServiceImpl.javacontrollers/{Category,Ingredient,Allergen,Dish}Controller.javasecurity/SpringSecurityConfig.javaservices/impl/*ServiceImplTest.java,controllers/*ControllerTest.java(8 files)docs/{categories,ingredients,allergens,dishes}.mdOrders
models/entities/{Order,OrderItem,Dish}.java(recursion fix)models/dto/request/order/*,models/dto/response/order/*mappers/OrderMapper.java,services/OrderService.java+impl/OrderServiceImpl.java,controllers/OrderController.javaservices/impl/OrderServiceImplTest.java,controllers/OrderControllerTest.javadocs/orders.mdKitchen
constants/ApiPaths.java(KITCHEN_PATH,QUEUE)services/OrderService.java+impl/OrderServiceImpl.java(getKitchenQueue)controllers/KitchenController.javaservices/impl/OrderServiceImplTest.java,controllers/KitchenControllerTest.javadocs/kitchen.mdInvoicing
models/entities/{Invoice,Order}.java(recursion fix)models/dto/request/invoice/*,models/dto/response/invoice/*repositories/InvoiceRepository.java,mappers/InvoiceMapper.javaservices/InvoiceService.java+impl/InvoiceServiceImpl.java,controllers/InvoiceController.javaservices/impl/InvoiceServiceImplTest.java,controllers/InvoiceControllerTest.javadocs/invoices.mdFixes / security
controllers/SessionController.java(CAJA/COCINA→CASHIER/KITCHEN)security/SpringSecurityConfig.java(/errorpermitAll)test/security/JwtUtilTest.java(property key fix)Environment / Docker / CI
.gitignore,.env.example,src/main/resources/application.properties(now tracked), removedapplication.properties.example.mvn/wrapper/maven-wrapper.properties,Dockerfile,.dockerignore,docker-compose.yml.github/workflows/ci.ymlconfig/DevDataSeeder.java,database/test-data.sqlDocs
README.md,database/README.md,docs/README.md(+ per-module files listed above)