test(config): align current odds and settlement contracts

This commit is contained in:
wchino
2026-07-21 23:41:18 +08:00
parent 457d2cc9e5
commit 150c3e7ebd
11 changed files with 93 additions and 163 deletions

View File

@@ -9,9 +9,9 @@ use App\Models\PlayConfigItem;
use App\Models\PlayConfigVersion;
use App\Support\OddsStandardScopes;
use App\Lottery\ConfigVersionStatus;
use App\Services\Ticket\PlayCatalogResolver;
use Database\Seeders\CurrencySeeder;
use Database\Seeders\PlayTypeSeeder;
use App\Services\Ticket\PlayCatalogResolver;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
@@ -59,7 +59,7 @@ test('syncMissingForVersion adds five scopes from default-only rows', function (
->where('prize_scope', $scope)
->firstOrFail();
expect((int) $row->odds_value)->toBe(OddsStandardScopes::PRESET_ODDS_BY_SCOPE[$scope]);
expect((int) $row->odds_value)->toBe(OddsStandardScopes::presetOddsForPlay((string) $pt->play_code)[$scope]);
/** @var string $rebate Eloquent `decimal:4` cast */
$rebate = (string) $row->rebate_rate;
expect($rebate)->toBe('0.0100');