Skip to content
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

Merged
merged 3 commits into from
Jun 28, 2023

Conversation

thenmaster
Copy link
Member

Now in case the field does not exist we fail instead of falling back to the date column value

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);
Copy link
Contributor

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());
Copy link
Contributor

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());
Copy link
Contributor

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());
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Formatting

@thenmaster thenmaster marked this pull request as ready for review June 27, 2023 11:16
@@ -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());
Copy link
Contributor

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());
Copy link
Contributor

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());
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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

@thenmaster thenmaster requested a review from Vasco-F June 27, 2023 13:41
@thenmaster thenmaster merged commit 3ca3992 into master Jun 28, 2023
@thenmaster thenmaster deleted the remove_local_date_fallbacks branch June 28, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants