adding update fileds for olt on usecase
This commit is contained in:
parent
1374bfa4bf
commit
1f87bccbf4
|
|
@ -555,6 +555,21 @@ func (u *deviceDetailsUseCase) UpdateDeviceDetails(id uuid.UUID, deviceDTO req.U
|
||||||
updates["tower_id"] = *deviceDTO.TowerID
|
updates["tower_id"] = *deviceDTO.TowerID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if deviceDTO.OLTID != nil {
|
||||||
|
// Validate OLT exists
|
||||||
|
oltExists, err := u.ValidateOLTExists(*deviceDTO.OLTID)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to validate OLT: %w", err)
|
||||||
|
}
|
||||||
|
if !oltExists {
|
||||||
|
return fmt.Errorf("OLT with ID %s not found", deviceDTO.OLTID.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
updates["olt_id"] = *deviceDTO.OLTID
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("Updating device %s with fields: %+v", id, updates)
|
||||||
|
|
||||||
if len(updates) == 0 {
|
if len(updates) == 0 {
|
||||||
return errors.New("no fields to update")
|
return errors.New("no fields to update")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue