Documentation
¶
Index ¶
- type MySQLRepository
- func (repo MySQLRepository) Create(ctx context.Context, pricingTier PricingTier) (int64, error)
- func (repo MySQLRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
- func (repo MySQLRepository) GetById(ctx context.Context, id int64) (*PricingTier, error)
- func (repo MySQLRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTier, error)
- func (repo MySQLRepository) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTier, error)
- func (repo MySQLRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier PricingTier) error
- type PricingTier
- type PricingTierListParamParser
- type PricingTierRepository
- type PricingTierService
- func (svc PricingTierService) Create(ctx context.Context, pricingTierSpec PricingTierSpec) (*PricingTierSpec, error)
- func (svc PricingTierService) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
- func (svc PricingTierService) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTierSpec, error)
- func (svc PricingTierService) GetRoutes() []service.Route
- func (svc PricingTierService) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTierSpec, error)
- func (svc PricingTierService) UpdateByPricingTierId(ctx context.Context, pricingTierId string, ...) (*PricingTierSpec, error)
- type PricingTierSpec
- type UpdatePricingTierSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLRepository ¶
type MySQLRepository struct {
database.SQLRepository
}
func NewMySQLRepository ¶
func NewMySQLRepository(db *database.MySQL) MySQLRepository
func (MySQLRepository) Create ¶
func (repo MySQLRepository) Create(ctx context.Context, pricingTier PricingTier) (int64, error)
func (MySQLRepository) DeleteByPricingTierId ¶
func (repo MySQLRepository) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
func (MySQLRepository) GetById ¶
func (repo MySQLRepository) GetById(ctx context.Context, id int64) (*PricingTier, error)
func (MySQLRepository) GetByPricingTierId ¶
func (repo MySQLRepository) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTier, error)
func (MySQLRepository) List ¶
func (repo MySQLRepository) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTier, error)
func (MySQLRepository) UpdateByPricingTierId ¶
func (repo MySQLRepository) UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier PricingTier) error
type PricingTier ¶
type PricingTier struct {
ID int64 `db:"id"`
ObjectId int64 `db:"objectId"`
PricingTierId string `db:"pricingTierId"`
Name database.NullString `db:"name"`
Description database.NullString `db:"description"`
CreatedAt time.Time `db:"createdAt"`
UpdatedAt time.Time `db:"updatedAt"`
DeletedAt database.NullTime `db:"deletedAt"`
}
func (PricingTier) ToPricingTierSpec ¶
func (pricingTier PricingTier) ToPricingTierSpec() *PricingTierSpec
type PricingTierListParamParser ¶
type PricingTierListParamParser struct{}
func (PricingTierListParamParser) GetDefaultSortBy ¶
func (parser PricingTierListParamParser) GetDefaultSortBy() string
func (PricingTierListParamParser) GetSupportedSortBys ¶
func (parser PricingTierListParamParser) GetSupportedSortBys() []string
func (PricingTierListParamParser) ParseValue ¶
func (parser PricingTierListParamParser) ParseValue(val string, sortBy string) (interface{}, error)
type PricingTierRepository ¶
type PricingTierRepository interface {
Create(ctx context.Context, pricingTier PricingTier) (int64, error)
GetById(ctx context.Context, id int64) (*PricingTier, error)
GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTier, error)
List(ctx context.Context, listParams middleware.ListParams) ([]PricingTier, error)
UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTier PricingTier) error
DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
}
func NewRepository ¶
func NewRepository(db database.Database) (PricingTierRepository, error)
type PricingTierService ¶
type PricingTierService struct {
service.BaseService
}
func NewService ¶
func NewService(env service.Env) PricingTierService
func (PricingTierService) Create ¶
func (svc PricingTierService) Create(ctx context.Context, pricingTierSpec PricingTierSpec) (*PricingTierSpec, error)
func (PricingTierService) DeleteByPricingTierId ¶
func (svc PricingTierService) DeleteByPricingTierId(ctx context.Context, pricingTierId string) error
func (PricingTierService) GetByPricingTierId ¶
func (svc PricingTierService) GetByPricingTierId(ctx context.Context, pricingTierId string) (*PricingTierSpec, error)
func (PricingTierService) GetRoutes ¶
func (svc PricingTierService) GetRoutes() []service.Route
GetRoutes registers all route handlers for this module
func (PricingTierService) List ¶
func (svc PricingTierService) List(ctx context.Context, listParams middleware.ListParams) ([]PricingTierSpec, error)
func (PricingTierService) UpdateByPricingTierId ¶
func (svc PricingTierService) UpdateByPricingTierId(ctx context.Context, pricingTierId string, pricingTierSpec UpdatePricingTierSpec) (*PricingTierSpec, error)
type PricingTierSpec ¶
type PricingTierSpec struct {
PricingTierId string `json:"pricingTierId" validate:"required"`
Name database.NullString `json:"name"`
Description database.NullString `json:"description"`
Context context.ContextSetSpec `json:"context,omitempty"`
CreatedAt time.Time `json:"createdAt"`
}
func (PricingTierSpec) ToObjectSpec ¶
func (spec PricingTierSpec) ToObjectSpec() *object.ObjectSpec
func (PricingTierSpec) ToPricingTier ¶
func (spec PricingTierSpec) ToPricingTier(objectId int64) *PricingTier
type UpdatePricingTierSpec ¶
type UpdatePricingTierSpec struct {
Name database.NullString `json:"name"`
Description database.NullString `json:"description"`
}
Click to show internal directories.
Click to hide internal directories.