From 605a14d886addd87499d992bb951397c77212c02 Mon Sep 17 00:00:00 2001 From: ravitasmii <115474684+RavitaNRL@users.noreply.github.com> Date: Thu, 30 Nov 2023 21:22:00 +0700 Subject: [PATCH] Menambahkan Field Tersisa di struct Tiket --- entity/tiket.go | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/entity/tiket.go b/entity/tiket.go index e8b3f7e..29c06fe 100644 --- a/entity/tiket.go +++ b/entity/tiket.go @@ -5,23 +5,23 @@ import ( ) type Ticket struct { - ID int64 `json:"id"` - Image string `json:"image"` - Location string `json:"location"` - Date string // Format: YYYY-MM-DD - Title string `json:"title"` - Description string `json:"description"` - Price int64 `json:"price"` - Status string `json:"Status"` // e.g., 'available', 'sold out' - Quota int64 `json:"Quota"` - Category string `json:"category"` - Tersisa int64 `json:"Tersisa"` // e.g., 1000, 5000, 10000 - CreatedAt time.Time `json:"-"` - UpdatedAt time.Time `json:"-"` - DeletedAt time.Time `json:"-"` + ID int64 `json:"id"` + Image string `json:"image"` + Location string `json:"location"` + Date string // Format: YYYY-MM-DD + Title string `json:"title"` + Description string `json:"description"` + Price int64 `json:"price"` + Status string `json:"Status"` // e.g., 'available', 'sold out' + Quota int64 `json:"Quota"` + Category string `json:"category"` + Tersisa int64 `json:"Tersisa"` // e.g., 1000, 5000, 10000 + CreatedAt time.Time `json:"-"` + UpdatedAt time.Time `json:"-"` + DeletedAt time.Time `json:"-"` } -func NewTicket(image, location, date, title, description, category string, price, quota, tersisa int64) *Ticket { +func NewTicket(image, location, date, title, description, category, status string, price, quota, tersisa int64) *Ticket { return &Ticket{ Image: image, Location: location, @@ -30,6 +30,7 @@ func NewTicket(image, location, date, title, description, category string, price Description: description, Category: category, Price: price, + Status: status, Quota: quota, Tersisa: tersisa, }