Refactor billing configuration management to centralize expiration handling
CI / Backend (build + test) (push) Failing after 1m8s
CI / Frontend (lint + typecheck + build) (push) Successful in 34s

- Updated `BillingConfigResumer` to manage billing expiration entirely on the application side, using `enable` as the sole control mechanism for client access.
- Changed all relevant methods to pass `DateTimeOffset.UnixEpoch` for `expiresAt`, ensuring the panel does not enforce expiration independently of our application logic.
- Modified `IXuiPanelGateway` interface to reflect the new expiration handling approach, clarifying the role of `expiresAt` in client management.
- Adjusted command handlers for creating and rotating VPN configurations to set `expiresAt` to `null`, preventing unintended expiration enforcement by the panel.
- Enhanced documentation to explain the new billing expiration management strategy and its implications for client configurations.
This commit is contained in:
Leonid Pershin
2026-07-22 23:43:45 +03:00
parent 33ad98cf62
commit 29291b5dec
9 changed files with 102 additions and 82 deletions
@@ -144,6 +144,20 @@ public class ApproveExtensionRequestCommandHandlerTests
Assert.True(result.IsSuccess);
Assert.Equal(ConfigStatus.Active, config.Status);
Assert.NotNull(config.ExpiresAt);
// enable:true — истечение управляется полностью на нашей стороне, панельный expiresAt
// сбрасывается в "без срока" (см. BillingConfigResumer.NoExpiry), а не в реальный новый срок.
await _gateway
.Received(1)
.UpdateClientAsync(
Arg.Any<Node>(),
inbound.RemoteInboundId,
"ext-1",
VpnProtocol.Vless,
Arg.Any<string>(),
true,
Arg.Is<DateTimeOffset?>(d => d == DateTimeOffset.UnixEpoch),
Arg.Any<CancellationToken>()
);
}
[Fact]