import 'package:equatable/equatable.dart'; class CustomerFileModel extends Equatable { final String? id; final String customerId; // Riferimento UUID final String name; final String url; final String extension; final DateTime? createdAt; const CustomerFileModel({ this.id, required this.customerId, required this.name, required this.url, required this.extension, this.createdAt, }); factory CustomerFileModel.fromJson(Map json) { return CustomerFileModel( id: json['id'] as String, customerId: json['customer_id'], name: json['name'], url: json['url'], extension: json['extension'] ?? '', createdAt: json['created_at'] != null ? DateTime.parse(json['created_at']) : null, ); } Map toJson() { return { if (id != null) 'id': id, 'customer_id': customerId, 'name': name, 'url': url, 'extension': extension, }; } @override List get props => [id, customerId, name, url, extension, createdAt]; }