interfaces

package
v0.0.0-...-993f9dd Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPaymentProcessor

func IsPaymentProcessor(obj interface{}) bool

func IsPaymentProcessorError

func IsPaymentProcessorError(obj interface{}) bool

Types

type AddPriceListPrices

type AddPriceListPrices struct {
	// The ID of the price list to add prices to
	PriceListId uuid.UUID
	// The prices to add
	Prices []string
}

AddPriceListPrices represents the data transfer object for adding prices to a price list

type BulkUpdateInventoryLevelInput

type BulkUpdateInventoryLevelInput struct {
	InventoryItemIDd uuid.UUID
	LocationId       uuid.UUID
	StockedQuantity  int
	IncomingQuantity int
}

type CalculatedPrice

type CalculatedPrice struct {
	// The ID of the money amount selected as the calculated price
	MoneyAmountId uuid.UUID
	// The ID of the associated price list, if any
	PriceListId uuid.UUID
	// The type of the associated price list, if any
	PriceListType string
	// The `min_quantity` field defined on a money amount
	MinQuantity int
	// The `max_quantity` field defined on a money amount
	MaxQuantity int
}

CalculatedPrice represents the details of the calculated price

type CalculatedPriceSet

type CalculatedPriceSet struct {
	// The ID of the price set
	Id uuid.UUID
	// Whether the calculated price is associated with a price list
	IsCalculatedPricePriceList bool `json:"is_calculated_price_price_list,omitempty"`
	// The amount of the calculated price, or `null` if there isn't a calculated price
	CalculatedAmount float64
	// Whether the original price is associated with a price list
	IsOriginalPricePriceList bool `json:"is_original_price_price_list,omitempty"`
	// The amount of the original price, or `null` if there isn't a calculated price
	OriginalAmount float64
	// The currency code of the calculated price, or null if there isn't a calculated price
	CurrencyCode string
	// The details of the calculated price
	CalculatedPrice *CalculatedPrice
	// The details of the original price
	OriginalPrice *CalculatedPrice
}

CalculatedPriceSet represents the calculated price set

type CartCompletionResponse

type CartCompletionResponse struct {
	ResponseCode int
	ResponseBody core.JSONB
}

type CreateBatchJobInput

type CreateBatchJobInput struct {
	Type    string
	Context core.JSONB
	DryRun  bool
}

type CreateInventoryItemInput

type CreateInventoryItemInput struct {
	SKU              string
	OriginCountry    string
	MidCode          string
	Material         string
	Weight           float64
	Length           float64
	Height           float64
	Width            float64
	Title            string
	Description      string
	Thumbnail        string
	Metadata         map[string]interface{}
	HsCode           string
	RequiresShipping bool
}

type CreateInventoryLevelInput

type CreateInventoryLevelInput struct {
	InventoryItemIDd uuid.UUID
	LocationId       uuid.UUID
	StockedQuantity  int
	ReservedQuantity int
	IncomingQuantity int
}

type CreateReservationItemInput

type CreateReservationItemInput struct {
	LineItemId      uuid.UUID
	InventoryItemId uuid.UUID
	LocationId      uuid.UUID
	Quantity        int
	Description     string
	CreatedBy       string
	ExternalId      string
	Metadata        map[string]interface{}
}

type CreateStockLocationInput

type CreateStockLocationInput struct {
	Name      string                     `json:"name"`
	AddressID *string                    `json:"address_id,omitempty"`
	Address   *StockLocationAddressInput `json:"address,omitempty"`
	Metadata  map[string]interface{}     `json:"metadata,omitempty"`
}

*

  • @schema AdminPostStockLocationsReq
  • type: object
  • description: "The details of the stock location to create."
  • required:
  • - name
  • properties:
  • name:
  • description: the name of the stock location
  • type: string
  • address_id:
  • description: the ID of an existing stock location address to associate with the stock location. Only required if `address` is not provided.
  • type: string
  • metadata:
  • type: object
  • description: An optional key-value map with additional details
  • example: {car: "white"}
  • externalDocs:
  • description: "Learn about the metadata attribute, and how to delete and update it."
  • url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
  • address:
  • description: A new stock location address to create and associate with the stock location. Only required if `address_id` is not provided.
  • $ref: "#/components/schemas/StockLocationAddressInput"

type CsvParserContext

type CsvParserContext struct {
	Line       []string
	LineNumber int
	Column     string
	TupleKey   string
}

type DefaultPriceType

type DefaultPriceType string
const (
	DEFAULT DefaultPriceType = "default"
)

type DeleteFileType

type DeleteFileType struct {
	FileKey string
}

