Documentation ¶
Overview ¶
Package scrumbus provides business access to scrum domain.
Index ¶
- Constants
- Variables
- type Address
- type Business
- func (b *Business) Count(ctx context.Context, filter QueryFilter) (int, error)
- func (b *Business) Create(ctx context.Context, ns NewScrum) (Scrum, error)
- func (b *Business) Delete(ctx context.Context, scrum Scrum) error
- func (b *Business) NewWithTx(tx sqldb.CommitRollbacker) (*Business, error)
- func (b *Business) Query(ctx context.Context, filter QueryFilter, orderBy order.By, page page.Page) ([]Scrum, error)
- func (b *Business) QueryByID(ctx context.Context, scrumID uuid.UUID) (Scrum, error)
- func (b *Business) QueryByUserID(ctx context.Context, userID uuid.UUID) ([]Scrum, error)
- func (b *Business) Update(ctx context.Context, scrum Scrum, uh UpdateScrum) (Scrum, error)
- type NewScrum
- type QueryFilter
- type Scrum
- type Storer
- type UpdateScrum
Constants ¶
const (
OrderByID = "scrum_id"
)
Set of fields that the results can be ordered by.
Variables ¶
var ( ErrNotFound = errors.New("scrum not found") ErrUserDisabled = errors.New("user disabled") )
Set of error variables for CRUD operations.
DefaultOrderBy represents the default way we sort.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Address1 string // We should create types for these fields. Address2 string ZipCode string City string State string Country string }
Address represents an individual address.
type Business ¶
type Business struct {
// contains filtered or unexported fields
}
Business manages the set of APIs for scrum api access.
func NewBusiness ¶
func NewBusiness(log *logger.Logger, userBus *userbus.Business, delegate *delegate.Delegate, storer Storer) *Business
NewBusiness constructs a scrum business API for use.
func (*Business) NewWithTx ¶
func (b *Business) NewWithTx(tx sqldb.CommitRollbacker) (*Business, error)
NewWithTx constructs a new domain value that will use the specified transaction in any store related calls.
func (*Business) Query ¶
func (b *Business) Query(ctx context.Context, filter QueryFilter, orderBy order.By, page page.Page) ([]Scrum, error)
Query retrieves a list of existing scrums.
func (*Business) QueryByUserID ¶
QueryByUserID finds the scrums by a specified User ID.
type QueryFilter ¶
type QueryFilter struct { ID *uuid.UUID UserID *uuid.UUID Name *string StartCreatedDate *time.Time EndCreatedDate *time.Time }
QueryFilter holds the available fields a query can be filtered on. We are using pointer semantics because the With API mutates the value.
type Scrum ¶
type Scrum struct { ID uuid.UUID Name string Time int Color string Attendees []string UserID uuid.UUID DateCreated time.Time DateUpdated time.Time }
Scrum represents an individual scrum.
type Storer ¶
type Storer interface { NewWithTx(tx sqldb.CommitRollbacker) (Storer, error) Create(ctx context.Context, scrum Scrum) error Update(ctx context.Context, scrum Scrum) error Delete(ctx context.Context, scrum Scrum) error Query(ctx context.Context, filter QueryFilter, orderBy order.By, page page.Page) ([]Scrum, error) Count(ctx context.Context, filter QueryFilter) (int, error) QueryByID(ctx context.Context, scrumID uuid.UUID) (Scrum, error) QueryByUserID(ctx context.Context, userID uuid.UUID) ([]Scrum, error) }
Storer interface declares the behaviour this package needs to persist and retrieve data.
type UpdateScrum ¶
UpdateScrum defines what information may be provided to modify an existing Scrum. All fields are optional so clients can send only the fields they want changed. It uses pointer fields so we can differentiate between a field that was not provided and a field that was provided as explicitly blank. Normally we do not want to use pointers to basic types but we make exception around marshalling/unmarshalling.