diff options
Diffstat (limited to 'internal/listing')
| -rw-r--r-- | internal/listing/listing.go | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/internal/listing/listing.go b/internal/listing/listing.go index de769cc..773da66 100644 --- a/internal/listing/listing.go +++ b/internal/listing/listing.go @@ -7,43 +7,44 @@ import ( "codeberg.org/mihna123/openstore/internal/user" ) -type location struct { +type Location struct { city string street string premise string } -type status int +type Status int const ( - draft status = iota - published - closed + DraftStatus Status = iota + PublishedStatus + ClosedStatus ) -var statusName = map[status]string{ - draft: "draft", - published: "published", - closed: "closed", +var statusName = map[Status]string{ + DraftStatus: "draft", + PublishedStatus: "published", + ClosedStatus: "closed", } -func (s status) String() string { +func (s Status) String() string { return statusName[s] } type Listing struct { id int title string + slug string description string images []string price float64 currency string category []string - location location - status status + location Location + status Status views int createdAt time.Time author *user.User isExternal bool - origin url.URL + origin *url.URL } |
