random intermediate commit

This commit is contained in:
Jan 2024-12-22 09:46:10 +01:00
parent 7f79078c6a
commit 010efaa917
11 changed files with 120 additions and 3 deletions

10
pom.xml
View file

@ -40,15 +40,19 @@
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
<groupId>com.h2database</groupId> <!---->
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.example</groupId>
<artifactId>batchprocessing</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>

View file

@ -0,0 +1,8 @@
package de.avatic.taricdb.batch;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ImporterConfiguration {
}

View file

@ -0,0 +1,16 @@
package de.avatic.taricdb.batch.processors;
import java.io.File;
import java.util.List;
import org.springframework.batch.item.ItemProcessor;
public class ExtractZipItemProcessor implements ItemProcessor<File,List<File>> {
@Override
public List<File> process(File item) throws Exception {
// TODO Auto-generated method stub
return null;
}
}

View file

@ -0,0 +1,5 @@
package de.avatic.taricdb.batch.processors;
public class FootnoteItemProcessor {
}

View file

@ -0,0 +1,11 @@
package de.avatic.taricdb.model;
public class UploadFile {
int id;
UploadFileType type;
}

View file

@ -0,0 +1,26 @@
package de.avatic.taricdb.model;
public enum UploadFileType {
ZIP("null"),
DUTIES("Duties Import 01-99.xlsx"),
BUSINESS_CODE("TARIC Business codes.xlsx"),
GEO_COMPOSITION("Geographical areas composition.xlsx"),
GEO("Geographical areas descriptions.xlsx"),
LEGAL_BASES("Legal bases.xlsx"),
MEASURE_CONDITIONS("Measure conditions.xlsx"),
MEASURE_EXCLUSIONS("Measure exclusions.xlsx"),
MEASURE_FOOTNOTES("Measure footnotes.xlsx"),
NOMENCLATURE_DE("Nomenclature DE.xlsx"),
NOMENCLATURE_FR("Nomenclature FR.xlsx"),
NOMENCLATURE_EN("Nomenclature EN.xlsx"),
DECLARABLE_CODES("Declarable codes.xlsx"),
ADDITIONAL_CODES("Additional codes descriptions.xlsx"),
BOX_44("Box 44 codes of the SAD.xlsx"),
FOOTNOTES("Footnotes descriptions.xlsx"),
NOMENCLATURE_FOOTNOTES("Nomenclature footnotes.xlsx");
UploadFileType(String fileName) {
}
}

View file

@ -0,0 +1,5 @@
package de.avatic.taricdb.repository;
public class UploadFileRepository {
}

View file

@ -0,0 +1,8 @@
package de.avatic.taricdb.service;
import org.springframework.stereotype.Component;
@Component
public class UploadService {
}

View file

@ -0,0 +1,15 @@
package de.avatic.taricdb.web;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class UploadController {
@PostMapping
public void startConversion() {
}
}

View file

@ -1 +1,2 @@
spring.application.name=taricdb
spring.batch.job.enabled= false

View file

@ -1,3 +1,15 @@
-- upload tables
create table if not exists "upload_file"
(
id INT NOT NULL PRIMARY KEY,
file_name TEXT,
file_type ENUM("zip", "duties", "business_codes", "geo_composition", "geo", "legal_bases", "measure_conditions", "measure_exclusions",
"measure_footnotes", "nomenclature_de", "nomenclature_en", , "nomenclature_fr", "declarable_codes", "additional_codes", "box44",
"footnotes", "nomenclature_footnotes")
blob LONGBLOB
parent_zip INT
);
-- meta tables, like units and certificates
create table if not exists "legal_base"
(
@ -110,6 +122,12 @@ create table if not exists "nomenclature"
is_leaf_start_date DATE,
parent_id INT -- TODO: for each child do: alter table nomenclature add constraint parent_nomenclature foreign key (parent_id) references nomenclature(id) on delete set null;
);
create table if not exists "nomenclature_footnote"
(
id INT NOT NULL PRIMARY KEY,
FOREIGN KEY (footnote_id) REFERENCES footnote(id),
FOREIGN KEY (nomenclature_id) REFERENCES nomenclature(id)
);
create table if not exists "additional_code"
(
id INT NOT NULL PRIMARY KEY,