Update backend

This commit is contained in:
aditya.siregar
2024-08-18 12:39:23 +07:00
parent 6a8541faa0
commit c41485041c
7 changed files with 114 additions and 20 deletions
+4 -1
View File
@@ -109,6 +109,7 @@ type OrderExecuteRequest struct {
func (o *Order) SetExecutePaymentStatus() {
if o.PaymentType == "CASH" {
o.Status = "PAID"
o.TicketStatus = "USED"
return
}
o.Status = "PENDING"
@@ -184,7 +185,9 @@ func (e *HistoryOrderDB) ToHistoryOrder() *HistoryOrder {
func (b *HistoryOrderList) ToHistoryOrderList() []*HistoryOrder {
var HistoryOrders []*HistoryOrder
for _, historyOrder := range *b {
HistoryOrders = append(HistoryOrders, historyOrder.ToHistoryOrder())
if historyOrder.Status != "NEW" && historyOrder.Tickets != nil {
HistoryOrders = append(HistoryOrders, historyOrder.ToHistoryOrder())
}
}
return HistoryOrders
}