types

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

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContactFullName                  = "Full Name"
	ContactName                      = "Name"
	ContactPersonalCode              = "Personal Code"
	ContactRegistrationNumber        = "Reg. #"
	ContactCompanyRegistrationNumber = "Company Reg. #"
	ContactVAT                       = "VAT"
	ContactAddress                   = "Address"
	ContactPhone                     = "Phone"
	ContactCellPhone                 = "Cell"
	ContactFax                       = "Cell"
	ContactEmail                     = "Email"
	ContactBankAccount               = "Bank Account"
	ContactWalletAddress             = "Wallet Address"
	ContactDirector                  = "Director"
)
View Source
const SaneDateTimeLayout = "2006-01-02 15:04"

Variables

View Source
var File_models_proto protoreflect.FileDescriptor

Functions

func Filter

func Filter[T any](arr []T, predicate func(T) bool) []T

func FormatTime

func FormatTime(t time.Time) string

func Now

func Now() string

func ParseContact

func ParseContact(out map[string]string, vals []string)

func ParseTime

func ParseTime(val string) (time.Time, error)

func Remove

func Remove[T any](arr []T, index int) ([]T, error)

func SanitizeDateTime

func SanitizeDateTime(val string) (string, error)

func SanitizePath

func SanitizePath(s string) string

Types

type Account

type Account struct {
	Id                    string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                  string            `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Denom                 string            `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty"`
	Decimals              int32             `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"`
	Contact               map[string]string `` /* 156-byte string literal not displayed */
	InvoiceFileNameFormat string            `protobuf:"bytes,100,opt,name=invoiceFileNameFormat,proto3" json:"invoiceFileNameFormat,omitempty"`
	InvoiceCodeFormat     string            `protobuf:"bytes,101,opt,name=invoiceCodeFormat,proto3" json:"invoiceCodeFormat,omitempty"`
	InvoiceDuePeriod      uint32            `protobuf:"varint,102,opt,name=invoiceDuePeriod,proto3" json:"invoiceDuePeriod,omitempty"`
	Locale                *Locale           `protobuf:"bytes,500,opt,name=locale,proto3" json:"locale,omitempty"`
	// contains filtered or unexported fields
}

func (*Account) Descriptor deprecated

func (*Account) Descriptor() ([]byte, []int)

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetContact

func (x *Account) GetContact() map[string]string

func (*Account) GetDecimals

func (x *Account) GetDecimals() int32

func (*Account) GetDenom

func (x *Account) GetDenom() string

func (*Account) GetId

func (x *Account) GetId() string

func (*Account) GetInvoiceCodeFormat

func (x *Account) GetInvoiceCodeFormat() string

func (*Account) GetInvoiceDuePeriod

func (x *Account) GetInvoiceDuePeriod() uint32

func (*Account) GetInvoiceFileNameFormat

func (x *Account) GetInvoiceFileNameFormat() string

func (*Account) GetLocale

func (x *Account) GetLocale() *Locale

func (*Account) GetName

func (x *Account) GetName() string

func (*Account) MakeId

func (a *Account) MakeId(salt string) string

func (*Account) MakeInvoiceCode

func (a *Account) MakeInvoiceCode(inv []*Invoice, totalCount int, now time.Time) string

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

func (x *Account) ProtoReflect() protoreflect.Message

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

type AccountTemplateContext

type AccountTemplateContext struct {
	Config   *Config    `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	Template *Template  `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"`
	Accounts []*Account `protobuf:"bytes,10,rep,name=accounts,proto3" json:"accounts,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountTemplateContext) Descriptor deprecated

func (*AccountTemplateContext) Descriptor() ([]byte, []int)

Deprecated: Use AccountTemplateContext.ProtoReflect.Descriptor instead.

func (*AccountTemplateContext) GetAccounts

func (x *AccountTemplateContext) GetAccounts() []*Account

func (*AccountTemplateContext) GetConfig

func (x *AccountTemplateContext) GetConfig() *Config

func (*AccountTemplateContext) GetTemplate

func (x *AccountTemplateContext) GetTemplate() *Template

func (*AccountTemplateContext) ProtoMessage

func (*AccountTemplateContext) ProtoMessage()

func (*AccountTemplateContext) ProtoReflect

func (x *AccountTemplateContext) ProtoReflect() protoreflect.Message

func (*AccountTemplateContext) Reset

func (x *AccountTemplateContext) Reset()

func (*AccountTemplateContext) String

func (x *AccountTemplateContext) String() string

type Accounts

type Accounts struct {
	Accounts []*Account        `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
	Params   map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Accounts) Descriptor deprecated

