Documentation ¶
Index ¶
- func LastBirths(startDate, endDate time.Time) wrapper.QuerySpecification
- func LastMarriages(startDate, endDate time.Time) wrapper.QuerySpecification
- func OnlyActive() wrapper.QuerySpecification
- func OnlyInactive() wrapper.QuerySpecification
- func OnlyMarriage() wrapper.QuerySpecification
- func WithBirthday(date time.Time) wrapper.QuerySpecification
- type QueryBuilder
- type Repository
- type Service
- type Specification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LastBirths ¶
func LastBirths(startDate, endDate time.Time) wrapper.QuerySpecification
func LastMarriages ¶
func LastMarriages(startDate, endDate time.Time) wrapper.QuerySpecification
func OnlyActive ¶
func OnlyActive() wrapper.QuerySpecification
func OnlyInactive ¶
func OnlyInactive() wrapper.QuerySpecification
func OnlyMarriage ¶
func OnlyMarriage() wrapper.QuerySpecification
func WithBirthday ¶
func WithBirthday(date time.Time) wrapper.QuerySpecification
Types ¶
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
QueryBuilder allows a client to add dynamic filters to a Query
func (*QueryBuilder) AddFilter ¶
func (spec *QueryBuilder) AddFilter(key string, value interface{})
func (*QueryBuilder) ToSpecification ¶
func (spec *QueryBuilder) ToSpecification() wrapper.QuerySpecification
ToSpecification apply filters to a search on the repo
type Repository ¶
type Repository interface { FindAll(ctx context.Context, specification wrapper.QuerySpecification) ([]*domain.Member, error) FindByID(ctx context.Context, id string) (*domain.Member, error) Insert(ctx context.Context, member *domain.Member) error RetireMembership(ctx context.Context, member *domain.Member) error UpdateContact(ctx context.Context, member *domain.Member) error UpdateAddress(ctx context.Context, member *domain.Member) error UpdatePerson(ctx context.Context, member *domain.Member) error }
func NewRepository ¶
func NewRepository(api wrapper.DynamoDBAPI, memberTable string) Repository
type Service ¶
type Service interface { SearchMembers(ctx context.Context, querySpecification wrapper.QuerySpecification, postSpecification ...Specification) ([]*domain.Member, error) GetMember(ctx context.Context, id string) (*domain.Member, error) SaveMember(ctx context.Context, member *domain.Member) (string, error) RetireMembership(ctx context.Context, id string, reason string, date time.Time) error UpdateContact(ctx context.Context, memberID string, contact domain.Contact) error UpdateAddress(ctx context.Context, memberID string, address domain.Address) error UpdatePerson(ctx context.Context, memberID string, person domain.Person) error }
func NewMemberService ¶
func NewMemberService(r Repository) Service
type Specification ¶
func OnlyByClassification ¶
func OnlyByClassification(value enum.Classification) Specification
func OnlyLegalMembers ¶
func OnlyLegalMembers() Specification
func OnlyMembershipEndCurrentYear ¶
func OnlyMembershipEndCurrentYear() Specification
Click to show internal directories.
Click to hide internal directories.