datastore

package
v0.0.0-...-ee53a0f Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusActive   = 1
	StatusArchived = 2
)
View Source
const (
	OrderAscending  = 1
	OrderDescending = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NorthAmericanIndustryClassificationSystem

type NorthAmericanIndustryClassificationSystem struct {
	ID                          primitive.ObjectID                                  `bson:"_id" json:"id"`
	TenantID                    primitive.ObjectID                                  `bson:"tenant_id" json:"tenant_id,omitempty"`
	Status                      int8                                                `bson:"status" json:"status"`
	PublicID                    uint64                                              `bson:"public_id" json:"public_id"`
	LanguageCode                string                                              `bson:"language_code" json:"language_code"` // Please use `ISO 639-1` (https://en.wikipedia.org/wiki/ISO_639-1).
	Version                     string                                              `bson:"version" json:"version"`             // Ex: "NOC 2021 V1.0"
	Level                       uint8                                               `bson:"level" json:"level"`                 // Ex: 1
	Code                        uint                                                `bson:"code" json:"code"`                   // Ex: 1
	CodeStr                     string                                              `bson:"code_str" json:"code_str"`           // Ex: 00001
	SectorCode                  uint                                                `bson:"sector_code" json:"sector_code"`
	SectorCodeStr               string                                              `bson:"sector_code_str" json:"sector_code_str"`
	SectorTitle                 string                                              `bson:"sector_title" json:"sector_title"`
	SectorDescription           string                                              `bson:"sector_description" json:"sector_description"`
	SubsectorCode               uint                                                `bson:"subsector_code" json:"subsector_code"`
	SubsectorCodeStr            string                                              `bson:"subsector_code_str" json:"subsector_code_str"`
	SubsectorTitle              string                                              `bson:"subsector_title" json:"subsector_title"`
	SubsectorDescription        string                                              `bson:"subsector_description" json:"subsector_description"`
	IndustryGroupCode           uint                                                `bson:"industry_group_code" json:"industry_group_code"`
	IndustryGroupCodeStr        string                                              `bson:"industry_group_code_str" json:"industry_group_code_str"`
	IndustryGroupTitle          string                                              `bson:"industry_group_title" json:"industry_group_title"`
	IndustryGroupDescription    string                                              `bson:"industry_group_description" json:"industry_group_description"`
	IndustryCode                uint                                                `bson:"industry_code" json:"industry_code"`
	IndustryCodeStr             string                                              `bson:"industry_code_str" json:"industry_code_str"`
	IndustryTitle               string                                              `bson:"industry_title" json:"industry_title"`
	IndustryDescription         string                                              `bson:"industry_description" json:"industry_description"`
	CanadianIndustryCode        uint                                                `bson:"canadian_industry_code" json:"canadian_industry_code"`
	CanadianIndustryCodeStr     string                                              `bson:"canadian_industry_code_str" json:"canadian_industry_code_str"`
	CanadianIndustryTitle       string                                              `bson:"canadian_industry_title" json:"canadian_industry_title"`
	CanadianIndustryDescription string                                              `bson:"canadian_industry_description" json:"canadian_industry_description"`
	Superscript                 string                                              `bson:"superscript" json:"superscript"`
	Elements                    []*NorthAmericanIndustryClassificationSystemElement `bson:"elements" json:"elements"`
}

type NorthAmericanIndustryClassificationSystemAsSelectOption

type NorthAmericanIndustryClassificationSystemAsSelectOption struct {
	Value primitive.ObjectID `bson:"_id" json:"value"` // Extract from the database `_id` field and output through API as `value`.
	Label string             `bson:"industry_title" json:"label"`
}

type NorthAmericanIndustryClassificationSystemElement

type NorthAmericanIndustryClassificationSystemElement struct {
	Type        string `bson:"type" json:"type"`
	Description string `bson:"description" json:"description"`
}

type NorthAmericanIndustryClassificationSystemListFilter

type NorthAmericanIndustryClassificationSystemListFilter struct {
	// Pagination related.
	Cursor    primitive.ObjectID
	PageSize  int64
	SortField string
	SortOrder int8 // 1=ascending | -1=descending

	// Filter related.
	TenantID   primitive.ObjectID
	Status     int8
	SearchText string
}

type NorthAmericanIndustryClassificationSystemListResult

type NorthAmericanIndustryClassificationSystemListResult struct {
	Results     []*NorthAmericanIndustryClassificationSystem `json:"results"`
	NextCursor  primitive.ObjectID                           `json:"next_cursor"`
	HasNextPage bool                                         `json:"has_next_page"`
}

type NorthAmericanIndustryClassificationSystemPaginationListAndCountResult

type NorthAmericanIndustryClassificationSystemPaginationListAndCountResult struct {
	Results     []*NorthAmericanIndustryClassificationSystem `json:"results"`
	NextCursor  string                                       `json:"next_cursor"`
	HasNextPage bool                                         `json:"has_next_page"`
	Count       int64                                        `json:"count"`
}

NorthAmericanIndustryClassificationSystemPaginationListResult represents the paginated list results for the NorthAmericanIndustryClassificationSystem records (meaning limited).

type NorthAmericanIndustryClassificationSystemPaginationListFilter

type NorthAmericanIndustryClassificationSystemPaginationListFilter struct {
	// Pagination related.
	Cursor    string
	PageSize  int64
	SortField string
	SortOrder int8 // 1=ascending | -1=descending

	// Filter related.
	TenantID      primitive.ObjectID
	Status        int8
	SearchText    string
	CodeStr       string
	IndustryTitle string
}

type NorthAmericanIndustryClassificationSystemPaginationListResult

type NorthAmericanIndustryClassificationSystemPaginationListResult struct {
	Results     []*NorthAmericanIndustryClassificationSystem `json:"results"`
	NextCursor  string                                       `json:"next_cursor"`
	HasNextPage bool                                         `json:"has_next_page"`
}

NorthAmericanIndustryClassificationSystemPaginationListResult represents the paginated list results for the associate records.

type NorthAmericanIndustryClassificationSystemStorer

type NorthAmericanIndustryClassificationSystemStorer interface {
	Create(ctx context.Context, m *NorthAmericanIndustryClassificationSystem) error
	GetByID(ctx context.Context, id primitive.ObjectID) (*NorthAmericanIndustryClassificationSystem, error)
	GetByPublicID(ctx context.Context, oldID uint64) (*NorthAmericanIndustryClassificationSystem, error)
	GetLatestByTenantID(ctx context.Context, tenantID primitive.ObjectID) (*NorthAmericanIndustryClassificationSystem, error)
	GetByCode(ctx context.Context, code uint) (*NorthAmericanIndustryClassificationSystem, error)
	// GetByEmail(ctx context.Context, email string) (*NorthAmericanIndustryClassificationSystem, error)
	// GetByVerificationCode(ctx context.Context, verificationCode string) (*NorthAmericanIndustryClassificationSystem, error)
	// GetLatestByTenantID(ctx context.Context, tenantID primitive.ObjectID) (*NorthAmericanIndustryClassificationSystem, error)
	// CheckIfExistsByEmail(ctx context.Context, email string) (bool, error)
	UpdateByID(ctx context.Context, m *NorthAmericanIndustryClassificationSystem) error
	ListByFilter(ctx context.Context, f *NorthAmericanIndustryClassificationSystemPaginationListFilter) (*NorthAmericanIndustryClassificationSystemPaginationListResult, error)
	ListAndCountByFilter(ctx context.Context, f *NorthAmericanIndustryClassificationSystemPaginationListFilter) (*NorthAmericanIndustryClassificationSystemPaginationListAndCountResult, error)
	ListAsSelectOptionByFilter(ctx context.Context, f *NorthAmericanIndustryClassificationSystemPaginationListFilter) ([]*NorthAmericanIndustryClassificationSystemAsSelectOption, error)
}

NorthAmericanIndustryClassificationSystemStorer Interface for user.

func NewDatastore

func NewDatastore(appCfg *c.Conf, loggerp *slog.Logger, client *mongo.Client) NorthAmericanIndustryClassificationSystemStorer

type NorthAmericanIndustryClassificationSystemStorerImpl

type NorthAmericanIndustryClassificationSystemStorerImpl struct {
	Logger     *slog.Logger
	DbClient   *mongo.Client
	Collection *mongo.Collection
}

func (NorthAmericanIndustryClassificationSystemStorerImpl) CountByFilter

func (NorthAmericanIndustryClassificationSystemStorerImpl) Create

func (NorthAmericanIndustryClassificationSystemStorerImpl) GetByCode

func (NorthAmericanIndustryClassificationSystemStorerImpl) GetByID

func (NorthAmericanIndustryClassificationSystemStorerImpl) GetByPublicID

func (NorthAmericanIndustryClassificationSystemStorerImpl) GetLatestByTenantID

func (NorthAmericanIndustryClassificationSystemStorerImpl) UpdateByID

Jump to

Keyboard shortcuts

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