- Updated the OwnerVerificationRequest model to change pendingToggleIsActive to pendingToggleStatus, reflecting the new status structure. - Refactored the Product model to replace is_active with status, utilizing the ProductStatus enum for better clarity and type safety. - Modified the ProductService to accommodate the new status field, including pagination and creation logic. - Adjusted the AnalysisService to filter products based on their status. - Updated the VerificationChangeFormatter to handle the new status field. - Created a migration to remove is_active from the products table and add status with appropriate default values. - Refactored the ProductSeeder to use the new status field. - Updated frontend components and types to reflect the changes from is_active to status. - Adjusted tests to ensure they validate the new status logic correctly.
24 lines
418 B
PHP
24 lines
418 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Traits\ProvidesEnumOptions;
|
|
|
|
enum ProductStatus: string
|
|
{
|
|
use ProvidesEnumOptions;
|
|
|
|
case DRAFT = 'draft';
|
|
case ACTIVE = 'active';
|
|
case INACTIVE = 'inactive';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::DRAFT => 'Draf',
|
|
self::ACTIVE => 'Aktif',
|
|
self::INACTIVE => 'Nonaktif',
|
|
};
|
|
}
|
|
}
|