import 'package:freezed_annotation/freezed_annotation.dart';

part 'administrator_dto.freezed.dart';
part 'administrator_dto.g.dart';

@freezed
class AdministratorDto with _$AdministratorDto {
  const AdministratorDto._(); // Private constructor for getters

  const factory AdministratorDto({
    int? id,
    required String name,
    required String phone,
    required String mobile,
    required String email,
    required String passwd,
  }) = _AdministratorDto;

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

@freezed
class AdministratorRequestDto with _$AdministratorRequestDto {
  const factory AdministratorRequestDto({
    required String name,
    required String phone,
    required String mobile,
    required String email,
    required String passwd,
  }) = _AdministratorRequestDto;

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

@freezed
class AdministratorUpdateRequestDto with _$AdministratorUpdateRequestDto {
  const factory AdministratorUpdateRequestDto({
    String? name,
    String? phone,
    String? mobile,
    String? email,
    String? passwd,
  }) = _AdministratorUpdateRequestDto;

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

@freezed
class AdministratorListResponse with _$AdministratorListResponse {
  const factory AdministratorListResponse({
    @JsonKey(name: 'data') required List<AdministratorDto> items,
    @JsonKey(name: 'total') required int totalCount,
    @JsonKey(name: 'page') required int currentPage,
    @JsonKey(name: 'total_pages') required int totalPages,
    @JsonKey(name: 'page_size') int? pageSize,
  }) = _AdministratorListResponse;

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