-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement Seller Coupon Management REST API #54
Commits on Mar 24, 2024
-
feat: Add review listing by seller with pagination
Implemented a new endpoint to retrieve a paginated list of reviews for a given seller, identified by sellerID. The method validates the user's role to ensure they are authorized as a seller before fetching the reviews. It handles pagination and sorting of reviews in descending order based on reviewID. Added error handling for unauthorized access attempts. - Ensure user role validation for seller-specific actions. - Utilize pageable for efficient data fetching and pagination. - Return descriptive error messages for unauthorized requests.
Configuration menu - View commit details
-
Copy full SHA for 2db826b - Browse repository at this point
Copy the full SHA 2db826bView commit details -
Refactor ReviewAPIControllerTest for Enhanced Clarity and Functionality
This commit introduces several key changes to the ReviewAPIControllerTest. Notably, it adds new tests for handling reviews by sellers, accommodating the differentiation between authorized seller roles and other user roles. The tests now include scenarios for both valid requests by sellers and unauthorized requests by non-seller roles, ensuring robust access control. Additionally, the ReviewDetailDTO is introduced in tests to better represent review details, aligning with the latest business logic. These modifications enhance test clarity, expand coverage for new functionalities, and improve alignment with current domain models and access control requirements.
Configuration menu - View commit details
-
Copy full SHA for 16a6a60 - Browse repository at this point
Copy the full SHA 16a6a60View commit details -
Enhance findReviewsBySeller response with pagination details
Updated the findReviewsBySeller method to include total pages and the list of review details in the response. This change aims to provide clients with more comprehensive data for UI rendering and pagination handling. Now, the response not only contains the list of reviews but also the total number of pages, enabling clients to implement more effective data presentation and navigation features.
Configuration menu - View commit details
-
Copy full SHA for 8e80179 - Browse repository at this point
Copy the full SHA 8e80179View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b3e36f - Browse repository at this point
Copy the full SHA 2b3e36fView commit details -
Refactor findReviewsBySeller to fetch all reviews for products posted…
… by a seller including feedback counts.
Configuration menu - View commit details
-
Copy full SHA for bde9815 - Browse repository at this point
Copy the full SHA bde9815View commit details -
Update tests for findReviewsBySeller to reflect API changes, includin…
…g feedback counts in review details.
Configuration menu - View commit details
-
Copy full SHA for 92d0b95 - Browse repository at this point
Copy the full SHA 92d0b95View commit details -
Refactor SellerReviewManageController and related view for dynamic co…
…ntent loading - Refactor SellerReviewManageController to SellerController and adjust its logic to pass sellerID instead of reviews list directly to the model. This change facilitates the front-end to fetch reviews dynamically via an API call. - Update the corresponding Thymeleaf view to remove static content rendering of reviews. Integrate Axios to fetch reviews data dynamically from the server and implement pagination functionality. This improves the page's responsiveness and scalability by loading reviews content on demand. - Add Axios script import in the HTML header for making HTTP requests.
Configuration menu - View commit details
-
Copy full SHA for cf02a6f - Browse repository at this point
Copy the full SHA cf02a6fView commit details
Commits on Mar 25, 2024
-
feat: Add endpoint to retrieve coupons by seller
- Added GET mapping to fetch coupons associated with a specific seller. - Validates if the user is authorized as a seller before proceeding. - Utilizes pagination to manage large result sets. - Returns a ResponseEntity containing the list of coupons and total pages.
Configuration menu - View commit details
-
Copy full SHA for 8d5c124 - Browse repository at this point
Copy the full SHA 8d5c124View commit details -
Refactor coupon list sorting and streamline code
- Changed sorting criteria for coupon list from 'id' to 'couponID'. - Improved code efficiency by using .toList() method for stream conversion.
Configuration menu - View commit details
-
Copy full SHA for fcb8330 - Browse repository at this point
Copy the full SHA fcb8330View commit details -
Enhance Coupon API Tests with New Features and Improvements
- Integrated CouponApplicableProduct entity to reflect real-world applicability scenarios in tests. - Adopted UserRole enum to enforce role-based testing rigorously. - Introduced CouponResponseDTO in tests to align with the API response structure, ensuring consistency between test expectations and actual API behavior. - Revised sorting criteria in listCouponsTest to 'couponID', matching the updated business logic. - Utilized UUID for coupon codes to simulate realistic test scenarios more closely. - Enhanced setUp method to include initialization of new attributes, such as applicableProducts, ensuring a comprehensive testing setup.
Configuration menu - View commit details
-
Copy full SHA for 9767119 - Browse repository at this point
Copy the full SHA 9767119View commit details -
refactor: Modify CouponResponseDTO to format date and display coupon …
…type description - Updated CouponResponseDTO to format date strings using DateTimeFormatter. - Changed the 'type' field to display the description of the coupon type.
Configuration menu - View commit details
-
Copy full SHA for b2c2673 - Browse repository at this point
Copy the full SHA b2c2673View commit details -
refactor: Modify CouponAPIController to return DTOs instead of entities
- Refactored CouponAPIController to return CouponResponseDTOs instead of entity objects to improve consistency and maintainability. - Updated the endpoint logic for finding coupons by seller to utilize DTOs consistently.
Configuration menu - View commit details
-
Copy full SHA for 2a16bf9 - Browse repository at this point
Copy the full SHA 2a16bf9View commit details -
Refactor SellerCouponManageController for Cleaner Routing and Logic S…
…implification This commit refactors the SellerCouponManageController by cleaning up the routing paths and simplifying the logic within the controller methods. The primary changes include adjusting the request mappings to more accurately reflect the intended actions and streamlining the method implementations for clarity and efficiency. Additionally, unnecessary code and comments have been removed to enhance readability and maintainability.
Configuration menu - View commit details
-
Copy full SHA for a5afd3f - Browse repository at this point
Copy the full SHA a5afd3fView commit details -
Added currentPage to the response in findListBySeller method to enhan…
…ce pagination support. This change introduces the currentPage variable in the response body of the findListBySeller API method. This enhancement allows the front-end to accurately display the current page number in the pagination component, improving user navigation experience across paginated coupon lists for sellers.
Configuration menu - View commit details
-
Copy full SHA for 144f2bf - Browse repository at this point
Copy the full SHA 144f2bfView commit details -
Enhanced dynamic pagination in coupon list with currentPage tracking.
The update involves modifications to the client-side script to dynamically generate pagination buttons based on the currentPage value. This enhancement includes the ability to request and display different pages of coupons without reloading the page, providing a smoother and more responsive user interface for navigating through coupon lists.
Configuration menu - View commit details
-
Copy full SHA for e2e06d2 - Browse repository at this point
Copy the full SHA e2e06d2View commit details
Commits on Mar 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d77ae4e - Browse repository at this point
Copy the full SHA d77ae4eView commit details -
Refactor coupon management code for clarity and maintainability. Simp…
…lified date and time parsing for coupon validity periods, and streamlined the handling of coupon-related actions such as creation, editing, and deletion. Removed redundant code and optimized imports for better performance and readability.
Configuration menu - View commit details
-
Copy full SHA for 52399db - Browse repository at this point
Copy the full SHA 52399dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f90ae0 - Browse repository at this point
Copy the full SHA 1f90ae0View commit details -
Optimize the coupon management modal interaction and enhance UI consi…
…stency. This update includes optimizations for the coupon management modal's user interactions, ensuring smoother functionality and improved user experience. Changes have been made to modal buttons' order and event handlers for more intuitive navigation and operation. The update aims to provide a more consistent and user-friendly interface across the coupon management features.
Configuration menu - View commit details
-
Copy full SHA for 8d69fe3 - Browse repository at this point
Copy the full SHA 8d69fe3View commit details -
feat: Add product search API endpoint for sellers
Added a new method to handle GET requests at `/searchForCoupon` in the ProductAPIController, enabling sellers to search for products based on a specific query. This functionality supports pagination and returns a list of products matching the query after verifying the seller's permissions. This enhancement is aimed at facilitating more efficient product management for sellers in relation to coupons.
Configuration menu - View commit details
-
Copy full SHA for df4b3c2 - Browse repository at this point
Copy the full SHA df4b3c2View commit details -
refactor: Streamline coupon selection and review management in Seller…
…Controller - Removed unused imports and dependencies from SellerCouponManageController to simplify the coupon management process. - Integrated `selectProductForCouponForm` method into SellerController to consolidate endpoints, aligning with RESTful API design principles. - Enhanced readability and maintainability by reducing redundancy and focusing on streamlined controller actions. This refactor improves the architecture by adhering more closely to RESTful principles, simplifying future developments and adjustments in the coupon management and review sections.
Configuration menu - View commit details
-
Copy full SHA for 3776ad0 - Browse repository at this point
Copy the full SHA 3776ad0View commit details -
Refactor seller and coupon management for RESTful API integration and…
… enhance product selection for coupons. This commit introduces a dedicated API controller for handling coupon-applicable products, streamlines the process of selecting products for coupons through a RESTful endpoint, and removes outdated methods from the SellerController to align with RESTful practices.
Configuration menu - View commit details
-
Copy full SHA for e01bc5a - Browse repository at this point
Copy the full SHA e01bc5aView commit details -
Refactored Coupon Management: Moved applicable product management fro…
…m CouponAPIController to CouponApplicableProductAPIController and updated SellerController for RESTful compliance. This change enhances modularity and aligns with REST principles, improving maintainability and scalability of coupon-related functionalities.
Configuration menu - View commit details
-
Copy full SHA for d7bfe62 - Browse repository at this point
Copy the full SHA d7bfe62View commit details -
Refactor seller coupon management page to use RESTful API for asynchr…
…onous product search and selection, enhancing user experience.
Configuration menu - View commit details
-
Copy full SHA for 5dbb161 - Browse repository at this point
Copy the full SHA 5dbb161View commit details -
feat: Enhance coupon-applicable products configuration
- Introduced CouponApplicableProductRequestDTO for robust request data validation, utilizing @notempty annotation to prevent missing couponID. - Added CouponApplicableProductValidator to enforce coupon ownership checks and validate applicability of products to coupons, ensuring data integrity and authorization. - Refactored CouponApplicableProductAPIController to leverage the new DTO and validator for a cleaner, more maintainable approach to handling coupon-product associations. - These changes aim to improve the reliability and security of the coupon application process, facilitating easier management and application of products to coupons.
Configuration menu - View commit details
-
Copy full SHA for 3620a71 - Browse repository at this point
Copy the full SHA 3620a71View commit details -
feat: Validate product ownership in coupon application
This commit introduces a validation step in the `validateAndApplyProductsToCoupon` method to ensure that the products being applied to a coupon are indeed posted by the current user. This check is crucial for maintaining data integrity and preventing unauthorized coupon applications to products not owned by the user. The method now filters out any products not posted by the user before proceeding with the coupon application process, and throws a `ResponseStatusException` if any discrepancies are found. - Add a filter to `validateAndApplyProductsToCoupon` to check product ownership. - Throw `ResponseStatusException` for products not posted by the current user. - Ensure only products owned by the user are applied to the coupon. This enhancement strengthens the security and integrity of the coupon application process.
Configuration menu - View commit details
-
Copy full SHA for 9ecff34 - Browse repository at this point
Copy the full SHA 9ecff34View commit details -
Add unit test for selecting products applicable to a coupon
Added a unit test to ensure that the controller method for selecting products applicable to a coupon processes requests correctly when valid data is provided. Mocked necessary dependencies and simulated valid data for the test scenario.
Configuration menu - View commit details
-
Copy full SHA for ad4dd76 - Browse repository at this point
Copy the full SHA ad4dd76View commit details -
fix: Correct Product instantiation in CouponApplicableProductAPIContr…
…ollerTest - Fix incorrect Product instantiation with non-existing constructor by adjusting product IDs. - Ensure each mocked Product object has a unique ID reflecting the intended test scenario. - This correction ensures the test setup accurately reflects the real-world scenario where each product has a unique identifier and is associated with a user. - The changes enhance the reliability of the `selectProductForCoupon_ShouldProcessRequest_WhenGivenValidData` test by ensuring the mocked data setup aligns with expected domain model constraints.
Configuration menu - View commit details
-
Copy full SHA for 5447cd6 - Browse repository at this point
Copy the full SHA 5447cd6View commit details -
refactor: Delete SellerCouponManageController
Removed SellerCouponManageController as it is no longer needed after transitioning to API.
Configuration menu - View commit details
-
Copy full SHA for 2fdd3e9 - Browse repository at this point
Copy the full SHA 2fdd3e9View commit details -
Fix NullPointerException in getCurrentUser by adding null check for P…
…rincipal - Add a null check for the Principal parameter in the getCurrentUser method to avoid NullPointerException when the Principal is null. - Throw an Unauthorized status exception if the Principal is null to indicate that no authenticated user information is available. - Ensure that a meaningful error response is returned when no user context is available in the request.
Configuration menu - View commit details
-
Copy full SHA for 44b1213 - Browse repository at this point
Copy the full SHA 44b1213View commit details -
feat: Added global exception handler
- Added a global exception handler to handle ResponseStatusException. - Configured to return a response including the status code and reason when an exception occurs.
Configuration menu - View commit details
-
Copy full SHA for 4c7fcc3 - Browse repository at this point
Copy the full SHA 4c7fcc3View commit details -
feat: Added constructor with parameters
Added a constructor with parameters to the Coupon class.
Configuration menu - View commit details
-
Copy full SHA for 8926462 - Browse repository at this point
Copy the full SHA 8926462View commit details -
Refactor CouponApplicableProductAPIControllerTest to handle various e…
…rror scenarios This commit overhauls the CouponApplicableProductAPIControllerTest to include comprehensive testing for different error scenarios, including unauthorized access, ownership validation for products, handling of invalid product information, and non-existent coupons. Additionally, it updates the test for successful coupon application to ensure proper validation and processing. The goal is to enhance test coverage and reliability for the coupon application process in the API.
Configuration menu - View commit details
-
Copy full SHA for 0046df8 - Browse repository at this point
Copy the full SHA 0046df8View commit details -
Enhanced test coverage for CouponApplicableProductAPIController
- Added a test for the endpoint that retrieves a list of products applicable to a coupon. - Improved existing tests by including JSON body content verification. - Refactored setup method to initialize common objects for tests.
Configuration menu - View commit details
-
Copy full SHA for 645b25c - Browse repository at this point
Copy the full SHA 645b25cView commit details -
Enhance coupon product selection feature with AJAX submission
This commit introduces an enhancement to the coupon product selection functionality on the "쿠폰 적용 상품 설정" page. Key improvements include the AJAX-based form submission process, enabling dynamic interaction without page reloads. The form now sends selected product IDs directly to the server-side endpoint via AJAX POST request, streamlining the user experience. Additionally, error handling is enhanced to provide user-friendly feedback using alerts for various error conditions encountered during form submission and data fetching operations. These changes aim to improve the usability and responsiveness of the product selection workflow for coupon application.
Configuration menu - View commit details
-
Copy full SHA for 4063e86 - Browse repository at this point
Copy the full SHA 4063e86View commit details