Documentation ¶
Index ¶
- Constants
- type Credit
- type CreditAsSelectOption
- type CreditListFilter
- type CreditListResult
- type CreditPaginationListFilter
- type CreditPaginationListResult
- type CreditStorer
- type CreditStorerImpl
- func (impl CreditStorerImpl) CheckIfExistsByNameInOrgBranch(ctx context.Context, name string, orgID primitive.ObjectID, ...) (bool, error)
- func (impl CreditStorerImpl) Create(ctx context.Context, u *Credit) error
- func (impl CreditStorerImpl) DeleteByID(ctx context.Context, id primitive.ObjectID) error
- func (impl CreditStorerImpl) GetByID(ctx context.Context, id primitive.ObjectID) (*Credit, error)
- func (impl CreditStorerImpl) GetByName(ctx context.Context, name string) (*Credit, error)
- func (impl CreditStorerImpl) GetByPaymentProcessorCreditID(ctx context.Context, paymentProcessorCreditID string) (*Credit, error)
- func (impl CreditStorerImpl) GetNextAvailable(ctx context.Context, userID primitive.ObjectID, serviceType int8) (*Credit, error)
- func (impl CreditStorerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *CreditPaginationListFilter) ([]*CreditAsSelectOption, error)
- func (impl CreditStorerImpl) ListByFilter(ctx context.Context, f *CreditPaginationListFilter) (*CreditPaginationListResult, error)
- func (impl CreditStorerImpl) UpdateByID(ctx context.Context, m *Credit) error
Constants ¶
View Source
const ( StatusActive = 1 StatusClaimed = 2 StatusArchived = 3 BusinessFunctionGrantFreeSubmission = 1 )
View Source
const ( SortOrderAscending = 1 SortOrderDescending = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credit ¶
type Credit struct { StoreID primitive.ObjectID `bson:"store_id" json:"store_id"` StoreName string `bson:"store_name" json:"store_name"` StoreTimezone string `bson:"store_timezone" json:"store_timezone"` ID primitive.ObjectID `bson:"_id" json:"id"` UserName string `bson:"user_name" json:"user_name"` UserLexicalName string `bson:"user_lexical_name" json:"user_lexical_name"` UserID primitive.ObjectID `bson:"user_id" json:"user_id"` BusinessFunction int8 `bson:"business_function" json:"business_function"` OfferID primitive.ObjectID `bson:"offer_id" json:"offer_id"` OfferName string `bson:"offer_name" json:"offer_name"` OfferServiceType int8 `bson:"offer_service_type" json:"offer_service_type"` Status int8 `bson:"status" json:"status"` CreatedAt time.Time `bson:"created_at,omitempty" json:"created_at,omitempty"` ModifiedAt time.Time `bson:"modified_at,omitempty" json:"modified_at,omitempty"` ClaimedByComicSubmissionID primitive.ObjectID `bson:"claimed_by_comic_submission_id" json:"claimed_by_comic_submission_id"` }
type CreditAsSelectOption ¶
type CreditListFilter ¶
type CreditListFilter struct { // Pagination related. Cursor primitive.ObjectID PageSize int64 SortField string SortOrder int8 // 1=ascending | -1=descending // Filter related. StoreID primitive.ObjectID UserID primitive.ObjectID OfferID primitive.ObjectID OfferServiceType int8 Status int8 BusinessFunction int8 SearchText string }
type CreditListResult ¶
type CreditPaginationListFilter ¶
type CreditPaginationListFilter struct { // Pagination related. Cursor string PageSize int64 SortField string SortOrder int8 // 1=ascending | -1=descending // Filter related. StoreID primitive.ObjectID UserID primitive.ObjectID OfferID primitive.ObjectID OfferServiceType int8 Status int8 BusinessFunction int8 SearchText string }
type CreditPaginationListResult ¶
type CreditPaginationListResult struct { Results []*Credit `json:"results"` NextCursor string `json:"next_cursor"` HasNextPage bool `json:"has_next_page"` }
CreditPaginationListResult represents the paginated list results for the associate records.
type CreditStorer ¶
type CreditStorer interface { Create(ctx context.Context, m *Credit) error GetByID(ctx context.Context, id primitive.ObjectID) (*Credit, error) GetByName(ctx context.Context, name string) (*Credit, error) GetByPaymentProcessorCreditID(ctx context.Context, paymentProcessorCreditID string) (*Credit, error) GetNextAvailable(ctx context.Context, userID primitive.ObjectID, serviceType int8) (*Credit, error) UpdateByID(ctx context.Context, m *Credit) error ListByFilter(ctx context.Context, m *CreditPaginationListFilter) (*CreditPaginationListResult, error) ListAsSelectOptionByFilter(ctx context.Context, f *CreditPaginationListFilter) ([]*CreditAsSelectOption, error) DeleteByID(ctx context.Context, id primitive.ObjectID) error }
CreditStorer Interface for store.
func NewDatastore ¶
type CreditStorerImpl ¶
type CreditStorerImpl struct { Logger *slog.Logger DbClient *mongo.Client Collection *mongo.Collection }
func (CreditStorerImpl) CheckIfExistsByNameInOrgBranch ¶
func (CreditStorerImpl) Create ¶
func (impl CreditStorerImpl) Create(ctx context.Context, u *Credit) error
func (CreditStorerImpl) DeleteByID ¶
func (CreditStorerImpl) GetByPaymentProcessorCreditID ¶
func (CreditStorerImpl) GetNextAvailable ¶
func (CreditStorerImpl) ListAsSelectOptionByFilter ¶
func (impl CreditStorerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *CreditPaginationListFilter) ([]*CreditAsSelectOption, error)
func (CreditStorerImpl) ListByFilter ¶
func (impl CreditStorerImpl) ListByFilter(ctx context.Context, f *CreditPaginationListFilter) (*CreditPaginationListResult, error)
func (CreditStorerImpl) UpdateByID ¶
func (impl CreditStorerImpl) UpdateByID(ctx context.Context, m *Credit) error
Click to show internal directories.
Click to hide internal directories.