diff options
| author | mihna123 <mihailonvojinovic@gmail.com> | 2026-08-23 17:45:41 +0200 |
|---|---|---|
| committer | mihna123 <mihailonvojinovic@gmail.com> | 2026-08-23 17:45:41 +0200 |
| commit | a24690f2bee8314cc4c08c26b1709478893e7938 (patch) | |
| tree | c65a2fbc270cc0b5f22cdc28427da1fd8de198da /internal/listing/listing.go | |
| parent | a6ae2d9b9cb4f823d677beab11bd3d8610541f01 (diff) | |
| download | openstore-a24690f2bee8314cc4c08c26b1709478893e7938.tar.gz openstore-a24690f2bee8314cc4c08c26b1709478893e7938.zip | |
listing: add slug prop to struct and export some more props and constants
Diffstat (limited to 'internal/listing/listing.go')
| -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 } |
