feat(organization): add member limit feature

- Introduced a new member limit feature for organizations, allowing a maximum number of members to be set (default is 50; 0 means unlimited).
- Updated API endpoints to handle member limit during organization creation and updates.
- Implemented validation to prevent adding members when the limit is reached.
- Enhanced UI components to display and manage member limits, including localization updates for English and Chinese.
- Added migration files to support the new member limit column in the organizations table.

This update improves organization management by allowing administrators to control membership size.
This commit is contained in:
wizardchen
2026-01-30 20:26:41 +08:00
committed by lyingbug
parent b1b6396ac0
commit ca1b3da1df
15 changed files with 566 additions and 240 deletions
@@ -98,7 +98,7 @@ func (r *organizationRepository) ListSearchable(ctx context.Context, query strin
// Update updates an organization (Select ensures zero values like invite_code_validity_days=0 are persisted)
func (r *organizationRepository) Update(ctx context.Context, org *types.Organization) error {
return r.db.WithContext(ctx).Model(&types.Organization{}).Where("id = ?", org.ID).
Select("name", "description", "require_approval", "searchable", "invite_code_validity_days", "updated_at").
Select("name", "description", "require_approval", "searchable", "invite_code_validity_days", "member_limit", "updated_at").
Updates(org).Error
}