package repository import ( "context" "gateway/internal/model/auth/domain/entity" "go.mongodb.org/mongo-driver/v2/bson" ) // InviteRepository persists invite codes. type InviteRepository interface { GetByTenantAndCodeHash(ctx context.Context, tenantID, codeHash string) (*entity.InviteCode, error) ConsumeOne(ctx context.Context, id bson.ObjectID) (*entity.InviteCode, error) } // InviteConsumeLock serializes concurrent consumption for the same invite code. type InviteConsumeLock interface { TryLock(ctx context.Context, tenantID, codeHash string) (bool, error) Unlock(ctx context.Context, tenantID, codeHash string) error }