Merge pull request 'addinng olt' (#35) from feature/responses-v2 into dev
Reviewed-on: winter-access/backend_nam#35
This commit is contained in:
commit
4a908890d8
|
|
@ -27,6 +27,8 @@ type DeviceDetailsResponse struct {
|
||||||
ImageURL *string `json:"image_url,omitempty"`
|
ImageURL *string `json:"image_url,omitempty"`
|
||||||
ImageURLs []string `json:"image_urls"`
|
ImageURLs []string `json:"image_urls"`
|
||||||
TowerID *uuid.UUID `json:"tower_id,omitempty"` // Add TowerID
|
TowerID *uuid.UUID `json:"tower_id,omitempty"` // Add TowerID
|
||||||
|
OLTID *uuid.UUID `json:"olt_id"` // Add OLTID
|
||||||
|
OLTName *string `json:"olt_name"` // Add OLT name
|
||||||
|
|
||||||
// Connection details
|
// Connection details
|
||||||
Backbones []BackboneConnectionInfo `json:"backbones"`
|
Backbones []BackboneConnectionInfo `json:"backbones"`
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,12 @@ func ConvertToDeviceDetailsResponse(device entity.DeviceDetails, geocoder servic
|
||||||
allImageURLs = []string{} // Return empty array instead of nil
|
allImageURLs = []string{} // Return empty array instead of nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle OLT information
|
||||||
|
var oltName *string
|
||||||
|
if device.OLT != nil && device.OLT.OLTName != "" {
|
||||||
|
oltName = &device.OLT.OLTName
|
||||||
|
}
|
||||||
|
|
||||||
response := res.DeviceDetailsResponse{
|
response := res.DeviceDetailsResponse{
|
||||||
ID: device.ID,
|
ID: device.ID,
|
||||||
DeviceCode: device.DeviceCode,
|
DeviceCode: device.DeviceCode,
|
||||||
|
|
@ -220,6 +226,8 @@ func ConvertToDeviceDetailsResponse(device entity.DeviceDetails, geocoder servic
|
||||||
ImageURLs: allImageURLs,
|
ImageURLs: allImageURLs,
|
||||||
TowerID: device.TowerID, // Keep TowerID for reference
|
TowerID: device.TowerID, // Keep TowerID for reference
|
||||||
// Remove AssignedTower field - now everything is in Towers
|
// Remove AssignedTower field - now everything is in Towers
|
||||||
|
OLTID: device.OLTID, // Add OLTID
|
||||||
|
OLTName: oltName, // Add OLT name
|
||||||
Backbones: backboneInfos,
|
Backbones: backboneInfos,
|
||||||
Fishbones: fishboneInfos,
|
Fishbones: fishboneInfos,
|
||||||
Towers: towerInfos, // All towers combined here
|
Towers: towerInfos, // All towers combined here
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue