diff --git a/core/src/main/java/google/registry/beam/invoicing/BillingEvent.java b/core/src/main/java/google/registry/beam/invoicing/BillingEvent.java index 2b77d2550..4de572c3f 100644 --- a/core/src/main/java/google/registry/beam/invoicing/BillingEvent.java +++ b/core/src/main/java/google/registry/beam/invoicing/BillingEvent.java @@ -235,6 +235,7 @@ public abstract class BillingEvent implements Serializable { DATE_TIME_FORMATTER.format(eventTime()), registrarId(), billingId(), + poNumber(), tld(), action(), domain(), diff --git a/core/src/test/java/google/registry/beam/invoicing/BillingEventTest.java b/core/src/test/java/google/registry/beam/invoicing/BillingEventTest.java index 84dffb5ac..f647dc1c1 100644 --- a/core/src/test/java/google/registry/beam/invoicing/BillingEventTest.java +++ b/core/src/test/java/google/registry/beam/invoicing/BillingEventTest.java @@ -133,7 +133,17 @@ public class BillingEventTest { BillingEvent event = BillingEvent.parseFromRecord(schemaAndRecord); assertThat(event.toCsv()) .isEqualTo("1,2017-10-24 09:06:03 UTC,2017-01-19 23:59:43 UTC,myRegistrar," - + "12345-CRRHELLO,test,RENEW,example.test,123456,5,USD,20.50,AUTO_RENEW"); + + "12345-CRRHELLO,,test,RENEW,example.test,123456,5,USD,20.50,AUTO_RENEW"); + } + + @Test + public void testConvertBillingEvent_nonNullPoNumber_toCsv() { + GenericRecord record = createRecord(); + record.put("poNumber", "905610"); + BillingEvent event = BillingEvent.parseFromRecord(new SchemaAndRecord(record, null)); + assertThat(event.toCsv()) + .isEqualTo("1,2017-10-24 09:06:03 UTC,2017-01-19 23:59:43 UTC,myRegistrar," + + "12345-CRRHELLO,905610,test,RENEW,example.test,123456,5,USD,20.50,AUTO_RENEW"); } @Test diff --git a/core/src/test/java/google/registry/beam/invoicing/InvoicingPipelineTest.java b/core/src/test/java/google/registry/beam/invoicing/InvoicingPipelineTest.java index dcedf4903..d85907df7 100644 --- a/core/src/test/java/google/registry/beam/invoicing/InvoicingPipelineTest.java +++ b/core/src/test/java/google/registry/beam/invoicing/InvoicingPipelineTest.java @@ -157,21 +157,21 @@ public class InvoicingPipelineTest { return ImmutableMap.of( "invoice_details_2017-10_theRegistrar_test.csv", ImmutableList.of( - "1,2017-10-04 00:00:00 UTC,2017-10-04 00:00:00 UTC,theRegistrar,234," + "1,2017-10-04 00:00:00 UTC,2017-10-04 00:00:00 UTC,theRegistrar,234,," + "test,RENEW,mydomain2.test,REPO-ID,3,USD,20.50,", - "1,2017-10-04 00:00:00 UTC,2017-10-04 00:00:00 UTC,theRegistrar,234," + "1,2017-10-04 00:00:00 UTC,2017-10-04 00:00:00 UTC,theRegistrar,234,," + "test,RENEW,mydomain.test,REPO-ID,3,USD,20.50,"), "invoice_details_2017-10_theRegistrar_hello.csv", ImmutableList.of( - "1,2017-10-02 00:00:00 UTC,2017-09-29 00:00:00 UTC,theRegistrar,234," + "1,2017-10-02 00:00:00 UTC,2017-09-29 00:00:00 UTC,theRegistrar,234,," + "hello,CREATE,mydomain3.hello,REPO-ID,5,JPY,70.75,"), "invoice_details_2017-10_bestdomains_test.csv", ImmutableList.of( - "1,2017-10-04 00:00:00 UTC,2017-10-04 00:00:00 UTC,bestdomains,456," + "1,2017-10-04 00:00:00 UTC,2017-10-04 00:00:00 UTC,bestdomains,456,116688," + "test,RENEW,mydomain4.test,REPO-ID,1,USD,20.50,"), "invoice_details_2017-10_anotherRegistrar_test.csv", ImmutableList.of( - "1,2017-10-04 00:00:00 UTC,2017-10-04 00:00:00 UTC,anotherRegistrar,789," + "1,2017-10-04 00:00:00 UTC,2017-10-04 00:00:00 UTC,anotherRegistrar,789,," + "test,CREATE,mydomain5.test,REPO-ID,1,USD,0.00,SUNRISE ANCHOR_TENANT")); }