type FileServiceGetUploadStreamResult

type FileServiceGetUploadStreamResult struct {
	WriteStream io.Writer
	Promise     chan struct{}
	URL         string
	FileKey     string
}

type FileServiceUploadResult

type FileServiceUploadResult struct {
	URL string
	Key string
}

type FilterableInventoryItemProps

type FilterableInventoryItemProps struct {
	ID               string
	LocationId       uuid.UUID
	Q                string
	SKU              string
	OriginCountry    string
	HsCode           string
	RequiresShipping bool
}

type FilterableInventoryLevelProps

type FilterableInventoryLevelProps struct {
	InventoryItemId  uuid.UUIDs
	LocationId       uuid.UUIDs
	StockedQuantity  int
	ReservedQuantity int
	IncomingQuantity int
}

type FilterableReservationItemProps

type FilterableReservationItemProps struct {
	ID              string
	Type            string
	LineItemId      []uuid.UUID
	InventoryItemId uuid.UUID
	LocationId      uuid.UUID
	Description     string
	CreatedBy       string
	Quantity        int
}

type FilterableStockLocation

type FilterableStockLocation struct {
	Id   uuid.UUID `json:"id,omitempty"`
	Name string    `json:"name,omitempty"`
}

type GetUploadedFileType

type GetUploadedFileType struct {
	FileKey   string
	IsPrivate bool
}

type IBatchJobStrategy

type IBatchJobStrategy interface {
	PrepareBatchJobForProcessing(batchJobEntity CreateBatchJobInput, req *http.Request) (*CreateBatchJobInput, error)
	PreProcessBatchJob(batchJobId uuid.UUID) error
	ProcessJob(batchJobId uuid.UUID) error
	BuildTemplate() (string, error)
}

type ICacheService

type ICacheService interface {
	Get(key string) (interface{}, error)
	Set(key string, data interface{}, ttl *int) error
	Invalidate(key string) error
}

type ICartCompletionStrategy

type ICartCompletionStrategy interface {
	Complete(cartId uuid.UUID, idempotencyKey *models.IdempotencyKey, context types.RequestContext) (*CartCompletionResponse, *utils.ApplictaionError)
}

type ICsvValidator

type ICsvValidator interface {
	Validate(value interface{}, context CsvParserContext) (bool, error)
}

type IFileService

type IFileService interface {
	Upload(file *multipart.FileHeader) (*FileServiceUploadResult, *utils.ApplictaionError)
	UploadProtected(file *multipart.FileHeader) (*FileServiceUploadResult, *utils.ApplictaionError)
	Delete(fileData DeleteFileType) *utils.ApplictaionError
	GetUploadStreamDescriptor(fileData UploadStreamDescriptorType) (*FileServiceGetUploadStreamResult, *utils.ApplictaionError)
	GetDownloadStream(fileData GetUploadedFileType) (io.ReadCloser, *utils.ApplictaionError)
	GetPresignedDownloadUrl(fileData GetUploadedFileType) (string, *utils.ApplictaionError)
}

type IFulfillmentService

type IFulfillmentService interface {
	GetIdentifier() string
	GetFulfillmentOptions() (map[string]interface{}, *utils.ApplictaionError)
	ValidateFulfillmentData(optionData *models.ShippingOption, data map[string]interface{}, cart *models.Cart) map[string]interface{}
	ValidateOption(data models.ShippingOption) bool
	CanCalculate(data map[string]interface{}) bool
	CalculatePrice(optionData *models.ShippingOption, data map[string]interface{}, cart *models.Cart) float64
	CreateFulfillment(data *models.ShippingMethod, items []models.LineItem, order *types.CreateFulfillmentOrder, fulfillment *models.Fulfillment) core.JSONB
	CancelFulfillment(fulfillment *models.Fulfillment) *models.Fulfillment
	GetFulfillmentDocuments(data interface{}) []interface{}
	CreateReturn(fromData *models.Return) core.JSONB
	GetReturnDocuments(data interface{}) []interface{}
	GetShipmentDocuments(data interface{}) []interface{}
	RetrieveDocuments(fulfillmentData map[string]interface{}, documentType string) map[string]interface{}
}

type IInventoryService

