feat(panel-go): monthly traffic reset for customers
- trafficResetDay/Period/At on the shared customer record (omitempty, inert for the Node panel, which preserves unknown fields) - housekeeping applies due resets before quota evaluation: period-key idempotency, short-month clamping (31st fires Feb 28), missed-period catch-up after panel downtime, traffic suspensions auto-resume - first sight of a schedule only arms the period marker, never zeroes; API create/PATCH accept trafficResetDay (0=off) and re-arm on change - UI: reset-day input + last-reset display in the customer form - tests: calendar math, apply pass, API lifecycle, persistence; full Go/Node suites green, difftest formal 50/50
This commit is contained in:
@@ -532,6 +532,9 @@ type Customer struct {
|
||||
UsedBytes int64 `json:"usedBytes"`
|
||||
UsedUplinkBytes int64 `json:"usedUplinkBytes"`
|
||||
UsedDownlinkBytes int64 `json:"usedDownlinkBytes"`
|
||||
TrafficResetDay int `json:"trafficResetDay,omitempty"`
|
||||
TrafficResetPeriod string `json:"trafficResetPeriod,omitempty"`
|
||||
TrafficResetAt *string `json:"trafficResetAt,omitempty"`
|
||||
ExpiresAt *string `json:"expiresAt"`
|
||||
IPLimit int64 `json:"ipLimit"`
|
||||
DeviceLimit int64 `json:"deviceLimit"`
|
||||
|
||||
Reference in New Issue
Block a user