From a0b640f008029761b6f2cd13188620f95b0a0838 Mon Sep 17 00:00:00 2001 From: Salaton Date: Wed, 1 Nov 2023 17:14:38 +0300 Subject: [PATCH] chore: add distance field to facility response This will return the proximity distance to a facility whenever coordinates are provided. The facilities will also be ordered by the distance from the user --- output.go | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/output.go b/output.go index 2dc71f2..d353ef2 100644 --- a/output.go +++ b/output.go @@ -43,20 +43,21 @@ type IdentifiersOutput struct { // FacilityOutput is used to display facility(ies) type FacilityOutput struct { - ID string `json:"id"` - Created time.Time `json:"created"` - Name string `json:"name"` - Description string `json:"description"` - FacilityType string `json:"facility_type"` - County string `json:"county"` - Country string `json:"country"` - Coordinates CoordinatesOutput `json:"coordinates"` - Status string `json:"status"` - Address string `json:"address"` - Contacts []ContactsOutput `json:"contacts"` - Identifiers []IdentifiersOutput `json:"identifiers"` - BusinessHours []BusinessHoursOutput `json:"businesshours"` - Services []FacilityService `json:"services"` + ID string `json:"id,omitempty"` + Created time.Time `json:"created,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + FacilityType string `json:"facility_type,omitempty"` + County string `json:"county,omitempty"` + Country string `json:"country,omitempty"` + Coordinates CoordinatesOutput `json:"coordinates,omitempty"` + Distance string `json:"distance,omitempty"` + Status string `json:"status,omitempty"` + Address string `json:"address,omitempty"` + Contacts []ContactsOutput `json:"contacts,omitempty"` + Identifiers []IdentifiersOutput `json:"identifiers,omitempty"` + BusinessHours []BusinessHoursOutput `json:"businesshours,omitempty"` + Services []FacilityService `json:"services,omitempty"` } // BusinessHoursOutput models data that show facility's operational hours