model

package
v0.0.0-...-5ecfc35 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const ANNUAL = "Annual Vows"
View Source
const DECEASED = "Deceased"
View Source
const ELECTRONIC communicationPref = "electronic"
View Source
const FRIEND = "Friend"
View Source
const LIFE = "Life Vows"
View Source
const MAILED communicationPref = "mailed"
View Source
const NONE communicationPref = "none"
View Source
const REMOVED = "Removed"

Variables

This section is empty.

Functions

func AveryLabels

func AveryLabels(pdffile io.Writer, addresses []addressFormatter)

Avery 5160

func Connect

func Connect(ctx context.Context, uri string) error

Connect tries to establish a connection to a MySQL/MariaDB database under the given URI and initializes the tables if they don"t exist yet.

func Disconnect

func Disconnect()

Disconnect closes the database connection called only at server shutdown

func DoxologyEmailedDirect

func DoxologyEmailedDirect(ctx context.Context) ([]string, error)

DoxologyEmailedDirect returns a list of addresses for direct API processing, so we can dump the CSV stuff

func DoxologyPrinted

func DoxologyPrinted(ctx context.Context, w io.Writer) error

func DoxologySync

func DoxologySync(ctx context.Context) error

func FontEmailedDirect

func FontEmailedDirect(ctx context.Context) ([]string, error)

FontEmailedDirect returns a list of addresses for direct google groups API processing

func FontSync

func FontSync(ctx context.Context) error

func FormatAddress

func FormatAddress(m addressFormatter) (string, error)

Make sure that addresses for mailing are properly formatted - handle both members and subscribers

func FormatPhoneNumber

func FormatPhoneNumber(number string, country string) (string, error)

func Friendzone

func Friendzone(ctx context.Context) error

Friendzone moves all members who have not reaffirmed vows in the past friendzoneMinDays and converts them to friends

func ReportAllEmail

func ReportAllEmail(ctx context.Context, w io.Writer) error

func ReportAllSubscribers

func ReportAllSubscribers(ctx context.Context, w io.Writer) error

func ReportAnnual

func ReportAnnual(ctx context.Context, w io.Writer) error

func ReportAvery

func ReportAvery(ctx context.Context, w io.Writer) error

func ReportBarb

func ReportBarb(ctx context.Context, w io.Writer) error

func ReportExpired

func ReportExpired(ctx context.Context, w io.Writer) error

func ReportLife

func ReportLife(ctx context.Context, w io.Writer) error

func ReportLifeCheckinFormMerge

func ReportLifeCheckinFormMerge(ctx context.Context, w io.Writer) error

func ReportReaffirmationFormMerge

func ReportReaffirmationFormMerge(ctx context.Context, w io.Writer) error

func SetMeField

func SetMeField(ctx context.Context, id MemberID, field string, value string) error

Types

type Authname

type Authname string

func (Authname) Authenticate

func (u Authname) Authenticate(password string) (uint8, error)

func (Authname) GetID

func (u Authname) GetID() (MemberID, error)

func (Authname) Register

func (u Authname) Register() (string, error)

func (Authname) SetAuthData

func (u Authname) SetAuthData(pw string, level int) error

func (Authname) String

func (u Authname) String() string

String satisfies the stringer interface

type ChangeLogEntry

type ChangeLogEntry struct {
	ID      MemberID
	Changer MemberID
	Field   string
	Value   string
	Date    time.Time
}

type Chapter

type Chapter struct {
	ID    ChapterID
	Name  string
	Prior MemberID
	Email string
}

func Chapters

func Chapters() ([]*Chapter, error)

func (*Chapter) Members

func (c *Chapter) Members(ctx context.Context) ([]*Member, error)

func (*Chapter) Remove

func (c *Chapter) Remove() error

func (*Chapter) Update

func (c *Chapter) Update() error

type ChapterID

type ChapterID int

func (ChapterID) ChapterSync

func (id ChapterID) ChapterSync(ctx context.Context) error

func (ChapterID) Load

func (id ChapterID) Load() (*Chapter, error)

type Commemoration

type Commemoration struct {
	OSLName  string
	Locality string
	Country  string
	Year     int
}

func Commemorations

func Commemorations(ctx context.Context, month time.Month, day int) ([]Commemoration, error)

