initial commit

This commit is contained in:
Mikhail Trofimov 2025-06-02 15:08:57 +03:00
parent 0347785fc1
commit 06d7ab73f0
15 changed files with 177 additions and 0 deletions

8
.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

22
.idea/compiler.xml generated Normal file
View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Annotation profile for credit_tracker" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<processorPath>
<entry name="$MAVEN_REPOSITORY$/org/projectlombok/lombok/unknown/lombok-unknown.jar" />
</processorPath>
<module name="credit_tracker" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="credit_tracker" options="-parameters" />
</option>
</component>
</project>

17
.idea/dataSources.xml generated Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="credit_tracker@10.200.200.133" uuid="0d8c3b66-5201-424a-8dd4-9f3ef5b0aba4">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://10.200.200.133:5432/credit_tracker</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.host.port" />
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
<property name="com.intellij.clouds.kubernetes.db.container.port" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

6
.idea/encodings.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
</component>
</project>

25
.idea/jarRepositories.xml generated Normal file
View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="mfd" />
<option name="name" value="mfd" />
<option name="url" value="http://10.200.200.131:8888/repository/internal/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

12
.idea/misc.xml generated Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" />
</project>

4
.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings" defaultProject="true" />
</project>

26
HELP.md Normal file
View file

@ -0,0 +1,26 @@
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.4.6/maven-plugin)
* [Create an OCI image](https://docs.spring.io/spring-boot/3.4.6/maven-plugin/build-image.html)
* [Spring Web](https://docs.spring.io/spring-boot/3.4.6/reference/web/servlet.html)
* [MyBatis Framework](https://mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/)
### Guides
The following guides illustrate how to use some features concretely:
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)
* [MyBatis Quick Start](https://github.com/mybatis/spring-boot-starter/wiki/Quick-Start)
### Maven Parent overrides
Due to Maven's design, elements are inherited from the parent POM to the project POM.
While most of the inheritance is fine, it also inherits unwanted elements like `<license>` and `<developers>` from the parent.
To prevent this, the project POM contains empty overrides for these elements.
If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.

View file

@ -0,0 +1,15 @@
spring.application.name=credit_tracker
# datasources
# indic
ct.indic-data-source-settings.driver=com.ibm.db2.jcc.DB2Driver
ct.indic-data-source-settings.url=jdbc:db2://10.230.227.100:2668/cprosd22:currentSchema=INDIC;
ct.indic-data-source-settings.username=ros9appl
ct.indic-data-source-settings.password=R0s9Appl
# signal
ct.signal-data-source-settings.driver=org.postgresql.Driver
ct.signal-data-source-settings.url=jdbc:postgresql://10.200.200.133:5432/credit_tracker
ct.signal-data-source-settings.username=credit_tracker_user
ct.signal-data-source-settings.password=

View file

@ -0,0 +1,42 @@
-- Create signals_user_packages
-- Хранит основную информацию о каждом пакете мониторинга, установленном клиентом
CREATE TABLE signals_user_packages (
id SERIAL PRIMARY KEY, -- внутренний идентификатор в таблице
membercode VARCHAR(255), -- логин клиента
package_name VARCHAR(255), -- имя пакета
created_at TIMESTAMP, -- дата и время первичной регистрации пакета
status VARCHAR(255), -- статус пакета: ON_MONITORING, REJECTED, PROCESSING, DELETED, ERROR
deactivated_at TIMESTAMP, -- дата и время удаления пакета
last_downloaded_report VARCHAR(255) -- имя последнего успешно загруженного отчёта из оф. сервиса по пакету
);
-- Create signals_phone_fid_map
CREATE TABLE signals_phone_fid_map (
id SERIAL PRIMARY KEY, -- внутренний идентификатор в таблице
package_id INTEGER NOT NULL, -- идентификатор пакета
subject_id VARCHAR(255), -- идентификатор субъекта из XML
phone VARCHAR(255), -- номер телефона
fid VARCHAR(255), -- найденный FID или NULL
flag_debt5000 SMALLINT, -- 1, если есть активная просрочка > 5000 руб., иначе 0
flag_90_12 SMALLINT, -- 1, если по субъекту когда-либо была просрочка 90+ дней за последний год, иначе 0
calculated_at TIMESTAMP, -- дата последнего расчёта флагов
CONSTRAINT fk_signals_user_packages
FOREIGN KEY (package_id)
REFERENCES signals_user_packages(id)
);
-- Create signals_hits
CREATE TABLE signals_hits (
id SERIAL PRIMARY KEY, -- внутренний идентификатор в таблице
package_id INTEGER NOT NULL, -- идентификатор пакета
subject_id VARCHAR(255), -- идентификатор субъекта, по которому сработал сигнал
signal_type INTEGER, -- тип сигнала
response_sent_at TIMESTAMP, -- дата и время формирования отчета с данным сигналом
report_file_name VARCHAR(255), -- имя XML-файла отчёта, в который вошел данный сигнал
CONSTRAINT fk_signals_user_packages
FOREIGN KEY (package_id)
REFERENCES signals_user_packages(id)
);
-- Create index on response_sent_at
CREATE INDEX idx_signals_hits_response_sent_at ON signals_hits(response_sent_at);