product variants table split off from category variants table, variant values table updated to reflect

This commit is contained in:
2025-10-03 02:16:24 -07:00
parent d49a8784e6
commit 49912abd3a
21 changed files with 477 additions and 46 deletions

View File

@@ -36,9 +36,11 @@ class ProductCategoryVariantOptionsFixture extends TestFixture
'modified' => '2025-07-04 12:00:00',
'enabled' => 1,
],
[
'id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d25',
'variant_value' => 'Blue',
'id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d21',
'variant_value' => '12AWG',
'variant_label' => null,
'product_category_variant_id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d94',
'created' => '2025-07-04 12:00:00',
@@ -46,8 +48,8 @@ class ProductCategoryVariantOptionsFixture extends TestFixture
'enabled' => 1,
],
[
'id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d26',
'variant_value' => 'Red',
'id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d22',
'variant_value' => '14AWG',
'variant_label' => null,
'product_category_variant_id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d94',
'created' => '2025-07-04 12:00:00',

View File

@@ -22,14 +22,12 @@ class ProductCategoryVariantsFixture extends TestFixture
'id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d93',
'name' => 'Color',
'product_category_id' => 'db4b4273-eddc-46d4-93c8-45cf7c6e058e',
'product_id' => null,
'enabled' => 1,
],
[
'id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d94',
'name' => 'Color',
'name' => 'AWG',
'product_category_id' => 'db4b4273-eddc-46d4-93c8-45cf7c6e058e',
'product_id' => 'cfc98a9a-29b2-44c8-b587-8156adc05317',
'enabled' => 1,
],
];

View File

@@ -28,7 +28,7 @@ class ProductSkuVariantValuesFixture extends TestFixture
[
'id' => '98b609d8-1d4f-484c-a13a-6adb7102da56',
'product_sku_id' => '3a477e3e-7977-4813-81f6-f85949613979',
'product_category_variant_id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d93',
'product_variant_id' => '2e6e4031-c430-4d07-b8d6-a4e759b72569',
'product_category_variant_option_id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d23',
],
];

View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace CakeProducts\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* ProductVariantsFixture
*/
class ProductVariantsFixture extends TestFixture
{
/**
* Init method
*
* @return void
*/
public function init(): void
{
$this->records = [
[
'id' => '2e6e4031-c430-4d07-b8d6-a4e759b72568',
'name' => 'Color',
'product_category_variant_id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d93',
'product_id' => 'cfc98a9a-29b2-44c8-b587-8156adc05317',
'enabled' => 1,
],
[
'id' => '2e6e4031-c430-4d07-b8d6-a4e759b72569',
'name' => 'Color',
'product_category_variant_id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d93',
'product_id' => 'cfc98a9a-29b2-44c8-b587-8156adc05318',
'enabled' => 1,
],
[
'id' => '2e6e4031-c430-4d07-b8d6-a4e759b72561',
'name' => 'AWG',
'product_category_variant_id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d94',
'product_id' => 'cfc98a9a-29b2-44c8-b587-8156adc05317',
'enabled' => 1,
],
[
'id' => '2e6e4031-c430-4d07-b8d6-a4e759b72562',
'name' => 'AWG',
'product_category_variant_id' => '5a386e9f-6e7a-4ae7-9360-c8e529f78d94',
'product_id' => 'cfc98a9a-29b2-44c8-b587-8156adc05318',
'enabled' => 1,
]
];
parent::init();
}
}

View File

@@ -25,6 +25,13 @@ class ProductsFixture extends TestFixture
'product_type_id' => 1,
'deleted' => null,
],
[
'id' => 'cfc98a9a-29b2-44c8-b587-8156adc05318',
'name' => 'Heat Shrink',
'product_category_id' => '6d223283-361b-4f9f-a7f1-c97aa0ca4c23',
'product_type_id' => 1,
'deleted' => null,
],
];
parent::init();
}