import 'package:json_annotation/json_annotation.dart';

import 'package:pshared/data/dto/money.dart';

part 'fx_quote.g.dart';

@JsonSerializable()
class FxQuoteDTO {
  final String? quoteRef;
  final String? baseCurrency;
  final String? quoteCurrency;
  final String? side;
  final String? price;
  final MoneyDTO? baseAmount;
  final MoneyDTO? quoteAmount;
  final int? expiresAtUnixMs;
  final int? pricedAtUnixMs;
  final String? provider;
  final String? rateRef;

  @JsonKey(defaultValue: false)
  final bool? firm;

  const FxQuoteDTO({
    this.quoteRef,
    this.baseCurrency,
    this.quoteCurrency,
    this.side,
    this.price,
    this.baseAmount,
    this.quoteAmount,
    this.expiresAtUnixMs,
    this.pricedAtUnixMs,
    this.provider,
    this.rateRef,
    this.firm = false,
  });

  factory FxQuoteDTO.fromJson(Map<String, dynamic> json) =>
      _$FxQuoteDTOFromJson(json);
  Map<String, dynamic> toJson() => _$FxQuoteDTOToJson(this);
}