type IInventoryService interface {
	ListInventoryItems(context context.Context, selector FilterableInventoryItemProps, config *sql.Options) ([]InventoryItemDTO, *int64, *utils.ApplictaionError)
	ListReservationItems(context context.Context, selector FilterableReservationItemProps, config *sql.Options) ([]ReservationItemDTO, *int64, *utils.ApplictaionError)
	ListInventoryLevels(context context.Context, selector FilterableInventoryLevelProps, config *sql.Options) ([]InventoryLevelDTO, *int64, *utils.ApplictaionError)
	RetrieveInventoryItem(context context.Context, inventoryItemId uuid.UUID, config *sql.Options) (InventoryItemDTO, *utils.ApplictaionError)
	RetrieveInventoryLevel(context context.Context, inventoryItemId uuid.UUID, locationId string) (InventoryLevelDTO, *utils.ApplictaionError)
	RetrieveReservationItem(context context.Context, reservationId uuid.UUID) (ReservationItemDTO, *utils.ApplictaionError)
	CreateReservationItem(context context.Context, input CreateReservationItemInput) (ReservationItemDTO, *utils.ApplictaionError)
	CreateReservationItems(context context.Context, input []CreateReservationItemInput) ([]ReservationItemDTO, *utils.ApplictaionError)
	CreateInventoryItem(context context.Context, input CreateInventoryItemInput) (InventoryItemDTO, *utils.ApplictaionError)
	CreateInventoryItems(context context.Context, input []CreateInventoryItemInput) ([]InventoryItemDTO, *utils.ApplictaionError)
	CreateInventoryLevel(context context.Context, data CreateInventoryLevelInput) (InventoryLevelDTO, *utils.ApplictaionError)
	CreateInventoryLevels(context context.Context, data []CreateInventoryLevelInput) ([]InventoryLevelDTO, *utils.ApplictaionError)
	UpdateInventoryLevels(context context.Context, updates []BulkUpdateInventoryLevelInput) ([]InventoryLevelDTO, *utils.ApplictaionError)
	UpdateInventoryLevel(context context.Context, inventoryItemId uuid.UUID, locationId string, update UpdateInventoryLevelInput) (InventoryLevelDTO, *utils.ApplictaionError)
	UpdateInventoryItem(context context.Context, inventoryItemId uuid.UUID, input CreateInventoryItemInput) (InventoryItemDTO, *utils.ApplictaionError)
	UpdateReservationItem(context context.Context, reservationItemId uuid.UUID, input UpdateReservationItemInput) (ReservationItemDTO, *utils.ApplictaionError)
	DeleteReservationItemsByLineItem(context context.Context, lineItemId uuid.UUIDs) *utils.ApplictaionError
	DeleteReservationItem(context context.Context, reservationItemId uuid.UUIDs) *utils.ApplictaionError
	DeleteInventoryItem(context context.Context, inventoryItemId uuid.UUID) *utils.ApplictaionError
	RestoreInventoryItem(context context.Context, inventoryItemId uuid.UUID) *utils.ApplictaionError
	DeleteInventoryItemLevelByLocationID(context context.Context, locationId string) *utils.ApplictaionError
	DeleteReservationItemByLocationID(context context.Context, locationId string) *utils.ApplictaionError
	DeleteInventoryLevel(context context.Context, inventoryItemId uuid.UUID, locationId string) *utils.ApplictaionError
	AdjustInventory(context context.Context, inventoryItemId uuid.UUID, locationId uuid.UUID, adjustment int) (InventoryLevelDTO, *utils.ApplictaionError)
	ConfirmInventory(context context.Context, inventoryItemId uuid.UUID, locationIds uuid.UUIDs, quantity int) (bool, *utils.ApplictaionError)
	RetrieveAvailableQuantity(context context.Context, inventoryItemId uuid.UUID, locationIds uuid.UUIDs) (int, *utils.ApplictaionError)
	RetrieveStockedQuantity(context context.Context, inventoryItemId uuid.UUID, locationIds uuid.UUIDs) (int, *utils.ApplictaionError)
	RetrieveReservedQuantity(context context.Context, inventoryItemId uuid.UUID, locationIds uuid.UUIDs) (int, *utils.ApplictaionError)
}

type IMigrator

type IMigrator interface {
	Up() error
	Down() error
	GetName() string
}

type INotificationService

type INotificationService interface {
	SendNotification(event string, data interface{}, attachmentGenerator interface{}) (*ReturnedData, error)
	ResendNotification(notification interface{}, config interface{}, attachmentGenerator interface{}) (*ReturnedData, error)
}

type IOauthService

type IOauthService interface {
	GenerateToken(code string) (map[string]interface{}, error)
	RefreshToken(code string) (map[string]interface{}, error)
	DestroyToken(code string) (map[string]interface{}, error)
}

IOauthService is an interface for file connectors

type IParser

type IParser interface {
	// Parse parses the readable stream with the given options
	Parse(readableStream io.Reader, options interface{}) ([]interface{}, error)
}

