db

package
v0.0.0-...-19239a5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: EUPL-1.2 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSubstitutes

func NewSubstitutes(ownerId int, substituteIds []int) *[]entity.Substitute

Types

type AmountOptions

type AmountOptions struct {
	From     *float64
	To       *float64
	Currency string
}

type Connector

type Connector struct {
	*dbutil.Connector
}

func NewConnector

func NewConnector(dbConfig dbutil.Configuration) *Connector

func (*Connector) AddUserSubstitutes

func (c *Connector) AddUserSubstitutes(ctx goContext.Context, ownerId int, substituteIds []int) ([]int, error)

func (*Connector) CreateInvoice

func (c *Connector) CreateInvoice(ctx goContext.Context, invoice *entity.Invoice) error

func (*Connector) DeleteOldTestInvoices

func (c *Connector) DeleteOldTestInvoices(ctx goContext.Context, expiration time.Duration) ([]string, error)

func (*Connector) GetAndUpdateNotNotifiedInvoices

func (c *Connector) GetAndUpdateNotNotifiedInvoices(ctx goContext.Context, limit int) ([]entity.Invoice, error)

func (*Connector) GetInvoice

func (c *Connector) GetInvoice(ctx goContext.Context, id string) (*entity.Invoice, error)

func (*Connector) GetOrCreateUser

func (c *Connector) GetOrCreateUser(ctx goContext.Context, upvsUri, name string) (*entity.User, error)

func (*Connector) GetPublicInvoices

func (c *Connector) GetPublicInvoices(ctx goContext.Context, options *PublicInvoicesOptions) ([]entity.Invoice, error)

func (*Connector) GetUser

func (c *Connector) GetUser(ctx goContext.Context, id int) (*entity.User, error)

func (*Connector) GetUserInvoices

func (c *Connector) GetUserInvoices(ctx goContext.Context, options *UserInvoicesOptions) ([]entity.Invoice, error)

func (*Connector) GetUserOrganizationIds

func (c *Connector) GetUserOrganizationIds(ctx goContext.Context, userId int) ([]string, error)

func (*Connector) GetUserSubstitutes

func (c *Connector) GetUserSubstitutes(ctx goContext.Context, ownerId int) ([]int, error)

func (*Connector) GetUserUris

func (c *Connector) GetUserUris(ctx goContext.Context, icos []string) ([]string, error)

func (*Connector) IsValidSubstitute

func (c *Connector) IsValidSubstitute(ctx goContext.Context, userId int, ico string) error

func (*Connector) RemoveUserSubstitutes

func (c *Connector) RemoveUserSubstitutes(ctx goContext.Context, ownerId int, substituteIds []int) ([]int, error)

func (*Connector) UpdateNotificationStatus

func (c *Connector) UpdateNotificationStatus(ctx goContext.Context, invoiceIds []string, status string) error

func (*Connector) UpdateUser

func (c *Connector) UpdateUser(ctx goContext.Context, updatedData *entity.User) (*entity.User, error)

func (*Connector) UpdateVisualizationCreatedStatus

func (c *Connector) UpdateVisualizationCreatedStatus(ctx goContext.Context, invoiceId string, status bool) error

type DateOptions

type DateOptions struct {
	From *timeutil.Date
	To   *timeutil.Date
}

type PublicInvoicesOptions

type PublicInvoicesOptions struct {
	Formats          []string
	StartId          string
	Limit            int
	Test             bool
	Order            string
	Amount           AmountOptions
	AmountWithoutVat AmountOptions
	IssueDate        DateOptions
	CreatedAt        TimeOptions
	CustomerName     string
	SupplierName     string
	CustomerIco      string
	SupplierIco      string
}

func (*PublicInvoicesOptions) Validate

func (o *PublicInvoicesOptions) Validate(maxLimit int) error

type TimeOptions

type TimeOptions struct {
	From *time.Time
	To   *time.Time
}

type UserInvoicesOptions

type UserInvoicesOptions struct {
	UserId int
	*PublicInvoicesOptions
}

Jump to

Keyboard shortcuts

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