class DiscountingBillProductPricer {

  public PointSensitivities presentValueSensitivityWithZSpread(
      ResolvedBill bill,
      LegalEntityDiscountingProvider provider,
      double zSpread,
      CompoundedRateType compoundedRateType,
      int periodsPerYear) {

    if (provider.getValuationDate().isAfter(bill.getNotional().getDate())) {
      return PointSensitivities.empty();
    }
    IssuerCurveDiscountFactors issuerDf = issuerCurveDf(bill, provider);
    double dfEndBar = bill.getNotional().getAmount();
    ZeroRateSensitivity zeroSensMaturity = issuerDf.getDiscountFactors()
        .zeroRatePointSensitivityWithSpread(bill.getNotional().getDate(), zSpread, compoundedRateType, periodsPerYear);
    IssuerCurveZeroRateSensitivity dscSensMaturity =
        IssuerCurveZeroRateSensitivity.of(zeroSensMaturity, issuerDf.getLegalEntityGroup())
            .multipliedBy(dfEndBar);

    return dscSensMaturity.build();
  }

}