-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove fallbacks for local date field. #450
Conversation
Now in case the field does not exist we fail instead of falling back to the date column value
creditNote = (ADCreditNoteEntity) services.issueDocument( | ||
new ADCreditNoteTestUtil(ADAbstractTest.injector).getCreditNoteBuilder(reference), params); | ||
ADCreditNoteEntity creditNote = (ADCreditNoteEntity) services.issueDocument(new ADCreditNoteTestUtil( | ||
ADAbstractTest.injector).getCreditNoteBuilder(reference), params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Formatting
@@ -93,7 +94,7 @@ public FRInvoice.Builder getInvoiceBuilder(FRBusinessEntity business) { | |||
return invoiceBuilder.setBilled(FRInvoiceTestUtil.BILLED).setCancelled(FRInvoiceTestUtil.CANCELLED) | |||
.setSelfBilled(FRInvoiceTestUtil.SELFBILL).setDate(new Date()).setSourceId(FRInvoiceTestUtil.SOURCE_ID) | |||
.setCustomerUID(customerUID).setBusinessUID(business.getUID()) | |||
.addPayment(this.payment.getPaymentBuilder()); | |||
.addPayment(this.payment.getPaymentBuilder()).setLocalDate(LocalDate.now()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Formatting
Same to all existing calls to setLocalDate in test class
@@ -63,6 +64,6 @@ public FRReceipt.Builder getReceiptBuilder(FRBusinessEntity business) { | |||
return receiptBuilder.setBilled(FRReceiptTestUtil.BILLED).setCancelled(FRReceiptTestUtil.CANCELLED) | |||
.setSelfBilled(FRReceiptTestUtil.SELFBILL).setSourceId(FRReceiptTestUtil.SOURCE_ID).setDate(new Date()) | |||
.setBusinessUID(business.getUID()).addPayment(this.payments.getPaymentBuilder()).addEntry(entryBuilder) | |||
.setCreditOrDebit(GenericInvoice.CreditOrDebit.CREDIT); | |||
.setCreditOrDebit(GenericInvoice.CreditOrDebit.CREDIT).setLocalDate(LocalDate.now()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Formatting
@@ -83,7 +84,7 @@ public FRSimpleInvoice.Builder getSimpleInvoiceBuilder(FRBusinessEntity business | |||
.setSelfBilled(FRInvoiceTestUtil.SELFBILL).setDate(new Date()).setSourceId(FRInvoiceTestUtil.SOURCE_ID) | |||
.setCustomerUID(customerUID).setBusinessUID(businessEntity.getUID()) | |||
.addPayment(this.payment.getPaymentBuilder()).setClientType(clientType) | |||
.setCreditOrDebit(GenericInvoice.CreditOrDebit.CREDIT); | |||
.setCreditOrDebit(GenericInvoice.CreditOrDebit.CREDIT).setLocalDate(LocalDate.now()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Formatting
creditNote = (PTCreditNoteEntity) services.issueDocument( | ||
new PTCreditNoteTestUtil(PTAbstractTest.injector).getCreditNoteBuilder(reference), params); | ||
PTCreditNoteEntity creditNote = (PTCreditNoteEntity) services.issueDocument(new PTCreditNoteTestUtil( | ||
PTAbstractTest.injector).getCreditNoteBuilder(reference), params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Formatting
creditNote = (ESCreditNoteEntity) services.issueDocument( | ||
new ESCreditNoteTestUtil(ESAbstractTest.injector).getCreditNoteBuilder(reference), params); | ||
ESCreditNoteEntity creditNote = (ESCreditNoteEntity) services.issueDocument(new ESCreditNoteTestUtil( | ||
ESAbstractTest.injector).getCreditNoteBuilder(reference), params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Formatting
@@ -137,7 +140,7 @@ public FRInvoiceEntity getDifferentRegionsInvoice() { | |||
invoiceBuilder.setBilled(FRInvoiceTestUtil.BILLED).setCancelled(FRInvoiceTestUtil.CANCELLED) | |||
.setSelfBilled(FRInvoiceTestUtil.SELFBILL).setDate(new Date()).setSourceId(FRInvoiceTestUtil.SOURCE_ID) | |||
.setCustomerUID(customerUID).setBusinessUID(this.business.getBusinessEntity().getUID()) | |||
.addPayment(this.payment.getPaymentBuilder()); | |||
.addPayment(this.payment.getPaymentBuilder()).setLocalDate(LocalDate.now()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
@@ -160,7 +163,7 @@ public FRInvoiceEntity getManyEntriesInvoice() { | |||
invoiceBuilder.setBilled(FRInvoiceTestUtil.BILLED).setCancelled(FRInvoiceTestUtil.CANCELLED) | |||
.setSelfBilled(FRInvoiceTestUtil.SELFBILL).setDate(new Date()).setSourceId(FRInvoiceTestUtil.SOURCE_ID) | |||
.setCustomerUID(customerUID).setBusinessUID(this.business.getBusinessEntity().getUID()) | |||
.addPayment(this.payment.getPaymentBuilder()); | |||
.addPayment(this.payment.getPaymentBuilder()).setLocalDate(LocalDate.now()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
@@ -183,7 +186,7 @@ public FRInvoiceEntity getManyEntriesWithDifferentRegionsInvoice() { | |||
invoiceBuilder.setBilled(FRInvoiceTestUtil.BILLED).setCancelled(FRInvoiceTestUtil.CANCELLED) | |||
.setSelfBilled(FRInvoiceTestUtil.SELFBILL).setDate(new Date()).setSourceId(FRInvoiceTestUtil.SOURCE_ID) | |||
.setCustomerUID(customerUID).setBusinessUID(this.business.getBusinessEntity().getUID()) | |||
.addPayment(this.payment.getPaymentBuilder()); | |||
.addPayment(this.payment.getPaymentBuilder()).setLocalDate(LocalDate.now()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting
creditNote = (ESCreditNoteEntity) services.issueDocument( | ||
new ESCreditNoteTestUtil(ESAbstractTest.injector).getCreditNoteBuilder(reference), params); | ||
ESCreditNoteEntity creditNote = (ESCreditNoteEntity) services.issueDocument( | ||
new ESCreditNoteTestUtil(ESAbstractTest.injector).getCreditNoteBuilder(reference), params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make the code more readable, i'd suggest seperating each issueDocument parameter per line
@@ -169,11 +169,10 @@ private ADCreditNoteEntity generateESCreditNote(PaymentMechanism paymentMechanis | |||
|
|||
this.createSeries(reference, "AC"); | |||
|
|||
ADCreditNoteEntity creditNote = null; | |||
creditNote = (ADCreditNoteEntity) services.issueDocument( | |||
ADCreditNoteEntity creditNote = (ADCreditNoteEntity) services.issueDocument( | |||
new ADCreditNoteTestUtil(ADAbstractTest.injector).getCreditNoteBuilder(reference), params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make the code more readable, i'd suggest seperating each issueDocument parameter per line
@@ -160,11 +160,10 @@ private PTCreditNoteEntity generatePTCreditNote(PaymentMechanism paymentMechanis | |||
|
|||
this.createSeries(reference, "AC"); | |||
|
|||
PTCreditNoteEntity creditNote = null; | |||
creditNote = (PTCreditNoteEntity) services.issueDocument( | |||
PTCreditNoteEntity creditNote = (PTCreditNoteEntity) services.issueDocument( | |||
new PTCreditNoteTestUtil(PTAbstractTest.injector).getCreditNoteBuilder(reference), params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make the code more readable, i'd suggest seperating each issueDocument parameter per line
Now in case the field does not exist we fail instead of falling back to the date column value