192 lines
7.0 KiB
Go
Raw Normal View History

2023-10-08 15:59:42 +07:00
package response
import (
"furtuna-be/internal/constants/order"
"furtuna-be/internal/constants/transaction"
2024-06-04 02:59:31 +07:00
"time"
2023-10-08 15:59:42 +07:00
)
type Order struct {
ID int64 `json:"id" `
BranchID int64 `json:"branch_id" `
BranchName string `json:"branch_name" `
Amount float64 `json:"amount" `
Status order.OrderStatus `json:"status" `
CustomerName string `json:"customer_name" `
CustomerPhone string `json:"customer_phone" `
Pax int `json:"pax" `
PaymentMethod transaction.PaymentMethod `json:"payment_method" `
OrderItem []OrderItem `json:"order_items" `
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type OrderAmount struct {
Amount float64 `json:"amount"`
}
2024-07-26 11:37:22 +07:00
type HistoryOrder struct {
2024-08-13 23:09:05 +07:00
ID int64 `json:"id"`
Employee string `json:"employee"`
Site string `json:"site"`
Timestamp string `json:"timestamp"`
BookingTime string `json:"booking_time"`
Tickets []string `json:"tickets"`
PaymentType string `json:"payment_type"`
Status string `json:"status"`
Amount float64 `json:"amount"`
VisitDate string `json:"visit_date"`
TicketStatus string `json:"ticket_status"`
Source string `json:"source"`
2024-07-26 11:37:22 +07:00
}
2023-10-08 15:59:42 +07:00
type OrderItem struct {
OrderItemID int64 `json:"order_item_id" `
ItemID int64 `json:"item_id" `
ItemType order.ItemType `json:"item_type" `
ItemName string `json:"item_name" `
Price float64 `json:"price" `
Qty int64 `json:"qty" `
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type OrderList struct {
Orders []Order `json:"orders"`
Total int64 `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
2024-07-26 11:37:22 +07:00
type HistoryOrderList struct {
Orders []HistoryOrder `json:"history_orders"`
Total int64 `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
type TicketSold struct {
Count int64 `json:"count"`
}
2023-10-08 15:59:42 +07:00
type OrderMonthlyRevenue struct {
TotalRevenue float64 `json:"total_revenue"`
TotalTransaction int64 `json:"total_transaction"`
}
type OrderBranchRevenue struct {
BranchID string `json:"branch_id"`
BranchName string `json:"name"`
BranchLocation string `json:"location"`
TotalTransaction int `json:"total_trans"`
TotalAmount float64 `json:"total_amount"`
}
2024-06-04 02:59:31 +07:00
type CreateOrderResponse struct {
ID int64 `json:"id"`
2024-08-21 22:56:53 +07:00
SiteName string `json:"site_name"`
VisitDate string `json:"visit_date"`
2024-06-04 02:59:31 +07:00
RefID string `json:"ref_id"`
PartnerID int64 `json:"partner_id"`
Status string `json:"status"`
Amount float64 `json:"amount"`
2024-08-09 10:02:05 +07:00
Total float64 `json:"total"`
Fee float64 `json:"fee"`
2024-06-04 02:59:31 +07:00
PaymentType string `json:"payment_type"`
CreatedAt time.Time `json:"created_at"`
OrderItems []CreateOrderItemResponse `json:"order_items"`
Token string `json:"token"`
}
2024-08-21 15:48:50 +07:00
type PrintDetailResponse struct {
ID int64 `json:"id"`
2024-08-21 15:51:40 +07:00
Logo string `json:"logo"`
2024-08-21 15:48:50 +07:00
OrderID string `json:"order_id"`
PartnerName string `json:"partner_name"`
Total float64 `json:"total"`
Fee float64 `json:"fee"`
PaymentType string `json:"payment_type"`
Source string `json:"source"`
VisitDateAt string `json:"visit_date_at"`
VisitTime string `json:"visit_time"`
OrderItems []CreateOrderItemResponse `json:"order_items"`
CasheerName string `json:"casheer_name"`
}
2024-06-04 02:59:31 +07:00
type ExecuteOrderResponse struct {
ID int64 `json:"id"`
RefID string `json:"ref_id"`
PartnerID int64 `json:"partner_id"`
Status string `json:"status"`
Amount float64 `json:"amount"`
PaymentType string `json:"payment_type"`
CreatedAt time.Time `json:"created_at"`
OrderItems []CreateOrderItemResponse `json:"order_items"`
PaymentToken string `json:"payment_token"`
RedirectURL string `json:"redirect_url"`
2024-08-06 16:21:55 +07:00
QRcode string `json:"qr_code"`
2024-06-04 02:59:31 +07:00
}
2024-08-13 23:09:05 +07:00
type ExecuteCheckinResponse struct {
ID int64 `json:"id"`
RefID string `json:"ref_id"`
PartnerID int64 `json:"partner_id"`
Status string `json:"status"`
Amount float64 `json:"amount"`
PaymentType string `json:"payment_type"`
CreatedAt time.Time `json:"created_at"`
OrderItems []CreateOrderItemResponse `json:"order_items"`
PaymentToken string `json:"payment_token"`
RedirectURL string `json:"redirect_url"`
QRcode string `json:"qr_code"`
}
type CheckingInquiryResponse struct {
Token string `json:"token"`
}
2024-06-04 02:59:31 +07:00
type CreateOrderItemResponse struct {
ID int64 `json:"id"`
ItemID int64 `json:"item_id"`
Quantity int64 `json:"quantity"`
Price float64 `json:"price"`
2024-06-05 00:24:53 +07:00
Name string `json:"name"`
2024-06-04 02:59:31 +07:00
}
2024-08-02 02:27:57 +07:00
type ProductDailySales struct {
2024-08-02 14:41:41 +07:00
Day time.Time `json:"day"`
SiteID int64 `json:"site_id"`
SiteName string `json:"site_name"`
PaymentType string `json:"payment_type"`
Total float64 `json:"total"`
2024-08-02 02:27:57 +07:00
}
type PaymentDistribution struct {
PaymentType string `json:"payment_type"`
Count int `json:"count"`
}
2024-08-04 01:14:59 +07:00
type OrderDetail struct {
2024-08-19 18:26:57 +07:00
ID int64 `json:"id"`
QRCode string `json:"qr_code"`
2024-08-21 22:27:05 +07:00
SiteName string `json:"site_name"`
2024-08-19 18:26:57 +07:00
FullName string `json:"full_name"`
Email string `json:"email"`
PhoneNumber string `json:"phone_number"`
OrderItems []OrderDetailItem `json:"order_items"`
TotalAmount float64 `json:"total_amount"`
CreatedAt time.Time `json:"created_at"`
Status string `json:"status"`
PaymentLink string `json:"payment_link"`
PaymentToken string `json:"payment_token"`
2024-08-22 01:32:24 +07:00
Fee float64 `json:"fee"`
2024-08-04 01:14:59 +07:00
}
type OrderDetailItem struct {
ItemType string `json:"item_type"`
Description string `json:"description"`
Quantity int `json:"quantity"` // Quantity of the item
UnitPrice float64 `json:"unit_price"` // Price per unit
TotalPrice float64 `json:"total_price"` // Total price for this item (Quantity * UnitPrice)
}