feature/add-stock-product#83
Merged
Merged
Conversation
Dazzlin00
approved these changes
Apr 26, 2025
CarlosDev73
approved these changes
Apr 26, 2025
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.
This pull request introduces several updates to improve the functionality, maintainability, and clarity of the codebase. Key changes include adding the
@Exposedecorator to DTOs for better serialization, introducing a newgetProductsmethod in theProductsServicewith enhanced filtering capabilities, and implementing a virtual column for stock calculation in theProductPresentationentity. Additionally, some dependencies were updated, and unused repositories were removed.Enhancements to DTOs:
@Exposedecorator to properties inCategoryDTO,ManufacturerDTO, andProductDTOto enable controlled serialization. The@Typedecorator was also introduced inProductDTOfor nested object transformation. ([[1]](https://github.com/PharmaTechVe/api/pull/83/files#diff-9bf124d4c46627b8d2c1d39974abd76ef5c0913dc4c3f414c204e343f243f2e9R2-R19),[[2]](https://github.com/PharmaTechVe/api/pull/83/files#diff-e12a4d8a96c805cdae4b3fd234088af73b59256488ba93544886c5de4f1d1c5eR2-R14),[[3]](https://github.com/PharmaTechVe/api/pull/83/files#diff-f15b7608e25d980cbe574edaa3ee0e2fb62816b80c6ac2acfeaff58f02d8d41dR29-R78))Improvements to
ProductsService:getProductsmethod with advanced filtering options (e.g., by category, manufacturer, branch, and price range). This method is more flexible and replaces the older version, which has been marked as deprecated. ([[1]](https://github.com/PharmaTechVe/api/pull/83/files#diff-96a20d758e030b096d5569de349503fa568238e0ab514be78826ed9c9f445625R122-R215),[[2]](https://github.com/PharmaTechVe/api/pull/83/files#diff-96a20d758e030b096d5569de349503fa568238e0ab514be78826ed9c9f445625L59-R49))Product,Manufacturer,Category, etc.), simplifying the service's dependency list. ([src/products/products.service.tsL3-L30](https://github.com/PharmaTechVe/api/pull/83/files#diff-96a20d758e030b096d5569de349503fa568238e0ab514be78826ed9c9f445625L3-L30))Entity Enhancements:
@VirtualColumnin theProductPresentationentity to calculate stock dynamically based on inventory data. ([src/products/entities/product-presentation.entity.tsR46-R52](https://github.com/PharmaTechVe/api/pull/83/files#diff-88948ad8709ca59cb3ca1f35cd0335a91d13d4677f55b74c13a8c33516e5531aR46-R52))Dependency Updates:
typeormdependency from version0.3.20to0.3.22inpackage.json. ([package.jsonL46-R46](https://github.com/PharmaTechVe/api/pull/83/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L46-R46))Controller Serialization:
ProductsControllerto useplainToInstancefor transforming and serializing the response data intoProductPresentationDTOwith explicit and implicit conversion options. ([src/products/products.controller.tsL127-R134](https://github.com/PharmaTechVe/api/pull/83/files#diff-057c369854000322460bf5f5a7a7271d71e83e676a2f33cf2cd50a9923f938f3L127-R134))