scope: services, interfaces
subject: Apply code formatting
- Correct indentation and formatting to match code style standards in multiple 'interfaces' and 'services' files.
- Also ensure lines at the end of the files.
Signed-off-by: Mathis <yidhra@tuta.io>
An additional task is marked in the MySQL service to check if models are linked before taking further actions. Similarly, in the Category service, two tasks are added to verify the existence of a category and elements linked to it before proceeding with deletion.
Signed-off-by: Mathis <yidhra@tuta.io>
Duplicate comments were found and removed from `category.service.ts`. This refactoring step will make the code cleaner and less confusing.
Signed-off-by: Mathis <yidhra@tuta.io>
This commit includes the addition of a new function, `updateCategory` in the category.service.ts file. This function allows for updating a category in the database. Error handling and logging are also implemented within the function.
Signed-off-by: Mathis <yidhra@tuta.io>
A comment has been added in the category service to return the new id in the future. Currently, the implementation returns a boolean value after creating a new category, but there is a plan to update this to return the generated id.
Signed-off-by: Mathis <yidhra@tuta.io>
The return type of the createCategory function in category.service.ts has been changed from unknown to boolean. Now, the function will return true if the creation is successful, and false if an error occurs.
Signed-off-by: Mathis <yidhra@tuta.io>
Several method calls in category.service.ts were incorrectly using IDbCategory instead of Category in MysqlService. This commit fixes the naming to correctly use Category in all method calls to ensure correct function execution.
Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
Refactor the category service by:
- Calling methods from MysqlService.IDbCategory instead of MysqlService.Category.
- Adding new methods: getById and deleteCategory with typed return and clear comments.
These changes enhances code flexibility and readability.
Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
Update category service functions with added getBySlug function and refactor getAllCategory to getAll. Exception handling has been improved, returning null on error.
Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
The commit updates the 'category.service.ts' file by refactoring the UUID usage. Previously, the UUID feature was imported as a whole, but now only the v4 function is imported for efficiency. It introduces a new function 'getAllCategory' to fetch all categories. This, combined with better error handling and logging, leads to improved service reliability.
Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>
A new CategoryService has been added in the services layer. This includes a function createCategory for creating a new category using IDbCategory data. Some placeholders for future features such as get, delete and retrieve by id or slug are also included.
Issue: #11
Signed-off-by: Mathis <yidhra@tuta.io>