func (*Accounts) Descriptor() ([]byte, []int)

Deprecated: Use Accounts.ProtoReflect.Descriptor instead.

func (*Accounts) GetAccounts

func (x *Accounts) GetAccounts() []*Account

func (*Accounts) GetParams

func (x *Accounts) GetParams() map[string]string

func (*Accounts) ProtoMessage

func (*Accounts) ProtoMessage()

func (*Accounts) ProtoReflect

func (x *Accounts) ProtoReflect() protoreflect.Message

func (*Accounts) Reset

func (x *Accounts) Reset()

func (*Accounts) String

func (x *Accounts) String() string

type AccountsArr

type AccountsArr []*Account

func (AccountsArr) ByDenom

func (arr AccountsArr) ByDenom(denom string) *Account

func (AccountsArr) ById

func (arr AccountsArr) ById(id string) *Account

func (AccountsArr) ByName

func (arr AccountsArr) ByName(name string) *Account

type Client

type Client struct {
	Id                    string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                  string            `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Description           string            `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	Notes                 []string          `protobuf:"bytes,4,rep,name=notes,proto3" json:"notes,omitempty"`
	Contact               map[string]string `` /* 155-byte string literal not displayed */
	InvoiceFileNameFormat string            `protobuf:"bytes,100,opt,name=invoiceFileNameFormat,proto3" json:"invoiceFileNameFormat,omitempty"`
	Locale                *Locale           `protobuf:"bytes,500,opt,name=locale,proto3" json:"locale,omitempty"`
	// contains filtered or unexported fields
}

func (*Client) Descriptor deprecated

func (*Client) Descriptor() ([]byte, []int)

Deprecated: Use Client.ProtoReflect.Descriptor instead.

func (*Client) GetContact

func (x *Client) GetContact() map[string]string

func (*Client) GetDescription

func (x *Client) GetDescription() string

func (*Client) GetId

func (x *Client) GetId() string

func (*Client) GetInvoiceFileNameFormat

func (x *Client) GetInvoiceFileNameFormat() string

func (*Client) GetLocale

func (x *Client) GetLocale() *Locale

func (*Client) GetName

func (x *Client) GetName() string

func (*Client) GetNotes

func (x *Client) GetNotes() []string

func (*Client) MakeId

func (a *Client) MakeId(salt string) string

func (*Client) ProtoMessage

func (*Client) ProtoMessage()

func (*Client) ProtoReflect

func (x *Client) ProtoReflect() protoreflect.Message

func (*Client) Reset

func (x *Client) Reset()

func (*Client) String

func (x *Client) String() string

type ClientTemplateContext

type ClientTemplateContext struct {
	Config   *Config   `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	Template *Template `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"`
	Clients  []*Client `protobuf:"bytes,10,rep,name=clients,proto3" json:"clients,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientTemplateContext) Descriptor deprecated

func (*ClientTemplateContext) Descriptor() ([]byte, []int)

Deprecated: Use ClientTemplateContext.ProtoReflect.Descriptor instead.

func (*ClientTemplateContext) GetClients

func (x *ClientTemplateContext) GetClients() []*Client

func (*ClientTemplateContext) GetConfig

func (x *ClientTemplateContext) GetConfig() *Config

func (*ClientTemplateContext) GetTemplate

func (x *ClientTemplateContext) GetTemplate() *Template

func (*ClientTemplateContext) ProtoMessage

func (*ClientTemplateContext) ProtoMessage()

func (*ClientTemplateContext) ProtoReflect

func (x *ClientTemplateContext) ProtoReflect() protoreflect.Message

func (*ClientTemplateContext) Reset

func (x *ClientTemplateContext) Reset()

func (*ClientTemplateContext) String

func (x *ClientTemplateContext) String() string

type Clients

type Clients struct {
	Clients []*Client         `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"`
	Params  map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Clients) Descriptor deprecated

func (*Clients) Descriptor() ([]byte, []int)

Deprecated: Use Clients.ProtoReflect.Descriptor instead.

func (*Clients) GetClients

func (x *Clients) GetClients() []*Client

func (*Clients) GetParams

