diff --git a/config/db.go b/config/db.go index 30fa693..53214c3 100644 --- a/config/db.go +++ b/config/db.go @@ -20,7 +20,7 @@ type Database struct { } func (c Database) DSN() string { - return fmt.Sprintf("host=%s port=%s dbname=%s user=%s password=%s sslmode=%s", c.Host, c.Port, c.DB, c.Username, c.Password, c.SslMode) + return fmt.Sprintf("host=%s port=%s dbname=%s user=%s password=%s sslmode=%s TimeZone=UTC", c.Host, c.Port, c.DB, c.Username, c.Password, c.SslMode) } func (c Database) ConnectionMaxLifetime() time.Duration { diff --git a/internal/handlers/http/order/order.go b/internal/handlers/http/order/order.go index 309184f..aebf8e5 100644 --- a/internal/handlers/http/order/order.go +++ b/internal/handlers/http/order/order.go @@ -276,13 +276,13 @@ func (h *Handler) toHistoryOrderResponse(resp *entity.HistoryOrder) response.His ID: resp.ID, Employee: resp.Employee, Site: resp.Site, - Timestamp: resp.Timestamp.Format(time.RFC3339), - BookingTime: resp.BookingTime.Format(time.RFC3339), + Timestamp: resp.Timestamp.Format("2006-01-02 15:04:05"), + BookingTime: resp.BookingTime.Format("2006-01-02 15:04:05"), Tickets: resp.Tickets, PaymentType: resp.PaymentType, Status: resp.Status, Amount: resp.Amount, - VisitDate: resp.VisitDate.Format(time.RFC3339), + VisitDate: resp.VisitDate.Format("2006-01-02"), TicketStatus: resp.TicketStatus, Source: resp.Source, } diff --git a/internal/handlers/http/transaction/transaction.go b/internal/handlers/http/transaction/transaction.go index 5b70f4f..57cf086 100644 --- a/internal/handlers/http/transaction/transaction.go +++ b/internal/handlers/http/transaction/transaction.go @@ -101,7 +101,7 @@ func (h *TransactionHandler) ToTransactionListResponse(transactions []*entity.Tr ID: transaction.ID, TransactionType: transaction.TransactionType, Status: transaction.Status, - CreatedAt: transaction.CreatedAt, + CreatedAt: transaction.CreatedAt.Format("2006-01-02 15:04:05"), SiteName: transaction.SiteName, Amount: transaction.Amount, PartnerName: transaction.PartnerName, diff --git a/internal/handlers/response/transaction.go b/internal/handlers/response/transaction.go index c6d67c5..d66baea 100644 --- a/internal/handlers/response/transaction.go +++ b/internal/handlers/response/transaction.go @@ -1,17 +1,15 @@ package response -import "time" - type TransactionListItem struct { - ID string `json:"id"` - TransactionType string `json:"transaction_type"` - Status string `json:"status"` - CreatedAt time.Time `json:"created_at"` - SiteName string `json:"site_name"` - Amount int64 `json:"amount"` - PartnerName string `json:"partner_name"` - Total int64 `json:"total"` - Fee int64 `json:"fee"` + ID string `json:"id"` + TransactionType string `json:"transaction_type"` + Status string `json:"status"` + CreatedAt string `json:"created_at"` + SiteName string `json:"site_name"` + Amount int64 `json:"amount"` + PartnerName string `json:"partner_name"` + Total int64 `json:"total"` + Fee int64 `json:"fee"` } type TransactionListResponse struct {