diff --git a/go/internal/network/service.go b/go/internal/network/service.go index a5b9f01..c06392a 100644 --- a/go/internal/network/service.go +++ b/go/internal/network/service.go @@ -22,8 +22,11 @@ var ErrCapacityExceeded = errors.New("active stream capacity exceeded") var ErrInvalidRetentionHours = errors.New("message retention hours must be between 24 and 336") type Service interface { + // Create creates a network and adds adminHumanId as the first member. Returns ErrInvalidName if name is empty. Create(ctx context.Context, name, adminHumanId string) (*Network, error) + // GetByID returns ErrNotFound if network doesn't exist. GetByID(ctx context.Context, id string) (*Network, error) + // SetName returns ErrNotFound or ErrInvalidName. SetName(ctx context.Context, id, name string) error // AddMembers inserts members and syncs the new seat count to billing // atomically; a Stripe failure rolls the insert back. @@ -32,6 +35,7 @@ type Service interface { CountSeats(ctx context.Context, networkID string) (int, error) ListForHuman(ctx context.Context, humanId string) ([]*Network, error) IsMember(ctx context.Context, networkID, humanId string) (bool, error) + // ListAll returns all networks with their members ListAll(ctx context.Context) ([]*Network, error) // Invitations (email-based, for users who haven't registered yet)