Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
update the method nam
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudFonzam committed Jan 6, 2024
1 parent ff37cfc commit 5a830a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/main/java/org/isf/accounting/rest/BillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.time.LocalDateTime;
import java.util.List;

import javax.validation.Valid;

import org.isf.accounting.dto.BillDTO;
import org.isf.accounting.dto.BillItemsDTO;
import org.isf.accounting.dto.BillPaymentsDTO;
Expand Down Expand Up @@ -105,7 +107,7 @@ public BillController(BillBrowserManager billManager, PriceListManager priceList
* @throws OHServiceException
*/
@PostMapping(value = "/bills", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<FullBillDTO> newBill(@RequestBody FullBillDTO newBillDto) throws OHServiceException {
public ResponseEntity<FullBillDTO> newBill(@Valid @RequestBody FullBillDTO newBillDto) throws OHServiceException {

if (newBillDto == null) {
throw new OHAPIException(new OHExceptionMessage("Bill is null."));
Expand Down Expand Up @@ -152,7 +154,7 @@ public ResponseEntity<FullBillDTO> newBill(@RequestBody FullBillDTO newBillDto)
* @throws OHServiceException
*/
@PutMapping(value = "/bills/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<FullBillDTO> updateBill(@PathVariable Integer id, @RequestBody FullBillDTO odBillDto) throws OHServiceException {
public ResponseEntity<FullBillDTO> updateBill(@PathVariable Integer id, @Valid @RequestBody FullBillDTO odBillDto) throws OHServiceException {

LOGGER.info("updated Bill {}", odBillDto);
Bill bill = billMapper.map2Model(odBillDto.getBill());
Expand Down Expand Up @@ -369,11 +371,11 @@ public ResponseEntity<List<BillDTO>> getPendingBills(@RequestParam(value = "pati
* @return a list of retrieved {@link Bill}s or {@code null} if an error occurred.
* @throws OHServiceException
*/
@PostMapping(value = "/bills/search/item", produces = MediaType.APPLICATION_JSON_VALUE)
@GetMapping(value = "/bills/search/item", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<BillDTO>> searchBills(
@RequestParam(value = "datefrom") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") @Schema(implementation = String.class) LocalDateTime dateFrom,
@RequestParam(value = "dateto") @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") @Schema(implementation = String.class) LocalDateTime dateTo,
@RequestBody BillItemsDTO billItemDTO) throws OHServiceException {
@Valid @RequestBody BillItemsDTO billItemDTO) throws OHServiceException {

BillItems billItem = billItemsMapper.map2Model(billItemDTO);

Expand Down Expand Up @@ -431,8 +433,8 @@ public ResponseEntity<Boolean> deleteBill(@PathVariable Integer id) throws OHSer
* @return a list of {@link Bill} associated to the passed {@link BillPayments} or {@code null} if an error occurred.
* @throws OHServiceException
*/
@PostMapping(value = "/bills/search/payments", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<BillDTO>> searchBillsByPayments(@RequestBody List<BillPaymentsDTO> paymentsDTO) throws OHServiceException {
@GetMapping(value = "/bills/search/payments", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<BillDTO>> searchBillsByPayments(@Valid @RequestBody List<BillPaymentsDTO> paymentsDTO) throws OHServiceException {

List<BillPayments> billPayments = billPaymentsMapper.map2ModelList(paymentsDTO);

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/isf/admission/rest/AdmissionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public ResponseEntity<Page<AdmissionDTO>> getAdmissions(
* @return the {@link List} of found {@link Admission} or NO_CONTENT otherwise.
* @throws OHServiceException
*/
@GetMapping(value = "/discharges", produces = MediaType.APPLICATION_JSON_VALUE)
@GetMapping(value = "/admissions/discharges", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Page<AdmissionDTO>> getDischarges(
@RequestParam(name = "dischargerange") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) @ArraySchema(schema = @Schema(implementation = String.class)) LocalDateTime[] dischargeRange,
@RequestParam(value = "page", required = false, defaultValue = "0") int page,
Expand Down Expand Up @@ -347,7 +347,7 @@ public ResponseEntity<Boolean> deleteAdmissionType(@PathVariable("id") int id) t
* @return {@code true} if the record has been set to discharge.
* @throws OHServiceException
*/
@PostMapping(value = "/admissions/discharge", produces = MediaType.APPLICATION_JSON_VALUE)
@PutMapping(value = "/admissions/discharge", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Boolean> dischargePatient(@RequestParam("patientCode") int patientCode,
@Valid @RequestBody AdmissionDTO currentAdmissionDTO) throws OHServiceException {

Expand Down

0 comments on commit 5a830a5

Please sign in to comment.