func (x *Clients) GetParams() map[string]string

func (*Clients) ProtoMessage

func (*Clients) ProtoMessage()

func (*Clients) ProtoReflect

func (x *Clients) ProtoReflect() protoreflect.Message

func (*Clients) Reset

func (x *Clients) Reset()

func (*Clients) String

func (x *Clients) String() string

type ClientsArr

type ClientsArr []*Client

func (ClientsArr) ById

func (arr ClientsArr) ById(id string) *Client

func (ClientsArr) ByName

func (arr ClientsArr) ByName(name string) *Client

type Config

type Config struct {
	Export []*Config_Export  `protobuf:"bytes,10,rep,name=export,proto3" json:"export,omitempty"`
	Params map[string]string `` /* 155-byte string literal not displayed */
	Locale *Locale           `protobuf:"bytes,500,opt,name=locale,proto3" json:"locale,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) Format

func (c *Config) Format(price *Price) string

func (*Config) GetExport

func (x *Config) GetExport() []*Config_Export

func (*Config) GetLocale

func (x *Config) GetLocale() *Locale

func (*Config) GetParams

func (x *Config) GetParams() map[string]string

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

func (*Config) Translate

func (c *Config) Translate(val string) string

type Config_Export

type Config_Export struct {
	What   string          `protobuf:"bytes,1,opt,name=what,proto3" json:"what,omitempty"`
	Styles []*Config_Style `protobuf:"bytes,2,rep,name=styles,proto3" json:"styles,omitempty"`
	// contains filtered or unexported fields
}

func (*Config_Export) Descriptor deprecated

func (*Config_Export) Descriptor() ([]byte, []int)

Deprecated: Use Config_Export.ProtoReflect.Descriptor instead.

func (*Config_Export) GetStyles

func (x *Config_Export) GetStyles() []*Config_Style

func (*Config_Export) GetWhat

func (x *Config_Export) GetWhat() string

func (*Config_Export) ProtoMessage

func (*Config_Export) ProtoMessage()

func (*Config_Export) ProtoReflect

func (x *Config_Export) ProtoReflect() protoreflect.Message

func (*Config_Export) Reset

func (x *Config_Export) Reset()

func (*Config_Export) String

func (x *Config_Export) String() string

type Config_Style

type Config_Style struct {
	What  string `protobuf:"bytes,1,opt,name=what,proto3" json:"what,omitempty"`
	Font  string `protobuf:"bytes,2,opt,name=font,proto3" json:"font,omitempty"`
	Align string `protobuf:"bytes,3,opt,name=align,proto3" json:"align,omitempty"`
	// contains filtered or unexported fields
}

func (*Config_Style) Descriptor deprecated

func (*Config_Style) Descriptor() ([]byte, []int)

Deprecated: Use Config_Style.ProtoReflect.Descriptor instead.

func (*Config_Style) GetAlign

func (x *Config_Style) GetAlign() string

func (*Config_Style) GetFont

func (x *Config_Style) GetFont() string

func (*Config_Style) GetWhat

func (x *Config_Style) GetWhat() string

func (*Config_Style) ProtoMessage

func (*Config_Style) ProtoMessage()

func (*Config_Style) ProtoReflect

func (x *Config_Style) ProtoReflect() protoreflect.Message

func (*Config_Style) Reset

func (x *Config_Style) Reset()

func (*Config_Style) String

func (x *Config_Style) String() string

type Invoice

type Invoice struct {
	FileName    string             `protobuf:"bytes,1,opt,name=fileName,proto3" json:"fileName,omitempty"`   // internal: filename of the invoice file
	Id          string             `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`               // unique id of the invoice
	Code        string             `protobuf:"bytes,4,opt,name=code,proto3" json:"code,omitempty"`           // registration code
	IssueDate   string             `protobuf:"bytes,5,opt,name=issueDate,proto3" json:"issueDate,omitempty"` // date-time when the invoice was issued at
	DueDate     string             `protobuf:"bytes,6,opt,name=dueDate,proto3" json:"dueDate,omitempty"`     // the invoice must be payed until this date
	Params      map[string]string  ``                                                                        /* 154-byte string literal not displayed */
	Project     *Project           `protobuf:"bytes,30,opt,name=project,proto3" json:"project,omitempty"`    // Copy of a project (if any)
	Client      *Client            `protobuf:"bytes,32,opt,name=client,proto3" json:"client,omitempty"`      // Copy of a client
	Account     *Account           `protobuf:"bytes,33,opt,name=account,proto3" json:"account,omitempty"`    // Copy of an account
	Items       []*Invoice_Item    `protobuf:"bytes,50,rep,name=items,proto3" json:"items,omitempty"`        // Billable, discount, shipping, etc items. Also, extra items.
	Total       *Price             `protobuf:"bytes,100,opt,name=total,proto3" json:"total,omitempty"`
	MarketValue *Price             `protobuf:"bytes,101,opt,name=marketValue,proto3" json:"marketValue,omitempty"` // if set, will force recalculation into this denomination
	Payments    []*Invoice_Payment `protobuf:"bytes,200,rep,name=payments,proto3" json:"payments,omitempty"`
	// contains filtered or unexported fields
}

func (*Invoice) Descriptor deprecated

func (*Invoice) Descriptor() ([]byte, []int)

Deprecated: Use Invoice.ProtoReflect.Descriptor instead.

func (*Invoice) GetAccount

func (x *Invoice) GetAccount() *Account

func (*Invoice) GetClient

func (x *Invoice) GetClient() *Client

func (*Invoice) GetCode

func (x *Invoice) GetCode() string

func (*Invoice) GetDueDate

func (x *Invoice) GetDueDate() string

func (*Invoice) GetFileName

func (x *Invoice) GetFileName() string

func (*Invoice) GetId

func (x *Invoice) GetId() string

func (*Invoice) GetIssueDate

func (x *Invoice) GetIssueDate() string

func (*Invoice) GetItems

func (x *Invoice) GetItems() []*Invoice_Item

func (*Invoice) GetMarketValue

func (x *Invoice) GetMarketValue() *Price

func (*Invoice) GetParams

func (x *Invoice) GetParams() map[string]string

func (*Invoice) GetPayments

func (x *Invoice) GetPayments() []*Invoice_Payment

func (*Invoice) GetProject

func (x *Invoice) GetProject() *Project

func (*Invoice) GetTotal

func (x *Invoice) GetTotal() *Price

func (*Invoice) MakeFileName

func (inv *Invoice) MakeFileName() string

func (*Invoice) MakeId

func (inv *Invoice) MakeId() string

func (*Invoice) ProtoMessage

func (*Invoice) ProtoMessage()

func (*Invoice) ProtoReflect

func (x *Invoice) ProtoReflect() protoreflect.Message

func (*Invoice) Reset

func (x *Invoice) Reset()

func (*Invoice) String

func (x *Invoice) String() string

func (*Invoice) Year

func (inv *Invoice) Year() int

type InvoiceTemplateContext

type InvoiceTemplateContext struct {
	Config   *Config    `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	Template *Template  `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"`
	Account  *Account   `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"`
	Invoices []*Invoice `protobuf:"bytes,10,rep,name=invoices,proto3" json:"invoices,omitempty"`
	// contains filtered or unexported fields
}

