feat: add AgentNodeIndexController for node listing and remove settlement_cycle field from AgentProfile logic
This commit is contained in:
@@ -44,7 +44,6 @@ test('super admin can update agent profile with capability flags', function ():
|
||||
'credit_limit' => 1200,
|
||||
'rebate_limit' => 1,
|
||||
'default_player_rebate' => 0.5,
|
||||
'settlement_cycle' => 'weekly',
|
||||
'can_grant_extra_rebate' => false,
|
||||
'can_create_child_agent' => true,
|
||||
'can_create_player' => true,
|
||||
|
||||
@@ -38,7 +38,6 @@ test('agent profile switches strip create player and child manage from effective
|
||||
'used_credit' => 0,
|
||||
'rebate_limit' => 0,
|
||||
'default_player_rebate' => 0,
|
||||
'settlement_cycle' => 'weekly',
|
||||
'can_grant_extra_rebate' => false,
|
||||
'can_create_child_agent' => false,
|
||||
'can_create_player' => false,
|
||||
@@ -98,7 +97,6 @@ test('agent profile switches on grant create capabilities even when platform age
|
||||
'used_credit' => 0,
|
||||
'rebate_limit' => 0,
|
||||
'default_player_rebate' => 0,
|
||||
'settlement_cycle' => 'weekly',
|
||||
'can_grant_extra_rebate' => false,
|
||||
'can_create_child_agent' => true,
|
||||
'can_create_player' => true,
|
||||
|
||||
@@ -40,15 +40,22 @@ test('super admin can create integration site and receive secrets once', functio
|
||||
'name' => 'Partner A',
|
||||
'wallet_api_url' => 'https://wallet.partner-a.test',
|
||||
'status' => 1,
|
||||
'admin_account' => [
|
||||
'username' => 'partner_a_admin',
|
||||
'nickname' => 'Partner A Admin',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
]);
|
||||
|
||||
$response->assertCreated()
|
||||
->assertJsonPath('code', 0)
|
||||
->assertJsonPath('data.code', 'partner-a')
|
||||
->assertJsonPath('data.secrets_display_once', true)
|
||||
->assertJsonPath('data.admin_user.username', 'partner_a_admin')
|
||||
->assertJsonStructure([
|
||||
'data' => [
|
||||
'secrets' => ['sso_jwt_secret', 'wallet_api_key'],
|
||||
'admin_user' => ['id', 'username', 'nickname', 'email'],
|
||||
],
|
||||
]);
|
||||
|
||||
@@ -66,6 +73,11 @@ test('super admin can reveal integration site secrets for copy', function (): vo
|
||||
->postJson('/api/v1/admin/integration-sites', [
|
||||
'code' => 'partner-secrets',
|
||||
'name' => 'Partner Secrets',
|
||||
'admin_account' => [
|
||||
'username' => 'partner_secrets_admin',
|
||||
'nickname' => 'Partner Secrets Admin',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
])
|
||||
->assertCreated();
|
||||
|
||||
@@ -94,6 +106,11 @@ test('integration site code cannot be changed on update', function (): void {
|
||||
->postJson('/api/v1/admin/integration-sites', [
|
||||
'code' => 'partner-b',
|
||||
'name' => 'Partner B',
|
||||
'admin_account' => [
|
||||
'username' => 'partner_b_admin',
|
||||
'nickname' => 'Partner B Admin',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
]);
|
||||
$create->assertCreated();
|
||||
$id = (int) $create->json('data.id');
|
||||
@@ -154,6 +171,11 @@ test('rotate secrets returns new plaintext once', function (): void {
|
||||
->postJson('/api/v1/admin/integration-sites', [
|
||||
'code' => 'partner-rotate',
|
||||
'name' => 'Rotate',
|
||||
'admin_account' => [
|
||||
'username' => 'partner_rotate_admin',
|
||||
'nickname' => 'Partner Rotate Admin',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
]);
|
||||
$id = (int) $create->json('data.id');
|
||||
$oldSecret = (string) $create->json('data.secrets.sso_jwt_secret');
|
||||
@@ -183,6 +205,11 @@ test('connectivity test probes partner balance api', function (): void {
|
||||
'code' => 'probe-site',
|
||||
'name' => 'Probe',
|
||||
'wallet_api_url' => 'https://wallet.probe.test',
|
||||
'admin_account' => [
|
||||
'username' => 'probe_site_admin',
|
||||
'nickname' => 'Probe Site Admin',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
]);
|
||||
$id = (int) $create->json('data.id');
|
||||
|
||||
@@ -205,6 +232,11 @@ test('export parameter sheet excludes plaintext secrets', function (): void {
|
||||
'code' => 'export-site',
|
||||
'name' => 'Export',
|
||||
'wallet_api_url' => 'https://wallet.export.test',
|
||||
'admin_account' => [
|
||||
'username' => 'export_site_admin',
|
||||
'nickname' => 'Export Site Admin',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
]);
|
||||
$id = (int) $create->json('data.id');
|
||||
|
||||
@@ -225,6 +257,11 @@ test('site scoped admin only sees bound integration sites', function (): void {
|
||||
->postJson('/api/v1/admin/integration-sites', [
|
||||
'code' => 'site-a',
|
||||
'name' => 'Site A',
|
||||
'admin_account' => [
|
||||
'username' => 'site_a_admin',
|
||||
'nickname' => 'Site A Admin',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
])
|
||||
->assertCreated();
|
||||
|
||||
@@ -232,6 +269,11 @@ test('site scoped admin only sees bound integration sites', function (): void {
|
||||
->postJson('/api/v1/admin/integration-sites', [
|
||||
'code' => 'site-b',
|
||||
'name' => 'Site B',
|
||||
'admin_account' => [
|
||||
'username' => 'site_b_admin',
|
||||
'nickname' => 'Site B Admin',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
])
|
||||
->assertCreated();
|
||||
|
||||
@@ -360,6 +402,11 @@ test('wallet_api_url rejects non-https', function (): void {
|
||||
'code' => 'bad-https-1',
|
||||
'name' => 'Bad HTTPS 1',
|
||||
'wallet_api_url' => 'http://wallet.bad.test',
|
||||
'admin_account' => [
|
||||
'username' => 'bad_https_admin_1',
|
||||
'nickname' => 'Bad HTTPS Admin 1',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
])
|
||||
->assertStatus(422)
|
||||
->assertJsonPath('data.errors.wallet_api_url.0', 'wallet_api_url 必须是 https 的公开域名根地址,并拒绝 localhost/内网 IP 与带路径/查询的地址。');
|
||||
@@ -373,6 +420,11 @@ test('wallet_api_url rejects localhost', function (): void {
|
||||
'code' => 'bad-https-2',
|
||||
'name' => 'Bad HTTPS 2',
|
||||
'wallet_api_url' => 'https://localhost:8080',
|
||||
'admin_account' => [
|
||||
'username' => 'bad_https_admin_2',
|
||||
'nickname' => 'Bad HTTPS Admin 2',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
])
|
||||
->assertStatus(422)
|
||||
->assertJsonPath('data.errors.wallet_api_url.0', 'wallet_api_url 必须是 https 的公开域名根地址,并拒绝 localhost/内网 IP 与带路径/查询的地址。');
|
||||
@@ -386,6 +438,11 @@ test('wallet_api_url rejects private ip with path', function (): void {
|
||||
'code' => 'bad-https-3',
|
||||
'name' => 'Bad HTTPS 3',
|
||||
'wallet_api_url' => 'https://127.0.0.1/wallet',
|
||||
'admin_account' => [
|
||||
'username' => 'bad_https_admin_3',
|
||||
'nickname' => 'Bad HTTPS Admin 3',
|
||||
'password' => 'secret-strong',
|
||||
],
|
||||
])
|
||||
->assertStatus(422)
|
||||
->assertJsonPath('data.errors.wallet_api_url.0', 'wallet_api_url 必须是 https 的公开域名根地址,并拒绝 localhost/内网 IP 与带路径/查询的地址。');
|
||||
|
||||
@@ -281,7 +281,6 @@ test('admin can set player credit limit without clobbering used credit', functio
|
||||
'used_credit' => 0,
|
||||
'rebate_limit' => 0.01,
|
||||
'default_player_rebate' => 0.005,
|
||||
'settlement_cycle' => 'weekly',
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ function createAgentLineForAllocation(string $code, int $creditLimit): AgentNode
|
||||
'used_credit' => 0,
|
||||
'rebate_limit' => 0.01,
|
||||
'default_player_rebate' => 0.005,
|
||||
'settlement_cycle' => 'weekly',
|
||||
]);
|
||||
|
||||
return AgentNode::query()->findOrFail($rootId);
|
||||
|
||||
@@ -49,7 +49,6 @@ function createSiteWithRoot(string $code): array
|
||||
'used_credit' => 0,
|
||||
'rebate_limit' => 0.01,
|
||||
'default_player_rebate' => 0.005,
|
||||
'settlement_cycle' => 'weekly',
|
||||
]);
|
||||
|
||||
return ['site_id' => $siteId, 'site_code' => $code, 'root_id' => $rootId];
|
||||
|
||||
@@ -37,7 +37,6 @@ test('share snapshot uses profile at build time not after change', function ():
|
||||
'used_credit' => 0,
|
||||
'rebate_limit' => 0.01,
|
||||
'default_player_rebate' => 0.005,
|
||||
'settlement_cycle' => 'weekly',
|
||||
]);
|
||||
|
||||
$playerId = (int) DB::table('players')->insertGetId([
|
||||
|
||||
Reference in New Issue
Block a user