response

package
v0.0.0-...-7d8e645 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResoposeMap map[string]string

Functions

func ErrorResponse

func ErrorResponse(ctx *gin.Context, statusCode int, message string, err error, data interface{})

func SuccessResponse

func SuccessResponse(ctx *gin.Context, statusCode int, message string, data ...interface{})

Types

type Address

type Address struct {
	ID          uint   `json:"address_id"`
	Name        string `json:"name"`
	PhoneNumber string `json:"phone_number"`
	House       string `json:"house"`
	Area        string `json:"area"`
	LandMark    string `json:"land_mark"`
	City        string `json:"city"`
	Pincode     uint   `json:"pincode"`
	CountryID   uint   `json:"country_id"`
	CountryName string `json:"country_name"`

	IsDefault *bool `json:"is_default"`
}

address

type AdminLogin

type AdminLogin struct {
	ID       uint   `json:"id" `
	UserName string `json:"user_name"`
	Email    string `json:"email"`
}

admin

type Cart

type Cart struct {
	CartItems       []CartItem
	AppliedCouponID uint `json:"applied_coupon_id"`
	TotalPrice      uint `json:"total_price"`
	DiscountAmount  uint `json:"discount_amount"`
}

type CartItem

type CartItem struct {
	ProductItemId uint   `json:"product_item_id"`
	ProductName   string `json:"product_name"`
	Price         uint   `json:"price"`
	DiscountPrice uint   `json:"discount_price"`
	QtyInStock    uint   `json:"qty_in_stock"`
	Qty           uint   `json:"qty"`
	SubTotal      uint   `json:"sub_total"`
}

type Category

type Category struct {
	ID          uint          `json:"category_id"`
	Name        string        `json:"category_name"`
	SubCategory []SubCategory `json:"sub_category" gorm:"-"`
}

for a specific category representation

type CheckOut

type CheckOut struct {
	Addresses    []Address  `json:"addresses"`
	ProductItems []CartItem `json:"product_items"`
	TotalPrice   uint       `json:"total_price"`
}

checkout

type EmailAndPhone

type EmailAndPhone struct {
	Email string `json:"email"`
	Phone string `json:"phone"`
}

type OTPResponse

type OTPResponse struct {
	OtpID string `json:"otp_id"`
}

type OfferCategory

type OfferCategory struct {
	OfferCategoryID uint   `json:"offer_category_id"`
	CategoryID      uint   `json:"category_id"`
	CategoryName    string `json:"category_name"`
	DiscountRate    uint   `json:"discount_rate"`
	OfferID         uint   `json:"offer_id"`
	OfferName       string `json:"offer_name"`
}

offer response

type OfferProduct

type OfferProduct struct {
	OfferProductID uint   `json:"offer_product_id"`
	ProductID      uint   `json:"product_id"`
	ProductName    string `json:"product_name"`
	DiscountRate   uint   `json:"discount_rate"`
	OfferID        uint   `json:"offer_id"`
	OfferName      string `json:"offer_name"`
}

type OrderItem

type OrderItem struct {
	ProductItemID uint   `json:"product_item_id"`
	ProductName   string `json:"product_name"`
	Image         string `json:""`
	Price         uint   `json:"price"`
	Qty           uint   `json:"qty"`
	SubTotal      uint   `json:"sub_total"`
	OrderDate     string `json:"order_date" `
	Status        string `json:"status"`
}

type OrderPayment

type OrderPayment struct {
	PaymentType  domain.PaymentType `json:"payment_type"`
	PaymentOrder any                `json:"payment_order"`
}

type OrderReturn

type OrderReturn struct {
	OrderReturnID uint      `json:"order_return_id" copier:"ID"`
	ShopOrderID   uint      `json:"shop_order_id"`
	RequestDate   time.Time `json:"request_date" `
	ReturnReason  string    `json:"return_reason" `
	RefundAmount  uint      `json:"refund_amount" `

	OrderStatusID uint      `json:"order_status_id"`
	OrderStatus   string    `json:"order_status"`
	IsApproved    bool      `json:"is_approved" `
	ReturnDate    time.Time `json:"return_date"`
	ApprovalDate  time.Time `json:"approval_date"`
	AdminComment  string    `json:"admin_comment"`
}

return

type PlaceOrder

type PlaceOrder struct {
	UserID          uint   `json:"user_id"`
	PaymentMethodID uint   `json:"payment_method_id"`
	PaymentType     string `json:"payment_type"`
	AmountToPay     uint   `json:"amount_to_pay"`
	Discount        uint   `json:"discount"`
	CouponCode      string `json:"coupon_code" `
	AddressID       uint   `json:"address_id"`
}

type Product

