models

package
v0.0.0-...-62f0cde Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package models defines default model layer for each database structures This is also known as domain layer in Uncle Bob's Clean Architecture

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	ID             int          `json:"id" db:"id"`
	Name           string       `json:"name" db:"name"`
	IsProduct      sql.NullBool `json:"isproduct" db:"isproduct"`
	IsMaterial     sql.NullBool `json:"ismaterial" db:"ismaterial"`
	IsSewingTrims  sql.NullBool `json:"issewingtrims" db:"issewingtrims"`
	IsPackingTrims sql.NullBool `json:"ispackingtrims" db:"ispackingtrims"`
}

Attributes ...

type AttributesRepository

type AttributesRepository interface {
	FetchAll(ctx context.Context) (attr []Attributes, err error)
}

AttributesRepository represents attribute's repository level

type AttributesServices

type AttributesServices interface {
	FetchAll(ctx context.Context) ([]Attributes, error)
}

AttributesServices represents attribute's Services level

type Products

type Products struct {
	ID                 int            `json:"product_id" db:"product_id"`
	ProductName        string         `json:"product_name" db:"product_name"`
	AttributeValueID   int            `json:"attribute_value_id" db:"attribute_value_id"`
	AttributeValueName sql.NullString `json:"attribute_value_name" db:"attribute_value_name"`
	AttributeID        int            `json:"attribute_id" db:"attribute_id"`
	AttributeName      string         `json:"attribute_name" db:"attribute_name"`
	CreatedAt          time.Time      `json:"-" db:"created_at"`
	UpdatedAt          time.Time      `json:"-" db:"updated_at"`
}

Products ...

type ProductsRepository

type ProductsRepository interface {
	FetchAll(ctx context.Context) (res []Products, err error)
	GetByID(ctx context.Context, id int) (res []Products, err error)
}

ProductsRepository represents attribute's repository level

type ProductsServices

type ProductsServices interface {
	FetchAll(ctx context.Context) (res []Products, err error)
	GetByID(ctx context.Context, id int) (res []Products, err error)
}

ProductsServices represents attribute's Services level

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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