dstpabuaran.com/app/Support/Marketplace/MarketplaceFeeRule.php
Yoga Pangestu a1a73cb222 Add admin settings routes and corresponding feature tests
- Introduced routes for managing admin settings including system, homepage, social media, marketplace, and HR settings.
- Created a comprehensive test suite for the AdminSettingsController to ensure proper functionality and validation of settings updates.
- Implemented tests for authentication, data integrity, and realistic user scenarios to validate the settings management process.
2026-07-31 01:04:14 +07:00

33 lines
685 B
PHP

<?php
namespace App\Support\Marketplace;
use Spatie\LaravelData\Data;
class MarketplaceFeeRule extends Data
{
public function __construct(
public string $base = 'per_transaksi',
public string $type = 'persentase',
public float $value = 0.0,
) {}
public static function defaultPercent(float $value): static
{
return new static(
base: 'per_transaksi',
type: 'persentase',
value: $value,
);
}
public function toArray(): array
{
return [
'base' => $this->base,
'type' => $this->type,
'value' => (float) $this->value,
];
}
}