Add Checkin
This commit is contained in:
+55
-43
@@ -5,23 +5,25 @@ import (
|
||||
)
|
||||
|
||||
type Order struct {
|
||||
ID int64 `gorm:"primaryKey;autoIncrement;column:id"`
|
||||
RefID string `gorm:"type:varchar;column:ref_id"`
|
||||
PartnerID int64 `gorm:"type:int;column:partner_id"`
|
||||
Status string `gorm:"type:varchar;column:status"`
|
||||
Amount float64 `gorm:"type:numeric;not null;column:amount"`
|
||||
Total float64 `gorm:"type:numeric;not null;column:total"`
|
||||
Fee float64 `gorm:"type:numeric;not null;column:fee"`
|
||||
SiteID *int64 `gorm:"type:numeric;not null;column:site_id"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime;column:created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime;column:updated_at"`
|
||||
CreatedBy int64 `gorm:"type:int;column:created_by"`
|
||||
PaymentType string `gorm:"type:varchar;column:payment_type"`
|
||||
UpdatedBy int64 `gorm:"type:int;column:updated_by"`
|
||||
OrderItems []OrderItem `gorm:"foreignKey:OrderID;constraint:OnDelete:CASCADE;"`
|
||||
Payment Payment `gorm:"foreignKey:OrderID;constraint:OnDelete:CASCADE;"`
|
||||
User User `gorm:"foreignKey:CreatedBy;constraint:OnDelete:CASCADE;"`
|
||||
Source string `gorm:"type:varchar;column:source"`
|
||||
ID int64 `gorm:"primaryKey;autoIncrement;column:id"`
|
||||
RefID string `gorm:"type:varchar;column:ref_id"`
|
||||
PartnerID int64 `gorm:"type:int;column:partner_id"`
|
||||
Status string `gorm:"type:varchar;column:status"`
|
||||
Amount float64 `gorm:"type:numeric;not null;column:amount"`
|
||||
Total float64 `gorm:"type:numeric;not null;column:total"`
|
||||
Fee float64 `gorm:"type:numeric;not null;column:fee"`
|
||||
SiteID *int64 `gorm:"type:numeric;not null;column:site_id"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime;column:created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime;column:updated_at"`
|
||||
CreatedBy int64 `gorm:"type:int;column:created_by"`
|
||||
PaymentType string `gorm:"type:varchar;column:payment_type"`
|
||||
UpdatedBy int64 `gorm:"type:int;column:updated_by"`
|
||||
OrderItems []OrderItem `gorm:"foreignKey:OrderID;constraint:OnDelete:CASCADE;"`
|
||||
Payment Payment `gorm:"foreignKey:OrderID;constraint:OnDelete:CASCADE;"`
|
||||
User User `gorm:"foreignKey:CreatedBy;constraint:OnDelete:CASCADE;"`
|
||||
Source string `gorm:"type:varchar;column:source"`
|
||||
TicketStatus string `gorm:"type:varchar;column:ticket_status"`
|
||||
VisitDate time.Time `gorm:"type:date;column:visit_date"`
|
||||
}
|
||||
|
||||
type OrderDB struct {
|
||||
@@ -45,6 +47,16 @@ type OrderResponse struct {
|
||||
Token string
|
||||
}
|
||||
|
||||
type CheckinResponse struct {
|
||||
Order *Order
|
||||
Token string
|
||||
}
|
||||
|
||||
type CheckinExecute struct {
|
||||
Order *Order
|
||||
Token string
|
||||
}
|
||||
|
||||
type ExecuteOrderResponse struct {
|
||||
Order *Order
|
||||
QRCode string
|
||||
@@ -107,19 +119,19 @@ type CallbackRequest struct {
|
||||
}
|
||||
|
||||
type HistoryOrder struct {
|
||||
ID int64 `gorm:"primaryKey;autoIncrement;column:id"`
|
||||
Employee string `gorm:"type:varchar;column:employee"`
|
||||
Site string `gorm:"type:varchar;column:site"`
|
||||
Timestamp time.Time `gorm:"autoCreateTime;column:timestamp"`
|
||||
BookingTime time.Time `gorm:"autoCreateTime;column:booking_time"`
|
||||
Tickets []string `gorm:"-"`
|
||||
RawTickets string `gorm:"type:text;column:tickets"`
|
||||
PaymentType string `gorm:"type:varchar;column:payment_type"`
|
||||
Status string `gorm:"type:varchar;column:status"`
|
||||
Amount float64 `gorm:"type:numeric;column:amount"`
|
||||
VisitDate time.Time `gorm:"type:date;column:visit_date"`
|
||||
TicketStatus string `gorm:"type:varchar;column:ticket_status"`
|
||||
Source string `gorm:"type:numeric;column:source"`
|
||||
ID int64 `gorm:"primaryKey;autoIncrement;column:id"`
|
||||
Employee string `gorm:"type:varchar;column:employee"`
|
||||
Site string `gorm:"type:varchar;column:site"`
|
||||
Timestamp time.Time `gorm:"autoCreateTime;column:timestamp"`
|
||||
BookingTime time.Time `gorm:"autoCreateTime;column:booking_time"`
|
||||
Tickets []string `gorm:"-"`
|
||||
RawTickets string `gorm:"type:text;column:tickets"`
|
||||
PaymentType string `gorm:"type:varchar;column:payment_type"`
|
||||
Status string `gorm:"type:varchar;column:status"`
|
||||
Amount float64 `gorm:"type:numeric;column:amount"`
|
||||
VisitDate time.Time `gorm:"type:date;column:visit_date"`
|
||||
TicketStatus string `gorm:"type:varchar;column:ticket_status"`
|
||||
Source string `gorm:"type:numeric;column:source"`
|
||||
}
|
||||
|
||||
type HistoryOrderDB struct {
|
||||
@@ -139,7 +151,7 @@ type OrderSearch struct {
|
||||
EndDate string
|
||||
Period string
|
||||
IsCustomer bool
|
||||
Source string
|
||||
Source string
|
||||
}
|
||||
|
||||
type HistoryOrderList []*HistoryOrderDB
|
||||
@@ -152,19 +164,19 @@ func (b *HistoryOrder) ToHistoryOrderDB() *HistoryOrderDB {
|
||||
|
||||
func (e *HistoryOrderDB) ToHistoryOrder() *HistoryOrder {
|
||||
return &HistoryOrder{
|
||||
ID: e.ID,
|
||||
Employee: e.Employee,
|
||||
Site: e.Site,
|
||||
Timestamp: e.Timestamp,
|
||||
BookingTime: e.BookingTime,
|
||||
Tickets: e.Tickets,
|
||||
RawTickets: e.RawTickets,
|
||||
PaymentType: e.PaymentType,
|
||||
Status: e.Status,
|
||||
Amount: e.Amount,
|
||||
VisitDate: e.VisitDate,
|
||||
ID: e.ID,
|
||||
Employee: e.Employee,
|
||||
Site: e.Site,
|
||||
Timestamp: e.Timestamp,
|
||||
BookingTime: e.BookingTime,
|
||||
Tickets: e.Tickets,
|
||||
RawTickets: e.RawTickets,
|
||||
PaymentType: e.PaymentType,
|
||||
Status: e.Status,
|
||||
Amount: e.Amount,
|
||||
VisitDate: e.VisitDate,
|
||||
TicketStatus: e.TicketStatus,
|
||||
Source: e.Source,
|
||||
Source: e.Source,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ type Product struct {
|
||||
DeletedAt *time.Time `gorm:"column:deleted_at"`
|
||||
CreatedBy int64 `gorm:"type:int;column:created_by"`
|
||||
UpdatedBy int64 `gorm:"type:int;column:updated_by"`
|
||||
Region string `gorm:"type:varchar;column:region"`
|
||||
Regency string `gorm:"type:varchar;column:regency"`
|
||||
}
|
||||
|
||||
func (Product) TableName() string {
|
||||
|
||||
@@ -29,6 +29,8 @@ type Site struct {
|
||||
Longitude *float64 `json:"longitude"`
|
||||
Region string `json:"region"`
|
||||
Regency string `json:"regency"`
|
||||
Lat float64 `json:"lat"`
|
||||
Long float64 `json:"long"`
|
||||
Distance float64 `gorm:"-"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user