Skip to content

Conversation

@gustaavik
Copy link
Member

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 NULL values for product variants, and modifying image paths for consistency.

Product and Variant Enhancements:

  • Added a currencyCode field to the seedProducts function and updated the INSERT INTO products query to include this field. (cmd/seed/main.go, [1] [2]
  • Updated the INSERT INTO product_variants query to include a currency_code field with a default value of "USD". (cmd/seed/main.go, cmd/seed/main.goL687-R712)
  • Updated API types in web/types/api.ts to include a currency field in ProductDTO and VariantDTO. (web/types/api.ts, [1] [2]

Image Path Consistency:

  • Updated image paths in seedProducts and seedProductVariants to use a consistent /images/ directory prefix. (cmd/seed/main.go, [1] [2] [3] [4]

Cart Item Handling:

  • Modified Create and Update methods in CartRepository to handle NULL values for product_variant_id when no variant is specified. (internal/infrastructure/repository/postgres/cart_repository.go, [1] [2]

Database Constraints:

Deprecated Features:

  • Commented out the seedCarts functionality in the main.go file, effectively disabling it for now. (cmd/seed/main.go, cmd/seed/main.goL122-R127)

@gustaavik gustaavik merged commit b4a9c2c into main May 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants