Documentation ¶
Index ¶
- type APIResponse
- type CartItem
- type Category
- type CategoryRequest
- type CreateOrderRequest
- type DeliveryAddress
- type District
- type Invoice
- type Items
- type LoginRequest
- type LoginResponse
- type Order
- type OrderItem
- type Paging
- type Product
- type ProductRequest
- type Province
- type ReadAllProductResponse
- type ReadProductRequest
- type Regency
- type RegisterRequest
- type RegisterResponse
- type ResponseError
- type Tag
- type UpdateCartItemRequest
- type User
- type Village
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type CartItem ¶
type CartItem struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"` Name string `bson:"name" json:"name"` Qty int64 `bson:"quantity" json:"qty"` Price float64 `bson:"price" json:"price"` ImageURL string `bson:"image_url" json:"image_url"` UserID primitive.ObjectID `bson:"user" json:"user"` ProductID primitive.ObjectID `bson:"product" json:"product"` }
type Category ¶
type Category struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"` Name string `bson:"name" json:"name"` CreatedAt time.Time `bson:"created_at" json:"created_at"` UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` }
func (*Category) BeforeSave ¶
type CategoryRequest ¶
type CategoryRequest struct {
Name string `bson:"name" json:"name" validate:"required,min=3,max=20"`
}
type CreateOrderRequest ¶
type DeliveryAddress ¶
type DeliveryAddress struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"` Name string `bson:"name" json:"name"` Village string `bson:"village" json:"village"` District string `bson:"district" json:"district"` Regency string `bson:"regency" json:"regency"` Province string `bson:"province" json:"province"` Detail string `bson:"detail" json:"detail"` CreatedAt time.Time `bson:"created_at" json:"created_at"` UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` }
func (*DeliveryAddress) BeforeSave ¶
func (da *DeliveryAddress) BeforeSave() DeliveryAddress
type District ¶
type District struct { Code string `json:"code" csv:"kode"` Name string `json:"name" csv:"nama"` RegencyCode string `csv:"kode_kabupaten"` }
Kecamatan
type Invoice ¶
type Invoice struct { Subtotal int64 `bson:"subtotal" json:"subtotal"` DeliveryFee int64 `bson:"delivery_fee" json:"delivery_fee"` DeliveryAddress DeliveryAddress `bson:"delivery_address" json:"delivery_address"` Total int64 `bson:"total" json:"total"` PaymentStatus string `bson:"payment_status" json:"payment_status"` User User `bson:"user" json:"user"` OrderID primitive.ObjectID `bson:"order_id" json:"order_id"` }
type LoginRequest ¶
type LoginResponse ¶
type Order ¶
type Order struct { ID primitive.ObjectID `bson:"_id" json:"_id"` OrderNumber int64 `bson:"order_number" json:"order_number"` Status string `bson:"status" json:"status"` DeliveryFee int64 `bson:"delivery_fee" json:"delivery_fee"` DeliveryAddress DeliveryAddress `bson:"delivery_address" json:"delivery_address"` OrderItems []OrderItem `bson:"order_item" json:"order_item"` UserID primitive.ObjectID `bson:"user_id" json:"user_id"` }
type OrderItem ¶
type OrderItem struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"` Name string `bson:"name" json:"name"` Price int64 `bson:"price" json:"price"` Qty int64 `bson:"quantity" json:"qty"` ProductID primitive.ObjectID `bson:"product_id" json:"product_id"` OrderID primitive.ObjectID `bson:"order_id" json:"order_id"` }
type Product ¶
type Product struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"` Name string `bson:"name" json:"name" validate:"required,min=3,max=45"` Description string `bson:"description" json:"description" validate:"required"` Price float32 `bson:"price" json:"price"` ImageURL string `bson:"image_url" json:"image_url"` CreatedAt time.Time `bson:"created_at" json:"created_at"` UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` Category Category `bson:"-" json:"category"` Tags []Tag `bson:"-" json:"tags"` }
func (*Product) BeforeSave ¶
type ProductRequest ¶
type ProductRequest struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"` Name string `bson:"name" json:"name" validate:"required,min=3,max=45"` Description string `bson:"description" json:"description" validate:"required"` Price float32 `bson:"price" json:"price"` ImageURL string `bson:"image_url" json:"image_url"` CategoryID string `bson:"category_id" json:"category_id"` Tags []string `bson:"tags" json:"-"` }
type ReadAllProductResponse ¶
type ReadProductRequest ¶
type Regency ¶
type Regency struct { Code string `json:"code" csv:"kode"` Name string `json:"name" csv:"nama"` ProvinceCode string `json:"province_code" csv:"kode_provinsi"` }
Kabupaten
type RegisterRequest ¶
type RegisterResponse ¶
type RegisterResponse struct { }
type ResponseError ¶
type ResponseError struct {
Message string `json:"errors"`
}
type UpdateCartItemRequest ¶
type UpdateCartItemRequest struct {
Items []Items `json:"items"`
}
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id"` FullName string `bson:"full_name" json:"full_name" validate:"required,min=3,max=45"` CustomerID int64 `bson:"-" json:"customer_id"` Email string `bson:"email" json:"email" validate:"required,email"` Password string `bson:"password" json:"password" validate:"required"` Role string `bson:"role" json:"role" validate:"eq=user|eq=admin"` Token string `bson:"token" json:"token"` CreatedAt time.Time `bson:"created_at" json:"created_at"` UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` }
func (*User) BeforeSave ¶
Click to show internal directories.
Click to hide internal directories.