import 'package:freezed_annotation/freezed_annotation.dart';

part 'license_query_dto.freezed.dart';
part 'license_query_dto.g.dart';

/// 라이선스 페이지네이션 쿼리 DTO
@freezed
class LicensePaginationQuery with _$LicensePaginationQuery {
  const factory LicensePaginationQuery({
    @Default(1) int page,
    @Default(20) int limit,
    @Default('expiry_date') String sort,
    @Default('asc') String order,
    @JsonKey(name: 'company_id') String? companyId,
    @JsonKey(name: 'user_id') String? userId,
    @JsonKey(name: 'license_type') String? licenseType,
    String? status,
    String? search,
  }) = _LicensePaginationQuery;

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

/// 만료 예정 라이선스 조회 쿼리 DTO
@freezed
class ExpiringLicensesQuery with _$ExpiringLicensesQuery {
  const factory ExpiringLicensesQuery({
    @Default(30) int days,
  }) = _ExpiringLicensesQuery;

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