Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { gorm.Model AddressID uuid.UUID `gorm:"not null;unique_index"` Prefix string Firstname string Lastname string BusinessName string IsBusiness bool `gorm:"not null;default:false"` Address1 string `gorm:"not null"` Address2 string Zip string `gorm:"not null;length:10"` PhoneNumber string `gorm:"not null"` City string `gorm:"not null"` State string `gorm:"not null"` Tax float32 `gorm:"not null;default:0"` }
Address entity
func (*Address) MarshalBinary ¶
MarshalBinary for redis
func (*Address) UnmarshalBinary ¶
UnmarshalBinary for redis
type PromotionCode ¶
type PromotionCode struct { entity.Base EntityID uuid.UUID `gorm:"not null;index:entitycode"` Code string `gorm:"not null;index:entitycode"` IsUSD bool `gorm:"not null;default:false"` IsPercent bool `gorm:"not null;default:false"` //PercentAmount this will be decimal value. If it's 10% off, this will be saved as 0.1 DiscountAmount float32 `gorm:"not null;default:0"` ActiveFrom time.Time `gorm:"not null"` ActiveTo time.Time `gorm:"not null"` //BusinessID only set when IsBusinessSpecific is true BusinessID uuid.UUID LimitedAmount int64 `gorm:"not null;default:-1"` IsActive bool `gorm:"not null;default:true"` IsNewCustomerOnly bool `gorm:"not null;default:false"` IsBusinessSpecific bool `gorm:"not null;default:false"` }
PromotionCode entity
func (*PromotionCode) MarshalBinary ¶
func (p *PromotionCode) MarshalBinary() ([]byte, error)
MarshalBinary for redis
func (*PromotionCode) ToDTO ¶
func (p *PromotionCode) ToDTO() (*module.DetailedPromotionCodeDTO, error)
ToDTO dto
func (*PromotionCode) UnmarshalBinary ¶
func (p *PromotionCode) UnmarshalBinary(data []byte) error
UnmarshalBinary for redis
type ShoppingCart ¶
type ShoppingCart struct { entity.Base //EntityID should be user ID. EntityID uuid.UUID `gorm:"not null;index:entity_business"` BusinessID uuid.UUID `gorm:"not null;index:entity_business"` ShippingAddress *Address BillingAddress *Address `gorm:"not null"` //ShippingMethodID TODO: Need to replace with actual data ShippingMethodID uuid.UUID Subtotal float32 `gorm:"not null;default:0"` ShippingCost float32 `gorm:"not null;default:0"` Tax float32 `gorm:"not null;default:0"` ShoppingCartItems []*ShoppingCartItem PromotionCodes []*PromotionCode PointsRedeem uint64 `gorm:"not null;default:0"` IsActive bool `gorm:"not null;default:true"` IsCompleted bool `gorm:"not null;default:false"` }
ShoppingCart entity
func (*ShoppingCart) MarshalBinary ¶
func (s *ShoppingCart) MarshalBinary() ([]byte, error)
MarshalBinary for redis
func (*ShoppingCart) ToDTO ¶
func (s *ShoppingCart) ToDTO() (*module.DetailedShoppingCartDTO, error)
ToDTO dto
func (*ShoppingCart) UnmarshalBinary ¶
func (s *ShoppingCart) UnmarshalBinary(data []byte) error
UnmarshalBinary for redis
type ShoppingCartItem ¶
type ShoppingCartItem struct { gorm.Model ProductID uuid.UUID `gorm:"not null"` Quantity uint64 `gorm:"not null"` }
ShoppingCartItem entity
func (*ShoppingCartItem) MarshalBinary ¶
func (s *ShoppingCartItem) MarshalBinary() ([]byte, error)
MarshalBinary for redis
func (*ShoppingCartItem) ToDTO ¶
func (s *ShoppingCartItem) ToDTO() *module.ShoppingCartItemDTO
ToDTO dto
func (*ShoppingCartItem) UnmarshalBinary ¶
func (s *ShoppingCartItem) UnmarshalBinary(data []byte) error
UnmarshalBinary for redis
Click to show internal directories.
Click to hide internal directories.