class CouponFixedFxResetDefinition extends CouponDefinition implements InstrumentDefinitionWithData<Payment, DoubleTimeSeries<ZonedDateTime>> {

  @Override
  public CouponFixedFxReset toDerivative(ZonedDateTime dateTime) {
    ArgumentChecker.notNull(dateTime, "date");
    LocalDate conversionDate = dateTime.toLocalDate();
    LocalDate fixingDate = _fxFixingDate.toLocalDate();
    ArgumentChecker.isTrue(!conversionDate.isAfter(fixingDate), 
        "Do not have any fixing data but are asking for a derivative at {} which is after fixing date {}", 
        conversionDate, fixingDate);
    double paymentTime = TimeCalculator.getTimeBetween(dateTime, getPaymentDate());
    double fixingTime = TimeCalculator.getTimeBetween(dateTime, _fxFixingDate);
    double deliveryTime = TimeCalculator.getTimeBetween(dateTime, _fxDeliveryDate);
    return new CouponFixedFxReset(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), _rate, 
        _referenceCurrency, fixingTime, deliveryTime);
  }

  public  CouponFixedFxResetDefinition(Currency currency, ZonedDateTime paymentDate, ZonedDateTime accrualStartDate, 
      ZonedDateTime accrualEndDate, double paymentAccrualFactor, double notional,
      double rate, Currency referenceCurrency, ZonedDateTime fxFixingDate, ZonedDateTime fxDeliveryDate);

}