Skip to content

Yousef Alothman #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Yousef Alothman #4

wants to merge 18 commits into from

Conversation

yousef23pdx
Copy link

No description provided.

…ms to listOrder endpoint now you can see the items), also i changed the table in the database to make order_id in items table to a foreign key instead of a normal interger.
…pecific order filtering

- Added SubmitOrderRequest DTO and submitOrder() logic
- Refactored ItemsController to allow adding new items
- Linked ItemEntity to orders via ManyToOne relationship
- Enforced user-specific order visibility using Spring Security
- Allowed unauthenticated access to /menus only
- Ensured item creation works independently from orders
- Fixed DB constraints and renamed item field for clarity
Added profile management features with JWT authentication. Set up ProfileEntity with a one-to-one relationship to users using userId. Added custom validation for names and phone numbers using regex and threw InvalidProfileException when needed. Created a POST /profile endpoint for authenticated users to submit their profile, and made sure duplicates aren’t allowed. Also added GET /profile to retrieve the logged-in user’s profile. Marked the service as open and transactional, and swapped @nAmed for @service to fix injection issues. Error handling is done with try/catch blocks and returns clean JSON messages. No unit testing yet.
@yousef23pdx yousef23pdx changed the title Exercises 1 & 2 Completed Yousef Alothman Apr 20, 2025
- Set up Cucumber integration with Spring Boot context loading
- Implemented JWT token injection via JwtService for secured endpoints
- Created separate Cucumber tests for:
  • User registration
  • User login and listing
  • Submitting and listing orders
  • Submitting and listing menu items
  • Submitting and retrieving user profiles
- Fixed GlobalToken generation issues
- Handled authenticated requests in tests without relying on logging
- Split all test steps into isolated step definition files for clarity
- Fixed HTTP 400 error by submitting a profile before retrieving it
- Standardized test structure across the project for easier maintenance
- Added environment-based config for `company.name` and `festive-mode`
- WelcomeController now returns a dynamic message based on company name and festive flag
- ItemsService returns discounted prices (20% off) when `festive-mode=true`
- Enabled configurable logging level via `logging.level.root` in application properties
- Updated application-test.properties for test scenarios
Add Swagger OpenAPI documentation and annotations

- Integrated springdoc-openapi-starter-webmvc-api dependency
- Configured Swagger API docs path in application.properties
- Annotated AuthenticationController with @operation and @ApiResponse
Add Swagger OpenAPI documentation and annotations

- Integrated springdoc-openapi-starter-webmvc-api dependency
- Configured Swagger API docs path in application.properties
- Annotated AuthenticationController with @operation and @ApiResponse
included the forgotten files to complete the task
included the forgotten files to complete the task
- Defined `OrderEntity` and `ItemEntity` with appropriate JPA annotations
- Set up `OrdersRepository` and `ItemsRepository`
- Implemented `OrdersService` with order submission and listing logic
- Integrated mapping from item IDs to orders
- Component scan adjusted to include all relevant packages
- Still debugging bean visibility and application context issues
fix: resolve 404 errors caused by IntelliJ tweaking package structure + table name mismatch

IntelliJ messed with the package structure causing Spring not to register the OrderController. Also fixed Hibernate trying to query "order/orders" instead of "orders" by explicitly setting @table(name = "orders") on OrderEntity.
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.

1 participant