IParser is the generic parsing interface. All different parsing implementations (csv, json, etc.) should implement this interface

type IPaymentProcessor

type IPaymentProcessor interface {
	GetIdentifier() string
	InitiatePayment(context *PaymentProcessorContext) (*PaymentProcessorSessionResponse, *PaymentProcessorError)
	UpdatePayment(context *PaymentProcessorContext) (*PaymentProcessorSessionResponse, *PaymentProcessorError)
	RefundPayment(paymentSessionData map[string]interface{}, refundAmount float64) (map[string]interface{}, *PaymentProcessorError)
	AuthorizePayment(paymentSessionData map[string]interface{}, context map[string]interface{}) (*models.PaymentSessionStatus, map[string]interface{}, *PaymentProcessorError)
	CapturePayment(paymentSessionData map[string]interface{}) (map[string]interface{}, *PaymentProcessorError)
	DeletePayment(paymentSessionData map[string]interface{}) (map[string]interface{}, *PaymentProcessorError)
	RetrievePayment(paymentSessionData map[string]interface{}) (map[string]interface{}, *PaymentProcessorError)
	CancelPayment(paymentSessionData map[string]interface{}) (map[string]interface{}, *PaymentProcessorError)
	GetPaymentStatus(paymentSessionData map[string]interface{}) (*models.PaymentSessionStatus, *PaymentProcessorError)
	UpdatePaymentData(sessionId uuid.UUID, data map[string]interface{}) (map[string]interface{}, *PaymentProcessorError)

	RetrieveSavedMethods(customer *models.Customer) []types.PaymentMethod
}

type IPriceSelectionStrategy

type IPriceSelectionStrategy interface {
	CalculateVariantPrice(data []Pricing, context *PricingContext) (map[uuid.UUID]PriceSelectionResult, *utils.ApplictaionError)

	OnVariantsPricesUpdate(variantIds uuid.UUIDs) error
}

type IPricingModuleService

