A TODO comment has been added to the `brand.service.ts` file indicating that blob validation needs to be implemented in the future, for both the 'create' and 'update' functions in the brand service.
Issue: #13
Signed-off-by: Mathis <yidhra@tuta.io>
A couple of new tasks have been added into the `brand.service.ts` file.
The tasks aim to fetch models and stats of a certain brand.
Issue: #13
Signed-off-by: Mathis <yidhra@tuta.io>
The `brand.service.ts` file is updated to include a new function `deleteBrand`, which allows a brand to be deleted from the database by its ID. Appropriate error handling and activity logging have been incorporated to ensure smooth operation.
Issue: #13
Signed-off-by: Mathis <yidhra@tuta.io>
A new function, `getByIdBrand`, has been added to the brand service. This function retrieves a brand from the database based on the provided brand ID, Checks are performed on the brand ID before the retrieval attempts.
Issue: #13
Signed-off-by: Mathis <yidhra@tuta.io>
Adds a new function `getBySlugBrand` in `brand.service.ts`. This function retrieves a brand by its slug, providing a more specific search option. It implements error logging for missing slug or brand not found scenarios, and successful retrieval of the brand.
Issue: #13
Signed-off-by: Mathis <yidhra@tuta.io>
The BrandService in the services module now includes a new functionality - the getAllBrand function. This function retrieves all brands from the database. Loggers have been added to check successful retrieval and error handling.
Issue: #13
Signed-off-by: Mathis <yidhra@tuta.io>
A new function `updateBrand` has been introduced to `BrandService`. This function handles updating a brand in the database, including checks for missing `id`, brand existence by `slug_name`, and logging for successful or failed updates.
Issue: #13
Signed-off-by: Mathis <yidhra@tuta.io>
Change the import of `IDbBrand` in `brand.service.ts` to explicitly denote it as a type. This clarifies that `IDbBrand` is only used for its type information, improving readability and understanding of code usage.
Signed-off-by: Mathis <yidhra@tuta.io>
This commit introduces the new file `brand.service.ts` under services. Specifically, it implements the `createBrand` method which handles the creation of a new brand instance in the database if there's no existing brand with the same slug name. The function returns a promise containing the operation result. A UUID is also generated as `brandId`, and several logs will be recorded in different situations.
Issue: #13
Signed-off-by: Mathis <yidhra@tuta.io>