model

package
v0.0.0-...-8f6881d Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Code    int32       `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type CreateTransactionRequest

type CreateTransactionRequest struct {
	ProductID int64 `json:"product_id" validate:"required"`
	User      User
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
}

type Product

type Product struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Price       float32   `json:"price"`
	Stock       int64     `json:"stock"`
	ImageURL    string    `json:"image_url"`
	StartDate   string    `json:"start_date"`
	EndDate     string    `json:"end_date"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type ProductRequest

type ProductRequest struct {
	ID          string  `json:"_id"`
	Name        string  `json:"name" validate:"required,min=3,max=45"`
	Description string  `json:"description" validate:"required"`
	Price       float32 `json:"price"`
	Stock       int64   `json:"stock"`
	ImageURL    string  `json:"image_url"`
	StartDate   string  `json:"start_date"`
	EndDate     string  `json:"end_date"`
}

type ResponseError

type ResponseError struct {
	Message string `json:"errors"`
}

type Transaction

type Transaction struct {
	ID         int64     `json:"id"`
	ProductID  int64     `json:"product_id"`
	UserID     int64     `json:"user_id"`
	Amount     float32   `json:"amount"`
	Status     string    `json:"status"`
	PaymentURL string    `json:"payment_url"`
	CreatedAt  time.Time `json:"created_at"`
	UpdatedAt  time.Time `json:"updated_at"`
}

type UpdateTransactionRequest

type UpdateTransactionRequest struct {
	TransactionStatus string `json:"transaction_status"`
	OrderID           string `json:"order_id"`
	PaymentType       string `json:"payment_type"`
	FraudStatus       string `json:"fraud_status"`
}

type User

type User struct {
	ID        int64
	Username  string
	Password  string
	Email     string
	Phone     string
	Address   string
	Roles     string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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