class AdminUnitModel {
  final int id;
  final String? plate;
  final String status;

  const AdminUnitModel({required this.id, this.plate, this.status = 'active'});

  factory AdminUnitModel.fromJson(Map<String, dynamic> json) => AdminUnitModel(
    id: (json['id'] as num).toInt(),
    plate: json['plate'] as String?,
    status: (json['status'] as String?) ?? 'active',
  );

  String get displayPlate =>
      plate == null || plate!.trim().isEmpty ? '#$id' : plate!;
}
