import 'package:account/src/features/linked_devices/domain/entities/update_device_request_entity.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'update_device_request_model.freezed.dart';
part 'update_device_request_model.g.dart';

@freezed
abstract class UpdateDeviceRequestModel with _$UpdateDeviceRequestModel {
  const factory UpdateDeviceRequestModel({
    required String identificator,
    required String name,
  }) = _UpdateDeviceRequestModel;

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

extension UpdateDeviceRequestModelMapper on UpdateDeviceRequestEntity {
  UpdateDeviceRequestModel toModel() => UpdateDeviceRequestModel(
    identificator: identificator,
    name: name,
  );
}
