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 changes to enhance the product seeding process, improve database handling for cart items, and update API types for better currency support. The most important changes include adding currency support to products and variants, updating database constraints and queries to handle
NULLvalues for product variants, and modifying image paths for consistency.Product and Variant Enhancements:
currencyCodefield to theseedProductsfunction and updated theINSERT INTO productsquery to include this field. (cmd/seed/main.go, [1] [2]INSERT INTO product_variantsquery to include acurrency_codefield with a default value of"USD". (cmd/seed/main.go, cmd/seed/main.goL687-R712)web/types/api.tsto include acurrencyfield inProductDTOandVariantDTO. (web/types/api.ts, [1] [2]Image Path Consistency:
seedProductsandseedProductVariantsto use a consistent/images/directory prefix. (cmd/seed/main.go, [1] [2] [3] [4]Cart Item Handling:
CreateandUpdatemethods inCartRepositoryto handleNULLvalues forproduct_variant_idwhen no variant is specified. (internal/infrastructure/repository/postgres/cart_repository.go, [1] [2]Database Constraints:
cart_itemstable to allowNULLforproduct_variant_idand ensured unique constraints handleNULLvalues using a partial index. (migrations/000018_fix_cart_items_variant_constraint.up.sql, migrations/000018_fix_cart_items_variant_constraint.up.sqlR1-R22)NULLvalues forproduct_variant_idin the database schema. (migrations/000019_fix_cart_repository_null_variant.up.sql, migrations/000019_fix_cart_repository_null_variant.up.sqlR1-R4)Deprecated Features:
seedCartsfunctionality in themain.gofile, effectively disabling it for now. (cmd/seed/main.go, cmd/seed/main.goL122-R127)