66 lines
3.0 KiB
Go
66 lines
3.0 KiB
Go
package req
|
|
|
|
import (
|
|
"users_management/m/model/entity"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type DeviceDetailsDTO struct {
|
|
DeviceCode string `json:"device_code" validate:"required"`
|
|
DeviceType string `json:"device_type" validate:"required,oneof=OTB ODP"`
|
|
Longitude float64 `json:"longitude" validate:"required"`
|
|
Latitude float64 `json:"latitude" validate:"required"`
|
|
PortAmount int `json:"port_amount" validate:"required,min=1,max=100"`
|
|
Status string `json:"status" validate:"required,oneof=active inactive maintenance"`
|
|
Region *string `json:"region,omitempty" validate:"omitempty,min=3"`
|
|
Province *string `json:"province,omitempty" validate:"omitempty,min=3"`
|
|
City *string `json:"city,omitempty" validate:"omitempty,min=3"`
|
|
District *string `json:"district,omitempty" validate:"omitempty,min=3"`
|
|
TowerID *uuid.UUID `json:"tower_id,omitempty"`
|
|
OLTID *uuid.UUID `json:"olt_id,omitempty"`
|
|
}
|
|
|
|
type UpdateDeviceDetailsDTO struct {
|
|
DeviceCode *string `json:"device_code,omitempty" validate:"omitempty,min=3"`
|
|
DeviceType *string `json:"device_type,omitempty" validate:"omitempty,oneof=OTB ODP CLOSURE"`
|
|
Longitude *float64 `json:"longitude,omitempty" validate:"omitempty,longitude"`
|
|
Latitude *float64 `json:"latitude,omitempty" validate:"omitempty,latitude"`
|
|
PortAmount *int `json:"port_amount,omitempty" validate:"omitempty,min=0,max=100"`
|
|
Status *string `json:"status,omitempty" validate:"omitempty,oneof=active inactive maintenance"`
|
|
Region *string `json:"region,omitempty" validate:"omitempty,min=3"`
|
|
Province *string `json:"province,omitempty" validate:"omitempty,min=3"`
|
|
City *string `json:"city,omitempty" validate:"omitempty,min=3"`
|
|
District *string `json:"district,omitempty" validate:"omitempty,min=3"`
|
|
TowerID *uuid.UUID `json:"tower_id,omitempty"`
|
|
OLTID *uuid.UUID `json:"olt_id,omitempty"`
|
|
}
|
|
|
|
type AssignMultipleCustomersDTO struct {
|
|
CustomerName string `json:"customer_name" binding:"required"`
|
|
PortNumber *int `json:"port_number,omitempty"`
|
|
IsOccupied *bool `json:"is_occupied,omitempty"`
|
|
Status *entity.PortStatus `json:"status,omitempty"` // Add status field
|
|
Bandwidth *string `json:"bandwidth,omitempty"` // Add bandwidth field
|
|
}
|
|
|
|
type UpdateCustomerByPortDTO struct {
|
|
PortNumber int `json:"port_number,omitempty"`
|
|
NewCustomerName *string `json:"new_customer_name,omitempty"`
|
|
IsOccupied *bool `json:"is_occupied,omitempty"`
|
|
Status *entity.PortStatus `json:"status,omitempty"` // Add status field
|
|
Bandwidth *string `json:"bandwidth,omitempty"` // Add bandwidth field
|
|
}
|
|
|
|
type BulkUpdateCustomersByPortDTO struct {
|
|
Updates []UpdateCustomerByPortDTO `json:"updates" binding:"required"`
|
|
}
|
|
|
|
type RemoveCustomerByPortDTO struct {
|
|
PortNumber int `json:"port_number" binding:"required,min=1"`
|
|
}
|
|
|
|
type DeleteImageDTO struct {
|
|
Filename string `json:"filename" validate:"required"`
|
|
}
|