Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] - Product Created Without Category and Variant #1250

Open
BigLens opened this issue Feb 27, 2025 · 0 comments · May be fixed by #1332
Open

[FIX] - Product Created Without Category and Variant #1250

BigLens opened this issue Feb 27, 2025 · 0 comments · May be fixed by #1332
Assignees
Labels
bug Something isn't working In-progress This issue is being worked on

Comments

@BigLens
Copy link

BigLens commented Feb 27, 2025

Bug Description

When a product is created, the product category and product variant entities exist in the system but are not linked to the product. This happens because the Many-to-One relationship between Product → ProductCategory and Product → ProductVariant is missing. As a result, products are created without any associated category or variant, leading to data inconsistency.

Steps to Reproduce

  1. Create a new product via the API or UI.
  2. Check the product details in the database or API response.
  3. Observe that the product is created successfully.
  4. Check the ProductCategory and ProductVariant tables – they exist but are not linked to the product.

Expected Behavior

A product should always have an associated category and variant.
The Many-to-One relationship should ensure that a product is correctly linked to its category and variant.
The system should prevent creating a product if it is not associated with a category and variant.

Current Behavior

The product is created, but its category and variant are not attached.
The category and variant exist as standalone entities with no relationship to the product.
The missing relation causes data inconsistencies and affects filtering, retrieval, and product management.

Possible Solution

Define proper Many-To-One relationships between Product, ProductCategory, and ProductVariant in the ORM..
Modify the product creation logic to require a category and variant when creating a new product.

Additional Context

This issue affects data integrity and product filtering functionalities.

@BigLens BigLens added the bug Something isn't working label Feb 27, 2025
@github-project-automation github-project-automation bot moved this to Backlogs in Boilerplate-TS Feb 28, 2025
@AdeGneus AdeGneus moved this from Backlogs to Mentors Approved in Boilerplate-TS Feb 28, 2025
@AdeGneus AdeGneus added the In-progress This issue is being worked on label Feb 28, 2025
@BigLens BigLens linked a pull request Mar 1, 2025 that will close this issue
27 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working In-progress This issue is being worked on
Projects
Status: Mentors Approved
Development

Successfully merging a pull request may close this issue.

2 participants