feat: Pricing update and refactor product API tests to not rely on internals (#6892)

This PR achieves the following
- Remove dependency on internals for seeding the tests (more work left, but major work done)
- Adds the workflow for updating variant's price

I will do a follow-up PR to further clean up the tests and remove all internal dependencies
This commit is contained in:
Stevche Radevski
2024-04-01 09:33:52 +00:00
committed by GitHub
parent fe1d3a4a78
commit 585818eaf8
10 changed files with 658 additions and 694 deletions
@@ -47,6 +47,10 @@ export const remapProduct = (p: ProductDTO) => {
}
export const remapVariant = (v: ProductVariantDTO) => {
if (!v) {
return v
}
return {
...v,
prices: (v as any).price_set?.prices?.map((price) => ({
@@ -646,7 +646,8 @@ export class AdminPostProductsProductOptionsOptionReq {
// eslint-disable-next-line max-len
export class ProductVariantReq extends AdminPostProductsProductVariantsVariantReq {
@IsString()
id: string
@IsOptional()
id?: string
}
export class ProductTagReq {