Documentation
¶
Index ¶
- Constants
- Variables
- func Connect(ctx context.Context, databaseURL string) (*pgxpool.Pool, error)
- type Order
- type OrderStatus
- type OrderStore
- func (s *OrderStore) Create(ctx context.Context, order *Order) error
- func (s *OrderStore) GetByID(ctx context.Context, orderID uuid.UUID) (*Order, error)
- func (s *OrderStore) GetByShopAndIssue(ctx context.Context, shopID uuid.UUID, issueNumber int) (*Order, error)
- func (s *OrderStore) GetByStripeSessionID(ctx context.Context, sessionID string) (*Order, error)
- func (s *OrderStore) GetOrdersByShop(ctx context.Context, shopID uuid.UUID, limit int) ([]*Order, error)
- func (s *OrderStore) MarkDelivered(ctx context.Context, orderID uuid.UUID) error
- func (s *OrderStore) MarkExpired(ctx context.Context, orderID uuid.UUID) error
- func (s *OrderStore) MarkFailed(ctx context.Context, orderID uuid.UUID, reason string) error
- func (s *OrderStore) MarkPaid(ctx context.Context, orderID uuid.UUID, ...) error
- func (s *OrderStore) MarkPendingPayment(ctx context.Context, orderID uuid.UUID, sessionID string) error
- func (s *OrderStore) MarkShipped(ctx context.Context, orderID uuid.UUID, trackingNumber, carrier string) error
- func (s *OrderStore) MarkShippedWithoutTracking(ctx context.Context, orderID uuid.UUID) error
- func (s *OrderStore) UpdateShipmentDetails(ctx context.Context, orderID uuid.UUID, trackingNumber, carrier string) error
- func (s *OrderStore) UpdateStripeSession(ctx context.Context, orderID uuid.UUID, sessionID string) error
- type Shop
- type ShopStore
- func (s *ShopStore) CountShopsByInstallationID(ctx context.Context, installationID int64) (int, error)
- func (s *ShopStore) Create(ctx context.Context, installationID int64, repoID int64, ...) (*Shop, error)
- func (s *ShopStore) DisconnectShop(ctx context.Context, installationID int64, repoID int64) error
- func (s *ShopStore) GetByID(ctx context.Context, id uuid.UUID) (*Shop, error)
- func (s *ShopStore) GetByInstallationAndRepoID(ctx context.Context, installationID int64, repoID int64) (*Shop, error)
- func (s *ShopStore) GetByInstallationID(ctx context.Context, installationID int64) (*Shop, error)
- func (s *ShopStore) GetByRepoID(ctx context.Context, repoID int64) (*Shop, error)
- func (s *ShopStore) GetConnectedShopsByInstallationID(ctx context.Context, installationID int64) ([]*Shop, error)
- func (s *ShopStore) GetDistinctInstallationIDs(ctx context.Context) ([]int64, error)
- func (s *ShopStore) GetFirstConfiguredShop(ctx context.Context, installationID int64) (*Shop, error)
- func (s *ShopStore) GetShopsByInstallationID(ctx context.Context, installationID int64) ([]*Shop, error)
- func (s *ShopStore) MarkOnboarded(ctx context.Context, shopID uuid.UUID) error
- func (s *ShopStore) ReconnectShop(ctx context.Context, installationID int64, repoID int64) error
- func (s *ShopStore) SuspendShop(ctx context.Context, installationID int64, repoID int64) error
- func (s *ShopStore) UnsuspendShop(ctx context.Context, installationID int64, repoID int64) error
- func (s *ShopStore) UpdateEmailConfig(ctx context.Context, shopID uuid.UUID, provider string, config map[string]any, ...) error
- func (s *ShopStore) UpdateRepoFullName(ctx context.Context, shopID uuid.UUID, repoFullName string) error
- func (s *ShopStore) UpdateStripeConnectAccount(ctx context.Context, shopID uuid.UUID, connectAccountID string) error
- func (s *ShopStore) UpdateStripeConnectDetails(ctx context.Context, shopID uuid.UUID, accountID string, ...) error
Constants ¶
View Source
const ( StatusPendingPayment = models.StatusPendingPayment StatusPaid = models.StatusPaid StatusPaymentFailed = models.StatusPaymentFailed StatusExpired = models.StatusExpired StatusShipped = models.StatusShipped StatusDelivered = models.StatusDelivered StatusRefunded = models.StatusRefunded )
Variables ¶
View Source
var ErrInvalidStatusTransition = errors.New("invalid order status transition")
Functions ¶
Types ¶
type OrderStatus ¶
type OrderStatus = models.OrderStatus
type OrderStore ¶
type OrderStore struct {
// contains filtered or unexported fields
}
func NewOrderStore ¶
func NewOrderStore(pool *pgxpool.Pool) *OrderStore
func (*OrderStore) GetByShopAndIssue ¶
func (*OrderStore) GetByStripeSessionID ¶
func (*OrderStore) GetOrdersByShop ¶
func (*OrderStore) MarkDelivered ¶
func (*OrderStore) MarkExpired ¶
func (*OrderStore) MarkFailed ¶
func (*OrderStore) MarkPendingPayment ¶
func (*OrderStore) MarkShipped ¶
func (*OrderStore) MarkShippedWithoutTracking ¶
func (*OrderStore) UpdateShipmentDetails ¶
func (*OrderStore) UpdateStripeSession ¶
type ShopStore ¶
type ShopStore struct {
// contains filtered or unexported fields
}
func NewShopStore ¶
func (*ShopStore) CountShopsByInstallationID ¶
func (*ShopStore) DisconnectShop ¶
func (*ShopStore) GetByInstallationAndRepoID ¶
func (*ShopStore) GetByInstallationID ¶
func (*ShopStore) GetByRepoID ¶
func (*ShopStore) GetConnectedShopsByInstallationID ¶
func (*ShopStore) GetDistinctInstallationIDs ¶
func (*ShopStore) GetFirstConfiguredShop ¶
func (*ShopStore) GetShopsByInstallationID ¶
func (*ShopStore) MarkOnboarded ¶
func (*ShopStore) ReconnectShop ¶
func (*ShopStore) SuspendShop ¶
func (*ShopStore) UnsuspendShop ¶
func (*ShopStore) UpdateEmailConfig ¶
func (*ShopStore) UpdateRepoFullName ¶
func (*ShopStore) UpdateStripeConnectAccount ¶
Click to show internal directories.
Click to hide internal directories.