datastore

package
v0.0.0-...-53e80a7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 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 InsuranceRequirement

type InsuranceRequirement struct {
	ID                    primitive.ObjectID `bson:"_id" json:"id"`
	TenantID              primitive.ObjectID `bson:"tenant_id" json:"tenant_id,omitempty"`
	Name                  string             `bson:"name" json:"name"`
	Description           string             `bson:"description" json:"description"`
	Status                int8               `bson:"status" json:"status"`
	PublicID              uint64             `bson:"public_id" json:"public_id"`
	CreatedAt             time.Time          `bson:"created_at" json:"created_at"`
	CreatedByUserID       primitive.ObjectID `bson:"created_by_user_id" json:"created_by_user_id,omitempty"`
	CreatedByUserName     string             `bson:"created_by_user_name" json:"created_by_user_name"`
	CreatedFromIPAddress  string             `bson:"created_from_ip_address" json:"created_from_ip_address"`
	ModifiedAt            time.Time          `bson:"modified_at" json:"modified_at"`
	ModifiedByUserID      primitive.ObjectID `bson:"modified_by_user_id" json:"modified_by_user_id,omitempty"`
	ModifiedByUserName    string             `bson:"modified_by_user_name" json:"modified_by_user_name"`
	ModifiedFromIPAddress string             `bson:"modified_from_ip_address" json:"modified_from_ip_address"`
}

type InsuranceRequirementAsSelectOption

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

type InsuranceRequirementListFilter

type InsuranceRequirementListFilter 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 InsuranceRequirementListResult

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

type InsuranceRequirementPaginationListAndCountResult

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

InsuranceRequirementPaginationListResult represents the paginated list results for the InsuranceRequirement records (meaning limited).

type InsuranceRequirementPaginationListFilter

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

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

type InsuranceRequirementPaginationListResult

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

InsuranceRequirementPaginationListResult represents the paginated list results for the associate records.

type InsuranceRequirementStorer

InsuranceRequirementStorer Interface for user.

func NewDatastore

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

type InsuranceRequirementStorerImpl

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

func (InsuranceRequirementStorerImpl) CheckIfExistsByEmail

func (impl InsuranceRequirementStorerImpl) CheckIfExistsByEmail(ctx context.Context, email string) (bool, error)

func (InsuranceRequirementStorerImpl) CountByFilter

func (InsuranceRequirementStorerImpl) Create

func (InsuranceRequirementStorerImpl) DeleteByID

func (InsuranceRequirementStorerImpl) GetByEmail

func (InsuranceRequirementStorerImpl) GetByID

func (InsuranceRequirementStorerImpl) GetByPublicID

func (InsuranceRequirementStorerImpl) GetByVerificationCode

func (impl InsuranceRequirementStorerImpl) GetByVerificationCode(ctx context.Context, verificationCode string) (*InsuranceRequirement, error)

func (InsuranceRequirementStorerImpl) GetLatestByTenantID

func (impl InsuranceRequirementStorerImpl) GetLatestByTenantID(ctx context.Context, tenantID primitive.ObjectID) (*InsuranceRequirement, error)

func (InsuranceRequirementStorerImpl) ListAsSelectOptionByFilter

func (InsuranceRequirementStorerImpl) UpdateByID

Jump to

Keyboard shortcuts

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