Updated the `data` property in the pagination schema from a single object to an array of objects to accurately represent paginated data. This change ensures that the schema aligns with the actual data structure used in the application.
Updated the `data` property in the pagination schema from a single object to an array of objects to accurately represent paginated data. This change ensures that the schema aligns with the actual data structure used in the application.
Introduced a new interface IWithCount to handle paginated data responses. It includes properties for count, limit, currentOffset, and a generic data type. This change will aid in standardizing pagination across the application.
Improved the readability and usability of the database schema by introducing type exports for each table. The exported types (IFileTable, IFileGroupTable, IFilesTypesTable, IMachinesTable, IFilesForMachinesTable, IFilesTypeForMachine) will allow the schemas to be more easily referenced and utilized in other parts of the codebase.
Introduced the SubHomePage component to enhance modularity of the home page. Adjusted styling to include margins and a dark mode class for the body element.
Updated the main application file to change the default port used when the environment variable PORT is not set from 3000 to 3333. This ensures the backend operates on a different port to avoid conflicts with other services running on port 3000.
Introduce a new NewFileModal component for adding files with a dialog box. Adjust page layout to use resizable panels to improve flexibility and user experience. Modify CSS variables for better dark mode color scheme.
Replaced mixed spaces and tabs with consistent tab spacing across multiple files for better code readability and maintenance. Adjusted import statements and string literals formatting to maintain coherence.
Convert array of machine IDs to sets for uniqueness in methods. Add console logs for debugging and update error handling to improve clarity. Refactor the files controller for better readability.
Integrated Swagger module in the backend for API documentation. Added console logs for better traceability and debugging in service and controller methods.
Added a step to delete file associations from `FilesForMachinesTable` before deleting the main file from `FilesTable`. This ensures proper cleanup of related entries in the database.
Add logic to remove file types by ID, ensuring they are not in use by any files or machines. Handle errors appropriately, throwing specific exceptions for cases where the file type cannot be deleted or an internal error occurs.
Added return statement to getTypes endpoint in files controller, utilizing the newly updated getAllFilesTypes method from the files service. Also fixed minor formatting issues.
Implemented the `getAllFilesTypes` method to retrieve all file types from the database. This method uses the database connection to select and return an array of file types, completing the previously marked TODO item.
Completed the `newType` method in `files.controller.ts` to call `filesService.createFileType` with the provided name and mime type. This enables the creation of new file types through the backend API.
Introduced createFileType method to handle file type creation, including format validation and error handling for database operations. Updated CreateFileTypeDto with length constraints on name and mime properties.
Updated the axios GET request in the backend test to use double quotes for consistency. Added a new 'fix' script in package.json for Biome to automatically fix and write unsafe changes. Changed var to let in global-setup.ts for better variable handling.
Reorganized import statements for cleaner structure and added a missing import for CreateFileTypeDto. Adjusted the placement of UseGuards decorators to maintain consistency across methods.
Introduced a new DTO class named CreateFileTypeDto in files.dto.ts for future implementations. The class currently has no properties defined, marked with a TODO comment for subsequent development.
Introduced new endpoints to handle file types: fetching all types, adding a new type, and deleting a type. These additions include necessary guards and parameter parsing for robust API functionality.
Updated the controllers and services by adding missing semicolons to ensure code consistency and prevent potential runtime errors. Reformatted the import statements to enhance readability and maintain a uniform style across the codebase.
This commit adds service method calls for managing groups in the controller. It includes integration for fetching groups by name, creating a new group, deleting a group, and finding files for a group. These changes enhance the functionality and efficiency of the groups controller.
Added logic to delete a group and update the associated files to have a null group reference. Also implemented a method to retrieve files associated with a group using pagination and search functionality.
Adjusted the indentation and formatting across several files for better readability. Enhanced the file deletion logic to handle cases where a file is found in the database but not in storage, and to delete only from the database when there are multiple references.
Implemented a new method to delete files from the storage by checksum and extension. This method logs the deletion process and throws a NotFoundException if the file cannot be found. Updated dependencies to include 'rm' from 'node:fs/promises'.
Introduced the deleteFile method in files.service.ts to handle file deletion, considering duplicates. Also updated files.controller.ts to create a new DELETE endpoint protected by the AdminGuard to ensure only admins can delete files.
A TODO comment was added to the files.service.ts to indicate the need for a file deletion feature. This serves as a placeholder for future development to ensure the feature is addressed.
Implemented the save method to store files and associate them with machines, including handling optional group associations. Modified the database schema to allow null as a default for group_id and added logic to update group ID after file insertion.
Updated the MIME type validation function to handle machine-specific MIME type sets. This ensures that a MIME type must be acceptable across all associated machines. Enhanced clarity and structure by using a map to maintain MIME types for each machine.
Allow groupId to be optional and added methods for group operations. Updated file insertion to handle optional groupId and adjusted group verification logic accordingly. Added method stubs for creating, deleting, and finding files within groups.
This commit introduces endpoints to add, remove, and list types associated with machines. It also includes the addition of the `TypeDto` class to handle type validations and updates HTTP response codes for the existing endpoints.
Removed obsolete todos for DTO and Patch operations. Added todos for types handling related to machine operations as placeholders for future implementation.
Add functionality to fetch and return a list of machines with limit, offset, and search parameters using the machineService. This enhances the controller's capability to handle queries more effectively.
Implemented methods in AuthorsService to find authors, filter files by author, and delete authors. Integrated these methods in AuthorsController to handle HTTP requests accordingly.
Deleted a redundant TODO comment about deleting a machine and associated file type. The method to remove a specified file type from a machine is already implemented.
Added a new 'id' column as the primary key with a unique constraint and default random value generation for the 'FilesTypeForMachine' table. This ensures each row has a unique identifier.
Updated the file search functionality to include a search field that filters files by name and added pagination support. This enhances the API by providing more flexible querying and making it easier to handle large datasets.
Implemented a new method to retrieve file types associated with a specific machine by its ID. This method queries the database and returns a promise that resolves to an array of file types.
Replaced variable assignment with direct return of the database insertion result to streamline the code. This improves readability and eliminates an unnecessary variable.
Implemented the `addFileType` method to link a file type to a machine. This includes database checks for valid machine and file type IDs, and the actual insertion logic. Updated imports and removed obsolete TODO comments.
Introduce the removeFileType method to handle the removal of specific file types from machines, including error handling for invalid machine or file type IDs. Additional TODOs are placeholders for future methods related to adding and retrieving file types for machines.
This ensures both modules have access to the necessary credentials functionality, improving their capability to handle secure operations. The inclusion of DbModule in AuthorsModule aligns it with the design pattern used in GroupsModule.
Implemented a new endpoint to create machines in the system. Added the required DTO for machine creation data validation and integrated it into the controller. Updated service methods to handle machine creation and improved the `findFilesForMachine` method for clarity and functionality.
This commit introduces the `findFilesForMachine` method, which retrieves files associated with a given machine ID from the database. It includes functionality to limit and offset the results based on given parameters, and throws a `NotFoundException` if the machine ID is not found.
Implemented `findMany` method to fetch machines based on a search field, applying limit and offset for pagination. Includes console logs for tracking search parameters and results.
Changed the parameter name from 'machineId' to 'author' in the deleteAuthor method to reflect the actual parameter expected by the route. This improves code clarity and ensures the method receives the correct data.
Refactored `import` statements in multiple files for consistent formatting. Grouped similar statements together and ensured single import per line for better readability.
Modified file retrieval routes for groups, authors, and machines to align with consistent structure. Changed the order of parameters in the routes to "files/:id". This enhances readability and standardizes API endpoint structures across different controllers.