Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultTaxInclusive(ctx context.Context, db *gorm.DB, gqlClient *gqlClient.Client, ...) bool
- func DefaultTaxRate(ctx context.Context, db *gorm.DB, gqlClient *gqlClient.Client, ...) float64
- func InvoiceItemCostHelper(item *LineItemInput) string
- func InvoiceItemTotalHelper(item *LineItemInput) string
- func InvoiceTotalHelper(invoice *InvoiceTemplateData) string
- type Address
- type Client
- type Company
- type Contact
- type Invoice
- type InvoiceInput
- type InvoiceNumber
- type InvoicePaymentStatus
- type InvoiceRenderMQ
- type InvoiceStatus
- type InvoiceTemplateData
- type LineItem
- type LineItemInput
- type Notify
- type Orm
- type PreferredContact
- type User
Constants ¶
View Source
const ClientBillingAddressType = "client_billing"
View Source
const ClientShippingAddressType = "client_shipping"
View Source
const CompanyBillingAddressType = "company_billing"
View Source
const CompanyShippingAddressType = "company_shipping"
Variables ¶
View Source
var AllInvoicePaymentStatus = []InvoicePaymentStatus{ InvoicePaymentStatusPending, InvoicePaymentStatusComplete, InvoicePaymentStatusOverdue, }
View Source
var AllInvoiceStatus = []InvoiceStatus{ InvoiceStatusDraft, InvoiceStatusSent, InvoiceStatusViewed, }
View Source
var AllPreferredContact = []PreferredContact{ PreferredContactPhone, PreferredContactMobile, PreferredContactEmail, }
Functions ¶
func DefaultTaxInclusive ¶
func DefaultTaxRate ¶
func InvoiceItemCostHelper ¶
func InvoiceItemCostHelper(item *LineItemInput) string
func InvoiceItemTotalHelper ¶
func InvoiceItemTotalHelper(item *LineItemInput) string
func InvoiceTotalHelper ¶
func InvoiceTotalHelper(invoice *InvoiceTemplateData) string
Types ¶
type Client ¶
type Client struct { ID hide.ID `gorm:"type: bigserial;primary_key" json:"id"` // int64 CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time Name string Website *string VatNumber *string BusinessNumber *string Phone *string BillingAddress Address `gorm:"polymorphic:Addressee;polymorphicValue:client_billing"` ShippingAddress Address `gorm:"polymorphic:Addressee;polymorphicValue:client_shipping"` Contacts []Contact CompanyID hide.ID `json:"company"` Company Company `json:"-"` Invoices []*Invoice `json:"invoices"` }
type Company ¶
type Company struct { ID hide.ID `gorm:"type: bigserial;primary_key" json:"id"` // int64 CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time Code string `gorm:"unique_index:idx_code"` Name string Website string BillingAddress Address `gorm:"polymorphic:Addressee;polymorphicValue:company_billing"` ShippingAddress Address `gorm:"polymorphic:Addressee;polymorphicValue:company_shipping"` InvoiceTaxInclusive bool `json:"invoiceTaxInclusive"` InvoiceTaxRate float64 `json:"invoiceTaxRate"` }
func GetCompany ¶
type InvoiceInput ¶
type InvoiceInput struct { ClientID hide.ID `json:"clientID"` Items []*LineItemInput `json:"items"` DateDue time.Time `json:"dateDue"` }
type InvoiceNumber ¶
func (InvoiceNumber) GormDataType ¶
func (n InvoiceNumber) GormDataType() string
func (*InvoiceNumber) Scan ¶
func (n *InvoiceNumber) Scan(v interface{}) error
type InvoicePaymentStatus ¶
type InvoicePaymentStatus string
const ( InvoicePaymentStatusPending InvoicePaymentStatus = "PENDING" InvoicePaymentStatusComplete InvoicePaymentStatus = "COMPLETE" InvoicePaymentStatusOverdue InvoicePaymentStatus = "OVERDUE" )
func (InvoicePaymentStatus) IsValid ¶
func (e InvoicePaymentStatus) IsValid() bool
func (InvoicePaymentStatus) MarshalGQL ¶
func (e InvoicePaymentStatus) MarshalGQL(w io.Writer)
func (InvoicePaymentStatus) String ¶
func (e InvoicePaymentStatus) String() string
func (*InvoicePaymentStatus) UnmarshalGQL ¶
func (e *InvoicePaymentStatus) UnmarshalGQL(v interface{}) error
type InvoiceRenderMQ ¶
type InvoiceStatus ¶
type InvoiceStatus string
const ( InvoiceStatusDraft InvoiceStatus = "DRAFT" InvoiceStatusSent InvoiceStatus = "SENT" InvoiceStatusViewed InvoiceStatus = "VIEWED" )
func (InvoiceStatus) IsValid ¶
func (e InvoiceStatus) IsValid() bool
func (InvoiceStatus) MarshalGQL ¶
func (e InvoiceStatus) MarshalGQL(w io.Writer)
func (InvoiceStatus) String ¶
func (e InvoiceStatus) String() string
func (*InvoiceStatus) UnmarshalGQL ¶
func (e *InvoiceStatus) UnmarshalGQL(v interface{}) error
type InvoiceTemplateData ¶
type InvoiceTemplateData struct { Number int Client Client Company Company Items []*LineItemInput }
type LineItem ¶
type LineItem struct { ID hide.ID `gorm:"type: bigserial;primary_key" json:"id"` // int64 CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` InvoiceID hide.ID Name string Description string UnitCost decimal.Decimal TaxRate decimal.Decimal Quantity float64 TaxInclusive bool }
func (*LineItem) TaxRatePercent ¶
type LineItemInput ¶
type Notify ¶
type Notify struct {
Users []int64
}
Notify holds data for sending notifications back to users
type PreferredContact ¶
type PreferredContact string
const ( PreferredContactPhone PreferredContact = "PHONE" PreferredContactMobile PreferredContact = "MOBILE" PreferredContactEmail PreferredContact = "EMAIL" )
func (PreferredContact) IsValid ¶
func (e PreferredContact) IsValid() bool
func (PreferredContact) MarshalGQL ¶
func (e PreferredContact) MarshalGQL(w io.Writer)
func (PreferredContact) String ¶
func (e PreferredContact) String() string
func (*PreferredContact) UnmarshalGQL ¶
func (e *PreferredContact) UnmarshalGQL(v interface{}) error
Click to show internal directories.
Click to hide internal directories.