feat: Replace 5% grace period with configurable ExtraUsers field (#31629)
* feat: Replace 5% grace period with configurable ExtraUsers field - Rename ExtraSeats to ExtraUsers in license Features struct - Remove fixed 5% grace period and minimum 1 extra user logic - Add configurable ExtraUsers field that allows exact control over additional seats - Update calculateGraceLimit() to use extraUsers parameter directly - When ExtraUsers is nil, defaults to 0 (hard cap with no overage) - Special case maintained: zero user licenses always return 0 grace limit - Update all tests to use new ExtraUsers functionality Closes #31628 Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com> * feat: eliminate calculateGraceLimit function, use inline baseLimit + extraUsers - Remove calculateGraceLimit function and replace with inline calculation - Allow extraUsers even when baseLimit is 0 (behavioral change) - Update tests to reflect new behavior - Remove TestCalculateGraceLimit since function no longer exists Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com> * feat: move ExtraUsers field to top level License struct Move ExtraUsers field from Features struct to the top level License struct for better organization and direct access. Update all references in limits.go and limits_test.go to use the new field location. Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com> * feat: use model.NewPointer for creating integer pointers in tests Replace inline function declarations with model.NewPointer calls for cleaner code. Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com> * feat: reorder ExtraUsers field to be after IsSeatCountEnforced Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com> * fix: format Go files with gofmt - Remove extra blank line in limits.go - Align struct fields in limits_test.go table test Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com> * Fix user limits tests and document ExtraUsers field - Fix TestCreateUserOrGuestSeatCountEnforcement to use ExtraUsers instead of old grace period - Add documentation to ExtraUsers field explaining it as a grace mechanism - Update test comments to reflect hard limit terminology 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Jesse Hallam <lieut-data@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
744d284069
Коммит
e367872c0b
@@ -68,7 +68,11 @@ type License struct {
|
||||
IsTrial bool `json:"is_trial"`
|
||||
IsGovSku bool `json:"is_gov_sku"`
|
||||
IsSeatCountEnforced bool `json:"is_seat_count_enforced"`
|
||||
SignupJWT *string `json:"signup_jwt"`
|
||||
// ExtraUsers provides a grace mechanism that allows a configurable number of users
|
||||
// beyond the base license limit before restricting user creation. When nil, defaults to 0.
|
||||
// For example: 100 licensed users + 5 ExtraUsers = 105 total allowed users.
|
||||
ExtraUsers *int `json:"extra_users"`
|
||||
SignupJWT *string `json:"signup_jwt"`
|
||||
}
|
||||
|
||||
type Customer struct {
|
||||
|
||||
Ссылка в новой задаче
Block a user