This commit is contained in:
aditya.siregar 2024-08-21 15:51:40 +07:00
parent 0ebeb73f76
commit 90ef6b910b
4 changed files with 4 additions and 1 deletions

View File

@ -227,6 +227,7 @@ type PaymentTypeDistribution struct {
type OrderPrintDetail struct {
ID int64 `gorm:"column:id"`
Logo string `gorm:"logo"`
PartnerName string `gorm:"column:partner_name"`
OrderID string `gorm:"column:order_id"`
VisitDate time.Time `gorm:"column:visit_date"`

View File

@ -466,5 +466,6 @@ func MapOrderToPrintDetailResponse(order *entity.OrderPrintDetail, casherName st
OrderItems: orderItems,
CasheerName: casherName,
PartnerName: order.PartnerName,
Logo: order.Logo,
}
}

View File

@ -98,6 +98,7 @@ type CreateOrderResponse struct {
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"`

View File

@ -69,7 +69,7 @@ func (r *OrderRepository) FindPrintDetailByID(ctx context.Context, id int64) (*e
err := r.db.WithContext(ctx).
Table("orders").
Select("orders.id, partners.name as partner_name, orders.ref_id as order_id, "+
Select("orders.id, partners.name as partner_name, partners.logo as logo, orders.ref_id as order_id, "+
"orders.visit_date, orders.payment_type, orders.source, "+
"orders.ticket_status, orders.total, orders.fee").
Joins("JOIN partners ON partners.id = orders.partner_id").