type Product struct {
	ID               uint      `json:"product_id"`
	CategoryID       uint      `json:"category_id"`
	Price            uint      `json:"price"`
	DiscountPrice    uint      `json:"discount_price"`
	Name             string    `json:"product_name"`
	Description      string    `json:"description" `
	CategoryName     string    `json:"category_name"`
	MainCategoryName string    `json:"main_category_name"`
	BrandID          uint      `json:"brand_id"`
	BrandName        string    `json:"brand_name"`
	Image            string    `json:"image"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
}

response for product

type ProductItems

type ProductItems struct {
	ID               uint                    `json:"product_item_id"`
	Name             string                  `json:"product_name"`
	ProductID        uint                    `json:"product_id"`
	Price            uint                    `json:"price"`
	DiscountPrice    uint                    `json:"discount_price"`
	SKU              string                  `json:"sku"`
	QtyInStock       uint                    `json:"qty_in_stock"`
	CategoryName     string                  `json:"category_name"`
	MainCategoryName string                  `json:"main_category_name"`
	BrandID          uint                    `json:"brand_id"`
	BrandName        string                  `json:"brand_name"`
	VariationValues  []ProductVariationValue `json:"variation_values" gorm:"-"`
	Images           []string                `json:"images" gorm:"-"`
}

for response a specific products all product items

type ProductVariationValue

type ProductVariationValue struct {
	VariationID       uint   `json:"variation_id"`
	Name              string `json:"variation_name"`
	VariationOptionID uint   `json:"variation_option_id"`
	Value             string `json:"variation_value"`
}

type RazorpayOrder

type RazorpayOrder struct {
	RazorpayKey     string      `json:"razorpay_key"`
	UserID          uint        `json:"user_id"`
	AmountToPay     uint        `json:"amount_to_pay"`
	RazorpayAmount  uint        `json:"razorpay_amount"`
	RazorpayOrderID interface{} `json:"razorpay_order_id"`
	Email           string      `json:"email"`
	Phone           string      `json:"phone"`

	ShopOrderID uint `json:"shop_order_id"`
}

razorpay

type Response

type Response struct {
	Status  bool        `json:"success"`
	Message string      `json:"message"`
	Error   interface{} `json:"error,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

type SalesReport

type SalesReport struct {
	UserID          uint      `json:"user_id"`
	FirstName       string    `json:"first_name"`
	Email           string    `json:"email"`
	ShopOrderID     uint      `json:"order_id"`
	OrderDate       time.Time `json:"order_date"`
	OrderTotalPrice uint      `json:"order_total_price"`
	Discount        uint      `json:"discount_price"`
	OrderStatus     string    `json:"order_status"`
	PaymentType     string    `json:"payment_type"`
}

type ShopOrder

type ShopOrder struct {
	UserID            uint      `json:"user_id"`
	ShopOrderID       uint      `json:"shop_order_id"`
	OrderDate         time.Time `json:"order_date"`
	AddressID         uint      `json:"address_id" `
	Address           Address   `json:"address"`
	OrderTotalPrice   uint      `json:"order_total_price" `
	Discount          uint      `json:"discount"`
	OrderStatusID     uint      `json:"order_status_id"`
	OrderStatus       string    `json:"order_status"`
	PaymentMethodID   uint      `json:"payment_method_id" gorm:"primaryKey;not null"`
	PaymentMethodName string    `json:"payment_method_name" gorm:"unique;not null"`
}

type Stock

type Stock struct {
	ProductItemID    uint              `json:"product_item_id"`
	ProductName      string            `json:"product_name"`
	Price            uint              `json:"price"`
	SKU              string            `json:"sku"`
	QtyInStock       uint              `json:"qty_in_stock"`
	VariationOptions []VariationOption `gorm:"-"`
}

type StripeOrder

type StripeOrder struct {
	ClientSecret   string `json:"client_secret"`
	PublishableKey string `json:"publishable_key"`
	AmountToPay    uint   `json:"amount_to_pay"`
	ShopOrderID    uint   `json:"shop_order_id"`
}

type SubCategory

type SubCategory struct {
	ID   uint   `json:"category_id"`
	Name string `json:"category_name"`
}

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

type User

type User struct {
	ID          uint      `json:"id" copier:"must"`
	GoogleImage string    `json:"google_profile_image"`
	FirstName   string    `json:"first_name" copier:"must"`
	LastName    string    `json:"last_name" copier:"must"`
	Age         uint      `json:"age" copier:"must"`
	Email       string    `json:"email" copier:"must"`
	UserName    string    `json:"user_name" copire:"must"`
	Phone       string    `json:"phone" copier:"must"`
	Verified    bool      `json:"verified"`
	BlockStatus bool      `json:"block_status" copier:"must"`
	CreatedAt   time.Time `json:"created_at" gorm:"not null"`
	UpdatedAt   time.Time `json:"updated_at"`
}

user details response

type UserCoupon

type UserCoupon struct {
	CouponID   uint   `json:"coupon_id"`
	CouponCode string `json:"coupon_code" `
	CouponName string `json:"coupon_name"`

	ExpireDate       time.Time `json:"expire_date"`
	Description      string    `json:"description"`
	DiscountRate     uint      `json:"discount_rate"`
	MinimumCartPrice uint      `json:"minimum_cart_price"`
	Image            string    `json:"image" binding:"required"`
	BlockStatus      bool      `json:"block_status"`

	Used   bool      `json:"used"`
	UsedAt time.Time `json:"used_at"`
}

type UserOrder

type UserOrder struct {
	OrderTotal  uint
	ShopOrderID uint
}

type Variation

type Variation struct {
	ID               uint              `json:"variation_id"`
	Name             string            `json:"variation_name"`
	VariationOptions []VariationOption `gorm:"-"`
}

for a specific variation representation

type VariationOption

type VariationOption struct {
	ID    uint   `json:"variation_option_id"`
	Value string `json:"variation_value"`
}

for a specific variation Value representation

type WishListItem

type WishListItem struct {
	ID              uint                    `json:"wish_list_id"`
	ProductItemID   uint                    `json:"product_item_id"`
	Name            string                  `json:"product_name"`
	ProductID       uint                    `json:"product_id"`
	Price           uint                    `json:"price"`
	DiscountPrice   uint                    `json:"discount_price"`
	SKU             string                  `json:"sku"`
	QtyInStock      uint                    `json:"qty_in_stock"`
	VariationValues []ProductVariationValue `gorm:"-"`
}

wish list response

Jump to

Keyboard shortcuts

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