Skip to content

jinahya/kftc-financial-institution-info

Repository files navigation

kftc-financial-institution-info

Java CI with Maven Quality Gate Status

Maven Central Version javadoc

Website Website

A simple, no-depes, library for accessing financial institution information provided by KFTC(금융결제원, 金融決濟院, Korea Financial Telecommunications and Clearings Institute).

Table of Contents


Build environment

JDK

Requires 21 for building while the module targets 11.

<!-- $ grep '<maven.compiler' pom.xml -->
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
    <maven.compiler.release>${maven.compiler.target}</maven.compiler.release>
    <maven.compiler.testSource>21</maven.compiler.testSource>
    <maven.compiler.testTarget>${maven.compiler.testSource}</maven.compiler.testTarget>
    <maven.compiler.testRelease>${maven.compiler.testTarget}</maven.compiler.testRelease>

Apache Maven Coordinates

<dependency>
  <groupId>io.github.jinahya</groupId>
  <artifactId>kftc-financial-institution-info</artifactId>
  <!-- Check the badge above for the latest version -->
</dependency>

Usages

금융 기관 정보

001 / 한국은행

final var infoSet = KftcFinancialInstitutionInfoSet.newInstance();
final var info = infoSet.get("001");
assertThat(info).hasValueSatisfying(i -> {
assertThat(i.getCategory()).isSameAs(KftcFinancialInstitutionCategory.BANK);
assertThat(i.getCode()).isEqualTo("001");
assertThat(i.getName()).isEqualTo("한국은행");
assertThat(i.isRepresentative()).isTrue();
});

101 / 한국신용정보원

final var infoSet = KftcFinancialInstitutionInfoSet.newInstance();
final var info = infoSet.get("101");
assertThat(info).hasValueSatisfying(i -> {
assertThat(i.getCategory()).isSameAs(KftcFinancialInstitutionCategory.OTHE);
assertThat(i.getCode()).isEqualTo("101");
assertThat(i.getName()).isEqualTo("한국신용정보원");
assertThat(i.isRepresentative()).isTrue();
});

금융 기관 지점 정보

0010003 / 한국 / 본부총괄

final var infoSet = KftcFinancialInstitutionBranchInfoSet.newInstance();
final var info = infoSet.get("0010003").orElseThrow();
assert Objects.equals(info.getBranchCode(), "0010003");
assert Objects.equals(info.getFinancialInstitutionName(), "한국");
assert Objects.equals(info.getBranchName(), "본부총괄");
assert Objects.equals(info.getPhoneNumber(), "02 759 4114"); // mind multiple spaces
assert Objects.equals(info.getPhoneNumberNormalized(" "), "02 759 4114");
assert Objects.equals(info.getPhoneNumberNormalized("-"), "02-759-4114");
assert Objects.equals(info.getFaxNumber(), "02 759 4060"); // mind multiple spaces
assert Objects.equals(info.getFaxNumberNormalized(" "), "02 759 4060");
assert Objects.equals(info.getFaxNumberNormalized("-"), "02-759-4060");
assert Objects.equals(info.getPostalCode(), "100794");
assert Objects.equals(info.getAddress(), "서울특별시 중구 남대문로 39");
assert Objects.equals(info.getStatus(), "정상");
assert info.getManagingBranchCode() == null;

4920018 / 중소벤처기업진흥공단 / 성장융합금융처

final var infoSet = KftcFinancialInstitutionBranchInfoSet.newInstance();
final var info = infoSet.get("4920018").orElseThrow();
assert info.getBranchCode().equals("4920018");
assert info.getFinancialInstitutionName().equals("중소벤처기업진흥공단");
assert info.getBranchName().equals("성장융합금융처");
assert info.getPhoneNumber().equals("02 32115603"); // mind multiple spaces
assert info.getPhoneNumberNormalized(" ").equals("02 32115603");
assert info.getPhoneNumberNormalized("").equals("0232115603");
assert info.getFaxNumber().equals("0505047 4412");
assert info.getPostalCode().equals("52851");
assert info.getAddress().equals("경상남도 진주시 동진로 430 (충무공동) 중소벤처기업진흥공단");
assert info.getStatus().equals("정상");
assert info.getManagingBranchCode() == null;

Notes

Those newInstance() methods, whenever invoked, load data from resources in the classpath. Callers are recommended to ( or should) cache the result.

class KftcService {

    // less than two hundreds values
    // the set and its values are all immutable and thread-safe
    public static final KftcFinancialInstitutionInfoSet INFO_SET
            = KftcFinancialInstitutionInfoSet.newInstance();

    // more than 20 thousands values!
    // do not load if it's not required 
    public static final KftcFinancialInstitutionBranchInfoSet BRANCH_INFO_SET
            = KftcFinancialInstitutionBranchInfoSet.newInstance();
}

More output formats

SQLite DB file

You can generate an SQLite database file, while builds, into db/kftc-financial-institution-info.sqlite3.

$ mvn -Pdb process-test-resources test
$ ls -l db

See kftc-financial-institution-info.sqlite3.md for more information.

JSON

$ mvn -Pjson test
$ ls -l target/*.json
$ mvn -Pndjson test
$ ls -l target/*.ndjson

Protocol Buffers

$ mvn -Pproto test
$ ls -l target/*.*pb

Links

issues.apache.org

jakarta.ee

garrit.xyz

stackoverflow.com

About

Codes for financial institutions assigned by KFTC

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published