164 lines
7.5 KiB
Go
164 lines
7.5 KiB
Go
package req
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// Cable Connection Search DTO
|
|
type CableConnectionSearchDTO struct {
|
|
// Pagination
|
|
Page int `json:"page" validate:"min=1"`
|
|
PerPage int `json:"per_page" validate:"min=1,max=100"`
|
|
|
|
// Filtering
|
|
CableType *string `json:"cable_type,omitempty"`
|
|
Status *string `json:"status,omitempty"`
|
|
DeviceID *uuid.UUID `json:"device_id,omitempty"`
|
|
FromDeviceID *uuid.UUID `json:"from_device_id,omitempty"`
|
|
ToDeviceID *uuid.UUID `json:"to_device_id,omitempty"`
|
|
MinLength *float64 `json:"min_length,omitempty" validate:"omitempty,min=0"`
|
|
MaxLength *float64 `json:"max_length,omitempty" validate:"omitempty,min=0"`
|
|
BranchingType *string `json:"branching_type,omitempty"`
|
|
InstallationDateFrom *time.Time `json:"installation_date_from,omitempty"`
|
|
InstallationDateTo *time.Time `json:"installation_date_to,omitempty"`
|
|
|
|
// Sorting
|
|
SortBy *string `json:"sort_by,omitempty" validate:"omitempty,oneof=cable_length installation_date created_at"`
|
|
SortDirection *string `json:"sort_direction,omitempty" validate:"omitempty,oneof=asc desc"`
|
|
|
|
// Geographic filtering
|
|
Region *string `json:"region,omitempty"`
|
|
Province *string `json:"province,omitempty"`
|
|
City *string `json:"city,omitempty"`
|
|
}
|
|
|
|
// Create Cable Connection DTO
|
|
type CreateCableConnectionDTO struct {
|
|
FromDeviceID uuid.UUID `json:"from_device_id" validate:"required"`
|
|
ToDeviceID uuid.UUID `json:"to_device_id" validate:"required"`
|
|
CableLength float64 `json:"cable_length" validate:"required,min=0.1"`
|
|
CableType string `json:"cable_type" validate:"required,oneof=PTP_SFP_BLD PTP_SFP_DUPLEX BB_MONEV fiber_optic drop_cable"`
|
|
BranchingType *string `json:"branching_type,omitempty"`
|
|
InstallationDate *time.Time `json:"installation_date,omitempty"`
|
|
Status string `json:"status" validate:"required,oneof=active inactive maintenance planned"`
|
|
Notes *string `json:"notes,omitempty"`
|
|
}
|
|
|
|
// Update Cable Connection DTO
|
|
type UpdateCableConnectionDTO struct {
|
|
FromDeviceID *uuid.UUID `json:"from_device_id,omitempty"`
|
|
ToDeviceID *uuid.UUID `json:"to_device_id,omitempty"`
|
|
CableLength *float64 `json:"cable_length,omitempty" validate:"omitempty,min=0.1"`
|
|
CableType *string `json:"cable_type,omitempty" validate:"omitempty,oneof=PTP_SFP_BLD PTP_SFP_DUPLEX BB_MONEV fiber_optic drop_cable"`
|
|
BranchingType *string `json:"branching_type,omitempty"`
|
|
InstallationDate *time.Time `json:"installation_date,omitempty"`
|
|
Status *string `json:"status,omitempty" validate:"omitempty,oneof=active inactive maintenance planned"`
|
|
Notes *string `json:"notes,omitempty"`
|
|
}
|
|
|
|
// Optimal Route Request DTO
|
|
type OptimalRouteRequestDTO struct {
|
|
FromDeviceID uuid.UUID `json:"from_device_id" validate:"required"`
|
|
ToDeviceID uuid.UUID `json:"to_device_id" validate:"required"`
|
|
CableType *string `json:"cable_type,omitempty"`
|
|
MaxHops *int `json:"max_hops,omitempty" validate:"omitempty,min=1,max=10"`
|
|
Constraints *RouteConstraintsDTO `json:"constraints,omitempty"`
|
|
}
|
|
|
|
type RouteConstraintsDTO struct {
|
|
MaxLength *float64 `json:"max_length,omitempty" validate:"omitempty,min=0"`
|
|
PreferredTypes []string `json:"preferred_types,omitempty"`
|
|
AvoidDevices []uuid.UUID `json:"avoid_devices,omitempty"`
|
|
RequireActiveOnly bool `json:"require_active_only"`
|
|
}
|
|
|
|
// Update Cable Status DTO
|
|
type UpdateCableStatusDTO struct {
|
|
Status string `json:"status" validate:"required,oneof=active inactive maintenance planned"`
|
|
Notes *string `json:"notes,omitempty"`
|
|
Reason *string `json:"reason,omitempty"`
|
|
}
|
|
|
|
// Trace Cable Path DTO
|
|
type TraceCablePathDTO struct {
|
|
FromDeviceID uuid.UUID `json:"from_device_id" validate:"required"`
|
|
ToDeviceID uuid.UUID `json:"to_device_id" validate:"required"`
|
|
MaxHops int `json:"max_hops" validate:"min=1,max=15"`
|
|
PathType *string `json:"path_type,omitempty" validate:"omitempty,oneof=shortest fastest most_reliable"`
|
|
}
|
|
|
|
// Cable Analysis DTO
|
|
type CableAnalysisRequestDTO struct {
|
|
ConnectionID *uuid.UUID `json:"connection_id,omitempty"`
|
|
FromDeviceID uuid.UUID `json:"from_device_id" validate:"required"`
|
|
ToDeviceID uuid.UUID `json:"to_device_id" validate:"required"`
|
|
AnalysisType string `json:"analysis_type" validate:"required,oneof=signal_quality route_optimization cost_analysis"`
|
|
IncludeAlternatives bool `json:"include_alternatives"`
|
|
}
|
|
|
|
// Bulk Operations DTO
|
|
type BulkCreateCableConnectionDTO struct {
|
|
Connections []CreateCableConnectionDTO `json:"connections" validate:"required,min=1,max=100"`
|
|
}
|
|
|
|
type BulkUpdateCableConnectionDTO struct {
|
|
ConnectionIDs []uuid.UUID `json:"connection_ids" validate:"required,min=1"`
|
|
Updates UpdateCableConnectionDTO `json:"updates" validate:"required"`
|
|
}
|
|
|
|
type BulkDeleteCableConnectionDTO struct {
|
|
ConnectionIDs []uuid.UUID `json:"connection_ids" validate:"required,min=1,max=100"`
|
|
}
|
|
|
|
// Cable Maintenance DTO
|
|
type ScheduleMaintenanceDTO struct {
|
|
ConnectionID uuid.UUID `json:"connection_id" validate:"required"`
|
|
MaintenanceType string `json:"maintenance_type" validate:"required,oneof=inspection repair replacement upgrade"`
|
|
ScheduledDate time.Time `json:"scheduled_date" validate:"required"`
|
|
TechnicianID *uuid.UUID `json:"technician_id,omitempty"`
|
|
Priority string `json:"priority" validate:"required,oneof=low medium high critical"`
|
|
Description *string `json:"description,omitempty"`
|
|
EstimatedDuration *int `json:"estimated_duration,omitempty" validate:"omitempty,min=1"` // in hours
|
|
}
|
|
|
|
// Network Analysis DTO
|
|
type NetworkAnalysisRequestDTO struct {
|
|
DeviceType *string `json:"device_type,omitempty"`
|
|
CableType *string `json:"cable_type,omitempty"`
|
|
Region *string `json:"region,omitempty"`
|
|
AnalysisDepth int `json:"analysis_depth" validate:"min=1,max=5"`
|
|
IncludeMetrics bool `json:"include_metrics"`
|
|
IncludeBottlenecks bool `json:"include_bottlenecks"`
|
|
}
|
|
|
|
// Cable Import DTO
|
|
type ImportCableConnectionDTO struct {
|
|
FromDeviceCode string `json:"from_device_code" validate:"required"`
|
|
ToDeviceCode string `json:"to_device_code" validate:"required"`
|
|
CableLength float64 `json:"cable_length" validate:"required,min=0.1"`
|
|
CableType string `json:"cable_type" validate:"required"`
|
|
BranchingType *string `json:"branching_type,omitempty"`
|
|
InstallationDate *time.Time `json:"installation_date,omitempty"`
|
|
Status string `json:"status" validate:"required"`
|
|
Notes *string `json:"notes,omitempty"`
|
|
}
|
|
|
|
type BulkImportCableConnectionDTO struct {
|
|
Connections []ImportCableConnectionDTO `json:"connections" validate:"required,min=1,max=1000"`
|
|
SkipErrors bool `json:"skip_errors"`
|
|
DryRun bool `json:"dry_run"`
|
|
}
|
|
|
|
// Validation and Quality Check DTO
|
|
type ValidateCableConnectionDTO struct {
|
|
ConnectionID *uuid.UUID `json:"connection_id,omitempty"`
|
|
FromDeviceID uuid.UUID `json:"from_device_id" validate:"required"`
|
|
ToDeviceID uuid.UUID `json:"to_device_id" validate:"required"`
|
|
CableLength float64 `json:"cable_length" validate:"required,min=0.1"`
|
|
CheckDistance bool `json:"check_distance"`
|
|
CheckCompatibility bool `json:"check_compatibility"`
|
|
CheckCapacity bool `json:"check_capacity"`
|
|
}
|