## CTM SENIORITY Project

Project for importing seniority data from external source to SI SP BO.

### Building project
Firstly open **pom.xml** file and set property **distribution.dir** to folder where you want the result files to be placed:
```
<properties>
    <distribution.dir>YOUR_DIR_LOCATION</distribution.dir>
</properties>
```
Then build project with command:
```
mvn clean install
```

After build your distribution folder should contain 3 new files:
 - YOUR_DIR_LOCATION
    - ctm-seniority.jar
    - ctm-seniority-application.properties
    - log4j.properties

### Running project

First set properties in file **YOUR_DIR_LOCATION/ctm-seniority-application.properties** then run command:
 - Import all data:
```
java -jar ctm-seniority.jar --spring.config.location=ctm-seniority-application.properties
```

- Import data after given date (Date should be in format dd.MM.yyyy):
```
java -jar ctm-seniority.jar --spring.config.location=ctm-seniority-application.properties DATE_FROM=12.05.2020
```

For logging properties, set the **log4j.properties** file.

After running the process two new files should appear in **YOUR_DIR_LOCATION** folder (where *TIMESTAMP* is date and time when process has started):
  - **CTM_SENIORITY_log_TIMESTAMP.txt**: List of successfully and unsuccessfully imported records and error description if there was anything wrong.
  - **ctm_log.log**: file with logs. Can be change by setting property **log4j.appender.file.File** in log4j.properties file.