type IPricingModuleService interface {
	CalculatePrices(sharedContext context.Context, context map[string]interface{}, ids uuid.UUIDs) ([]CalculatedPriceSet, *utils.ApplictaionError)
	Retrieve(sharedContext context.Context, context map[string]interface{}, id uuid.UUID, config *sql.Options) (PriceSet, *utils.ApplictaionError)
	List(sharedContext context.Context, context map[string]interface{}, filters PriceSet, config *sql.Options) ([]PriceSet, *utils.ApplictaionError)
	ListAndCount(sharedContext context.Context, context map[string]interface{}, filters PriceSet, config *sql.Options) ([]PriceSet, *int64, *utils.ApplictaionError)
	Create(sharedContext context.Context, context map[string]interface{}, data PriceSet) (PriceSet, *utils.ApplictaionError)
	Creates(sharedContext context.Context, context map[string]interface{}, data []PriceSet) ([]PriceSet, *utils.ApplictaionError)
	Update(sharedContext context.Context, context map[string]interface{}, data []PriceSet) ([]PriceSet, *utils.ApplictaionError)
	RemoveRules(sharedContext context.Context, context map[string]interface{}, data []PriceSet) *utils.ApplictaionError
	Delete(sharedContext context.Context, context map[string]interface{}, ids []string) *utils.ApplictaionError
	AddPrice(sharedContext context.Context, context map[string]interface{}, data PriceSet) (PriceSet, *utils.ApplictaionError)
	AddPrices(sharedContext context.Context, context map[string]interface{}, data []PriceSet) ([]PriceSet, *utils.ApplictaionError)
	AddRule(sharedContext context.Context, context map[string]interface{}, data RuleType) (PriceSet, *utils.ApplictaionError)
	AddRules(sharedContext context.Context, context map[string]interface{}, data []RuleType) ([]PriceSet, *utils.ApplictaionError)
	RetrieveMoneyAmount(sharedContext context.Context, context map[string]interface{}, id uuid.UUID, config *sql.Options) (models.MoneyAmount, *utils.ApplictaionError)
	ListMoneyAmounts(sharedContext context.Context, context map[string]interface{}, filters models.MoneyAmount, config *sql.Options) ([]models.MoneyAmount, *utils.ApplictaionError)
	ListAndCountMoneyAmounts(sharedContext context.Context, context map[string]interface{}, filters models.MoneyAmount, config *sql.Options) ([]models.MoneyAmount, *int64, *utils.ApplictaionError)
	CreateMoneyAmounts(sharedContext context.Context, context map[string]interface{}, data []models.MoneyAmount) ([]models.MoneyAmount, *utils.ApplictaionError)
	UpdateMoneyAmounts(sharedContext context.Context, context map[string]interface{}, data []models.MoneyAmount) ([]models.MoneyAmount, *utils.ApplictaionError)
	DeleteMoneyAmounts(sharedContext context.Context, context map[string]interface{}, ids []string) *utils.ApplictaionError
	RetrieveCurrency(sharedContext context.Context, context map[string]interface{}, code string, config *sql.Options) (models.Currency, *utils.ApplictaionError)
	ListCurrencies(sharedContext context.Context, context map[string]interface{}, filters models.Currency, config *sql.Options) ([]models.Currency, *utils.ApplictaionError)
	ListAndCountCurrencies(sharedContext context.Context, context map[string]interface{}, filters models.Currency, config *sql.Options) ([]models.Currency, *int64, *utils.ApplictaionError)
	CreateCurrencies(sharedContext context.Context, context map[string]interface{}, data []models.Currency) ([]models.Currency, *utils.ApplictaionError)
	UpdateCurrencies(sharedContext context.Context, context map[string]interface{}, data []models.Currency) ([]models.Currency, *utils.ApplictaionError)
	DeleteCurrencies(sharedContext context.Context, context map[string]interface{}, currencyCodes []string) *utils.ApplictaionError
	RetrieveRuleType(sharedContext context.Context, context map[string]interface{}, id uuid.UUID, config *sql.Options) (RuleType, *utils.ApplictaionError)
	ListRuleTypes(sharedContext context.Context, context map[string]interface{}, filters RuleType, config *sql.Options) ([]RuleType, *utils.ApplictaionError)
	ListAndCountRuleTypes(sharedContext context.Context, context map[string]interface{}, filters RuleType, config *sql.Options) ([]RuleType, *int64, *utils.ApplictaionError)
	CreateRuleTypes(sharedContext context.Context, context map[string]interface{}, data []RuleType) ([]RuleType, *utils.ApplictaionError)
	UpdateRuleTypes(sharedContext context.Context, context map[string]interface{}, data []RuleType) ([]RuleType, *utils.ApplictaionError)
	DeleteRuleTypes(sharedContext context.Context, context map[string]interface{}, ruleTypeIds []string) *utils.ApplictaionError
	RetrievePriceSetMoneyAmountRules(sharedContext context.Context, context map[string]interface{}, id uuid.UUID, config *sql.Options) (PriceSetMoneyAmountRules, *utils.ApplictaionError)
	ListPriceSetMoneyAmountRules(sharedContext context.Context, context map[string]interface{}, filters PriceSetMoneyAmount, config *sql.Options) ([]PriceSetMoneyAmountRules, *utils.ApplictaionError)
	ListAndCountPriceSetMoneyAmountRules(sharedContext context.Context, context map[string]interface{}, filters PriceSetMoneyAmount, config *sql.Options) ([]PriceSetMoneyAmountRules, *int64, *utils.ApplictaionError)
	ListPriceSetMoneyAmounts(sharedContext context.Context, context map[string]interface{}, filters PriceSetMoneyAmount, config *sql.Options) ([]PriceSetMoneyAmount, *utils.ApplictaionError)
	ListAndCountPriceSetMoneyAmounts(sharedContext context.Context, context map[string]interface{}, filters PriceSetMoneyAmount, config *sql.Options) ([]PriceSetMoneyAmount, *int64, *utils.ApplictaionError)
	CreatePriceSetMoneyAmountRules(sharedContext context.Context, context map[string]interface{}, data []PriceSetMoneyAmount) ([]PriceSetMoneyAmountRules, *utils.ApplictaionError)
	UpdatePriceSetMoneyAmountRules(sharedContext context.Context, context map[string]interface{}, data []PriceSetMoneyAmount) ([]PriceSetMoneyAmountRules, *utils.ApplictaionError)
	DeletePriceSetMoneyAmountRules(sharedContext context.Context, context map[string]interface{}, ids []string) *utils.ApplictaionError
	RetrievePriceRule(sharedContext context.Context, context map[string]interface{}, id uuid.UUID, config *sql.Options) (PriceRule, *utils.ApplictaionError)
	ListPriceRules(sharedContext context.Context, context map[string]interface{}, filters PriceRule, config *sql.Options) ([]PriceRule, *utils.ApplictaionError)
	ListAndCountPriceRules(sharedContext context.Context, context map[string]interface{}, filters PriceRule, config *sql.Options) ([]PriceRule, *int64, *utils.ApplictaionError)
	CreatePriceRules(sharedContext context.Context, context map[string]interface{}, data []PriceRule) ([]PriceRule, *utils.ApplictaionError)
	UpdatePriceRules(sharedContext context.Context, context map[string]interface{}, data []PriceRule) ([]PriceRule, *utils.ApplictaionError)
	DeletePriceRules(sharedContext context.Context, context map[string]interface{}, priceRuleIds []string) *utils.ApplictaionError
	RetrievePriceList(sharedContext context.Context, context map[string]interface{}, id uuid.UUID, config *sql.Options) (models.PriceList, *utils.ApplictaionError)
	ListPriceLists(sharedContext context.Context, context map[string]interface{}, filters models.PriceList, config *sql.Options) ([]models.PriceList, *utils.ApplictaionError)
	ListAndCountPriceLists(sharedContext context.Context, context map[string]interface{}, filters models.PriceList, config *sql.Options) ([]models.PriceList, *int64, *utils.ApplictaionError)
	CreatePriceLists(sharedContext context.Context, context map[string]interface{}, data []models.PriceList) ([]models.PriceList, *utils.ApplictaionError)
	UpdatePriceLists(sharedContext context.Context, context map[string]interface{}, data []models.PriceList) ([]models.PriceList, *utils.ApplictaionError)
	DeletePriceLists(sharedContext context.Context, context map[string]interface{}, priceListIds []string) *utils.ApplictaionError
	RetrievePriceListRule(sharedContext context.Context, context map[string]interface{}, id uuid.UUID, config *sql.Options) (PriceListRule, *utils.ApplictaionError)
	ListPriceListRules(sharedContext context.Context, context map[string]interface{}, filters PriceListRule, config *sql.Options) ([]PriceListRule, *utils.ApplictaionError)
	ListAndCountPriceListRules(sharedContext context.Context, context map[string]interface{}, filters PriceListRule, config *sql.Options) ([]PriceListRule, *int64, *utils.ApplictaionError)
	CreatePriceListRules(sharedContext context.Context, context map[string]interface{}, data []PriceListRule) ([]PriceListRule, *utils.ApplictaionError)
	UpdatePriceListRules(sharedContext context.Context, context map[string]interface{}, data []PriceListRule) ([]PriceListRule, *utils.ApplictaionError)
	DeletePriceListRules(sharedContext context.Context, context map[string]interface{}, priceListRuleIds []string) *utils.ApplictaionError
	AddPriceListPrices(sharedContext context.Context, context map[string]interface{}, data []AddPriceListPrices) ([]models.PriceList, *utils.ApplictaionError)
	SetPriceListRules(sharedContext context.Context, context map[string]interface{}, data PriceListRule) (models.PriceList, *utils.ApplictaionError)
	RemovePriceListRules(sharedContext context.Context, context map[string]interface{}, data PriceListRule) (models.PriceList, *utils.ApplictaionError)
}

