diff --git a/pom.xml b/pom.xml index 66f906d..11ad67c 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.0 + 3.3.2 zw.qantra @@ -103,6 +103,11 @@ postgresql runtime + + com.h2database + h2 + runtime + net.kaczmarzyk specification-arg-resolver @@ -133,6 +138,11 @@ org.springframework.boot spring-boot-starter-validation + + io.nflow + nflow-rest-api-spring-web + 10.0.1 + @@ -143,6 +153,32 @@ spring-boot-maven-plugin + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + generate-resources + + unpack + + + + + io.nflow + nflow-explorer + 10.0.1 + tar.gz + true + ${project.build.outputDirectory}/static/explorer + + + + + + + org.liquibase liquibase-maven-plugin diff --git a/src/main/java/zw/qantra/tm/TmApplication.java b/src/main/java/zw/qantra/tm/TmApplication.java index ec94f6d..1a7763c 100644 --- a/src/main/java/zw/qantra/tm/TmApplication.java +++ b/src/main/java/zw/qantra/tm/TmApplication.java @@ -1,12 +1,15 @@ package zw.qantra.tm; +import io.nflow.rest.config.RestConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import com.google.gson.Gson; +import org.springframework.context.annotation.Import; @SpringBootApplication +@Import(RestConfiguration.class) public class TmApplication { public static void main(String[] args) { diff --git a/src/main/java/zw/qantra/tm/configs/SecurityConfig.java b/src/main/java/zw/qantra/tm/configs/SecurityConfig.java index 799417b..7f460b0 100644 --- a/src/main/java/zw/qantra/tm/configs/SecurityConfig.java +++ b/src/main/java/zw/qantra/tm/configs/SecurityConfig.java @@ -29,7 +29,9 @@ public class SecurityConfig { http .csrf(AbstractHttpConfigurer::disable) .authorizeHttpRequests(auth -> auth - .requestMatchers("/auth/**").permitAll() + .requestMatchers("/explorer/**").permitAll() + .requestMatchers("/nflow/**").permitAll() + .requestMatchers("/auth/**").permitAll() .requestMatchers("/public/**").permitAll() .anyRequest().authenticated() ) diff --git a/src/main/java/zw/qantra/tm/domain/models/Setting.java b/src/main/java/zw/qantra/tm/domain/models/Setting.java index 25b7aeb..28fbf1d 100644 --- a/src/main/java/zw/qantra/tm/domain/models/Setting.java +++ b/src/main/java/zw/qantra/tm/domain/models/Setting.java @@ -14,6 +14,6 @@ import lombok.Setter; @AllArgsConstructor @NoArgsConstructor public class Setting extends BaseEntity { - private String name; - private String value; + private String settingName; + private String settingValue; } \ No newline at end of file diff --git a/src/main/resources/application-lab.properties b/src/main/resources/application-lab.properties index 3c418eb..3f6de79 100644 --- a/src/main/resources/application-lab.properties +++ b/src/main/resources/application-lab.properties @@ -1,6 +1,6 @@ spring.application.name=tm -debug=true -logging.level.root=INFO +debug=false + logging.level.org.springframework.boot.autoconfigure=INFO server.port=6950 @@ -41,3 +41,5 @@ erpnext.income.account=5111 - Sales Income - QPAY erpnext.cost.center=Main - QPAY erpnext.tax.account=VAT - QPAY erpnext.tax.rate=15.0 + +logging.level.root=WARN diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f196340..bf9264a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,6 @@ spring.application.name=tm debug=true -logging.level.root=INFO + logging.level.org.springframework.boot.autoconfigure=INFO server.port=6950 @@ -45,3 +45,5 @@ erpnext.tax.rate=15.0 # JWT Configuration jwt.secret=your-super-secret-jwt-key-here-make-it-very-long-and-secure-in-production jwt.expiration=86400000 + +logging.level.root=WARN diff --git a/src/main/resources/static/explorer/config.js b/src/main/resources/static/explorer/config.js new file mode 100644 index 0000000..8a6db70 --- /dev/null +++ b/src/main/resources/static/explorer/config.js @@ -0,0 +1,12 @@ +var Config = new function() { + this.refreshSeconds = 60; + + this.nflowEndpoints = [ + { + id: 'localhost', + title: 'local nflow instance', + apiUrl: '/api/nflow/api', + docUrl: '/api/nflow/ui/doc/' + }, + ]; +}; \ No newline at end of file