func (*InvoiceTemplateContext) Descriptor deprecated

func (*InvoiceTemplateContext) Descriptor() ([]byte, []int)

Deprecated: Use InvoiceTemplateContext.ProtoReflect.Descriptor instead.

func (*InvoiceTemplateContext) GetAccount

func (x *InvoiceTemplateContext) GetAccount() *Account

func (*InvoiceTemplateContext) GetConfig

func (x *InvoiceTemplateContext) GetConfig() *Config

func (*InvoiceTemplateContext) GetInvoices

func (x *InvoiceTemplateContext) GetInvoices() []*Invoice

func (*InvoiceTemplateContext) GetTemplate

func (x *InvoiceTemplateContext) GetTemplate() *Template

func (*InvoiceTemplateContext) ProtoMessage

func (*InvoiceTemplateContext) ProtoMessage()

func (*InvoiceTemplateContext) ProtoReflect

func (x *InvoiceTemplateContext) ProtoReflect() protoreflect.Message

func (*InvoiceTemplateContext) Reset

func (x *InvoiceTemplateContext) Reset()

func (*InvoiceTemplateContext) SelectedAccount

func (ic *InvoiceTemplateContext) SelectedAccount(inv *Invoice) *Account

func (*InvoiceTemplateContext) String

func (x *InvoiceTemplateContext) String() string

type Invoice_Item

