placidenduwayo 2 лет назад
Родитель
Сommit
a3f16ffd73

+ 6
- 0
.idea/inspectionProfiles/Project_Default.xml Просмотреть файл

@@ -0,0 +1,6 @@
1
+<component name="InspectionProjectProfileManager">
2
+  <profile version="1.0">
3
+    <option name="myName" value="Project Default" />
4
+    <inspection_tool class="UnusedProperty" enabled="false" level="WARNING" enabled_by_default="false" />
5
+  </profile>
6
+</component>

+ 0
- 1
micro-service-account/src/main/java/com/natan/bootcamp/cleanarchitecture/account/infrastructure/ports/input/restmplate/CustomerGetter.java Просмотреть файл

@@ -11,7 +11,6 @@ public class CustomerGetter {
11 11
 
12 12
     public static CustomerDto getCustomerFromOutside(String customerId) {
13 13
         RestTemplate restTemplate = new RestTemplateBuilder()
14
-              //  .basicAuthentication("user","user")
15 14
                 .build();
16 15
         CustomerDto customerDto = restTemplate.getForObject(
17 16
                 CUSTOMERURL+"/"+customerId, CustomerDto.class);

+ 2
- 2
micro-service-account/src/main/resources/application.properties Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 #for local use:localhost. For docker use: replace localhost by mysql
2 2
 spring.application.name=micro-service-account
3
-spring.datasource.url = jdbc:mysql://${MYSQL_HOST:localhost}${MYSQL_PORT:3306}/my_db_test?createDatabaseIfNotExist=true
3
+spring.datasource.url = jdbc:mysql://mysql:3306/account_db?createDatabaseIfNotExist=true
4 4
 spring.datasource.username =root
5 5
 spring.datasource.password = root
6 6
 spring.jpa.show-sql = true
@@ -8,4 +8,4 @@ spring.jpa.hibernate.ddl-auto = update
8 8
 spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL8Dialect
9 9
 server.port=8086
10 10
 server.servlet.context-path=/path
11
-server.error.include-message=always
11
+server.error.include-message=always

+ 4
- 0
micro-service-customer/src/main/java/com/natan/bootcamp/cleanarchitecture/customer/domain/entity/Customer.java Просмотреть файл

@@ -1,5 +1,8 @@
1 1
 package com.natan.bootcamp.cleanarchitecture.customer.domain.entity;
2 2
 
3
+import javax.persistence.EnumType;
4
+import javax.persistence.Enumerated;
5
+
3 6
 public class Customer {
4 7
 
5 8
     private String id;
@@ -7,6 +10,7 @@ public class Customer {
7 10
     private String firstname;
8 11
     private String creationDate;
9 12
     private Risk risk;
13
+    @Enumerated(EnumType.STRING)
10 14
     private Status status;
11 15
 
12 16
     public Customer() {

+ 2
- 2
micro-service-customer/src/main/resources/application.properties Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 #for local use:localhost. For docker use: replace localhost by mysql
2 2
 spring.application.name=micro-service-customer
3
-spring.datasource.url = jdbc:mysql://${MYSQL_HOST:localhost}${MYSQL_PORT:3306}/my_db_test?createDatabaseIfNotExist=true
3
+spring.datasource.url = jdbc:mysql://mysql:3306/customer_db?createDatabaseIfNotExist=true
4 4
 spring.datasource.username =root
5 5
 spring.datasource.password = root
6 6
 spring.jpa.show-sql = true
@@ -8,4 +8,4 @@ spring.jpa.hibernate.ddl-auto = update
8 8
 spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL8Dialect
9 9
 server.port=8085
10 10
 server.servlet.context-path=/path
11
-server.error.include-message=always
11
+server.error.include-message=always

+ 2
- 3
micro-service-movement/src/main/java/com/natan/bootcamp/cleanarchitecture/movement/infrastructure/ports/output/service/MovementService.java Просмотреть файл

@@ -2,14 +2,13 @@ package com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.outpu
2 2
 
3 3
 import com.natan.bootcamp.cleanarchitecture.movement.domain.entity.Movement;
4 4
 import com.natan.bootcamp.cleanarchitecture.movement.domain.entity.MvtSens;
5
-import com.natan.bootcamp.cleanarchitecture.movement.domain.entity.Risk;
6 5
 import com.natan.bootcamp.cleanarchitecture.movement.domain.entity.Status;
7 6
 import com.natan.bootcamp.cleanarchitecture.movement.domain.exceptions.MovementManagementException;
8 7
 import com.natan.bootcamp.cleanarchitecture.movement.domain.ports.output.IMovementOutputPort;
9
-import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.input.resttemplate.AccountGetter;
10
-import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.input.resttemplate.CustomerGetter;
11 8
 import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.input.dto.AccountDto;
12 9
 import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.input.dto.CustomerDto;
10
+import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.input.resttemplate.AccountGetter;
11
+import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.input.resttemplate.CustomerGetter;
13 12
 import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.output.mapping.MovementModelMapping;
14 13
 import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.output.model.MovementModel;
15 14
 import com.natan.bootcamp.cleanarchitecture.movement.infrastructure.ports.output.repository.IMovementCrudRepository;

+ 1
- 1
micro-service-movement/src/main/java/com/natan/bootcamp/cleanarchitecture/movement/infrastructure/ports/output/service/RisksManagement.java Просмотреть файл

@@ -21,7 +21,7 @@ public class RisksManagement {
21 21
             balance -= coverageAmount + coverageAmount *0.03;
22 22
         }
23 23
         if(mvtAmount > balance){
24
-            throw new MovementManagementException("error: balance <"+ balance+ ">not enough for the mvt");
24
+            throw new MovementManagementException("error: balance not enough for the mvt");
25 25
         }
26 26
     }
27 27
 }

+ 1
- 1
micro-service-movement/src/main/resources/application.properties Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 #for local use:localhost. For docker use: replace localhost by mysql
2 2
 spring.application.name=micro-service-movement
3
-spring.datasource.url = jdbc:mysql://${MYSQL_HOST:localhost}${MYSQL_PORT:3306}/my_db_test?createDatabaseIfNotExist=true
3
+spring.datasource.url = jdbc:mysql://mysql:3306/mvt_db?createDatabaseIfNotExist=true
4 4
 spring.datasource.username =root
5 5
 spring.datasource.password = root
6 6
 spring.jpa.show-sql = true

Powered by TurnKey Linux.