in src/main/scala/com/gu/invoicing/nextinvoicedate/Impl.scala [19:37]
def getBillingPreview(accountId: String): List[InvoiceItem] = {
Http(s"$zuoraApiHost/v1/operations/billing-preview")
.header("Authorization", s"Bearer $accessToken")
.header("Content-Type", "application/json")
.postData(
s"""
|{
| "accountId": "$accountId",
| "targetDate": "${LocalDate.now.plusMonths(13)}",
| "assumeRenewal": "Autorenew"
|}
|""".stripMargin,
)
.method("POST")
.asString
.body
.pipe(read[BillingPreview](_))
.invoiceItems
}