model

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Street  string `json:"street"`
	ZipCode string `json:"zipCode"`
	City    string `json:"city"`
	State   string `json:"state"`
}

type Adult

type Adult struct {
	Name             string      `json:"name"`
	Surname          string      `json:"surname"`
	SecondSurname    interface{} `json:"secondSurname"`
	TaxID            string      `json:"taxId"`
	Role             string      `json:"role"`
	Address          interface{} `json:"address"`
	Email            string      `json:"email"`
	MobilePhone      string      `json:"mobilePhone"`
	HomePhone        interface{} `json:"homePhone"`
	GrandMotherPhone interface{} `json:"grandMotherPhone"`
	GrandParentPhone interface{} `json:"grandParentPhone"`
	WorkPhone        interface{} `json:"workPhone"`
	BirthDate        interface{} `json:"birthDate"`
	Nationality      interface{} `json:"nationality"`
	Score            float32     `json:"score"`
}

func (Adult) MobilePhoneFmt

func (a Adult) MobilePhoneFmt() string

func (Adult) NameSurnameFmt

func (a Adult) NameSurnameFmt() string

type Child

type Child struct {
	Code          int         `json:"code"`
	Name          string      `json:"name"`
	Surname       string      `json:"surname"`
	SecondSurname string      `json:"secondSurname"`
	TaxID         string      `json:"taxId"`
	BirthDate     string      `json:"birthDate"`
	Group         string      `json:"group"`
	Note          interface{} `json:"note"`
	Active        bool        `json:"active"`
	Score         float32     `json:"score"`
}

func (Child) NameWithCode

func (c Child) NameWithCode() string

type Customer

type Customer struct {
	Children      []Child       `json:"children"`
	Adults        []Adult       `json:"adults"`
	InvoiceHolder InvoiceHolder `json:"invoiceHolder"`
	Note          interface{}   `json:"note"`
	Language      string        `json:"language"`
	Active        bool          `json:"active"`
}

func (Customer) ChildrenNames

func (c Customer) ChildrenNames(joinWith string) string

func (Customer) FirstAdult

func (c Customer) FirstAdult() Adult

func (Customer) FirstAdultNameWithCode

func (c Customer) FirstAdultNameWithCode() string

func (Customer) Id

func (c Customer) Id() int

type Invoice

type Invoice struct {
	CustomerID    int    `json:"customerId"`
	Date          string `json:"date"`
	YearMonth     string `json:"yearMonth"`
	ChildrenCodes []int  `json:"childrenCodes"`
	Lines         []Line `json:"lines"`
	PaymentType   string `json:"paymentType"`
	Note          string `json:"note"`
	Emailed       bool   `json:"emailed"`
	Printed       bool   `json:"printed"`
	SentToBank    bool   `json:"sentToBank"`
	Links         struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
		Invoice struct {
			Href string `json:"href"`
		} `json:"invoice"`
	} `json:"_links"`
}

func (Invoice) Amount

func (i Invoice) Amount() float32

func (Invoice) Code

func (i Invoice) Code() string

func (Invoice) LinesFmt

func (i Invoice) LinesFmt(joinWith string) string

func (Invoice) PaymentFmt

func (i Invoice) PaymentFmt() string

type InvoiceHolder

type InvoiceHolder struct {
	Name        string  `json:"name"`
	TaxID       string  `json:"taxId"`
	Address     Address `json:"address"`
	Email       string  `json:"email"`
	SendEmail   bool    `json:"sendEmail"`
	PaymentType string  `json:"paymentType"`
	BankAccount string  `json:"bankAccount"`
	IsBusiness  bool    `json:"isBusiness"`
}

func (InvoiceHolder) BankAccountFmt

func (i InvoiceHolder) BankAccountFmt() string

func (InvoiceHolder) PaymentInfoFmt

func (i InvoiceHolder) PaymentInfoFmt() string

type Line

type Line struct {
	ProductID     string  `json:"productId"`
	Units         float32 `json:"units"`
	ProductPrice  float32 `json:"productPrice"`
	TaxPercentage float32 `json:"taxPercentage"`
	ChildCode     int     `json:"childCode"`
}

type Product

type Product struct {
	Name          string  `json:"name"`
	ShortName     string  `json:"shortName"`
	Price         float64 `json:"price"`
	TaxPercentage float64 `json:"taxPercentage"`
	IsSubsidy     bool    `json:"isSubsidy"`
	Links         struct {
		Self struct {
			Href string `json:"href"`
		} `json:"self"`
		Product struct {
			Href string `json:"href"`
		} `json:"product"`
	} `json:"_links"`
}

Jump to

Keyboard shortcuts

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