dto

package
v0.0.0-...-71f7ba1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToTime

func ToTime(date *Date) *time.Time

Types

type AddressRequest

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

AddressRequest for HTTP calls to post a person swagger:model AddressRequest

func (AddressRequest) ToAddress

func (dto AddressRequest) ToAddress() *domain.Address

type ContactRequest

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

ContactRequest for HTTP calls to post a person swagger:model ContactRequest

func (ContactRequest) ToContact

func (dto ContactRequest) ToContact() *domain.Contact

type CreateMemberRequest

type CreateMemberRequest struct {
	OldChurch              string                `json:"oldChurch"`
	AttendsFridayWorship   *bool                 `json:"attendsFridayWorship" validate:"required"`
	AttendsSaturdayWorship *bool                 `json:"attendsSaturdayWorship" validate:"required"`
	AttendsSundayWorship   *bool                 `json:"attendsSundayWorship" validate:"required"`
	AttendsSundaySchool    *bool                 `json:"attendsSundaySchool" validate:"required"`
	AttendsObservation     string                `json:"attendsObservation"`
	Person                 CreatePersonRequest   `json:"person" validate:"required"`
	Religion               CreateReligionRequest `json:"religion" validate:"required"`
}

CreateMemberRequest for HTTP calls to post member swagger:model CreateMemberRequest

func (CreateMemberRequest) ToMember

func (dto CreateMemberRequest) ToMember() *domain.Member

type CreateMemberResponse

type CreateMemberResponse struct {
	ID string `json:"id"`
}

CreateMemberResponse for HTTP create member responses swagger:model CreateMemberResponse

type CreatePersonRequest

type CreatePersonRequest struct {
	FirstName        string         `json:"firstName" validate:"required"`
	LastName         string         `json:"lastName" validate:"required"`
	BirthDate        Date           `json:"birthDate" validate:"required"`
	MarriageDate     *Date          `json:"marriageDate"`
	PlaceOfBirth     string         `json:"placeOfBirth"`
	FathersName      string         `json:"fathersName"`
	MothersName      string         `json:"mothersName"`
	SpousesName      string         `json:"spousesName"`
	MaritalStatus    string         `json:"maritalStatus" validate:"eq=SINGLE|eq=WIDOW|eq=MARRIED|eq=DIVORCED"`
	BrothersQuantity int            `json:"brothersQuantity"`
	ChildrenQuantity int            `json:"childrenQuantity"`
	Profession       string         `json:"profession"`
	Gender           string         `json:"gender" validate:"required,eq=M|eq=F"`
	Contact          ContactRequest `json:"contact" validate:"required"`
	Address          AddressRequest `json:"address" validate:"required"`
}

CreatePersonRequest for HTTP calls to post a person swagger:model CreatePersonRequest

func (CreatePersonRequest) ToPerson

func (dto CreatePersonRequest) ToPerson() *domain.Person

type CreateReligionRequest

type CreateReligionRequest struct {
	FathersReligion   string `json:"fathersReligion"`
	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 *Date  `json:"acceptedJesusDate"`
	BaptismDate       *Date  `json:"baptismDate"`
}

CreateReligionRequest for HTTP calls to post a person swagger:model CreateReligionRequest

func (CreateReligionRequest) ToReligion

func (dto CreateReligionRequest) ToReligion() *domain.Religion

type CreateUserRequest

type CreateUserRequest struct {
	UserName                       string `json:"username" validate:"required,min=3,max=32"`
	Email                          string `json:"email" validate:"required,email,min=3,max=32"`
	Role                           string `json:"role" validate:"required,eq=ADMIN|eq=USER"`
	Password                       string `json:"password" validate:"required,password"`
	Phone                          string `json:"phone" validate:"required"`
	domain.NotificationPreferences `json:"preferences"`
}

CreateUserRequest for HTTP calls to post user swagger:model CreateUserRequest

func (CreateUserRequest) ToUser

func (r CreateUserRequest) ToUser() *domain.User

type Date

type Date struct {
	time.Time
}

Date shall be used to unmarshall a date only field using time.DateOnly

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(bytes []byte) error

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Error   string `json:"error"`
}

ErrorResponse for HTTP error responses swagger:model ErrorResponse

type GetAddressResponse

type GetAddressResponse struct {
	ZipCode  string `json:"zipCode,omitempty"`
	State    string `json:"state,omitempty"`
	City     string `json:"city,omitempty"`
	Address  string `json:"address,omitempty"`
	District string `json:"district,omitempty"`
	Number   int    `json:"number,omitempty"`
	Full     string `json:"full,omitempty"`
}

GetAddressResponse for HTTP get address response swagger:model GetAddressResponse

type GetContactResponse

type GetContactResponse struct {
	Cellphone string `json:"cellphone,omitempty"`
	Phone     string `json:"phone,omitempty"`
	Email     string `json:"email,omitempty"`
}

GetContactResponse for HTTP get contact response swagger:model GetContactResponse

type GetMemberResponse

type GetMemberResponse struct {
	ID             string             `json:"id"`
	Active         bool               `json:"active"`
	Classification string             `json:"classification"`
	Person         *GetPersonResponse `json:"person"`
}

GetMemberResponse for HTTP get member responses swagger:model GetMemberResponse

func NewGetMemberResponse

func NewGetMemberResponse(member *domain.Member) *GetMemberResponse

NewGetMemberResponse builds a member response

type GetPersonResponse

type GetPersonResponse struct {
	FirstName     string              `json:"firstName,omitempty"`
	LastName      string              `json:"lastName,omitempty"`
	FullName      string              `json:"fullName,omitempty"`
	Gender        string              `json:"gender,omitempty"`
	Age           int                 `json:"age,omitempty"`
	BirthDate     time.Time           `json:"birthDate,omitempty"`
	MarriageDate  *time.Time          `json:"marriageDate,omitempty"`
	SpousesName   string              `json:"spousesName,omitempty"`
	MaritalStatus string              `json:"maritalStatus,omitempty"`
	Contact       *GetContactResponse `json:"contact,omitempty"`
	Address       *GetAddressResponse `json:"address,omitempty"`
}

GetPersonResponse for HTTP get person response swagger:model GetPersonResponse

type GetTokenResponse

type GetTokenResponse struct {
	Token string `json:"token"`
}

GetTokenResponse for HTTP get token responses swagger:model GetTokenResponse

type MemberItem

