feat: auto-friend invite bound users

This commit is contained in:
richjohnrambo
2026-09-11 10:46:20 +08:00
parent 926b4bbd81
commit b9dc56eccf
4 changed files with 104 additions and 23 deletions
+14 -12
View File
@@ -37,18 +37,20 @@ type RegistrationInviteBatch struct {
}
type RegistrationInviteCode struct {
ID int64 `db:"id" json:"id"`
TenantID TenantID `db:"tenant_id" json:"tenant_id"`
BatchID *int64 `db:"batch_id" json:"batch_id,omitempty"`
Code string `db:"code" json:"code"`
Status RegistrationInviteStatus `db:"status" json:"status"`
ExpiresAt time.Time `db:"expires_at" json:"expires_at"`
UsageCount int `db:"usage_count" json:"usage_count"`
LastUsedAt *time.Time `db:"last_used_at" json:"last_used_at,omitempty"`
CreatedBy int64 `db:"created_by" json:"created_by"`
Remark string `db:"remark" json:"remark,omitempty"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
ID int64 `db:"id" json:"id"`
TenantID TenantID `db:"tenant_id" json:"tenant_id"`
BatchID *int64 `db:"batch_id" json:"batch_id,omitempty"`
Code string `db:"code" json:"code"`
Status RegistrationInviteStatus `db:"status" json:"status"`
ExpiresAt time.Time `db:"expires_at" json:"expires_at"`
MaxUses int `db:"max_uses" json:"max_uses"`
UsageCount int `db:"usage_count" json:"usage_count"`
BoundUserID *int64 `db:"bound_user_id" json:"bound_user_id,omitempty"`
LastUsedAt *time.Time `db:"last_used_at" json:"last_used_at,omitempty"`
CreatedBy int64 `db:"created_by" json:"created_by"`
Remark string `db:"remark" json:"remark,omitempty"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}
type RegistrationInviteListOptions struct {