member

package
v0.0.0-...-429728b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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
}

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
}

func NewMemberService

func NewMemberService(r Repository) Service

type Specification

type Specification func(member *domain.Member) bool

func OnlyByClassification

func OnlyByClassification(value enum.Classification) Specification

func OnlyLegalMembers

func OnlyLegalMembers() Specification

func OnlyMembershipEndCurrentYear

func OnlyMembershipEndCurrentYear() Specification

Directories

Path Synopsis
Package mock_member is a generated GoMock package.
Package mock_member is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL