NAM-APJATEL-BACKEND/model/dto/res/device_details.go

61 lines
2.8 KiB
Go

package res
import (
"time"
"users_management/m/model/entity"
"github.com/google/uuid"
)
type DeviceDetailsResponse struct {
ID uuid.UUID `json:"id"`
DeviceCode string `json:"device_code"`
DeviceType string `json:"device_type"`
Address string `json:"address"`
Longitude float64 `json:"longitude"`
Latitude float64 `json:"latitude"`
Status string `json:"status"`
PortAmount int `json:"port_amount"`
PortUsed int `json:"port_used"`
PortAvailable int `json:"port_available"`
CustomerNames []string `json:"customer_names"` // Just customer names
PortAssignments []PortAssignmentResponse `json:"port_assignments"` // Port details with customers
Region *string `json:"region,omitempty"`
Province *string `json:"province,omitempty"`
City *string `json:"city,omitempty"`
District *string `json:"district,omitempty"`
ImageURL *string `json:"image_url,omitempty"`
ImageURLs []string `json:"image_urls"`
TowerID *uuid.UUID `json:"tower_id,omitempty"` // Add TowerID
OLT *OLTInfo `json:"olt"` // Add OLT name
// Connection details
Backbones []BackboneConnectionInfo `json:"backbones"`
Fishbones []FishboneConnectionInfo `json:"fishbones"`
Towers []TowerConnectionDetail `json:"towers"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type OLTInfo struct {
OLTID uuid.UUID `json:"id"`
OLTName string `json:"name"`
}
type TowerConnectionDetail struct {
ID uuid.UUID `json:"id"`
TowerCode string `json:"tower_code"`
Distance float64 `json:"distance_km"` // Distance from tower to device
ExternalTower *bool `json:"external_tower"` // Indicates if this is an external tower
ImageURL *string `json:"image_url,omitempty"`
ImageURLs []string `json:"image_urls"` // Store multiple images as JSONB
}
type PortAssignmentResponse struct {
PortNumber int `json:"port_number"`
CustomerName *string `json:"customer_name"`
IsOccupied bool `json:"is_occupied"`
Status entity.PortStatus `json:"status"` // Add status field
Bandwidth *string `json:"bandwidth"` // Add bandwidth field
}