Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type CategoryRepository ¶
type CategoryRepository struct { data.Repository[domain.Category, uint] }
func NewCategoryRepository ¶
func NewCategoryRepository(repository data.Repository[domain.Category, uint]) *CategoryRepository
type CompanyRepository ¶
type CompanyRepository struct { data.Repository[domain.Company, uint] }
func NewCompanyRepository ¶
func NewCompanyRepository(repository data.Repository[domain.Company, uint]) *CompanyRepository
type CreditCard ¶
func (CreditCard) From ¶
func (c CreditCard) From(m domain.CreditCard) any
func (CreditCard) To ¶
func (c CreditCard) To() domain.CreditCard
type Department ¶
type Department struct { data.LazyLoader `gorm:"-"` ID uint `gorm:"primaryKey;column:id"` Name string `gorm:"column:name"` CompanyID uint Company Company `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` UpperID *uint Upper *Department `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` ManagerID uint Manager Employee `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` }
func (Department) From ¶
func (d Department) From(m domain.Department) any
func (Department) To ¶
func (d Department) To() domain.Department
type DepartmentRepository ¶
type DepartmentRepository struct { data.Repository[domain.Department, uint] // contains filtered or unexported fields }
func NewDepartmentRepository ¶
func NewDepartmentRepository(repository data.Repository[domain.Department, uint], findByUpperRepository data.FindByRepository[domain.Department, domain.Department]) *DepartmentRepository
func (*DepartmentRepository) FindByUpper ¶
func (e *DepartmentRepository) FindByUpper(ctx context.Context, upper domain.Department) ([]domain.Department, error)
type Employee ¶
type Employee struct { data.LazyLoader `gorm:"-"` ID uint `gorm:"primaryKey;column:id"` Name string `gorm:"column:name"` CompanyID uint Company Company `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` Manages []Product `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` CreditCard CreditCard `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" fetch:"eager"` Departments []Department `gorm:"many2many:employee_departments;" fetch:"lazy"` Languages []Language `gorm:"many2many:employee_languages;" fetch:"lazy"` }
type EmployeeRepository ¶
type EmployeeRepository struct { data.Repository[domain.Employee, uint] // contains filtered or unexported fields }
func NewEmployeeRepository ¶
func NewEmployeeRepository( repository data.Repository[domain.Employee, uint], findByCompanyRepository data.FindByRepository[domain.Employee, domain.Company], findByDepartmentRepository data.FindByRepository[domain.Employee, domain.Department], ) *EmployeeRepository
func (*EmployeeRepository) FindByCompany ¶
func (*EmployeeRepository) FindByDepartment ¶
func (e *EmployeeRepository) FindByDepartment(ctx context.Context, department domain.Department) ([]domain.Employee, error)
type LanguageRepository ¶
type LanguageRepository struct { data.Repository[Language, string] }
func NewLanguageRepository ¶
func NewLanguageRepository(repository data.Repository[Language, string]) *LanguageRepository
type Product ¶
type Product struct { data.LazyLoader `gorm:"-"` ID uint `gorm:"primaryKey;column:id"` Name string `gorm:"column:name"` CompanyID uint Company Company `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` CategoryID uint Category Category `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` EmployeeID uint }
type ProductRepository ¶
type ProductRepository struct { data.Repository[domain.Product, uint] // contains filtered or unexported fields }
func NewProductRepository ¶
func NewProductRepository( repository data.Repository[domain.Product, uint], companyBelongToRepository data.FindByRepository[domain.Product, domain.Company], categoryBelongToRepository data.FindByRepository[domain.Product, domain.Category], ) *ProductRepository
func (*ProductRepository) FindByCategory ¶
func (*ProductRepository) FindByCompany ¶
Click to show internal directories.
Click to hide internal directories.