type Invoice_Item struct {
	Name   string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Unit   string  `protobuf:"bytes,2,opt,name=unit,proto3" json:"unit,omitempty"`
	Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"`
	Rate   float32 `protobuf:"fixed32,4,opt,name=rate,proto3" json:"rate,omitempty"`
	Extra  bool    `protobuf:"varint,10,opt,name=extra,proto3" json:"extra,omitempty"` // indicates whether this is an extra (applied after total)
	// contains filtered or unexported fields
}

func (*Invoice_Item) AdjustedRate

func (it *Invoice_Item) AdjustedRate() float32

func (*Invoice_Item) Descriptor deprecated

func (*Invoice_Item) Descriptor() ([]byte, []int)

Deprecated: Use Invoice_Item.ProtoReflect.Descriptor instead.

func (*Invoice_Item) GetAmount

func (x *Invoice_Item) GetAmount() float32

func (*Invoice_Item) GetExtra

func (x *Invoice_Item) GetExtra() bool

func (*Invoice_Item) GetName

func (x *Invoice_Item) GetName() string

func (*Invoice_Item) GetRate

func (x *Invoice_Item) GetRate() float32

func (*Invoice_Item) GetUnit

func (x *Invoice_Item) GetUnit() string

func (*Invoice_Item) Price

func (it *Invoice_Item) Price(denom string) *Price

func (*Invoice_Item) ProtoMessage

func (*Invoice_Item) ProtoMessage()

func (*Invoice_Item) ProtoReflect

func (x *Invoice_Item) ProtoReflect() protoreflect.Message

func (*Invoice_Item) Reset

func (x *Invoice_Item) Reset()

func (*Invoice_Item) String

func (x *Invoice_Item) String() string

type Invoice_Payment

type Invoice_Payment struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Date    string `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"`
	Comment string `protobuf:"bytes,3,opt,name=comment,proto3" json:"comment,omitempty"`
	Amount  *Price `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*Invoice_Payment) Descriptor deprecated

func (*Invoice_Payment) Descriptor() ([]byte, []int)

Deprecated: Use Invoice_Payment.ProtoReflect.Descriptor instead.

func (*Invoice_Payment) GetAmount

func (x *Invoice_Payment) GetAmount() *Price

func (*Invoice_Payment) GetComment

func (x *Invoice_Payment) GetComment() string

func (*Invoice_Payment) GetDate

func (x *Invoice_Payment) GetDate() string

func (*Invoice_Payment) GetName

func (x *Invoice_Payment) GetName() string

func (*Invoice_Payment) ProtoMessage

func (*Invoice_Payment) ProtoMessage()

func (*Invoice_Payment) ProtoReflect

func (x *Invoice_Payment) ProtoReflect() protoreflect.Message

func (*Invoice_Payment) Reset

func (x *Invoice_Payment) Reset()

func (*Invoice_Payment) String

func (x *Invoice_Payment) String() string

type Invoices

type Invoices []*Invoice

func (Invoices) ByCode

func (arr Invoices) ByCode(code string) *Invoice

func (Invoices) ById

func (arr Invoices) ById(id string) *Invoice

func (Invoices) ByYear

func (arr Invoices) ByYear(year int) *Invoice

type Locale

type Locale struct {
	Translations map[string]string `` /* 165-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Locale) Descriptor deprecated

func (*Locale) Descriptor() ([]byte, []int)

Deprecated: Use Locale.ProtoReflect.Descriptor instead.

func (*Locale) Format

func (c *Locale) Format(price *Price) string

func (*Locale) GetTranslations

func (x *Locale) GetTranslations() map[string]string

func (*Locale) ProtoMessage

func (*Locale) ProtoMessage()

func (*Locale) ProtoReflect

func (x *Locale) ProtoReflect() protoreflect.Message

func (*Locale) Reset

func (x *Locale) Reset()

func (*Locale) String

func (x *Locale) String() string

func (*Locale) Translate

func (c *Locale) Translate(val string) string

type Price

type Price struct {
	Denom    string  `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	Amount   float32 `protobuf:"fixed32,2,opt,name=amount,proto3" json:"amount,omitempty"`
	Decimals uint32  `protobuf:"varint,3,opt,name=decimals,proto3" json:"decimals,omitempty"`
	// contains filtered or unexported fields
}

func (*Price) Add

func (p *Price) Add(b *Price) *Price

func (*Price) Convert

