ports

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminService

type AdminService interface {
	Backup() (string, error)
	CreateDirectories() (string, error)
}

type BillingService added in v0.20.0

type BillingService interface {
	InsertConsumptions(id int, consumptions map[string]float64, note string) (string, error)
	BillConsumptions() (string, error)
	RectifyConsumptions(id int, consumptions map[string]float64, note string) (string, error)
}

type CommandManager added in v1.2.0

type CommandManager interface {
	AddCommand(interface{})
	Execute() []string
}

type ConfigService

type ConfigService interface {
	Init()
	GetString(key string) string
	SetString(key string, value string) error
	GetTime(key string) time.Time
	SetTime(key string, value time.Time) error
	GetCurrentYearMonth() model.YearMonth
	SetCurrentYearMonth(yearMonth model.YearMonth) error
	GetConfigDirectory() string
	GetHomeDirectory() string
	GetWorkingDirectory() string
	GetInvoicesDirectory() string
	GetReportsDirectory() string
	GetCustomersCardsDirectory() string
	GetBackupDirectory() string
}

type CreateService added in v0.20.0

type CreateService interface {
	CreateCustomer(customer model.TransientCustomer) (string, error)
	CreateProduct(product model.Product) (string, error)
}

type DbService

type DbService interface {
	FindActiveChildConsumptions(id int) ([]model.Consumption, error)
	FindActiveChildren() ([]model.Child, error)
	FindActiveCustomers() ([]model.Customer, error)
	FindAllActiveConsumptions() ([]model.Consumption, error)
	FindAllProducts() ([]model.Product, error)
	FindAllSequences() ([]model.Sequence, error)
	FindChangedCustomers(changedSince time.Time) ([]model.Customer, error)
	FindChild(id int) (model.Child, error)
	FindCustomer(id int) (model.Customer, error)
	FindInvoice(id string) (model.Invoice, error)
	FindInvoicesByCustomer(customerId int) ([]model.Invoice, error)
	FindInvoicesByCustomerAndYearMonth(customerId int, yearMonth model.YearMonth) ([]model.Invoice, error)
	FindInvoicesByYearMonth(yearMonth model.YearMonth) ([]model.Invoice, error)
	FindInvoicesByYearMonthAndPaymentTypeAndSentToBank(yearMonth model.YearMonth, paymentType payment_type.PaymentType, sentToBank bool) ([]model.Invoice, error)
	FindProduct(id string) (model.Product, error)
	FindSequence(sequenceType sequence_type.SequenceType) (model.Sequence, error)
	InsertConsumptions(consumptions []model.Consumption) error
	InsertCustomer(customer model.Customer) error
	InsertInvoices(invoices []model.Invoice) error
	InsertProduct(product model.Product) error
	UpdateConsumptions(consumptions []model.Consumption) error
	UpdateSequences(sequences []model.Sequence) error
	UpdateSequence(sequences model.Sequence) error
	UpdateInvoices(invoices []model.Invoice) error
}

type DisplayService

type DisplayService interface {
	DisplayCustomer(id int) (string, error)
	DisplayInvoice(id string) (string, error)
	DisplayProduct(id string) (string, error)
}

type EditService

type EditService interface {
	EditCustomer(id int) (string, error)
	EditInvoice(id string) (string, error)
	EditProduct(id string) (string, error)
}

type Entity

type Entity uint
const (
	Customer Entity = iota
	Invoice
	Product
)

type ExternalEditor

type ExternalEditor interface {
	Edit(entity Entity, id string) (string, error)
}

type GenerateService

type GenerateService interface {
	CustomerReport() (string, error)
	MonthReport(yearMonth model.YearMonth) (string, error)
	ProductReport() (string, error)
	SingleInvoice(id string) (string, error)
	MonthInvoices(yearMonth model.YearMonth) (string, error)
	BddFile() (string, error)
	CustomersCards() (string, error)
}

type ListService

type ListService interface {
	ListCustomerInvoices(customerId int) (string, error)
	ListCustomerYearMonthInvoices(customerId int, yearMonth model.YearMonth) (string, error)
	ListProducts() (string, error)
	ListYearMonthInvoices(yearMonth model.YearMonth) (string, error)
	ListCustomers() (string, error)
	ListChildren() (string, error)
	ListMails() (string, error)
	ListMailsByLanguage() (string, error)
	ListGroupMails(groupType group_type.GroupType) (string, error)
	ListConsumptions() (string, error)
	ListChildConsumptions(childId int) (string, error)
}

type OsService

type OsService interface {
	OpenUrlInBrowser(url string) error
	RunCommand(command string, args ...string) error
	CreateDirectory(dirPath string) error
	CopyFile(sourceFilePath string, destinationFilePath string) error
	ItemExists(itemPath string) (exists bool, err error)
	GetTempDirectory() (dirPath string, err error)
	CreateZipFile(zipFilePath string, files []string) error
	Now() time.Time
	ListFiles(dir string, ext string) (filenames []string, err error)
	ReadFile(filePath string) (content []byte, err error)
	WriteFile(dirPath string, filename string, content []byte) (filePath string, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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