type Dashboard_t

type Dashboard_t struct {
	LifevowCount         int
	AnnualCount          int
	FriendCount          int
	SubscriberCount      int
	ThisYearGiving       string
	LastYearGiving       string
	AnnualVowsWhoGave    int
	LifeVowsWhoGave      int
	AnnualVowsReaffirmed int
	LifeVowsCheckin      int
}

Dashboard is the format sent to the UI

func Dashboard

func Dashboard() (Dashboard_t, error)

type GivingRecord

type GivingRecord struct {
	EntryID     int
	ID          MemberID
	Amount      float64
	Check       int
	Transaction string
	Description string
	Date        time.Time
}

func (*GivingRecord) Store

func (n *GivingRecord) Store() error

type Locality

type Locality struct {
	CountryCode  string
	LocalityCode string
	JointCode    string
	Locality     string
}

func Localities

func Localities(ctx context.Context) ([]*Locality, error)

type Member

type Member struct {
	ID                 MemberID
	MemberStatus       string
	FirstName          string
	MiddleName         string
	LastName           string
	PreferredName      string
	Title              string
	LifevowName        string
	Suffix             string
	Address            string
	AddressLine2       string
	City               string
	State              string
	Country            string
	PostalCode         string
	PrimaryPhone       string
	SecondaryPhone     string
	PrimaryEmail       string
	SecondaryEmail     string
	BirthDate          time.Time
	DateRecordCreated  time.Time
	DateFirstVows      time.Time
	DateReaffirmation  time.Time
	DateRemoved        time.Time
	DateDeceased       time.Time
	DateNovitiate      time.Time
	DateLifeVows       time.Time
	Status             string
	Leadership         string
	HowJoined          string
	HowRemoved         string
	ListInDirectory    bool
	ListAddress        bool
	ListPrimaryPhone   bool
	ListSecondaryPhone bool
	ListPrimaryEmail   bool
	ListSecondaryEmail bool
	Doxology           communicationPref
	Newsletter         communicationPref
	Communication      communicationPref
	Occupation         string
	Employer           string
	Denomination       string
	Benefactor         bool
	FormattedAddr      string // only populated for export to webui
}

Member is the format sent to the UI

func Leadership

func Leadership(ctx context.Context, category string) ([]*Member, error)

func LocalityMembers

func LocalityMembers(ctx context.Context, country string, locality string) ([]*Member, error)

func Necrology

func Necrology(ctx context.Context) ([]*Member, error)

func SearchBirthday

func SearchBirthday(ctx context.Context, month time.Month, day int) ([]*Member, error)

func (*Member) Changelog

func (m *Member) Changelog() ([]*ChangeLogEntry, error)

func (*Member) CleanUnlisted

func (n *Member) CleanUnlisted()

func (*Member) ISOCountry

func (m *Member) ISOCountry() string

func (*Member) OSLName

func (n *Member) OSLName() string

func (*Member) OSLShortName

func (n *Member) OSLShortName() string

func (*Member) SetChapters

func (m *Member) SetChapters(ctx context.Context, incoming ...int) error

func (*Member) WriteVCard

func (m *Member) WriteVCard(w io.Writer) error

type MemberID

type MemberID int

func ActiveMemberIDs

func ActiveMemberIDs(ctx context.Context) ([]MemberID, error)

ActiveMemberIDs returns All Annual Vows, Life Vows and Friends

func ActiveMemberIDsUS

func ActiveMemberIDsUS(ctx context.Context) ([]MemberID, error)

ActiveMemberIDsUS returns All Annual Vows, Life Vows and Friends in the US

func AnnualMemberIDs

func AnnualMemberIDs(ctx context.Context) ([]MemberID, error)

AnnualMemberIDs does what it says

func Create

func Create(firstname, lastname string) (MemberID, error)

func FriendIDs

func FriendIDs(ctx context.Context) ([]MemberID, error)

FriendsIDs does what it says

func JustMemberIDsUS

func JustMemberIDsUS(ctx context.Context) ([]MemberID, error)

JustMemberIDsUS returns All Annual Vows and Life Vows in the US

func LifeMemberIDs

func LifeMemberIDs(ctx context.Context) ([]MemberID, error)

LifeMemberIDs does what it says

