billing

package
v0.0.0-...-8bae9e1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundUser     = errors.New("user not found")
	ErrNotFoundCustomer = errors.New("customer not found")
	ErrNotFoundInvoice  = errors.New("invoice not found")
	ErrNotFoundTemplate = errors.New("template not found")

	ErrAlreadyExistsUser     = errors.New("user already exists")
	ErrAlreadyExistsCustomer = errors.New("customer already exists")
	ErrAlreadyExistsTemplate = errors.New("template already exists")

	ErrInvalidCustomerCanonical = errors.New("invalid customer canonical")
	ErrInvalidTemplateCanonical = errors.New("invalid template canonical")
	ErrInvalidInvoiceNumber     = errors.New("invalid invoice number")
)

Functions

This section is empty.

Types

type Billing

type Billing interface {
	// User logic
	CreateUser(ctx context.Context, u *user.User) error
	GetUser(ctx context.Context) (*user.User, error)
	UpdateUser(ctx context.Context, u *user.User) error

	// Customer logic
	CreateCustomer(ctx context.Context, c *customer.Customer) error
	GetCustomers(ctx context.Context) ([]*customer.Customer, error)
	GetCustomer(ctx context.Context, canonical string) (*customer.Customer, error)
	UpdateCustomer(ctx context.Context, canonical string, c *customer.Customer) error
	DeleteCustomer(ctx context.Context, canonical string) error

	// Invoice logic
	CreateInvoice(ctx context.Context, c *invoice.Invoice, cusCan string) error
	GetInvoices(ctx context.Context) ([]*invoice.Invoice, error)
	GetInvoice(ctx context.Context, number string) (*invoice.Invoice, error)
	UpdateInvoice(ctx context.Context, number string, c *invoice.Invoice, cusCan string) error
	DeleteInvoice(ctx context.Context, number string) error
	ViewInvoice(ctx context.Context, invoiceNumber, templateCan string) ([]byte, error)

	// Template logic
	CreateTemplate(ctx context.Context, t *template.Template) error
	GetTemplate(ctx context.Context, can string) (*template.Template, error)
	GetTemplates(ctx context.Context) ([]*template.Template, error)
	UpdateTemplate(ctx context.Context, can string, t *template.Template) error
	DeleteTemplate(ctx context.Context, can string) error
}

Jump to

Keyboard shortcuts

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