import 'package:freezed_annotation/freezed_annotation.dart';

part 'equipment_dto.freezed.dart';
part 'equipment_dto.g.dart';

@freezed
class EquipmentDto with _$EquipmentDto {
  const factory EquipmentDto({
    required int id,
    @JsonKey(name: 'equipment_number') required String equipmentNumber,
    @JsonKey(name: 'serial_number') String? serialNumber,
    String? category1,
    String? category2,
    String? category3,
    required String manufacturer,
    @JsonKey(name: 'model_name') String? modelName,
    String? barcode,
    required String status,
    @JsonKey(name: 'company_id') int? companyId,
    @JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
    @JsonKey(name: 'purchase_date') String? purchaseDate,
    @JsonKey(name: 'purchase_price') double? purchasePrice,
    @JsonKey(name: 'last_inspection_date') String? lastInspectionDate,
    @JsonKey(name: 'next_inspection_date') String? nextInspectionDate,
    String? remark,
    @JsonKey(name: 'created_at') DateTime? createdAt,
    @JsonKey(name: 'updated_at') DateTime? updatedAt,
  }) = _EquipmentDto;

  factory EquipmentDto.fromJson(Map<String, dynamic> json) =>
      _$EquipmentDtoFromJson(json);
}