func NecrologyIDs

func NecrologyIDs(ctx context.Context) ([]MemberID, error)

NecrologyIDs does what it says

func NewMemberIDs

func NewMemberIDs(ctx context.Context) ([]MemberID, error)

NewMemberIDs does what it says

func ReminderAnnual

func ReminderAnnual(ctx context.Context) ([]MemberID, error)

ReminderAnnual returns those who have not reaffirmed in the past year

func TestMemberIDs

func TestMemberIDs() ([]MemberID, error)

func (MemberID) ChangeLogStore

func (id MemberID) ChangeLogStore(c ChangeLogEntry) error

func (MemberID) Get

func (id MemberID) Get(ctx context.Context) (*Member, error)

GetMember returns a populated Member struct, NULLs converted to ""

func (MemberID) GetChapters

func (id MemberID) GetChapters() ([]int, error)

func (MemberID) GetNotes

func (m MemberID) GetNotes() ([]*Note, error)

func (MemberID) GivingRecords

func (id MemberID) GivingRecords() ([]*GivingRecord, error)

func (MemberID) SetMemberField

func (id MemberID) SetMemberField(ctx context.Context, field string, value string, changer MemberID) error

func (MemberID) SubscribeAllChapters

func (id MemberID) SubscribeAllChapters(ctx context.Context) error

func (MemberID) SubscribeChapter

func (id MemberID) SubscribeChapter(ctx context.Context, chapterid ChapterID) error

func (MemberID) SubscribeDoxology

func (id MemberID) SubscribeDoxology(ctx context.Context) error

func (MemberID) SubscribeFont

func (id MemberID) SubscribeFont(ctx context.Context) error

func (MemberID) UnsubscribeAllChapters

func (id MemberID) UnsubscribeAllChapters(ctx context.Context) error

func (MemberID) UnsubscribeChapter

func (id MemberID) UnsubscribeChapter(ctx context.Context, chapterid ChapterID) error

func (MemberID) UnsubscribeDoxology

func (id MemberID) UnsubscribeDoxology(ctx context.Context) error

func (MemberID) UnsubscribeFont

func (id MemberID) UnsubscribeFont(ctx context.Context) error

type Note

type Note struct {
	ID     NoteID
	Member MemberID
	Date   time.Time
	Note   string
}

func (*Note) Store

func (n *Note) Store() error

type NoteID

type NoteID uint

func (NoteID) Delete

func (n NoteID) Delete() error

type SearchResult

type SearchResult struct {
	ID              MemberID
	MemberStatus    string
	FirstName       string
	LastName        string
	PreferredName   string
	ListInDirectory bool
}

SearchResult is the format sent to the UI

func Search(ctx context.Context, query string, unlisted bool) ([]*SearchResult, error)

func SearchEmail

func SearchEmail(ctx context.Context, query string, unlisted bool) ([]*SearchResult, error)

type SubSearchResult

type SubSearchResult struct {
	ID   SubscriberID
	Name string
	Attn string
}

SearchResult is the format sent to the UI

func SubscriberSearch

func SubscriberSearch(ctx context.Context, query string) ([]*SubSearchResult, error)

GetMember returns a populated Member struct, NULLs converted to ""

func SubscriberSearchEmail

func SubscriberSearchEmail(ctx context.Context, query string) ([]*SubSearchResult, error)

type Subscriber

type Subscriber struct {
	ID                SubscriberID
	Name              string
	Attn              string
	Address           string
	AddressLine2      string
	City              string
	State             string
	Country           string
	PostalCode        string
	PrimaryPhone      string
	SecondaryPhone    string
	PrimaryEmail      string
	SecondaryEmail    string
	DateRecordCreated time.Time
	DatePaid          time.Time
	Doxology          communicationPref
	Newsletter        communicationPref
	Communication     communicationPref
	FormattedAddr     string
}

func (*Subscriber) ISOCountry

func (s *Subscriber) ISOCountry() string

type SubscriberID

type SubscriberID int

func (SubscriberID) Get

func (id SubscriberID) Get(ctx context.Context) (*Subscriber, error)

func (SubscriberID) SetField

func (id SubscriberID) SetField(ctx context.Context, field string, value string) error

Jump to

Keyboard shortcuts

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