type ISearchService

type ISearchService interface {
	// contains filtered or unexported methods
}

type ITaxCalculationStrategy

type ITaxCalculationStrategy interface {
	Calculate(items []models.LineItem, taxLines []interface{}, calculationContext *TaxCalculationContext) float64
}

type ITaxService

type ITaxService interface {
	GetTaxLines(itemLines []ItemTaxCalculationLine, shippingLines []ShippingTaxCalculationLine, context *TaxCalculationContext) ([]types.ProviderTaxLine, *utils.ApplictaionError)
}

type InventoryItemDTO

type InventoryItemDTO struct {
	core.BaseModel
	SKU              string
	OriginCountry    string
	HsCode           string
	RequiresShipping bool
	MidCode          string
	Material         string
	Weight           float64
	Length           float64
	Height           float64
	Width            float64
	Title            string
	Description      string
	Thumbnail        string
}

type InventoryLevelDTO

type InventoryLevelDTO struct {
	core.BaseModel
	InventoryItemId   uuid.UUID
	LocationId        uuid.UUID
	StockedQuantity   int
	ReservedQuantity  int
	IncomingQuantity  int
	AvailableQuantity int
}

type ItemTaxCalculationLine

type ItemTaxCalculationLine struct {
	Item  models.LineItem
	Rates []types.TaxServiceRate
}

type LineContext

type LineContext struct {
	LineNumber int
	Line       interface{}
}

type Migration

type Migration interface {
	AddSql(sql string)
}

type ModuleJoinerConfig

type ModuleJoinerConfig struct {
	JoinerID   string
	JoinerType string
}

type PaymentProcessorContext

type PaymentProcessorContext struct {
	Id                 uuid.UUID
	BillingAddress     *models.Address
	Email              string
	CurrencyCode       string
	Amount             float64
	ResourceId         uuid.UUID
	Customer           *models.Customer
	Context            map[string]interface{}
	PaymentSessionData map[string]interface{}
}

