service

package
v0.0.0-...-1951ad6 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() fx.Option

func SumTotalForInvoice

func SumTotalForInvoice(Items []dto.InvoiceItemDTO, field string) float64

Types

type Category

type Category struct {
	// contains filtered or unexported fields
}

func NewCategory

func NewCategory(repo *repo.Category) *Category

func (*Category) AddCategory

func (s *Category) AddCategory(ctx context.Context, categoryDTO *dto.CategoryDTO) (*model.Category, error)

func (*Category) DeleteCategory

func (s *Category) DeleteCategory(ctx context.Context, categoryID int) error

func (*Category) GetCategories

func (s *Category) GetCategories(ctx context.Context) ([]model.Category, error)

func (*Category) UpdateCategory

func (s *Category) UpdateCategory(ctx context.Context, categoryID int, categoryDTO *dto.CategoryDTO) (*model.Category, error)

type Client

type Client struct {
	Repo *repo.Client
}

func NewClient

func NewClient(Repo *repo.Client) *Client

func (*Client) AddClient

func (s *Client) AddClient(ctx context.Context, clientDTO *dto.CreateClientDTO) (*model.Client, error)

func (*Client) DeleteClient

func (s *Client) DeleteClient(ctx context.Context, clientID int) error

func (*Client) GetClients

func (s *Client) GetClients(ctx context.Context) ([]model.Client, error)

func (*Client) UpdateClient

func (s *Client) UpdateClient(ctx context.Context, clientID int, clientDTO *dto.UpdateClientDTO) (*model.Client, error)

type Inventory

type Inventory struct {
	// contains filtered or unexported fields
}

func NewInventory

func NewInventory(repo *repo.Inventory) *Inventory

func (*Inventory) AddInventory

func (s *Inventory) AddInventory(ctx context.Context, inventoryDTO *dto.InventoryDTO) (*model.Inventory, error)

func (*Inventory) DeleteInventory

func (s *Inventory) DeleteInventory(ctx context.Context, inventoryID int) error

func (*Inventory) GetInventories

func (s *Inventory) GetInventories(ctx context.Context) ([]model.Inventory, error)

func (*Inventory) UpdateInventory

func (s *Inventory) UpdateInventory(ctx context.Context, inventoryID int, inventoryDTO *dto.InventoryDTO) (*model.Inventory, error)

type Invoice

type Invoice struct {
	Repo          *repo.Invoice
	InventoryRepo *repo.Inventory
	ProductRepo   *repo.Product
}

func NewInvoice

func NewInvoice(Repo *repo.Invoice, InventoryRepo *repo.Inventory, ProductRepo *repo.Product) *Invoice

func (*Invoice) AddInvoice

func (s *Invoice) AddInvoice(ctx context.Context, invoiceDTO *dto.InvoiceDTO) (*model.Invoice, error)

func (*Invoice) GetInvoices

func (s *Invoice) GetInvoices(ctx context.Context) ([]model.Invoice, error)

type Product

type Product struct {
	Repo *repo.Product
}

func NewProduct

func NewProduct(Repo *repo.Product) *Product

func (*Product) AddProduct

func (s *Product) AddProduct(ctx context.Context, productDTO *dto.ProductDTO) (*model.Product, error)

func (*Product) DeleteProduct

func (s *Product) DeleteProduct(ctx context.Context, productID int) error

func (*Product) GetProducts

func (s *Product) GetProducts(ctx context.Context) ([]model.Product, error)

func (*Product) ShowProduct

func (s *Product) ShowProduct(ctx context.Context, productID int) (*model.Product, error)

func (*Product) UpdateProduct

func (s *Product) UpdateProduct(ctx context.Context, productID int, productDTO *dto.ProductDTO) (*model.Product, error)

type User

type User struct {
	Repo *repo.User
}

func NewUser

func NewUser(Repo *repo.User) *User

func (*User) AddUser

func (s *User) AddUser(ctx context.Context, userDTO *dto.CreateUserDTO) (*model.User, error)

func (*User) DeleteUser

func (s *User) DeleteUser(ctx context.Context, userID int) error

func (*User) GetUsers

func (s *User) GetUsers(ctx context.Context) ([]model.User, error)

func (*User) UpdateUser

func (s *User) UpdateUser(ctx context.Context, userID int, userDTO *dto.UpdateUserDTO) (*model.User, error)

Jump to

Keyboard shortcuts

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