type MemberItem struct {
	ID                     string     `dynamodbav:"id,omitempty"`
	ChurchID               string     `dynamodbav:"church_id"`
	OldChurch              string     `dynamodbav:"oldChurch,omitempty"`
	AttendsFridayWorship   bool       `dynamodbav:"attendsFridayWorship"`
	AttendsSaturdayWorship bool       `dynamodbav:"attendsSaturdayWorship"`
	AttendsSundayWorship   bool       `dynamodbav:"attendsSundayWorship"`
	AttendsSundaySchool    bool       `dynamodbav:"attendsSundaySchool"`
	AttendsObservation     string     `dynamodbav:"attendsObservation,omitempty"`
	Name                   string     `dynamodbav:"name"`
	FirstName              string     `dynamodbav:"firstName"`
	LastName               string     `dynamodbav:"lastName"`
	BirthDate              time.Time  `dynamodbav:"birthDate"`
	MarriageDate           *time.Time `dynamodbav:"marriageDate,omitempty"`
	PlaceOfBirth           string     `dynamodbav:"placeOfBirth"`
	FathersName            string     `dynamodbav:"fathersName"`
	MothersName            string     `dynamodbav:"mothersName"`
	SpousesName            string     `dynamodbav:"spousesName,omitempty"`
	MaritalStatus          string     `dynamodbav:"maritalStatus,omitempty"`
	BrothersQuantity       int        `dynamodbav:"brothersQuantity"`
	ChildrenQuantity       int        `dynamodbav:"childrensQuantity"`
	Profession             string     `dynamodbav:"profession,omitempty"`
	Gender                 string     `dynamodbav:"gender"`
	PhoneArea              int        `dynamodbav:"phoneArea,omitempty"`
	Phone                  int        `dynamodbav:"phone,omitempty"`
	CellPhoneArea          int        `dynamodbav:"cellPhoneArea"`
	CellPhone              int        `dynamodbav:"cellPhone"`
	Email                  string     `dynamodbav:"email"`
	ZipCode                string     `dynamodbav:"zipCode"`
	State                  string     `dynamodbav:"state"`
	City                   string     `dynamodbav:"city"`
	Address                string     `dynamodbav:"address"`
	District               string     `dynamodbav:"district"`
	AddressNumber          int        `dynamodbav:"addressNumber"`
	MoreInfo               string     `dynamodbav:"moreInfo"`
	FathersReligion        string     `dynamodbav:"fathersReligion,omitempty"`
	BaptismPlace           string     `dynamodbav:"baptismPlace"`
	LearnedGospelAge       int        `dynamodbav:"learnedGospelAge"`
	AcceptedJesus          bool       `dynamodbav:"acceptedJesus"`
	Baptized               bool       `dynamodbav:"baptized"`
	CatholicBaptized       bool       `dynamodbav:"catholicBaptized"`
	KnowsTithe             bool       `dynamodbav:"knowsTithe"`
	AgreesTithe            bool       `dynamodbav:"agreesTithe"`
	Tithe                  bool       `dynamodbav:"tithe"`
	AcceptedJesusDate      *time.Time `dynamodbav:"acceptedJesusDate"`
	BaptismDate            *time.Time `dynamodbav:"baptismDate"`
	Active                 bool       `dynamodbav:"active,omitempty"`
	BirthDateShort         string     `dynamodbav:"birthDateShort"`
	MarriageDateShort      string     `dynamodbav:"marriageDateShort"`
	MembershipStartDate    time.Time  `dynamodbav:"membershipStartDate"`
	MembershipEndDate      *time.Time `dynamodbav:"membershipEndDate"`
	MembershipEndReason    string     `dynamodbav:"membershipEndReason"`
}

MemberItem for dynamoDB struct

func NewMemberItem

func NewMemberItem(member *domain.Member) *MemberItem

NewMemberItem creates a MemberItem from a domain.Member

func (*MemberItem) ToMember

func (item *MemberItem) ToMember() *domain.Member

ToMember converts a MemberItem into a domain.Member

type RetireMemberRequest

type RetireMemberRequest struct {
	Reason     string    `json:"reason" validate:"required"`
	RetireDate time.Time `json:"date"`
}

RetireMemberRequest for HTTP calls to put member status swagger:model RetireMemberRequest

type UpdatePersonRequest

type UpdatePersonRequest struct {
	FirstName        string `json:"firstName" validate:"required"`
	LastName         string `json:"lastName" validate:"required"`
	BirthDate        Date   `json:"birthDate" validate:"required"`
	MarriageDate     *Date  `json:"marriageDate"`
	SpousesName      string `json:"spousesName"`
	MaritalStatus    string `json:"maritalStatus" validate:"eq=SINGLE|eq=WIDOW|eq=MARRIED|eq=DIVORCED"`
	ChildrenQuantity int    `json:"childrenQuantity"`
}

UpdatePersonRequest for HTTP calls to put a person swagger:model UpdatePersonRequest

func (UpdatePersonRequest) ToPerson

func (request UpdatePersonRequest) ToPerson() domain.Person

type UserItem

type UserItem struct {
	ID              string `dynamodbav:"id"`
	ChurchID        string `dynamodbav:"church_id"`
	UserName        string `dynamodbav:"username"`
	Email           string `dynamodbav:"email"`
	Role            string `dynamodbav:"role"`
	Password        string `dynamodbav:"password"`
	Phone           string `dynamodbav:"phone"`
	ConfirmedEmail  bool   `dynamodbav:"confirmed_email"`
	SendDailySMS    bool   `dynamodbav:"send_daily_sms"`
	SendWeeklyEmail bool   `dynamodbav:"send_weekly_email"`
}

func NewUserItem

func NewUserItem(user *domain.User) *UserItem

NewUserItem creates a UserItem from a domain.User

func (*UserItem) ToUser

func (item *UserItem) ToUser() *domain.User

ToUser converts a UserItem into a domain.User

Jump to

Keyboard shortcuts

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