Skip to content

Commit 1e9e58b

Browse files
author
JEstebanC
committed
Changes in the statusBill adding the status deleted and the user list is now just for the clients
1 parent 5bcd9db commit 1e9e58b

15 files changed

+9
-147
lines changed

pom.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@
8484
<version>1.32.1</version>
8585
</dependency>
8686

87-
<!-- MercadoPago
88-
https://search.maven.org/artifact/com.mercadopago/sdk-java/2.0.1/jar-->
89-
<dependency>
90-
<groupId>com.mercadopago</groupId>
91-
<artifactId>sdk-java</artifactId>
92-
<version>2.0.1</version>
93-
</dependency>
94-
9587
</dependencies>
9688

9789
<build>
@@ -102,7 +94,7 @@
10294
<configuration>
10395
<excludes>
10496
<exclude>
105-
<groupId>org.projectlombok</groupId>
97+
<groupId>org.project-lombok</groupId>
10698
<artifactId>lombok</artifactId>
10799
</exclude>
108100
</excludes>

src/main/java/JEstebanC/FastFoodApp/dto/payment/PaymentAdditionalInfoPayerRequest.java

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/main/java/JEstebanC/FastFoodApp/dto/payment/PaymentAdditionalInfoRequest.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/main/java/JEstebanC/FastFoodApp/dto/payment/PaymentCreateRequest.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/main/java/JEstebanC/FastFoodApp/dto/payment/PaymentItemRequest.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/main/java/JEstebanC/FastFoodApp/dto/payment/PaymentOrderRequest.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/main/java/JEstebanC/FastFoodApp/dto/payment/PaymentPayerRequest.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/main/java/JEstebanC/FastFoodApp/dto/payment/PaymentReceiverAddressRequest.java

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/main/java/JEstebanC/FastFoodApp/dto/payment/PaymentShipmentsRequest.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/main/java/JEstebanC/FastFoodApp/dto/payment/PhoneRequest.java

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package JEstebanC.FastFoodApp.enumeration;
22

33
public enum StatusBill {
4-
5-
PAID, PENDING, NONPAYMENT;
4+
PAID, PENDING, NONPAYMENT,DELETED;
65
}

src/main/java/JEstebanC/FastFoodApp/model/Bill.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class Bill {
3030
@Id
3131
@GeneratedValue(strategy = GenerationType.AUTO)
3232
private Long idBill;
33+
private String idTransaction;
3334
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSX")
3435
private Date date;
3536
@ManyToOne

src/main/java/JEstebanC/FastFoodApp/repository/IUserRepository.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
@Repository
1818
public interface IUserRepository extends JpaRepository<User, Long> {
1919
Collection<User> findByNameStartsWith(String name);
20-
21-
@Query(value = "select * from user_app order by name OFFSET ? ROWS FETCH NEXT 10 ROWS ONLY", nativeQuery = true)
20+
21+
//this query just search the clients
22+
@Query(value = "select * from user_app where user_roles=2 order by name OFFSET ? ROWS FETCH NEXT 10 ROWS ONLY", nativeQuery = true)
2223
Collection<User> list(Long page);
2324

2425
User findByIdUser(Long idUser);

src/main/java/JEstebanC/FastFoodApp/service/BillServiceImp.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public BillUserDTO update(Long idBill, Bill bill) {
7575
public Boolean delete(Long idBill) {
7676
log.info("Deleting the bill id: " + idBill);
7777
if (billRepository.existsById(idBill)) {
78-
billRepository.deleteById(idBill);
78+
Bill bill= billRepository.findById(idBill).get();
79+
bill.setStatusBill(StatusBill.DELETED);
7980
return true;
8081
} else {
8182
return false;

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spring.sql.init.platform=postgres
88
spring.datasource.url=jdbc:postgresql://dbfastfoodapp.postgres.database.azure.com:5432/FastFood?user=FastFoodApp&password=AzureJeDev99&sslmode=require
99
spring.jpa.show-sql=true
1010
spring.jpa.generate-ddl=true
11-
spring.jpa.hibernate.ddl-auto=create-drop
11+
#spring.jpa.hibernate.ddl-auto=update
1212
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
1313

1414
spring.mail.host = smtp.gmail.com

0 commit comments

Comments
 (0)