Skip to content

Commit

Permalink
Menambahkan Field Tersisa di struct Tiket
Browse files Browse the repository at this point in the history
  • Loading branch information
RavitaNRL committed Nov 30, 2023
1 parent 7779f39 commit 605a14d
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions entity/tiket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
}
Expand Down

0 comments on commit 605a14d

Please sign in to comment.