feat(features): edición de elementos + catálogo de tipos de elemento
- Migración: tabla feature_types + columnas feature_type_id (FK) e is_active en features. Modelo FeatureType; Feature gana featureType() + casts is_active. - Catálogo de tipos (FeatureTypeManager, ruta /feature-types): CRUD con modal (nombre, descripción, color), contador de usos; gateado por edit layers. - Editor de elementos del proyecto (FeatureManager, ruta projects.features): tabla Rappasoft ProjectFeaturesTable (filtros nombre/capa/tipo en cabecera), toggle activo/inactivo y borrado individual; modal para editar nombre/tipo/activo. - Acceso: botón "Elementos" en el dashboard del proyecto (edit layers) y enlace a "Tipos de elemento" desde el editor. Tests: FeatureManagementTest (6). Suite 87 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,16 +13,22 @@ class Feature extends Model
|
||||
const STATUSES = ['planned', 'started', 'in_progress', 'completed', 'verified'];
|
||||
|
||||
protected $fillable = [
|
||||
'layer_id', 'name', 'geometry', 'properties', 'template_id',
|
||||
'progress', 'status', 'responsible', 'responsible_user_id',
|
||||
'layer_id', 'name', 'geometry', 'properties', 'template_id', 'feature_type_id',
|
||||
'progress', 'status', 'is_active', 'responsible', 'responsible_user_id',
|
||||
'uuid', 'client_updated_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'geometry' => 'array',
|
||||
'properties' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
|
||||
public function featureType()
|
||||
{
|
||||
return $this->belongsTo(FeatureType::class);
|
||||
}
|
||||
|
||||
public function layer()
|
||||
{
|
||||
return $this->belongsTo(Layer::class);
|
||||
|
||||
Reference in New Issue
Block a user