Add shipping system #9
Merged
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 significant updates to the shipping, discount, order, and product use cases, including support for shipping methods, weight-based calculations, and enhanced discount logic. Key changes include the addition of shipping-related functionality, updates to discount application logic, and the inclusion of weight attributes for products and variants.
Shipping Functionality Enhancements:
ShippingUseCaseto theOrderUseCasefor handling shipping methods and costs. This includes calculating shipping options and applying shipping methods to orders. (internal/application/usecase/order_usecase.go) [1] [2] [3] [4]CreateOrderInputto includeShippingMethodIDfor specifying the desired shipping method during order creation. (internal/application/usecase/order_usecase.go)internal/application/usecase/order_usecase.go) [1] [2]Discount Logic Improvements:
ApplyDiscountToOrdermethod to support category-based discounts by dynamically determining eligible products from specified categories. (internal/application/usecase/discount_usecase.go)Product and Variant Updates:
Weightattribute toCreateProductInput,CreateVariantInput, andAddVariantInputto support weight-based shipping calculations. (internal/application/usecase/product_usecase.go) [1] [2] [3]Weightattribute and ensure the product's weight is updated when the default variant changes. (internal/application/usecase/product_usecase.go) [1] [2]Documentation:
docs/shipping_api_examples.mdfile containing example request and response bodies for public and admin shipping API endpoints, including workflows for creating shipping methods, zones, and rates. (docs/shipping_api_examples.md)