test suite and admin interface enhancements#82
Merged
cybervoid0 merged 5 commits intomasterfrom Apr 10, 2026
Merged
Conversation
- Added middleware for protected routes using NextAuth. - Introduced session management functions to enforce admin access. - Refactored admin layout to utilize session data for redirection. - Created reusable logout button component for user session management. - Updated various server actions to require admin privileges and validate input data using Zod schemas. - Enhanced security headers in the Next.js configuration for improved application security.
- Updated the estimatedPrice field in UpdateBarometerSchema to require positive values, enhancing data integrity and validation. This change ensures that only valid price entries are accepted.
…er, brand, document, and file actions - Introduced unit tests for authentication actions, ensuring proper session handling and role validation. - Added tests for barometer actions, covering create, update, and delete functionalities with validation checks. - Implemented tests for brand actions, validating creation, updating, and deletion processes. - Created tests for document actions, ensuring correct handling of document creation, updates, and deletions. - Developed tests for file actions, including file saving, deletion, and temporary file creation, with admin access checks. - Enhanced overall test coverage and reliability across various server modules.
…ments - Introduced a new Reference Data page in the admin section for managing materials and movement types. - Implemented the ReferenceDataList component to handle creation and deletion of materials and movements. - Added server actions for creating and deleting materials and movements with appropriate validation. - Updated routing to include the new Reference Data page. - Enhanced the admin page with a link to manage materials and movements.
…agement - Updated the admin page to include links for managing materials and movement types. - Introduced new components for handling deletion and editing of reference data. - Created dedicated pages for managing materials and movements, utilizing the ReferenceDataList component. - Implemented server actions for creating, updating, and deleting materials and movements with validation. - Removed the old reference data page to streamline the admin interface.
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.
Summary
Comprehensive test suite and admin interface enhancements for reference data management:
/admin/materials/and/admin/movements/) with full CRUD operations (create, read, update, delete)Changes
Server Layer
server/materials/- Actions, schemas, and tests for material CRUDserver/movements/- Actions, schemas, and tests for movement type CRUDTag.materials,Tag.movements,Tag.barometers) for data consistencyAdmin UI
app/(pages)/admin/_components/- Shared components (ReferenceDataList, EditDialog, DeleteAlert)app/(pages)/admin/materials/andapp/(pages)/admin/movements/- Dedicated management pagesrouter.refresh()Testing
server/testing/mocks.tswith comprehensive mock module setupRoutes
/admin/materials/and/admin/movements/routesTest plan
npm test -- server/