Documentation ¶
Index ¶
- Constants
- type Receipt
- type ReceiptAsSelectOption
- type ReceiptListFilter
- type ReceiptListResult
- type ReceiptPaginationListFilter
- type ReceiptPaginationListResult
- type ReceiptStorer
- type ReceiptStorerImpl
- func (impl ReceiptStorerImpl) CheckIfExistsByNameInOrgBranch(ctx context.Context, name string, orgID primitive.ObjectID, ...) (bool, error)
- func (impl ReceiptStorerImpl) Create(ctx context.Context, u *Receipt) error
- func (impl ReceiptStorerImpl) DeleteByID(ctx context.Context, id primitive.ObjectID) error
- func (impl ReceiptStorerImpl) GetByID(ctx context.Context, id primitive.ObjectID) (*Receipt, error)
- func (impl ReceiptStorerImpl) GetByName(ctx context.Context, name string) (*Receipt, error)
- func (impl ReceiptStorerImpl) GetByPaymentProcessorPurchaseID(ctx context.Context, paymentProcessorPurchaseID string) (*Receipt, error)
- func (impl ReceiptStorerImpl) GetByPaymentProcessorReceiptID(ctx context.Context, paymentProcessorReceiptID string) (*Receipt, error)
- func (impl ReceiptStorerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *ReceiptPaginationListFilter) ([]*ReceiptAsSelectOption, error)
- func (impl ReceiptStorerImpl) ListByFilter(ctx context.Context, f *ReceiptPaginationListFilter) (*ReceiptPaginationListResult, error)
- func (impl ReceiptStorerImpl) UpdateByID(ctx context.Context, m *Receipt) error
- type StripeReceipt
Constants ¶
View Source
const ( StatusActive = 1 StatusArchived = 2 PaymentProcessorStripe = 1 )
View Source
const ( SortOrderAscending = 1 SortOrderDescending = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Receipt ¶
type Receipt struct { StoreID primitive.ObjectID `bson:"store_id" json:"store_id"` StoreName string `bson:"store_name" json:"store_name"` 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"` 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"` // The name of the payment processor we used to create this receipt. PaymentProcessor int8 `bson:"payment_processor" json:"payment_processor"` // PaymentProcessorReceiptID is the unique id set by the payment processor for this particular receipt. PaymentProcessorReceiptID string `bson:"payment_processor_receipt_id" json:"payment_processor_receipt_id"` // PaymentProcessorReceiptURL is the external URL to the payment processors receipt hosted service. PaymentProcessorReceiptURL string `bson:"payment_processor_receipt_url" json:"payment_processor_receipt_url"` PaymentProcessorPurchaseID string `bson:"payment_processor_purchase_id" json:"payment_processor_purchase_id"` PaymentProcessorPurchasedAt time.Time `bson:"payment_processor_purchased_at" json:"payment_processor_purchased_at"` }
type ReceiptAsSelectOption ¶
type ReceiptListFilter ¶
type ReceiptListResult ¶
type ReceiptPaginationListResult ¶
type ReceiptPaginationListResult struct { Results []*Receipt `json:"results"` NextCursor string `json:"next_cursor"` HasNextPage bool `json:"has_next_page"` }
ReceiptPaginationListResult represents the paginated list results for the associate records.
type ReceiptStorer ¶
type ReceiptStorer interface { Create(ctx context.Context, m *Receipt) error GetByID(ctx context.Context, id primitive.ObjectID) (*Receipt, error) GetByName(ctx context.Context, name string) (*Receipt, error) GetByPaymentProcessorReceiptID(ctx context.Context, paymentProcessorReceiptID string) (*Receipt, error) GetByPaymentProcessorPurchaseID(ctx context.Context, paymentProcessorPurchaseID string) (*Receipt, error) UpdateByID(ctx context.Context, m *Receipt) error ListByFilter(ctx context.Context, m *ReceiptPaginationListFilter) (*ReceiptPaginationListResult, error) ListAsSelectOptionByFilter(ctx context.Context, f *ReceiptPaginationListFilter) ([]*ReceiptAsSelectOption, error) DeleteByID(ctx context.Context, id primitive.ObjectID) error CheckIfExistsByNameInOrgBranch(ctx context.Context, name string, orgID primitive.ObjectID, branchID primitive.ObjectID) (bool, error) }
ReceiptStorer Interface for store.
func NewDatastore ¶
type ReceiptStorerImpl ¶
type ReceiptStorerImpl struct { Logger *slog.Logger DbClient *mongo.Client Collection *mongo.Collection }
func (ReceiptStorerImpl) CheckIfExistsByNameInOrgBranch ¶
func (ReceiptStorerImpl) Create ¶
func (impl ReceiptStorerImpl) Create(ctx context.Context, u *Receipt) error
func (ReceiptStorerImpl) DeleteByID ¶
func (ReceiptStorerImpl) GetByPaymentProcessorPurchaseID ¶
func (ReceiptStorerImpl) GetByPaymentProcessorReceiptID ¶
func (ReceiptStorerImpl) ListAsSelectOptionByFilter ¶
func (impl ReceiptStorerImpl) ListAsSelectOptionByFilter(ctx context.Context, f *ReceiptPaginationListFilter) ([]*ReceiptAsSelectOption, error)
func (ReceiptStorerImpl) ListByFilter ¶
func (impl ReceiptStorerImpl) ListByFilter(ctx context.Context, f *ReceiptPaginationListFilter) (*ReceiptPaginationListResult, error)
func (ReceiptStorerImpl) UpdateByID ¶
func (impl ReceiptStorerImpl) UpdateByID(ctx context.Context, m *Receipt) error
type StripeReceipt ¶
type StripeReceipt struct { // The unique identification created by Stripe to present this particular receipt. ID string `bson:"id" json:"id"` // Time at which the object was created. Measured in seconds since the Unix epoch. Created int64 `json:"created"` // Whether payment was successfully collected for this receipt. An receipt can be paid (most commonly) with a charge or with credit from the customer's account balance. Paid bool `json:"paid"` // The URL for the hosted receipt page, which allows customers to view and pay an receipt. If the receipt has not been finalized yet, this will be null. HostedReceiptURL string `bson:"hosted_receipt_url" json:"hosted_receipt_url"` // The link to download the PDF for the receipt. If the receipt has not been finalized yet, this will be null. ReceiptPDF string `json:"receipt_pdf"` }
Click to show internal directories.
Click to hide internal directories.