Documentation ¶
Index ¶
- Constants
- type Address
- type AddressView
- type BusinessAccountType
- type Category
- type Collection
- type CollectionOfProduct
- type Coupon
- type CouponFor
- type CouponType
- type CouponUsage
- type Customer
- type Location
- type LocationType
- type Log
- type Order
- type OrderDetails
- type OrderDetailsView
- type OrderDetailsViewExternal
- type OrderItemAttributeKV
- type OrderLog
- type OrderStatus
- type OrderedItem
- type OrderedItemAttribute
- type OrderedItemDetails
- type OrderedItemDetailsInternal
- type OrderedItemView
- type OrderedItemViewExternal
- type PaymentForLocation
- type PaymentMethod
- type PaymentStatus
- type PayoutMethod
- type PayoutSend
- type PayoutSendDetails
- type PayoutSendStatus
- type PayoutSettings
- type PayoutSettingsDetails
- type Permission
- type PlatformStatus
- type Product
- type ProductAttribute
- type ProductDetails
- type ProductDetailsInternal
- type ProductImage
- type ProductKV
- type ResCategorySearch
- type ResCategorySearchInternal
- type Review
- type Session
- type Settings
- type SettingsDetails
- type ShippingForLocation
- type ShippingMethod
- type Staff
- type StaffProfile
- type StatusReport
- type Store
- type StoreFinanceSummaryView
- type StorePayoutSummaryView
- type StorePermission
- type StoreStatus
- type StoreView
- type Summary
- type User
- type UserPermission
- type UserStatus
- type WeightUnit
Constants ¶
View Source
const ( OrderPending OrderStatus = "order_pending" OrderCancelled OrderStatus = "order_cancelled" OrderConfirmed OrderStatus = "order_confirmed" OrderShipping OrderStatus = "order_shipping" OrderDelivered OrderStatus = "order_delivered" PaymentPending PaymentStatus = "payment_pending" PaymentCompleted PaymentStatus = "payment_completed" PaymentFailed PaymentStatus = "payment_failed" PaymentReverted PaymentStatus = "payment_reverted" )
View Source
const ( UserRegistered UserStatus = "registered" UserActive UserStatus = "active" UserBanned UserStatus = "banned" UserSuspended UserStatus = "suspended" AdminPerm Permission = "admin" ManagerPerm Permission = "manager" UserPerm Permission = "user" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { ID string `json:"id" gorm:"column:id;primary_key"` UserID string `json:"-" gorm:"column:user_id;index;not null"` Name string `json:"name" gorm:"column:name;not null"` Address string `json:"address" gorm:"column:address;not null"` State string `json:"state" gorm:"column:state"` City string `json:"city" gorm:"column:city;not null"` CountryID int64 `json:"country_id" gorm:"column:country_id;not null"` Postcode string `json:"postcode" gorm:"column:postcode;not null"` Email string `json:"email,omitempty" gorm:"column:email"` Phone string `json:"phone,omitempty" gorm:"column:phone"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index;not null"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` }
func (*Address) ForeignKeys ¶
type AddressView ¶
type AddressView struct { ID string `json:"id"` UserID string `json:"-"` Name string `json:"name,omitempty"` Address string `json:"address,omitempty"` City string `json:"city,omitempty"` Country string `json:"country,omitempty"` State string `json:"state,omitempty"` Postcode string `json:"postcode,omitempty"` Email string `json:"email,omitempty"` Phone string `json:"phone,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
func (*AddressView) CreateView ¶
func (av *AddressView) CreateView(tx *gorm.DB) error
func (*AddressView) TableName ¶
func (av *AddressView) TableName() string
type BusinessAccountType ¶
type BusinessAccountType struct { ID string `json:"id" gorm:"column:id;primary_key"` Name string `json:"name" gorm:"column:name;unique_index;not null"` IsPublished bool `json:"is_published" gorm:"column:is_published;default:false"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` }
func (*BusinessAccountType) TableName ¶
func (bat *BusinessAccountType) TableName() string
type Category ¶
type Category struct { ID string `json:"id" gorm:"column:id;unique;not null"` Name string `json:"name" gorm:"column:name;primary_key"` StoreID string `json:"-" gorm:"column:store_id;primary_key"` Description string `json:"description" gorm:"column:description;not null"` Image string `json:"image" gorm:"column:image;not null"` IsPublished bool `json:"is_published" gorm:"column:is_published;index;not null"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index;not null"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` }
func (*Category) ForeignKeys ¶
type Collection ¶
type Collection struct { ID string `json:"id" gorm:"column:id;unique;not null"` Name string `json:"name" gorm:"column:name;primary_key"` StoreID string `json:"-" gorm:"column:store_id;primary_key"` Description string `json:"description" gorm:"column:description;not null"` Image string `json:"image" gorm:"column:image;not null"` IsPublished bool `json:"is_published" gorm:"column:is_published;index"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index"` UpdatedAt time.Time `json:"-" gorm:"column:updated_at"` }
func (*Collection) ForeignKeys ¶
func (c *Collection) ForeignKeys() []string
func (*Collection) TableName ¶
func (c *Collection) TableName() string
type CollectionOfProduct ¶
type CollectionOfProduct struct { ProductID string `json:"product_id" gorm:"column:product_id;primary_key"` CollectionID string `json:"collection_id" gorm:"column:collection_id;primary_key"` }
func (*CollectionOfProduct) ForeignKeys ¶
func (cop *CollectionOfProduct) ForeignKeys() []string
func (*CollectionOfProduct) TableName ¶
func (cop *CollectionOfProduct) TableName() string
type Coupon ¶
type Coupon struct { ID string `json:"id" gorm:"column:id;primary_key"` StoreID string `json:"store_id" gorm:"column:store_id;index;not null"` Code string `json:"code" gorm:"column:code;unique_index"` IsActive bool `json:"is_active" gorm:"column:is_active;index"` DiscountAmount int64 `json:"discount_amount" gorm:"column:discount_amount"` IsFlatDiscount bool `json:"is_flat_discount" gorm:"column:is_flat_discount"` IsUserSpecific bool `json:"is_user_specific" gorm:"column:is_user_specific"` MaxDiscount int64 `json:"max_discount" gorm:"column:max_discount"` MaxUsage int `json:"max_usage" gorm:"column:max_usage"` MaxUsagePerUser int `json:"max_usage_per_user" gorm:"column:max_usage_per_user;default:0"` MinOrderValue int64 `json:"min_order_value" gorm:"column:min_order_value"` DiscountType CouponType `json:"discount_type" gorm:"column:discount_type;index"` StartAt time.Time `json:"start_at" gorm:"column:start_at;index"` EndAt time.Time `json:"end_at" gorm:"column:end_at;index"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;index"` }
func (*Coupon) CalculateDiscount ¶
func (*Coupon) ForeignKeys ¶
type CouponFor ¶
type CouponFor struct { CouponID string `json:"coupon_id" gorm:"column:coupon_id;primary_key"` UserID string `json:"user_id" gorm:"column:user_id;primary_key"` }
func (*CouponFor) ForeignKeys ¶
type CouponType ¶
type CouponType string
const ( ProductDiscount CouponType = "product_discount" ShippingDiscount CouponType = "shipping_discount" TotalDiscount CouponType = "total_discount" )
type CouponUsage ¶
type CouponUsage struct { CouponID string `json:"coupon_id" gorm:"column:coupon_id;primary_key"` UserID string `json:"user_id" gorm:"column:user_id;primary_key"` OrderID string `json:"order_id" gorm:"column:order_id;primary_key"` }
func (*CouponUsage) ForeignKeys ¶
func (cu *CouponUsage) ForeignKeys() []string
func (*CouponUsage) TableName ¶
func (cu *CouponUsage) TableName() string
type Customer ¶
type Customer struct { ID string `json:"id"` Name string `json:"name"` Email string `json:"email"` ProfilePicture string `json:"profile_picture"` Phone string `json:"phone"` IsEmailVerified bool `json:"is_email_verified"` IsPhoneVerified bool `json:"is_phone_verified"` StoreID string `json:"store_id"` NumberOfPurchases int `json:"number_of_purchases"` }
type Location ¶
type Location struct { ID int64 `json:"id" gorm:"column:id;primary_key"` Name string `json:"name" gorm:"column:name;not null;index"` ISOName *string `json:"iso_name" gorm:"column:iso_name;index"` LocationType LocationType `json:"-" gorm:"column:location_type;not null;index"` ParentID int64 `json:"-" gorm:"column:parent_id;type:bigint;not null;index"` IsPublished int64 `json:"is_published" gorm:"column:is_published;not null;index"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;default:CURRENT_TIMESTAMP"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;default:CURRENT_TIMESTAMP"` }
type LocationType ¶
type LocationType int64
const ( LocationTypeCountry LocationType = 0 LocationTypeState LocationType = 1 LocationTypeCity LocationType = 2 )
type Log ¶
type Log struct { ID string `json:"id" gorm:"column:id;primary_key;not null"` Label string `json:"label" gorm:"column:label;index;not null"` Path string `json:"path" gorm:"column:path;index;not null"` Status int `json:"status" gorm:"column:status;index;not null"` Size int64 `json:"size" gorm:"column:size;index;not null"` IP string `json:"ip" gorm:"column:ip;not null"` User string `json:"user" gorm:"user"` TimeTaken float64 `json:"time_taken" gorm:"column:time_taken;index;not null"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index;not null"` }
type Order ¶
type Order struct { ID string `json:"id" gorm:"column:id;primary_key"` Hash string `json:"hash" gorm:"column:hash;unique_index;not null"` UserID string `json:"user_id" gorm:"column:user_id;index;not null"` StoreID string `json:"store_id" gorm:"column:store_id;index;not null"` ShippingAddressID *string `json:"shipping_address_id;omitempty" gorm:"column:shipping_address_id"` BillingAddressID string `json:"billing_address_id" gorm:"column:billing_address_id;not null"` PaymentMethodID string `json:"payment_method_id" gorm:"column:payment_method_id;not null"` ShippingMethodID *string `json:"shipping_method_id;omitempty" gorm:"column:shipping_method_id"` ShippingCharge int64 `json:"shipping_charge" gomr:"column:shipping_charge"` PaymentProcessingFee int64 `json:"payment_processing_fee" gorm:"column:payment_processing_fee"` SubTotal int64 `json:"sub_total" gorm:"column:sub_total"` IsAllDigitalProducts bool `json:"is_all_digital_products" gorm:"column:is_all_digital_products;index"` PaymentGateway *string `json:"payment_gateway" gorm:"column:payment_gateway"` Nonce *string `json:"nonce" gomr:"column:nonce"` TransactionID *string `json:"transaction_id" gorm:"column:transaction_id;unique_index"` OriginalGrandTotal int64 `json:"original_grand_total" gorm:"column:original_grand_total;not null;default:0"` SellerEarnings int64 `json:"seller_earnings" gorm:"seller_earnings;index;not nul;default:0"` PlatformEarnings int64 `json:"platform_earnings" gorm:"platform_earnings;index;not null;default:0"` ActualEarnings int64 `json:"actual_earnings" gorm:"actual_earnings;index;not null;default:0"` GrandTotal int64 `json:"grand_total" gorm:"column:grand_total;not nul;default:0"` DiscountedAmount int64 `json:"discounted_amount" gorm:"column:discounted_amount"` Status OrderStatus `json:"status" gorm:"column:status"` PaymentStatus PaymentStatus `json:"payment_status" gorm:"column:payment_status"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index;not null"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` }
func (*Order) ForeignKeys ¶
type OrderDetails ¶
type OrderDetails struct { ID string `json:"id"` Hash string `json:"hash"` TotalAdditionalCharge int64 `json:"total_additional_charge"` ShippingCharge int64 `json:"shipping_charge"` PaymentProcessingFee int64 `json:"payment_processing_fee"` SubTotal int64 `json:"sub_total"` PaymentGateway string `json:"payment_gateway"` Nonce string `json:"nonce"` TransactionID string `json:"transaction_id"` GrandTotal int64 `json:"grand_total"` DiscountedAmount int64 `json:"discounted_amount"` CouponCode string `json:"coupon_code"` Status OrderStatus `json:"status"` PaymentStatus PaymentStatus `json:"payment_status"` IsAllDigitalProducts bool `json:"is_all_digital_products"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` ShippingID string `json:"shipping_id"` ShippingName string `json:"shipping_name"` ShippingHouse string `json:"shipping_house"` ShippingRoad string `json:"shipping_road"` ShippingCity string `json:"shipping_city"` ShippingCountry string `json:"shipping_country"` ShippingPostcode string `json:"shipping_postcode"` ShippingEmail string `json:"shipping_email"` ShippingPhone string `json:"shipping_phone"` BillingID string `json:"billing_id"` BillingName string `json:"billing_name"` BillingHouse string `json:"billing_house"` BillingRoad string `json:"billing_road"` BillingCity string `json:"billing_city"` BillingCountry string `json:"billing_country"` BillingPostcode string `json:"billing_postcode"` BillingEmail string `json:"billing_email"` BillingPhone string `json:"billing_phone"` StoreID string `json:"store_id"` StoreName string `json:"store_name"` StoreAddress string `json:"store_address"` StoreCity string `json:"store_city"` StoreCountry string `json:"store_country"` StorePostcode string `json:"store_postcode"` StoreEmail string `json:"store_email"` StorePhone string `json:"store_phone"` StoreStatus string `json:"store_status"` PaymentMethodID string `json:"payment_method_id"` PaymentMethodName string `json:"payment_method_name"` PaymentMethodIsOffline bool `json:"payment_method_is_offline"` ShippingMethodID string `json:"shipping_method_id"` ShippingMethodName string `json:"shipping_method_name"` ApproximateDeliveryTime int `json:"approximate_delivery_time"` ReviewRating int `json:"review_rating"` ReviewDescription string `json:"review_description"` SellerEarnings int64 `json:"seller_earnings"` PlatformEarnings int64 `json:"platform_earnings"` ActualEarnings int64 `json:"actual_earnings"` }
func (*OrderDetails) TableName ¶
func (od *OrderDetails) TableName() string
type OrderDetailsView ¶
type OrderDetailsView struct { ID string `json:"id,omitempty"` Hash string `json:"hash,omitempty"` ShippingCharge int64 `json:"shipping_charge,omitempty"` PaymentProcessingFee int64 `json:"payment_processing_fee,omitempty"` SubTotal int64 `json:"sub_total,omitempty"` PaymentGateway string `json:"payment_gateway,omitempty"` Nonce *string `json:"nonce,omitempty"` // Private TransactionID *string `json:"transaction_id,omitempty"` //Private GrandTotal int64 `json:"grand_total,omitempty"` DiscountedAmount int64 `json:"discounted_amount,omitempty"` CouponCode string `json:"coupon_code,omitempty"` Status OrderStatus `json:"status,omitempty"` PaymentStatus PaymentStatus `json:"payment_status,omitempty"` IsAllDigitalProducts bool `json:"is_all_digital_products,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` ShippingID *string `json:"shipping_id,omitempty"` ShippingName *string `json:"shipping_name,omitempty"` ShippingAddress *string `json:"shipping_address,omitempty"` ShippingCity *string `json:"shipping_city,omitempty"` ShippingCountry *string `json:"shipping_country,omitempty"` ShippingPostcode *string `json:"shipping_postcode,omitempty"` ShippingEmail *string `json:"shipping_email,omitempty"` ShippingPhone *string `json:"shipping_phone,omitempty"` BillingID string `json:"billing_id,omitempty"` BillingName string `json:"billing_name,omitempty"` BillingAddress string `json:"billing_address,omitempty"` BillingCity string `json:"billing_city,omitempty"` BillingCountry string `json:"billing_country,omitempty"` BillingPostcode string `json:"billing_postcode,omitempty"` BillingEmail string `json:"billing_email,omitempty"` BillingPhone string `json:"billing_phone,omitempty"` StoreID string `json:"store_id,omitempty"` StoreName string `json:"store_name,omitempty"` StoreAddress string `json:"store_address,omitempty"` StoreCity string `json:"store_city,omitempty"` StoreCountry string `json:"store_country,omitempty"` StorePostcode string `json:"store_postcode,omitempty"` StoreEmail string `json:"store_email,omitempty"` StorePhone string `json:"store_phone,omitempty"` StoreStatus string `json:"store_status,omitempty"` PaymentMethodID string `json:"payment_method_id,omitempty"` PaymentMethodName string `json:"payment_method_name,omitempty"` PaymentMethodIsOffline bool `json:"payment_method_is_offline"` ShippingMethodID string `json:"shipping_method_id"` ShippingMethodName string `json:"shipping_method_name"` ApproximateDeliveryTime int `json:"approximate_delivery_time"` Items []OrderedItemView `json:"items"` UserID string `json:"user_id"` UserName string `json:"user_name"` UserEmail string `json:"user_email"` UserPhone *string `json:"user_phone,omitempty"` UserPicture *string `json:"user_picture,omitempty"` ReviewRating int `json:"review_rating,omitempty"` ReviewDescription string `json:"review_description,omitempty"` SellerEarnings int64 `json:"seller_earnings"` PlatformEarnings int64 `json:"platform_earnings"` ActualEarnings int64 `json:"actual_earnings"` }
func (*OrderDetailsView) CreateView ¶
func (odv *OrderDetailsView) CreateView(tx *gorm.DB) error
func (*OrderDetailsView) TableName ¶
func (odv *OrderDetailsView) TableName() string
type OrderDetailsViewExternal ¶
type OrderDetailsViewExternal struct { ID string `json:"id,omitempty"` Hash string `json:"hash"` ShippingCharge int64 `json:"shipping_charge"` PaymentProcessingFee int64 `json:"payment_processing_fee"` SubTotal int64 `json:"sub_total"` PaymentGateway string `json:"payment_gateway"` Nonce *string `json:"nonce,omitempty"` TransactionID *string `json:"transaction_id,omitempty"` GrandTotal int64 `json:"grand_total"` DiscountedAmount int64 `json:"discounted_amount"` CouponCode string `json:"coupon_code"` Status OrderStatus `json:"status"` PaymentStatus PaymentStatus `json:"payment_status"` IsAllDigitalProducts bool `json:"is_all_digital_products"` CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` ShippingID *string `json:"shipping_id,omitempty"` ShippingName *string `json:"shipping_name,omitempty"` ShippingAddress *string `json:"shipping_address,omitempty"` ShippingCity *string `json:"shipping_city,omitempty"` ShippingCountry *string `json:"shipping_country,omitempty"` ShippingPostcode *string `json:"shipping_postcode,omitempty"` ShippingEmail *string `json:"shipping_email,omitempty"` ShippingPhone *string `json:"shipping_phone,omitempty"` BillingID string `json:"billing_id"` BillingName string `json:"billing_name"` BillingAddress string `json:"billing_address"` BillingCity string `json:"billing_city"` BillingCountry string `json:"billing_country"` BillingPostcode string `json:"billing_postcode"` BillingEmail string `json:"billing_email"` BillingPhone string `json:"billing_phone"` StoreID string `json:"store_id"` StoreName string `json:"store_name"` StoreAddress string `json:"store_address"` StoreCity string `json:"store_city"` StoreCountry string `json:"store_country"` StorePostcode string `json:"store_postcode"` StoreEmail string `json:"store_email"` StorePhone string `json:"store_phone"` StoreStatus string `json:"store_status"` PaymentMethodID string `json:"payment_method_id"` PaymentMethodName string `json:"payment_method_name"` PaymentMethodIsOffline bool `json:"payment_method_is_offline"` ShippingMethodID string `json:"shipping_method_id"` ShippingMethodName string `json:"shipping_method_name"` ApproximateDeliveryTime int `json:"approximate_delivery_time"` Items []OrderedItemViewExternal `json:"items"` UserID string `json:"user_id"` UserName string `json:"user_name"` UserEmail string `json:"user_email"` UserPhone *string `json:"user_phone,omitempty"` UserPicture *string `json:"user_picture,omitempty"` ReviewRating int `json:"review_rating"` ReviewDescription string `json:"review_description"` }
func (*OrderDetailsViewExternal) TableName ¶
func (odi *OrderDetailsViewExternal) TableName() string
type OrderItemAttributeKV ¶
type OrderLog ¶
type OrderLog struct { ID string `json:"id" gorm:"column:id;primary_key"` OrderID string `json:"order_id" gorm:"column:order_id;index"` Action string `json:"action" gorm:"column:action"` Details string `json:"details" gorm:"column:details"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at"` }
func (*OrderLog) ForeignKeys ¶
type OrderStatus ¶
type OrderStatus string
func (OrderStatus) IsValid ¶
func (os OrderStatus) IsValid() bool
type OrderedItem ¶
type OrderedItem struct { ID string `json:"id" gorm:"column:id;primary_key;not null"` OrderID string `json:"order_id" gorm:"column:order_id"` ProductID string `json:"product_id" gorm:"column:product_id"` Quantity int `json:"quantity" gorm:"column:quantity"` Price int64 `json:"price" gorm:"column:price"` ProductCost int64 `json:"product_cost" gorm:"column:product_cost"` SubTotal int64 `json:"sub_total" gorm:"column:sub_total"` }
func (*OrderedItem) ForeignKeys ¶
func (op *OrderedItem) ForeignKeys() []string
func (*OrderedItem) TableName ¶
func (op *OrderedItem) TableName() string
type OrderedItemAttribute ¶
type OrderedItemAttribute struct { OrderedItemID string `json:"ordered_item_id" gorm:"column:ordered_item_id;primary_key"` AttributeKey string `json:"attribute_key" gorm:"column:attribute_key;primary_key"` AttributeValue string `json:"attribute_value" gorm:"column:attribute_value"` }
func (*OrderedItemAttribute) ForeignKeys ¶
func (oia *OrderedItemAttribute) ForeignKeys() []string
func (*OrderedItemAttribute) TableName ¶
func (oia *OrderedItemAttribute) TableName() string
type OrderedItemDetails ¶
type OrderedItemView ¶
type OrderedItemView struct { ID string `json:"id"` OrderID string `json:"order_id"` ProductID string `json:"product_id"` Name string `json:"name"` Quantity int `json:"quantity"` Price int64 `json:"price"` ProductCost int64 `json:"product_cost"` SubTotal int64 `json:"sub_total"` Description string `json:"description"` SKU string `json:"sku"` AdditionalImages []string `json:"additional_images"` Image string `json:"image"` IsShippable bool `json:"is_shippable"` IsDigital bool `json:"is_digital"` Attributes []OrderItemAttributeKV `json:"attributes"` }
func (*OrderedItemView) CreateView ¶
func (oiv *OrderedItemView) CreateView(tx *gorm.DB) error
func (*OrderedItemView) TableName ¶
func (oiv *OrderedItemView) TableName() string
type OrderedItemViewExternal ¶
type OrderedItemViewExternal struct { ID string `json:"id"` OrderID string `json:"order_id"` ProductID string `json:"product_id"` Name string `json:"name"` Quantity int `json:"quantity"` Price int64 `json:"price"` SubTotal int64 `json:"sub_total"` Description string `json:"description"` SKU string `json:"sku"` AdditionalImages []string `json:"additional_images"` Image string `json:"image"` IsShippable bool `json:"is_shippable"` IsDigital bool `json:"is_digital"` Attributes []OrderItemAttributeKV `json:"attributes"` }
func (*OrderedItemViewExternal) TableName ¶
func (oive *OrderedItemViewExternal) TableName() string
type PaymentForLocation ¶
type PaymentForLocation struct { LocationID int64 `json:"location_id" gorm:"column:location_id;primary_key"` PaymentMethodID string `json:"payment_method_id" gorm:"column:payment_method_id;primary_key"` }
func (*PaymentForLocation) ForeignKeys ¶
func (m *PaymentForLocation) ForeignKeys() []string
func (*PaymentForLocation) TableName ¶
func (m *PaymentForLocation) TableName() string
type PaymentMethod ¶
type PaymentMethod struct { ID string `json:"id" sql:"id" gorm:"primary_key"` Name string `json:"name" sql:"name" gorm:"unique;not null"` ProcessingFee int64 `json:"processing_fee" gorm:"processing_fee"` MinProcessingFee int64 `json:"min_processing_fee" gorm:"min_processing_fee"` MaxProcessingFee int64 `json:"max_processing_fee" sql:"max_processing_fee"` IsPublished bool `json:"is_published" sql:"is_published" gorm:"index"` IsOfflinePayment bool `json:"is_offline_payment" sql:"is_offline_payment" gorm:"is_offline_payment"` IsFlat bool `json:"is_flat" gorm:"column:is_flat"` CreatedAt time.Time `json:"created_at" sql:"created_at" gorm:"not null;index"` UpdatedAt time.Time `json:"updated_at" sql:"updated_at" gorm:"not null"` }
func (*PaymentMethod) CalculateProcessingFee ¶
func (pm *PaymentMethod) CalculateProcessingFee(bill int64) int64
func (*PaymentMethod) TableName ¶
func (pm *PaymentMethod) TableName() string
type PaymentStatus ¶
type PaymentStatus string
func (PaymentStatus) IsValid ¶
func (ps PaymentStatus) IsValid() bool
type PayoutMethod ¶
type PayoutMethod struct { ID string `json:"id" gorm:"column:id;primary_key"` Name string `json:"name" gorm:"column:name;unique;not null"` Inputs string `json:"inputs" gorm:"column:inputs;not null"` IsPublished bool `json:"is_published" gorm:"column:is_published;index"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` }
func (*PayoutMethod) TableName ¶
func (pom *PayoutMethod) TableName() string
type PayoutSend ¶
type PayoutSend struct { ID string `json:"id" gorm:"column:id;primary_key"` StoreID string `json:"store_id" gorm:"column:store_id;index"` InitiatedByUserID string `json:"initiated_by_user_id" gorm:"column:initiated_by_user_id;index"` IsMarketplaceInitiated bool `json:"is_marketplace_initiated" gorm:"column:is_marketplace_initiated;index"` Status PayoutSendStatus `json:"status" gorm:"column:status;index"` Amount int64 `json:"amount" gorm:"column:amount;index"` FailureReason string `json:"failure_reason" gorm:"column:failure_reason"` Note string `json:"note" gorm:"column:note"` Highlights string `json:"highlights" gorm:"column:highlights"` PayoutMethodID string `json:"payout_method_id" gorm:"column:payout_method_id"` PayoutMethodDetails string `json:"payout_method_details" gorm:"column:payout_method_details"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` }
func (*PayoutSend) ForeignKeys ¶
func (pst *PayoutSend) ForeignKeys() []string
func (*PayoutSend) TableName ¶
func (pst *PayoutSend) TableName() string
type PayoutSendDetails ¶
type PayoutSendDetails struct { ID string `json:"id"` StoreID string `json:"store_id"` InitiatedByUserID string `json:"initiated_by_user_id"` IsMarketplaceInitiated bool `json:"is_marketplace_initiated"` Status PayoutSendStatus `json:"status"` Amount int64 `json:"amount"` FailureReason string `json:"failure_reason"` Note string `json:"note"` Highlights string `json:"highlights"` PayoutMethodID string `json:"payout_method_id"` PayoutMethodName string `json:"payout_method_name"` PayoutMethodInputs string `json:"payout_method_inputs"` PayoutMethodDetails string `json:"payout_method_details"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (*PayoutSendDetails) TableName ¶
func (psd *PayoutSendDetails) TableName() string
type PayoutSendStatus ¶
type PayoutSendStatus string
const ( PayoutSendStatusPending PayoutSendStatus = "payout_pending" PayoutSendStatusConfirmed PayoutSendStatus = "payout_confirmed" PayoutSendStatusProcessing PayoutSendStatus = "payout_processing" PayoutSendStatusFailed PayoutSendStatus = "payout_failed" PayoutSendStatusCompleted PayoutSendStatus = "payout_completed" )
func (PayoutSendStatus) IsValid ¶
func (pss PayoutSendStatus) IsValid() bool
type PayoutSettings ¶
type PayoutSettings struct { ID string `json:"id" gorm:"column:id;primary_key"` StoreID string `json:"store_id" gorm:"column:store_id;unique_index;not null"` CountryID int64 `json:"country_id" gorm:"column:country_id;not null"` AccountTypeID string `json:"account_type_id" gorm:"column:account_type_id;not null"` BusinessName string `json:"business_name" gorm:"column:business_name;not null"` BusinessAddressID string `json:"business_address_id" gorm:"column:business_address_id;not null"` VatNumber string `json:"vat_number" gorm:"column:vat_number"` PayoutMethodID string `json:"payout_method_id" gorm:"column:payout_method_id;not null"` PayoutMethodDetails string `json:"payout_method_details" gorm:"column:payout_method_details;not null"` PayoutMinimumThreshold int64 `json:"payout_minimum_threshold" gorm:"column:payout_minimum_threshold;not null"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index;not null"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` }
func (*PayoutSettings) ForeignKeys ¶
func (pos *PayoutSettings) ForeignKeys() []string
func (*PayoutSettings) TableName ¶
func (pos *PayoutSettings) TableName() string
type PayoutSettingsDetails ¶
type PayoutSettingsDetails struct { ID string `json:"id"` CountryID int64 `json:"country_id"` CountryName string `json:"country_name"` BusinessName string `json:"business_name"` PayoutMinimumThreshold int64 `json:"payout_minimum_threshold"` PayoutMethodDetails string `json:"payout_method_details"` VatNumber string `json:"vat_number"` PayoutMethodID string `json:"payout_method_id"` PayoutMethodName string `json:"payout_method_name"` PayoutMethodInputs string `json:"payout_method_inputs"` UpdatedAt time.Time `json:"updated_at"` CreatedAt time.Time `json:"created_at"` StoreID string `json:"store_id"` BusinessAddressID string `json:"business_address_id"` BusinessAddressAddress string `json:"business_address_address"` BusinessAddressCity string `json:"business_address_city"` BusinessAddressState string `json:"business_address_state"` BusinessAddressPostcode string `json:"business_address_postcode"` BusinessAccountTypeID string `json:"business_account_type_id"` BusinessAccountTypeName string `json:"business_account_type_name"` }
func (*PayoutSettingsDetails) TableName ¶
func (psd *PayoutSettingsDetails) TableName() string
type Permission ¶
type Permission string
type PlatformStatus ¶
type PlatformStatus string
const ( Active PlatformStatus = "active" Maintenance PlatformStatus = "maintenance" )
type Product ¶
type Product struct { ID string `json:"id" gorm:"column:id;unique"` Name string `json:"name" gorm:"column:name;primary_key"` Slug string `json:"slug" gorm:"column:slug;index"` Description string `json:"description" gorm:"column:description"` IsPublished bool `json:"is_published" gorm:"column:is_published;index"` StoreID string `json:"store_id" gorm:"column:store_id;primary_key"` CategoryID *string `json:"category_id,omitempty" gorm:"column:category_id;index"` SKU string `json:"sku" gorm:"column:sku;unique"` Stock int `json:"stock" gorm:"column:stock;index"` MaxQuantityCount int `json:"max_quantity_count" gorm:"column:max_quantity_count;not null;default:10"` Unit string `json:"unit" gorm:"column:unit"` Price int64 `json:"price" gorm:"column:price;index"` ProductCost int64 `json:"product_cost" gorm:"column:product_cost;index"` Image string `json:"image,omitempty" gorm:"column:image"` IsShippable bool `json:"is_shippable" gorm:"column:is_shippable;index"` IsDigital bool `json:"is_digital" gorm:"column:is_digital;index"` DigitalDownloadLink string `json:"-" gorm:"column:digital_download_link"` DownloadCounter int `json:"download_counter" gorm:"column:download_counter;default:0;index"` Views int `json:"views" gorm:"column:views;default:0;index"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;index"` }
func (*Product) ForeignKeys ¶
type ProductAttribute ¶
type ProductAttribute struct { ID string `json:"id" gorm:"column:id;unique_index;not null"` ProductID string `json:"-" gorm:"column:product_id;primary_key"` Key string `json:"key" gorm:"column:key;primary_key"` Value string `json:"value" gorm:"column:value;primary_key"` Image string `json:"image" gorm:"column:image"` }
func (*ProductAttribute) ForeignKeys ¶
func (pa *ProductAttribute) ForeignKeys() []string
func (*ProductAttribute) TableName ¶
func (pa *ProductAttribute) TableName() string
type ProductDetails ¶
type ProductDetails struct { ID string `json:"id"` Name string `json:"name"` StoreID string `json:"store_id"` StoreName string `json:"store_name"` Slug string `json:"slug"` Description string `json:"description"` IsPublished bool `json:"is_published"` CategoryID string `json:"category_id,omitempty"` CategoryName string `json:"category_name,omitempty"` Image string `json:"image,omitempty"` IsShippable bool `json:"is_shippable"` IsDigital bool `json:"is_digital"` Price int `json:"price"` MaxQuantityCount int `json:"max_quantity_count"` SKU string `json:"sku"` Stock int `json:"stock"` Unit string `json:"unit"` AdditionalImages []string `json:"additional_images"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Collections []Collection `json:"collections,omitempty"` Attributes map[string][]ProductKV `json:"attributes,omitempty"` }
type ProductDetailsInternal ¶
type ProductDetailsInternal struct { ID string `json:"id"` Name string `json:"name"` StoreID string `json:"store_id"` StoreName string `json:"store_name"` Slug string `json:"slug"` Description string `json:"description"` IsPublished bool `json:"is_published"` CategoryID string `json:"category_id,omitempty"` CategoryName string `json:"category_name,omitempty"` Image string `json:"image,omitempty"` IsShippable bool `json:"is_shippable"` IsDigital bool `json:"is_digital"` Price int `json:"price"` ProductCost int `json:"product_cost"` MaxQuantityCount int `json:"max_quantity_count"` SKU string `json:"sku"` Stock int `json:"stock"` Unit string `json:"unit"` AdditionalImages []string `json:"additional_images"` DigitalDownloadLink string `json:"digital_download_link"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Collections []Collection `json:"collections,omitempty"` Attributes map[string][]ProductKV `json:"attributes,omitempty"` }
type ProductImage ¶
type ProductImage struct { ProductID string `json:"product_id" gorm:"column:product_id;primary_key"` ImagePath string `json:"image_path" gorm:"column:image_path;primary_key"` }
func (*ProductImage) ForeignKeys ¶
func (pi *ProductImage) ForeignKeys() []string
func (*ProductImage) TableName ¶
func (pi *ProductImage) TableName() string
type ResCategorySearch ¶
type ResCategorySearchInternal ¶
type ResCategorySearchInternal struct { ID string `json:"id"` Name string `json:"name"` StoreID string `json:"store_id"` Description string `json:"description"` Image string `json:"image"` Count int64 `json:"count"` IsPublished bool `json:"is_published"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type Review ¶
type Review struct { ID string `json:"id" gorm:"column:id;primary_key"` OrderID string `json:"-" gorm:"column:order_id;index;unique"` Rating int `json:"rating" gorm:"column:rating;index"` Description string `json:"description" gorm:"column:description"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index"` }
func (*Review) ForeignKeys ¶
type Session ¶
type Session struct { ID string `json:"-" gorm:"column:id;primary_key"` UserID string `json:"-" gorm:"column:user_id;index;not null"` AccessToken string `json:"access_token" gorm:"column:access_token;unique;not null"` RefreshToken string `json:"refresh_token" gorm:"column:refresh_token;unique;not null"` CreatedAt time.Time `json:"-" gorm:"column:created_at;index;not null"` ExpireOn int64 `json:"expire_on" gorm:"column:expire_on;index;not null"` }
func (*Session) ForeignKeys ¶
type Settings ¶
type Settings struct { ID string `json:"id" gorm:"column:id;primary_key"` Name string `json:"name" gorm:"column:name;not null"` Website string `json:"website" gorm:"column:website;not null"` Status PlatformStatus `json:"status" gorm:"column:status;not null"` CompanyAddressID string `json:"company_address_id" gorm:"column:company_address_id;not null"` IsSignUpEnabled bool `json:"is_sign_up_enabled" gorm:"column:is_sign_up_enabled;not null"` IsStoreCreationEnabled bool `json:"is_store_creation_enabled" gorm:"column:is_store_creation_enabled;not null"` DefaultCommissionRate int64 `json:"default_commission_rate" gorm:"column:default_commission_rate;not null;default:0"` EnabledAutoStoreConfirmation bool `json:"enabled_auto_store_confirmation" gorm:"column:enabled_auto_store_confirmation"` TagLine string `json:"tag_line" gorm:"column:tag_line;not null"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;not null"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;not null"` }
func (*Settings) ForeignKeys ¶
type SettingsDetails ¶
type SettingsDetails struct { ID string `json:"id"` Name string `json:"name"` Website string `json:"website"` Status PlatformStatus `json:"status"` Address string `json:"address"` City string `json:"city"` Country string `json:"country"` Postcode string `json:"postcode"` Email string `json:"email"` Phone string `json:"phone"` IsSignUpEnabled bool `json:"is_sign_up_enabled"` IsStoreCreationEnabled bool `json:"is_store_creation_enabled"` EnabledAutoStoreConfirmation bool `json:"enabled_auto_store_confirmation"` DefaultCommissionRate int64 `json:"default_commission_rate"` TagLine string `json:"tag_line"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type ShippingForLocation ¶
type ShippingForLocation struct { LocationID int64 `json:"location_id" gorm:"column:location_id;primary_key"` ShippingMethodID string `json:"shipping_method_id" gorm:"column:shipping_method_id;primary_key"` }
func (*ShippingForLocation) ForeignKeys ¶
func (m *ShippingForLocation) ForeignKeys() []string
func (*ShippingForLocation) TableName ¶
func (m *ShippingForLocation) TableName() string
type ShippingMethod ¶
type ShippingMethod struct { ID string `json:"id" sql:"id" gorm:"primary_key"` Name string `json:"name" sql:"name" gorm:"unique;not null"` ApproximateDeliveryTime int `json:"approximate_delivery_time" gorm:"approximate_delivery_time" gorm:"index"` DeliveryCharge int64 `json:"delivery_charge" sql:"delivery_charge" gorm:"index"` WeightUnit WeightUnit `json:"weight_unit" sql:"weight_unit"` IsFlat bool `json:"is_flat" gorm:"column:is_flat"` IsPublished bool `json:"is_published" sql:"is_published" gorm:"index"` CreatedAt time.Time `json:"created_at" sql:"created_at" gorm:"not null;index"` UpdatedAt time.Time `json:"updated_at" sql:"updated_at" gorm:"not null"` }
func (*ShippingMethod) CalculateDeliveryCharge ¶
func (sm *ShippingMethod) CalculateDeliveryCharge(weight int) int64
func (*ShippingMethod) TableName ¶
func (sm *ShippingMethod) TableName() string
type Staff ¶
type Staff struct { UserID string `json:"user_id" gorm:"column:user_id;primary_key;unique"` StoreID string `json:"store_id" gorm:"column:store_id;primary_key"` PermissionID string `json:"permission_id" gorm:"column:permission_id;primary_key"` IsCreator bool `json:"is_creator" gorm:"column:is_creator;index"` }
func (*Staff) ForeignKeys ¶
type StaffProfile ¶
type StaffProfile struct { StoreID string `json:"store_id"` StaffID string `json:"staff_id"` StaffName string `json:"staff_name"` StaffEmail string `json:"staff_email"` StaffPhone string `json:"staff_phone"` StaffPicture string `json:"staff_picture"` StaffPermission Permission `json:"staff_permission"` StaffStatus UserStatus `json:"staff_status"` IsCreator bool `json:"is_creator"` StoreStatus StoreStatus `json:"store_status"` StoreName string `json:"store_name"` }
type StatusReport ¶
type Store ¶
type Store struct { ID string `json:"id" gorm:"column:id;primary_key"` Name string `json:"name" gorm:"column:name;unique;not null"` AddressID string `json:"address_id" gorm:"column:address_id;not null"` Status StoreStatus `json:"status" gorm:"column:status;index"` LogoImage string `json:"logo_image" gorm:"column:logo_image"` CoverImage string `json:"cover_image" gorm:"column:cover_image"` CommissionRate int64 `json:"commission_rate" gorm:"column:commission_rate;not null;default:0"` IsProductCreationEnabled bool `json:"is_product_creation_enabled" gorm:"column:is_product_creation_enabled;not null;index"` IsOrderCreationEnabled bool `json:"is_order_creation_enabled" gorm:"column:is_order_creation_enabled;not null;index"` IsAutoConfirmEnabled bool `json:"is_auto_confirm_enabled" json:"column:is_auto_confirm_enabled;not null;index"` Description string `json:"description" gorm:"column:description;not null"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index;not null"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;not null"` }
func (*Store) CalculateCommission ¶
func (*Store) ForeignKeys ¶
type StoreFinanceSummaryView ¶
type StoreFinanceSummaryView struct { StoreID string `json:"store_id"` TotalIncome int64 `json:"total_income"` TotalEarnings int64 `json:"total_earnings"` TotalCommission int64 `json:"total_commission"` }
func (*StoreFinanceSummaryView) CreateView ¶
func (sfs *StoreFinanceSummaryView) CreateView(tx *gorm.DB) error
func (*StoreFinanceSummaryView) DropView ¶
func (sfs *StoreFinanceSummaryView) DropView(tx *gorm.DB) error
func (*StoreFinanceSummaryView) TableName ¶
func (sfs *StoreFinanceSummaryView) TableName() string
type StorePayoutSummaryView ¶
type StorePayoutSummaryView struct { StoreID string `json:"store_id"` TotalEarnings int64 `json:"total_earnings"` TotalRequested int64 `json:"total_requested"` TotalPaid int64 `json:"total_paid"` TotalAvailable int64 `json:"total_available"` }
func (*StorePayoutSummaryView) CreateView ¶
func (sps *StorePayoutSummaryView) CreateView(tx *gorm.DB) error
func (*StorePayoutSummaryView) DropView ¶
func (sps *StorePayoutSummaryView) DropView(tx *gorm.DB) error
func (*StorePayoutSummaryView) TableName ¶
func (sps *StorePayoutSummaryView) TableName() string
type StorePermission ¶
type StorePermission struct { ID string `json:"id" gorm:"column:id;primary_key"` Permission Permission `json:"permission" gorm:"column:permission;index;not null"` }
func (*StorePermission) TableName ¶
func (up *StorePermission) TableName() string
type StoreStatus ¶
type StoreStatus string
const ( StoreRegistered StoreStatus = "registered" StoreActive StoreStatus = "active" StoreSuspended StoreStatus = "suspended" StoreBanned StoreStatus = "banned" )
func (*StoreStatus) IsValid ¶
func (s *StoreStatus) IsValid() bool
type StoreView ¶
type StoreView struct { ID string `json:"id"` Name string `json:"name"` Status StoreStatus `json:"status"` LogoImage string `json:"logo_image"` CoverImage string `json:"cover_image"` CommissionRate int64 `json:"commission_rate"` IsProductCreationEnabled bool `json:"is_product_creation_enabled"` IsOrderCreationEnabled bool `json:"is_order_creation_enabled"` IsAutoConfirmEnabled bool `json:"is_auto_confirm_enabled"` Description string `json:"description"` Address string `json:"address"` City string `json:"city"` Country string `json:"country"` Postcode string `json:"postcode"` Email string `json:"email"` Phone string `json:"phone"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type User ¶
type User struct { ID string `json:"id" gorm:"column:id;primary_key"` Name string `json:"name" gorm:"column:name;not null"` Email string `json:"email" gorm:"column:email;unique;not null"` ProfilePicture *string `json:"profile_picture,omitempty" gorm:"column:profile_picture"` Phone *string `json:"phone,omitempty" gorm:"column:phone;unique"` Password string `json:"-" gorm:"column:password;not null"` VerificationToken *string `json:"-" gorm:"column:verification_token;unique"` ResetPasswordToken *string `json:"-" gorm:"column:reset_password_token;index"` ResetPasswordTokenGeneratedAt *time.Time `json:"-" gorm:"column:reset_password_token_generated_at"` Status UserStatus `json:"status" gorm:"column:status;index;not null"` IsEmailVerified bool `json:"is_email_verified" gorm:"column:is_email_verified"` PermissionID string `json:"-" gorm:"column:permission_id;index;not null"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;index"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` }
func (*User) ForeignKeys ¶
type UserPermission ¶
type UserPermission struct { ID string `json:"id" gorm:"column:id;primary_key"` Permission Permission `json:"permission" gorm:"column:permission;index;not null"` }
func (*UserPermission) TableName ¶
func (up *UserPermission) TableName() string
type UserStatus ¶
type UserStatus string
func (UserStatus) IsValid ¶
func (us UserStatus) IsValid() bool
type WeightUnit ¶
type WeightUnit string
const ( Ounce WeightUnit = "ounce" Gram WeightUnit = "gram" )
func (WeightUnit) IsValid ¶
func (wu WeightUnit) IsValid() bool
Source Files ¶
- address.go
- address_view.go
- business_account_type.go
- category.go
- collection.go
- collection_of_products.go
- coupon.go
- coupon_for.go
- coupon_usage.go
- customer.go
- location.go
- log.go
- order.go
- order_details.go
- order_details_view.go
- order_details_view_external.go
- order_log.go
- ordered_item.go
- ordered_item_attributes.go
- ordered_item_view.go
- ordered_item_view_external.go
- payment_for_location.go
- payment_method.go
- payout_method.go
- payout_send.go
- payout_settings.go
- product.go
- product_attribute.go
- product_details.go
- product_image.go
- review.go
- session.go
- settings.go
- settings_details.go
- shipping_for_location.go
- shipping_method.go
- status_report.go
- store.go
- store_finance_summary_view.go
- store_payout_summary_view.go
- store_view.go
- summary.go
- user.go
Click to show internal directories.
Click to hide internal directories.