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
@@ -135,6 +135,8 @@ public class RejectPaymentRequestCommandHandlerTests
Assert.True(result.IsSuccess);
Assert.Equal(ConfigStatus.Expired, config.Status);
// enable:false — истечение управляется полностью на нашей стороне, панельный expiresAt
// сбрасывается в "без срока" (см. BillingConfigResumer.NoExpiry), не реальную просроченную дату.
await _gateway
.Received(1)
.UpdateClientAsync(
@@ -144,7 +146,7 @@ public class RejectPaymentRequestCommandHandlerTests
VpnProtocol.Vless,
Arg.Any<string>(),
false,
Arg.Any<DateTimeOffset?>(),
Arg.Is<DateTimeOffset?>(d => d == DateTimeOffset.UnixEpoch),
Arg.Any<CancellationToken>()
);
// Фронт (/billing) должен узнать о смене статуса сразу, не дожидаясь опроса.