type PaymentProcessorError

type PaymentProcessorError struct {
	Error  string
	Code   string
	Detail interface{}
}

type PaymentProcessorSessionResponse

type PaymentProcessorSessionResponse struct {
	UpdateRequests map[string]interface{}
	SessionData    map[string]interface{}
}

type PriceListRule

type PriceListRule struct {
	Id                  uuid.UUID
	Value               string
	RuleType            RuleType
	PriceList           models.PriceList
	PriceListRuleValues []PriceListRuleValue
}

type PriceListRuleValue

type PriceListRuleValue struct {
	// The price list rule value's ID.
	Id uuid.UUID `json:"id"`
	// The rule's value.
	Value string `json:"value"`
	// The associated price list rule.
	PriceListRule PriceListRule `json:"price_list_rule"`
}

type PriceRule

type PriceRule struct {
	Id                    uuid.UUID
	PriceSetId            uuid.UUID
	PriceSet              PriceSet
	RuleTypeId            uuid.UUID
	RuleType              RuleType
	Value                 uuid.UUID
	Priority              int
	PriceSetMoneyAmountID string
	PriceListId           uuid.UUID
}

type PriceSelectionResult

type PriceSelectionResult struct {
	OriginalPrice              float64
	OriginalPriceIncludesTax   bool
	CalculatedPrice            float64
	CalculatedPriceIncludesTax bool
	CalculatedPriceType        string
	Prices                     []models.MoneyAmount
}

type PriceSet

type PriceSet struct {
	// The ID of the price set.
	Id uuid.UUID `json:"id"`
	// The prices that belong to this price set.
	MoneyAmounts []models.MoneyAmount `json:"money_amounts,omitempty"`
	// The rule types applied on this price set.
	RuleTypes []RuleType `json:"rule_types,omitempty"`
}

type PriceSetMoneyAmount

type PriceSetMoneyAmount struct {
	Id          uuid.UUID
	Title       string
	PriceSet    PriceSet
	PriceList   models.PriceList
	PriceSetId  uuid.UUIDs
	PriceRules  []PriceRule
	MoneyAmount models.MoneyAmount
}

PriceSetMoneyAmount represents the data transfer object for price set money amount

type PriceSetMoneyAmountRules

type PriceSetMoneyAmountRules struct {
	Id                  uuid.UUID
	PriceSetMoneyAmount PriceSetMoneyAmount
	RuleType            RuleType
	Value               string
}

PriceSetMoneyAmountRules represents the data transfer object for price set money amount rules

type PriceType

type PriceType string
const (
	DEFAULT_PRICE PriceType = "default"
)

type Pricing

type Pricing struct {
	VariantId uuid.UUID
	Quantity  int
}

type PricingContext

type PricingContext struct {
	CartId                uuid.UUID
	CustomerId            uuid.UUID
	CustomerGroupId       uuid.UUIDs
	RegionId              uuid.UUID
	Quantity              int
	CurrencyCode          string
	IncludeDiscountPrices bool
	TaxRates              []types.TaxServiceRate
	IgnoreCache           bool
	AutomaticTaxes        bool
	TaxRate               float64
}

type ProductPricing

type ProductPricing struct {
	ProductId uuid.UUID
	Variants  []models.ProductVariant
}

type ReservationItemDTO

type ReservationItemDTO struct {
	core.BaseModel
	LocationId      uuid.UUID
	InventoryItemId uuid.UUID
	Quantity        int
	LineItemId      uuid.UUID
	Description     string
	CreatedBy       string
}

type ReserveQuantityContext

type ReserveQuantityContext struct {
	LocationID     string
	LineItemID     string
	SalesChannelID string
}

type ReturnedData

type ReturnedData struct {
	To     string
	Status string
	Data   map[string]interface{}
}

type RuleType

type RuleType struct {
	// The ID of the rule type.
	Id uuid.UUID `json:"id"`
	// The display name of the rule type.
	Name string `json:"name"`
	// The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of
	// the `calculatePrices` method to specify a rule for calculating the price.
	RuleAttribute string `json:"rule_attribute"`
	// The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy
	// the provided context. The higher the value, the higher the priority of the rule type.
	DefaultPriority int `json:"default_priority"`
}

type SharedContext

type SharedContext struct {
	ContextID   string
	ContextType string
}

type ShippingTaxCalculationLine

type ShippingTaxCalculationLine struct {
	ShippingMethod models.ShippingMethod
	Rates          []types.TaxServiceRate
}

type StockLocationAddressDTO

