domain

package
v0.0.0-...-5863de9 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChurchID

func GetChurchID(ctx context.Context) string

func IsValidID

func IsValidID(id string) bool

IsValidID validates the ID regex for UUID

func NewID

func NewID() string

NewID builds a new UUID

Types

type Address

type Address struct {
	ZipCode  string `json:"zipCode"`
	State    string `json:"state"`
	City     string `json:"city"`
	Address  string `json:"address"`
	District string `json:"district"`
	Number   int    `json:"number"`
	MoreInfo string `json:"moreInfo"`
}

Address struct

func (Address) String

func (address Address) String() string

String address

type Church

type Church struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Abbreviation string `json:"abbreviation"`
	Language     string `json:"language"`
	Email        string `json:"email"`
}

Church provides information about a church

func GetChurch

func GetChurch(ctx context.Context) *Church

type Contact

type Contact struct {
	PhoneArea     int    `json:"phoneArea,omitempty"`
	Phone         int    `json:"phone,omitempty"`
	CellPhoneArea int    `json:"cellPhoneArea"`
	CellPhone     int    `json:"cellPhone"`
	Email         string `json:"email"`
}

Contact struct

func (Contact) GetFormattedCellPhone

func (c Contact) GetFormattedCellPhone() string

GetFormattedCellPhone (99) 999999999

func (Contact) GetFormattedPhone

func (c Contact) GetFormattedPhone() string

GetFormattedPhone (99) 99999999

type Member

type Member struct {
	ID                     string     `json:"id"`
	ChurchID               string     `json:"church_id"`
	OldChurch              string     `json:"oldChurch,omitempty"`
	AttendsFridayWorship   bool       `json:"attendsFridayWorship"`
	AttendsSaturdayWorship bool       `json:"attendsSaturdayWorship"`
	AttendsSundayWorship   bool       `json:"attendsSundayWorship"`
	AttendsSundaySchool    bool       `json:"attendsSundaySchool"`
	AttendsObservation     string     `json:"attendsObservation,omitempty"`
	Person                 *Person    `json:"person"`
	Religion               *Religion  `json:"religion"`
	Active                 bool       `json:"active,omitempty"`
	MembershipStartDate    time.Time  `json:"membership_start_date"`
	MembershipEndDate      *time.Time `json:"membership_end_date,omitempty"`
	MembershipEndReason    string     `json:"membership_end_reason,omitempty"`
}

Member struct

func (Member) Classification

func (member Member) Classification() enum.Classification

Classification returns a member classification based on age and marriage

func (Member) IsLegal

func (member Member) IsLegal() bool

IsLegal validate if a member is legal only if it's not a children

func (Member) MembershipEndCurrentYear

func (member Member) MembershipEndCurrentYear() bool

type NotificationPreferences

type NotificationPreferences struct {
	SendDailySMS    bool `json:"send_daily_sms"`
	SendWeeklyEmail bool `json:"send_weekly_email"`
}

type Person

type Person struct {
	Name             string     `json:"name"`
	FirstName        string     `json:"firstName"`
	LastName         string     `json:"lastName"`
	BirthDate        time.Time  `json:"birthDate"`
	MarriageDate     *time.Time `json:"marriageDate,omitempty"`
	PlaceOfBirth     string     `json:"placeOfBirth"`
	FathersName      string     `json:"fathersName"`
	MothersName      string     `json:"mothersName"`
	MaritalStatus    string     `json:"maritalStatus"`
	SpousesName      string     `json:"spousesName,omitempty"`
	BrothersQuantity int        `json:"brothersQuantity"`
	ChildrenQuantity int        `json:"childrenQuantity"`
	Profession       string     `json:"profession,omitempty"`
	Gender           string     `json:"gender"`
	Contact          *Contact   `json:"contact"`
	Address          *Address   `json:"address"`
}

Person type

func (Person) Age

func (person Person) Age() int

Age of a person

func (Person) GetCoupleName

func (person Person) GetCoupleName() string

GetCoupleName return the couple name in case the person is married

func (Person) GetFullName

func (person Person) GetFullName() string

GetFullName of a person

func (Person) IsMarried

func (person Person) IsMarried() bool

IsMarried returns true if the person is MARRIED

type Religion

type Religion struct {
	FathersReligion   string     `json:"fathersReligion,omitempty"`
	BaptismPlace      string     `json:"baptismPlace"`
	LearnedGospelAge  int        `json:"learnedGospelAge"`
	AcceptedJesus     bool       `json:"acceptedJesus"`
	Baptized          bool       `json:"baptized"`
	CatholicBaptized  bool       `json:"catholicBaptized"`
	KnowsTithe        bool       `json:"knowsTithe"`
	AgreesTithe       bool       `json:"agreesTithe"`
	Tithe             bool       `json:"tithe"`
	AcceptedJesusDate *time.Time `json:"acceptedJesusDate"`
	BaptismDate       *time.Time `json:"baptismDate"`
}

Religion struct

type SortByBirthDay

type SortByBirthDay []*Member

SortByBirthDay a list of members

func (SortByBirthDay) Len

func (a SortByBirthDay) Len() int

func (SortByBirthDay) Less

func (a SortByBirthDay) Less(i, j int) bool

func (SortByBirthDay) Swap

func (a SortByBirthDay) Swap(i, j int)

type SortByMarriageDay

type SortByMarriageDay []*Member

SortByMarriageDay a list of members

func (SortByMarriageDay) Len

func (a SortByMarriageDay) Len() int

func (SortByMarriageDay) Less

func (a SortByMarriageDay) Less(i, j int) bool

func (SortByMarriageDay) Swap

func (a SortByMarriageDay) Swap(i, j int)

type SortByName

type SortByName []*Member

SortByName a list of members

func (SortByName) Len

func (a SortByName) Len() int

func (SortByName) Less

func (a SortByName) Less(i, j int) bool

func (SortByName) Swap

func (a SortByName) Swap(i, j int)

type User

type User struct {
	ID          string                  `json:"id"`
	ChurchID    string                  `json:"church_id"`
	UserName    string                  `json:"username"`
	Email       string                  `json:"email"`
	Role        enum.Role               `json:"role"`
	Phone       string                  `json:"phone"`
	Preferences NotificationPreferences `json:"-"`
	Password    []byte                  `json:"-"`
	Church      *Church                 `json:"-"`
}

func NewUser

func NewUser(userName, email, password, phone string, role enum.Role, preferences NotificationPreferences) *User

Jump to

Keyboard shortcuts

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