import 'package:json_annotation/json_annotation.dart';

import 'package:pshared/api/responses/cursor_page.dart';
import 'package:pshared/api/responses/token.dart';
import 'package:pshared/data/dto/payment/payment.dart';

part 'payments.g.dart';


@JsonSerializable(explicitToJson: true)
class PaymentsResponse extends CursorPageResponse {
  @JsonKey(defaultValue: <PaymentDTO>[])
  final List<PaymentDTO> payments;

  const PaymentsResponse({
    required super.accessToken,
    required super.nextCursor,
    required this.payments,
  });

  factory PaymentsResponse.fromJson(Map<String, dynamic> json) => _$PaymentsResponseFromJson(json);
  @override
  Map<String, dynamic> toJson() => _$PaymentsResponseToJson(this);
}