func (p *Price) Convert(b *Price) *Price

Convert converts one denomination to another given that the second is represented in the first denomination. E.g. first price is 10Eth while the second is 4000Eur (per Eth) Therefore 10Eth.Convert(4000Eur) will be equal to 40000Eur

func (*Price) Descriptor deprecated

func (*Price) Descriptor() ([]byte, []int)

Deprecated: Use Price.ProtoReflect.Descriptor instead.

func (*Price) GetAmount

func (x *Price) GetAmount() float32

func (*Price) GetDecimals

func (x *Price) GetDecimals() uint32

func (*Price) GetDenom

func (x *Price) GetDenom() string

func (*Price) Mul

func (p *Price) Mul(rate float32) *Price

func (*Price) Pretty

func (p *Price) Pretty() string

func (*Price) ProtoMessage

func (*Price) ProtoMessage()

func (*Price) ProtoReflect

func (x *Price) ProtoReflect() protoreflect.Message

func (*Price) Reset

func (x *Price) Reset()

func (*Price) String

func (x *Price) String() string

func (*Price) Sub

func (p *Price) Sub(b *Price) *Price

func (*Price) Words

func (p *Price) Words() string

type Project

type Project struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name        string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	FileName    string `protobuf:"bytes,4,opt,name=fileName,proto3" json:"fileName,omitempty"`
	// Types that are assignable to Rate:
	//	*Project_Hourly
	//	*Project_Total
	Rate      isProject_Rate      `protobuf_oneof:"rate"`
	Completed bool                `protobuf:"varint,7,opt,name=completed,proto3" json:"completed,omitempty"`
	Params    map[string]string   `` /* 154-byte string literal not displayed */
	StartDate string              `protobuf:"bytes,20,opt,name=startDate,proto3" json:"startDate,omitempty"`
	EndDate   string              `protobuf:"bytes,21,opt,name=endDate,proto3" json:"endDate,omitempty"`
	Account   *Account            `protobuf:"bytes,31,opt,name=account,proto3" json:"account,omitempty"`
	Client    *Client             `protobuf:"bytes,30,opt,name=client,proto3" json:"client,omitempty"`
	Log       []*Project_LogEntry `protobuf:"bytes,50,rep,name=log,proto3" json:"log,omitempty"`
	// contains filtered or unexported fields
}

func (*Project) Denom

func (p *Project) Denom() string

func (*Project) Descriptor deprecated

func (*Project) Descriptor() ([]byte, []int)

Deprecated: Use Project.ProtoReflect.Descriptor instead.

func (*Project) GetAccount

func (x *Project) GetAccount() *Account

func (*Project) GetClient

func (x *Project) GetClient() *Client

func (*Project) GetCompleted

func (x *Project) GetCompleted() bool

func (*Project) GetDescription

func (x *Project) GetDescription() string

func (*Project) GetEndDate

func (x *Project) GetEndDate() string

func (*Project) GetFileName

func (x *Project) GetFileName() string

func (*Project) GetHourly

func (x *Project) GetHourly() float32

func (*Project) GetId

func (x *Project) GetId() string

func (*Project) GetLog

func (x *Project) GetLog() []*Project_LogEntry

func (*Project) GetName

func (x *Project) GetName() string

func (*Project) GetParams

func (x *Project) GetParams() map[string]string

func (*Project) GetRate

func (m *Project) GetRate() isProject_Rate

func (*Project) GetStartDate

func (x *Project) GetStartDate() string

func (*Project) GetTotal

func (x *Project) GetTotal() float32

func (*Project) MakeId

func (a *Project) MakeId() string

func (*Project) ProtoMessage

func (*Project) ProtoMessage()

func (*Project) ProtoReflect

func (x *Project) ProtoReflect() protoreflect.Message

func (*Project) RateString

func (p *Project) RateString() string

func (*Project) Reset

func (x *Project) Reset()

func (*Project) SetRate

func (p *Project) SetRate(amount float32, hourly bool)

func (*Project) String

func (x *Project) String() string

func (*Project) TotalDuration

func (p *Project) TotalDuration() time.Duration

func (*Project) TotalPrice

func (p *Project) TotalPrice() *Price

func (*Project) TotalProgress

func (p *Project) TotalProgress() float32

type ProjectTemplateContext

