Encapsulation, Abstraction, Programming, Behavior.
final var invoice = new Invoice(); invoice.setStatus(APPROVED); invoice.set... invoiceDetailService.caculateTotalAmount(invoide); return mapToReadDTO(repository.save(invoice)); } } @Service public class InvoiceDetailService { public void calculateTotalAmount(Invoice invoice){ invoice.setStatus(NEW)