2024-12-20 16:52:48 +07:00

198 lines
7.4 KiB
Go

package response
import (
"furtuna-be/internal/constants/order"
"furtuna-be/internal/constants/transaction"
"time"
)
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"`
}
type HistoryOrder struct {
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"`
}
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"`
}
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"`
}
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"`
}
type CreateOrderResponse struct {
ID int64 `json:"id"`
SiteName string `json:"site_name"`
VisitDate string `json:"visit_date"`
RefID string `json:"ref_id"`
PartnerID int64 `json:"partner_id"`
Status string `json:"status"`
Amount float64 `json:"amount"`
Total float64 `json:"total"`
Fee float64 `json:"fee"`
PaymentType string `json:"payment_type"`
CreatedAt time.Time `json:"created_at"`
OrderItems []CreateOrderItemResponse `json:"order_items"`
Token string `json:"token"`
BankCode string `json:"bank_code"`
BankName string `json:"bank_name"`
}
type PrintDetailResponse struct {
ID int64 `json:"id"`
Logo string `json:"logo"`
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"`
}
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"`
QRcode string `json:"qr_code"`
VirtualAccount string `json:"virtual_account"`
BankName string `json:"bank_name"`
BankCode string `json:"bank_code"`
}
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"`
}
type CreateOrderItemResponse struct {
ID int64 `json:"id"`
ItemID int64 `json:"item_id"`
Quantity int64 `json:"quantity"`
Price float64 `json:"price"`
Name string `json:"name"`
}
type ProductDailySales struct {
Day time.Time `json:"day"`
SiteID int64 `json:"site_id"`
SiteName string `json:"site_name"`
PaymentType string `json:"payment_type"`
Total float64 `json:"total"`
}
type PaymentDistribution struct {
PaymentType string `json:"payment_type"`
Count int `json:"count"`
}
type OrderDetail struct {
ID int64 `json:"id"`
QRCode string `json:"qr_code"`
SiteName string `json:"site_name"`
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"`
Fee float64 `json:"fee"`
}
type OrderDetailItem struct {
Name string `json:"name"`
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)
}