type ProjectTemplateContext struct {
	Config   *Config    `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	Template *Template  `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"`
	Projects []*Project `protobuf:"bytes,10,rep,name=projects,proto3" json:"projects,omitempty"`
	// contains filtered or unexported fields
}

func (*ProjectTemplateContext) Descriptor deprecated

func (*ProjectTemplateContext) Descriptor() ([]byte, []int)

Deprecated: Use ProjectTemplateContext.ProtoReflect.Descriptor instead.

func (*ProjectTemplateContext) GetConfig

func (x *ProjectTemplateContext) GetConfig() *Config

func (*ProjectTemplateContext) GetProjects

func (x *ProjectTemplateContext) GetProjects() []*Project

func (*ProjectTemplateContext) GetTemplate

func (x *ProjectTemplateContext) GetTemplate() *Template

func (*ProjectTemplateContext) ProtoMessage

func (*ProjectTemplateContext) ProtoMessage()

func (*ProjectTemplateContext) ProtoReflect

func (x *ProjectTemplateContext) ProtoReflect() protoreflect.Message

func (*ProjectTemplateContext) Reset

func (x *ProjectTemplateContext) Reset()

func (*ProjectTemplateContext) String

func (x *ProjectTemplateContext) String() string

type Project_Hourly

type Project_Hourly struct {
	Hourly float32 `protobuf:"fixed32,5,opt,name=hourly,proto3,oneof"`
}

type Project_LogEntry

type Project_LogEntry struct {
	Description string  `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	Start       string  `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"`
	Duration    int64   `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"`
	Progress    float32 `protobuf:"fixed32,4,opt,name=progress,proto3" json:"progress,omitempty"`
	// contains filtered or unexported fields
}

func (*Project_LogEntry) Descriptor deprecated

func (*Project_LogEntry) Descriptor() ([]byte, []int)

Deprecated: Use Project_LogEntry.ProtoReflect.Descriptor instead.

func (*Project_LogEntry) GetDescription

func (x *Project_LogEntry) GetDescription() string

func (*Project_LogEntry) GetDuration

func (x *Project_LogEntry) GetDuration() int64

func (*Project_LogEntry) GetProgress

func (x *Project_LogEntry) GetProgress() float32

func (*Project_LogEntry) GetStart

func (x *Project_LogEntry) GetStart() string

func (*Project_LogEntry) Price

func (pl *Project_LogEntry) Price(p *Project) *Price

func (*Project_LogEntry) ProtoMessage

func (*Project_LogEntry) ProtoMessage()

func (*Project_LogEntry) ProtoReflect

func (x *Project_LogEntry) ProtoReflect() protoreflect.Message

func (*Project_LogEntry) Reset

func (x *Project_LogEntry) Reset()

func (*Project_LogEntry) String

func (x *Project_LogEntry) String() string

type Project_Total

type Project_Total struct {
	Total float32 `protobuf:"fixed32,6,opt,name=total,proto3,oneof"`
}

type ProjectsArr

type ProjectsArr []*Project

func (ProjectsArr) ById

func (arr ProjectsArr) ById(id string) *Project

func (ProjectsArr) ByName

func (arr ProjectsArr) ByName(name string) *Project

type Template

type Template struct {
	Id       string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	What     string            `protobuf:"bytes,2,opt,name=what,proto3" json:"what,omitempty"`
	FileName string            `protobuf:"bytes,3,opt,name=fileName,proto3" json:"fileName,omitempty"`
	Params   map[string]string `` /* 153-byte string literal not displayed */
	Text     []byte            `protobuf:"bytes,10,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*Template) Descriptor deprecated

func (*Template) Descriptor() ([]byte, []int)

Deprecated: Use Template.ProtoReflect.Descriptor instead.

func (*Template) GetFileName

func (x *Template) GetFileName() string

func (*Template) GetId

func (x *Template) GetId() string

func (*Template) GetParams

func (x *Template) GetParams() map[string]string

func (*Template) GetText

func (x *Template) GetText() []byte

func (*Template) GetWhat

func (x *Template) GetWhat() string

func (*Template) MakeId

func (a *Template) MakeId() string

func (*Template) ProtoMessage

func (*Template) ProtoMessage()

func (*Template) ProtoReflect

func (x *Template) ProtoReflect() protoreflect.Message

func (*Template) Reset

func (x *Template) Reset()

func (*Template) String

func (x *Template) String() string

Jump to

Keyboard shortcuts

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