type StockLocationAddressDTO struct {
	Id          uuid.UUID  `json:"id,omitempty"`
	Address1    string     `json:"address_1"`
	Address2    *string    `json:"address_2,omitempty"`
	Company     *string    `json:"company,omitempty"`
	City        *string    `json:"city,omitempty"`
	CountryCode string     `json:"country_code"`
	Phone       *string    `json:"phone,omitempty"`
	PostalCode  *string    `json:"postal_code,omitempty"`
	Province    *string    `json:"province,omitempty"`
	CreatedAt   string     `json:"created_at"`
	UpdatedAt   string     `json:"updated_at"`
	DeletedAt   *string    `json:"deleted_at,omitempty"`
	Metadata    core.JSONB `json:"metadata,omitempty"`
}

type StockLocationAddressInput

type StockLocationAddressInput struct {
	Address1    string     `json:"address_1"`
	Address2    *string    `json:"address_2,omitempty"`
	City        *string    `json:"city,omitempty"`
	CountryCode string     `json:"country_code"`
	Phone       *string    `json:"phone,omitempty"`
	PostalCode  *string    `json:"postal_code,omitempty"`
	Province    *string    `json:"province,omitempty"`
	Metadata    core.JSONB `json:"metadata,omitempty"`
}

*

  • @schema AdminPostStockLocationsReqAddress
  • type: object
  • required:
  • - address_1
  • - country_code
  • properties:
  • address_1:
  • type: string
  • description: Stock location address
  • example: 35, Jhon Doe Ave
  • address_2:
  • type: string
  • description: Stock location address' complement
  • example: apartment 4432
  • company:
  • type: string
  • description: Stock location address' company
  • city:
  • type: string
  • description: Stock location address' city
  • example: Mexico city
  • country_code:
  • description: "The two character ISO code for the country."
  • type: string
  • externalDocs:
  • url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
  • description: See a list of codes.
  • phone:
  • type: string
  • description: Stock location address' phone number
  • example: +1 555 61646
  • postal_code:
  • type: string
  • description: Stock location address' postal code
  • example: HD3-1G8
  • province:
  • type: string
  • description: Stock location address' province
  • example: Sinaloa

type StockLocationDTO

type StockLocationDTO struct {
	Id        uuid.UUID                `json:"id"`
	Name      string                   `json:"name"`
	Metadata  map[string]interface{}   `json:"metadata,omitempty"`
	AddressID string                   `json:"address_id"`
	Address   *StockLocationAddressDTO `json:"address,omitempty"`
	CreatedAt string                   `json:"created_at"`
	UpdatedAt string                   `json:"updated_at"`
	DeletedAt *string                  `json:"deleted_at,omitempty"`
}

type StockLocationExpandedDTO

type StockLocationExpandedDTO struct {
	StockLocationDTO
	SalesChannels []interface{} `json:"sales_channels,omitempty"`
}

type StringComparisonOperator

type StringComparisonOperator string

type TaxCalculationContext

type TaxCalculationContext struct {
	ShippingAddress models.Address
	Customer        models.Customer
	Region          models.Region
	IsReturn        bool
	ShippingMethods []models.ShippingMethod
	AllocationMap   types.LineAllocationsMap
}

type UpdateInventoryLevelInput

type UpdateInventoryLevelInput struct {
	StockedQuantity  int
	IncomingQuantity int
}

type UpdateReservationItemInput

type UpdateReservationItemInput struct {
	Quantity    int
	LocationID  string
	Description string
	Metadata    core.JSONB
}

type UpdateStockLocationInput

type UpdateStockLocationInput struct {
	Name      *string                    `json:"name,omitempty"`
	AddressID *string                    `json:"address_id,omitempty"`
	Address   *StockLocationAddressInput `json:"address,omitempty"`
	Metadata  map[string]interface{}     `json:"metadata,omitempty"`
}

*

  • @schema AdminPostStockLocationsLocationReq
  • type: object
  • description: "The details to update of the stock location."
  • properties:
  • name:
  • description: the name of the stock location
  • type: string
  • address_id:
  • description: the stock location address ID
  • type: string
  • metadata:
  • type: object
  • description: An optional key-value map with additional details
  • example: {car: "white"}
  • externalDocs:
  • description: "Learn about the metadata attribute, and how to delete and update it."
  • url: "https://docs.medusajs.com/development/entities/overview#metadata-attribute"
  • address:
  • description: The data of an associated address to create or update.
  • $ref: "#/components/schemas/StockLocationAddressInput"

type UploadStreamDescriptorType

type UploadStreamDescriptorType struct {
	Name      string
	Ext       string
	IsPrivate bool
}

Jump to

Keyboard shortcuts

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