mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-20 21:14:10 +00:00
21 lines
478 B
PHP
21 lines
478 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Orders\Services;
|
|
|
|
|
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
|
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
|
use App\Models\Order;
|
|
use Carbon\Carbon;
|
|
|
|
class CalculatesSegmentRate
|
|
{
|
|
|
|
public function execute(Order $order, int $segmentRates){
|
|
return ($segmentRates == SegmentConstants::STANDARD_SEGMENT) ? 300 : (
|
|
(($segmentRates == SegmentConstants::CUSTOM_SEGMENT) ? -20 : 0)
|
|
);
|
|
}
|
|
|
|
}
|