Skip to content
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

Feature/seller sales statistics #58

Merged
merged 8 commits into from
Apr 10, 2024
Merged

Conversation

krkarma777
Copy link
Owner

No description provided.

- Add endpoints to fetch sales data for the last 30 days, the last year, and the last three years for sellers.
- Implement user role validation to ensure that only sellers can access these services.
- Sort returned sales data by period for better analytics insight.

This commit enhances the SalesVolumeAPIController by providing comprehensive sales data analytics over various periods. It ensures that these analytics are securely accessible only to users with the seller role, thereby enhancing the application's security posture.
Added unit tests to verify the behavior of the SalesVolumeAPIController. These tests ensure the successful retrieval of sales data for the last 30 days and its accurate return in JSON format. Utilizing MockMvc for mocking API requests and Mockito for mocking the behaviors of OrderService and UserAuthValidator, the tests effectively simulate the operation of the actual service logic without the need for real data interactions.
- Update methods in SalesVolumeAPIController to use @GetMapping instead of default visibility
- Define explicit endpoints for the last 30 days, last year, and last three years sales data
- Ensure consistency and clarity in API route definitions
- Added tests for fetching sales data over the last year and the last three years
- Utilized @WithMockUser to simulate authenticated user scenarios in tests
- Adjusted date formatting to "yyyy-MM-dd" for consistent date handling
- Ensured the setup of a mock user with ROLE_판매자 to test role-based access control
…ller

- Implement a new GET endpoint to fetch sales data for the current day.
- Import BigDecimal for handling precise sales calculations.
- Ensure the functionality aligns with existing sales data retrieval patterns for consistency.
- Renamed test methods to better reflect their purpose and functionality
- Added testFindSalesDataForCurrentDay() to test daily sales calculation
- Updated existing tests to match changes in controller functionality
- Improved code readability and removed redundant code
@krkarma777 krkarma777 merged commit 5b527f3 into master Apr 10, 2024
@krkarma777 krkarma777 deleted the feature/seller-sales-statistics branch April 10, 2024 11:24
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