Renamed follow-up card number to card sequence number

This commit is contained in:
dankl 2019-12-31 00:22:23 +01:00 committed by dankito
parent fc2a5e6cf9
commit bf535ba88e
7 changed files with 31 additions and 31 deletions

View File

@ -104,8 +104,8 @@ open class fints4javaModelMapper {
protected open fun getDisplayNameForTanMedium(tanMedium: net.dankito.fints.messages.datenelemente.implementierte.tan.TanMedium): String { protected open fun getDisplayNameForTanMedium(tanMedium: net.dankito.fints.messages.datenelemente.implementierte.tan.TanMedium): String {
if (tanMedium is TanGeneratorTanMedium) { if (tanMedium is TanGeneratorTanMedium) {
var cardNumber = tanMedium.cardNumber var cardNumber = tanMedium.cardNumber
tanMedium.followUpCardNumber?.let { tanMedium.cardSequenceNumber?.let {
cardNumber += " (Folgenummer $it)" // TODO: translate cardNumber += " (Kartenfolgenummer $it)" // TODO: translate
} }
tanMedium.mediaName?.let { mediaName -> tanMedium.mediaName?.let { mediaName ->

View File

@ -7,7 +7,7 @@ class TanGeneratorTanMedium(
mediumClass: TanMediumKlasse, mediumClass: TanMediumKlasse,
status: TanMediumStatus, status: TanMediumStatus,
val cardNumber: String, val cardNumber: String,
val followUpCardNumber: String?, val cardSequenceNumber: String?,
val cardType: Int?, val cardType: Int?,
val validFrom: Date?, val validFrom: Date?,
val validTo: Date?, val validTo: Date?,
@ -23,7 +23,7 @@ class TanGeneratorTanMedium(
other as TanGeneratorTanMedium other as TanGeneratorTanMedium
if (cardNumber != other.cardNumber) return false if (cardNumber != other.cardNumber) return false
if (followUpCardNumber != other.followUpCardNumber) return false if (cardSequenceNumber != other.cardSequenceNumber) return false
if (cardType != other.cardType) return false if (cardType != other.cardType) return false
if (validFrom != other.validFrom) return false if (validFrom != other.validFrom) return false
if (validTo != other.validTo) return false if (validTo != other.validTo) return false
@ -35,7 +35,7 @@ class TanGeneratorTanMedium(
override fun hashCode(): Int { override fun hashCode(): Int {
var result = super.hashCode() var result = super.hashCode()
result = 31 * result + cardNumber.hashCode() result = 31 * result + cardNumber.hashCode()
result = 31 * result + followUpCardNumber.hashCode() result = 31 * result + cardSequenceNumber.hashCode()
result = 31 * result + (cardType?.hashCode() ?: 0) result = 31 * result + (cardType?.hashCode() ?: 0)
result = 31 * result + (validFrom?.hashCode() ?: 0) result = 31 * result + (validFrom?.hashCode() ?: 0)
result = 31 * result + (validTo?.hashCode() ?: 0) result = 31 * result + (validTo?.hashCode() ?: 0)
@ -45,7 +45,7 @@ class TanGeneratorTanMedium(
override fun toString(): String { override fun toString(): String {
return super.toString() + " $mediaName $cardNumber (follow up: ${followUpCardNumber ?: "-"})" return super.toString() + " $mediaName $cardNumber (card sequence number: ${cardSequenceNumber ?: "-"})"
} }
} }

View File

@ -62,7 +62,7 @@ open class TanGeneratorTanMediumAnOderUmmelden(
Segmentkopf(CustomerSegmentId.ChangeTanMedium, segmentVersion, segmentNumber), Segmentkopf(CustomerSegmentId.ChangeTanMedium, segmentVersion, segmentNumber),
Code(TanMediumKlasse.TanGenerator, allCodes<TanMediumKlasse>(), Existenzstatus.Mandatory), Code(TanMediumKlasse.TanGenerator, allCodes<TanMediumKlasse>(), Existenzstatus.Mandatory),
AlphanumerischesDatenelement(newActiveTanMedium.cardNumber, Existenzstatus.Mandatory), AlphanumerischesDatenelement(newActiveTanMedium.cardNumber, Existenzstatus.Mandatory),
AlphanumerischesDatenelement(newActiveTanMedium.followUpCardNumber, if (parameters.enteringFollowUpCardNumberRequired) Existenzstatus.Mandatory else Existenzstatus.NotAllowed), AlphanumerischesDatenelement(newActiveTanMedium.cardSequenceNumber, if (parameters.enteringCardSequenceNumberRequired) Existenzstatus.Mandatory else Existenzstatus.NotAllowed),
if (segmentVersion > 1) NumerischesDatenelement(newActiveTanMedium.cardType, 2, if (parameters.enteringCardTypeAllowed) Existenzstatus.Optional else Existenzstatus.NotAllowed) else DoNotPrintDatenelement(), if (segmentVersion > 1) NumerischesDatenelement(newActiveTanMedium.cardType, 2, if (parameters.enteringCardTypeAllowed) Existenzstatus.Optional else Existenzstatus.NotAllowed) else DoNotPrintDatenelement(),
if (segmentVersion == 2) Kontoverbindung(bank, customer, customer.accounts.firstOrNull()) else DoNotPrintDatenelement(), if (segmentVersion == 2) Kontoverbindung(bank, customer, customer.accounts.firstOrNull()) else DoNotPrintDatenelement(),
if (segmentVersion >= 3 && parameters.accountInfoRequired) KontoverbindungInternational(bank, customer, customer.accounts.firstOrNull()) else DoNotPrintDatenelement(), if (segmentVersion >= 3 && parameters.accountInfoRequired) KontoverbindungInternational(bank, customer, customer.accounts.firstOrNull()) else DoNotPrintDatenelement(),

View File

@ -4,7 +4,7 @@ package net.dankito.fints.response.segments
open class ChangeTanMediaParameters( open class ChangeTanMediaParameters(
parameters: JobParameters, parameters: JobParameters,
val enteringTanListNumberRequired: Boolean, val enteringTanListNumberRequired: Boolean,
val enteringFollowUpCardNumberRequired: Boolean, val enteringCardSequenceNumberRequired: Boolean,
val enteringAtcAndTanRequired: Boolean, val enteringAtcAndTanRequired: Boolean,
val enteringCardTypeAllowed: Boolean, val enteringCardTypeAllowed: Boolean,
val accountInfoRequired: Boolean, val accountInfoRequired: Boolean,

View File

@ -45,7 +45,7 @@ class FinTsClientTest {
override fun enterTanGeneratorAtc(customer: CustomerData, tanMedium: TanGeneratorTanMedium): EnterTanGeneratorAtcResult? { override fun enterTanGeneratorAtc(customer: CustomerData, tanMedium: TanGeneratorTanMedium): EnterTanGeneratorAtcResult? {
Assert.fail("Bank asks you to synchronize your TAN generator for card ${tanMedium.cardNumber} " + Assert.fail("Bank asks you to synchronize your TAN generator for card ${tanMedium.cardNumber} " +
"(follow-up number ${tanMedium.followUpCardNumber}). Please do this via your online banking portal or Banking UI.") "(card sequence number ${tanMedium.cardSequenceNumber}). Please do this via your online banking portal or Banking UI.")
return null // should actually never be called return null // should actually never be called
} }

View File

@ -18,19 +18,19 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
private const val CardNumber = "9876543210" private const val CardNumber = "9876543210"
private const val FollowUpCardNumber = "02" private const val CardSequenceNumber = "02"
private const val CardType = 11 private const val CardType = 11
private const val SegmentNumber = 3 private const val SegmentNumber = 3
private val NewActiveTanMedium = TanGeneratorTanMedium(TanMediumKlasse.TanGenerator, TanMediumStatus.Verfuegbar, CardNumber, FollowUpCardNumber, CardType, null, null, "EC-Card") private val NewActiveTanMedium = TanGeneratorTanMedium(TanMediumKlasse.TanGenerator, TanMediumStatus.Verfuegbar, CardNumber, CardSequenceNumber, CardType, null, null, "EC-Card")
} }
@Test @Test
fun format_Version1_AtcNotRequired_FollowUpCardNumberNotRequired() { fun format_Version1_AtcNotRequired_CardSequenceNumberNotRequired() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, false, false, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, false, false, false, listOf())
@ -47,7 +47,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
} }
@Test @Test
fun format_Version1_AtcRequired_FollowUpCardNumberNotRequired() { fun format_Version1_AtcRequired_CardSequenceNumberNotRequired() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, true, false, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, true, false, false, listOf())
@ -64,7 +64,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
} }
@Test @Test
fun format_Version1_AtcNotRequired_FollowUpCardNumberRequired() { fun format_Version1_AtcNotRequired_CardSequenceNumberRequired() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, true, false, false, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, true, false, false, false, listOf())
@ -77,11 +77,11 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
// then // then
assertThat(result).isEqualTo("HKTAU:$SegmentNumber:1+G+$CardNumber+$FollowUpCardNumber") assertThat(result).isEqualTo("HKTAU:$SegmentNumber:1+G+$CardNumber+$CardSequenceNumber")
} }
@Test @Test
fun format_Version1_AtcRequired_FollowUpCardNumberRequired() { fun format_Version1_AtcRequired_CardSequenceNumberRequired() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, true, true, false, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, true, true, false, false, listOf())
@ -94,12 +94,12 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
// then // then
assertThat(result).isEqualTo("HKTAU:$SegmentNumber:1+G+$CardNumber+$FollowUpCardNumber++$ATC+$TAN") assertThat(result).isEqualTo("HKTAU:$SegmentNumber:1+G+$CardNumber+$CardSequenceNumber++$ATC+$TAN")
} }
@Test @Test
fun format_Version2_AtcNotRequired_FollowUpCardNumberNotRequired_CardTypeNotAllowed() { fun format_Version2_AtcNotRequired_CardSequenceNumberNotRequired_CardTypeNotAllowed() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, false, false, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, false, false, false, listOf())
@ -116,7 +116,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
} }
@Test @Test
fun format_Version2_AtcRequired_FollowUpCardNumberNotRequired_CardTypeNotAllowed() { fun format_Version2_AtcRequired_CardSequenceNumberNotRequired_CardTypeNotAllowed() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, true, false, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, true, false, false, listOf())
@ -133,7 +133,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
} }
@Test @Test
fun format_Version2_AtcNotRequired_FollowUpCardNumberRequired_CardTypeNotAllowed() { fun format_Version2_AtcNotRequired_CardSequenceNumberRequired_CardTypeNotAllowed() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, true, false, false, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, true, false, false, false, listOf())
@ -146,11 +146,11 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
// then // then
assertThat(result).isEqualTo("HKTAU:$SegmentNumber:2+G+$CardNumber+$FollowUpCardNumber++$CustomerId::$BankCountryCode:$BankCode") assertThat(result).isEqualTo("HKTAU:$SegmentNumber:2+G+$CardNumber+$CardSequenceNumber++$CustomerId::$BankCountryCode:$BankCode")
} }
@Test @Test
fun format_Version2_AtcNotRequired_FollowUpCardNumberNotRequired_CardTypeAllowed() { fun format_Version2_AtcNotRequired_CardSequenceNumberNotRequired_CardTypeAllowed() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, false, true, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, false, false, true, false, listOf())
@ -167,7 +167,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
} }
@Test @Test
fun format_Version2_AtcRequired_FollowUpCardNumberRequired_CardTypeAllowed() { fun format_Version2_AtcRequired_CardSequenceNumberRequired_CardTypeAllowed() {
// given // given
val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, true, true, true, false, listOf()) val parameters = ChangeTanMediaParameters(createEmptyJobParameters(), false, true, true, true, false, listOf())
@ -180,7 +180,7 @@ class TanGeneratorTanMediumAnOderUmmeldenTest: FinTsTestBase() {
// then // then
assertThat(result).isEqualTo("HKTAU:$SegmentNumber:2+G+$CardNumber+$FollowUpCardNumber+$CardType+$CustomerId::$BankCountryCode:$BankCode++++$ATC+$TAN") assertThat(result).isEqualTo("HKTAU:$SegmentNumber:2+G+$CardNumber+$CardSequenceNumber+$CardType+$CustomerId::$BankCountryCode:$BankCode++++$ATC+$TAN")
} }
// TODO: may also test 'gueltig ab' and 'gueltig bis' // TODO: may also test 'gueltig ab' and 'gueltig bis'

