feat: add cart editing feature to tenants
- Added 'cart_editing_enabled' attribute to Tenant model with default value true. - Updated StoreTenantRequest and UpdateTenantRequest to include validation for 'cart_editing_enabled'. - Modified TenantResource to expose 'cart_editing_enabled' in API responses. - Created migration to add 'cart_editing_enabled' column to tenants table, defaulting to true, and set to false for specific tenant. - Updated DesfilePuraTendenciaSeeder to set 'cart_editing_enabled' to false for the desfile tenant. - Enhanced Postman collection generation script to include 'cart_editing_enabled' in tenant creation and update requests. - Added tests to verify the correct behavior of 'cart_editing_enabled' during migrations and tenant provisioning.
This commit is contained in:
@@ -43,6 +43,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
'display_categories',
|
||||
'display_seach_bar',
|
||||
'display_cart',
|
||||
'cart_editing_enabled',
|
||||
'scanner_category_validation_enabled',
|
||||
'event_title',
|
||||
'event_location',
|
||||
@@ -59,6 +60,7 @@ class Tenant extends Model
|
||||
'display_categories' => true,
|
||||
'display_seach_bar' => true,
|
||||
'display_cart' => true,
|
||||
'cart_editing_enabled' => true,
|
||||
'scanner_category_validation_enabled' => true,
|
||||
];
|
||||
|
||||
@@ -108,6 +110,7 @@ class Tenant extends Model
|
||||
'display_categories' => 'boolean',
|
||||
'display_seach_bar' => 'boolean',
|
||||
'display_cart' => 'boolean',
|
||||
'cart_editing_enabled' => 'boolean',
|
||||
'scanner_category_validation_enabled' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ class StoreTenantRequest extends FormRequest
|
||||
'display_categories' => ['sometimes', 'boolean'],
|
||||
'display_seach_bar' => ['sometimes', 'boolean'],
|
||||
'display_cart' => ['sometimes', 'boolean'],
|
||||
'cart_editing_enabled' => ['sometimes', 'boolean'],
|
||||
'scanner_category_validation_enabled' => ['sometimes', 'boolean'],
|
||||
'website_type_code' => [
|
||||
'required_with:extras',
|
||||
|
||||
@@ -93,6 +93,7 @@ class UpdateTenantRequest extends FormRequest
|
||||
'display_categories' => ['sometimes', 'boolean'],
|
||||
'display_seach_bar' => ['sometimes', 'boolean'],
|
||||
'display_cart' => ['sometimes', 'boolean'],
|
||||
'cart_editing_enabled' => ['sometimes', 'boolean'],
|
||||
'scanner_category_validation_enabled' => ['sometimes', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -74,6 +74,7 @@ class TenantResource extends JsonResource
|
||||
'display_categories' => $this->display_categories,
|
||||
'display_seach_bar' => $this->display_seach_bar,
|
||||
'display_cart' => $this->display_cart,
|
||||
'cart_editing_enabled' => $this->cart_editing_enabled,
|
||||
'scanner_category_validation_enabled' => $this->scanner_category_validation_enabled,
|
||||
'social_media' => $this->whenLoaded(
|
||||
'socialMedia',
|
||||
|
||||
Reference in New Issue
Block a user