domain

package
v0.0.0-...-73ddacf Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Company

type Company struct {
	*CompanyData
	// contains filtered or unexported fields
}

func NewCompany

func NewCompany(data *CompanyData, repo *repo.RepoCompany) (*Company, error)

func NewCompanyEmpty

func NewCompanyEmpty(repo *repo.RepoCompany) (*Company, error)

func (*Company) RepoDeleteCompany

func (c *Company) RepoDeleteCompany(id uint) error

func (*Company) RepoGetCompanies

func (c *Company) RepoGetCompanies() ([]CompanyData, error)

func (*Company) RepoGetCompanyByID

func (c *Company) RepoGetCompanyByID(id uint) (*CompanyData, error)

func (*Company) RepoNewCompany

func (c *Company) RepoNewCompany() (int, error)

func (*Company) RepoUpdateCompany

func (c *Company) RepoUpdateCompany() error

RepoUpdateCompany should update the entity.

type CompanyData

type CompanyData struct {
	gorm.Model

	Code    string `json:"code"`
	Name    string `json:"name"`
	Country string `json:"country"`
	Website string `json:"website"`
	Phone   string `json:"phone"` // for supporting +40 type
}

func NewCompanyData

func NewCompanyData(code, name, country, website, phone string) (*CompanyData, error)

func (CompanyData) IsValid

func (c CompanyData) IsValid() error

Jump to

Keyboard shortcuts

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