9 Commits

Author SHA1 Message Date
0a6321deb0
feat(services): mark blob validation as TODO in brand service
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>
2024-04-26 10:00:55 +02:00
85adbbcdb3
docs(services): add new tasks in brand.service.ts
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>
2024-04-26 09:53:27 +02:00
5c0d266002
feat(services): add deleteBrand function to brand.service.ts
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>
2024-04-26 09:52:09 +02:00
6c626e0b18
feat(services): add getByIdBrand function in brand service
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>
2024-04-26 09:41:37 +02:00
aecaf83d85
feat(services): add getBySlugBrand function in brand.service
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>
2024-04-26 09:40:24 +02:00
33d44ee4b6
feat(services): add getAllBrand function in BrandService
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>
2024-04-26 09:35:55 +02:00
90cd80e540
feat(services): add updateBrand function to BrandService
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>
2024-04-26 09:30:03 +02:00
f3bddc7170
feat(services): change IDbBrand import to explicit type import
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>
2024-04-25 16:57:39 +02:00
6e429f4f27
feat(services): add new BrandService with createBrand function
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>
2024-04-25 16:56:50 +02:00