View File

@ -688,11 +688,11 @@ class ResponseParserTest : FinTsTestBase() {
// given // given
val oldCardNumber = "5109972878" val oldCardNumber = "5109972878"
val followUpCardNumber = "5200310149" val cardSequenceNumber = "5200310149"
val mediaName = "EC-Card (Debitkarte)" val mediaName = "EC-Card (Debitkarte)"
// when // when
val result = underTest.parse("HITAB:5:4:3+1+G:3:$oldCardNumber:$followUpCardNumber:::::::::$mediaName::::::::+G:2:$followUpCardNumber::::::::::$mediaName::::::::'") val result = underTest.parse("HITAB:5:4:3+1+G:3:$oldCardNumber:$cardSequenceNumber:::::::::$mediaName::::::::+G:2:$cardSequenceNumber::::::::::$mediaName::::::::'")
// then // then
assertSuccessfullyParsedSegment(result, InstituteSegmentId.TanMediaList, 5, 4, 3) assertSuccessfullyParsedSegment(result, InstituteSegmentId.TanMediaList, 5, 4, 3)
@ -702,8 +702,8 @@ class ResponseParserTest : FinTsTestBase() {
result.getFirstSegmentById<TanMediaList>(InstituteSegmentId.TanMediaList)?.let { segment -> result.getFirstSegmentById<TanMediaList>(InstituteSegmentId.TanMediaList)?.let { segment ->
assertThat(segment.usageOption).isEqualTo(TanEinsatzOption.KundeKannGenauEinMediumZuEinerZeitNutzen) assertThat(segment.usageOption).isEqualTo(TanEinsatzOption.KundeKannGenauEinMediumZuEinerZeitNutzen)
assertThat(segment.tanMedia).containsOnly( assertThat(segment.tanMedia).containsOnly(
TanGeneratorTanMedium(TanMediumKlasse.TanGenerator, TanMediumStatus.AktivFolgekarte, oldCardNumber, followUpCardNumber, null, null, null, mediaName), TanGeneratorTanMedium(TanMediumKlasse.TanGenerator, TanMediumStatus.AktivFolgekarte, oldCardNumber, cardSequenceNumber, null, null, null, mediaName),
TanGeneratorTanMedium(TanMediumKlasse.TanGenerator, TanMediumStatus.Verfuegbar, followUpCardNumber, null, null, null, null, mediaName) TanGeneratorTanMedium(TanMediumKlasse.TanGenerator, TanMediumStatus.Verfuegbar, cardSequenceNumber, null, null, null, null, mediaName)
) )
} }
?: run { Assert.fail("No segment of type TanMediaList found in ${result.receivedSegments}") } ?: run { Assert.fail("No segment of type TanMediaList found in ${result.receivedSegments}") }
@ -726,7 +726,7 @@ class ResponseParserTest : FinTsTestBase() {
assertThat(segment.securityClass).isEqualTo(1) assertThat(segment.securityClass).isEqualTo(1)
assertThat(segment.enteringTanListNumberRequired).isTrue() assertThat(segment.enteringTanListNumberRequired).isTrue()
assertThat(segment.enteringFollowUpCardNumberRequired).isFalse() assertThat(segment.enteringCardSequenceNumberRequired).isFalse()
assertThat(segment.enteringAtcAndTanRequired).isTrue() assertThat(segment.enteringAtcAndTanRequired).isTrue()
assertThat(segment.enteringCardTypeAllowed).isFalse() assertThat(segment.enteringCardTypeAllowed).isFalse()
assertThat(segment.accountInfoRequired).isFalse() assertThat(segment.accountInfoRequired).isFalse()
@ -750,7 +750,7 @@ class ResponseParserTest : FinTsTestBase() {
assertThat(segment.securityClass).isEqualTo(1) assertThat(segment.securityClass).isEqualTo(1)
assertThat(segment.enteringTanListNumberRequired).isFalse() assertThat(segment.enteringTanListNumberRequired).isFalse()
assertThat(segment.enteringFollowUpCardNumberRequired).isTrue() assertThat(segment.enteringCardSequenceNumberRequired).isTrue()
assertThat(segment.enteringAtcAndTanRequired).isFalse() assertThat(segment.enteringAtcAndTanRequired).isFalse()
assertThat(segment.enteringCardTypeAllowed).isTrue() assertThat(segment.enteringCardTypeAllowed).isTrue()
assertThat(segment.accountInfoRequired).isFalse() assertThat(segment.accountInfoRequired).isFalse()
@ -774,7 +774,7 @@ class ResponseParserTest : FinTsTestBase() {
assertThat(segment.securityClass).isEqualTo(1) assertThat(segment.securityClass).isEqualTo(1)
assertThat(segment.enteringTanListNumberRequired).isFalse() assertThat(segment.enteringTanListNumberRequired).isFalse()
assertThat(segment.enteringFollowUpCardNumberRequired).isTrue() assertThat(segment.enteringCardSequenceNumberRequired).isTrue()
assertThat(segment.enteringAtcAndTanRequired).isFalse() assertThat(segment.enteringAtcAndTanRequired).isFalse()
assertThat(segment.enteringCardTypeAllowed).isTrue() assertThat(segment.enteringCardTypeAllowed).isTrue()
assertThat(segment.accountInfoRequired).isTrue() assertThat(segment.accountInfoRequired).isTrue()