@@ -178,7 +178,7 @@ Feature: Comdirect API Client Library
178178 And an account with accountId exists
179179 When the user requests transactions for the accountId
180180 Then the library should check token expiry before request
181- And the library should log "DEBUG: Fetching transactions for account {accountId}"
181+ And the library should log "DEBUG: Fetching ALL transactions for account {accountId}"
182182 And the library should GET /api/banking/v1/accounts/{accountId}/transactions
183183 And the library should include Authorization header with bearer token
184184 And the library should include x-http-request-info header
@@ -192,53 +192,48 @@ Feature: Comdirect API Client Library
192192 And an account with accountId exists
193193 When the user requests transactions with transactionDirection="DEBIT"
194194 Then the library should add query parameter "transactionDirection=DEBIT"
195- And the library should log "DEBUG: Fetching transactions (direction: DEBIT)"
195+ And the library should log "DEBUG: Fetching ALL transactions for account {accountId} (direction: DEBIT)"
196196 And the library should return only debit transactions
197197
198- Scenario : Retrieve transactions with pagination
199- Given the library is authenticated with valid tokens
200- And an account with accountId exists
201- When the user requests transactions with paging_first=10
202- Then the library should add query parameter "paging-first=10"
203- And the library should log "DEBUG: Fetching transactions (starting at: 10)"
204- And the library should return transactions starting from index 10
205-
206198 Scenario : Retrieve transactions with booking status filter
207199 Given the library is authenticated with valid tokens
208200 And an account with accountId exists
209201 When the user requests transactions with transactionState="BOOKED"
210202 Then the library should add query parameter "transactionState=BOOKED"
211- And the library should log "DEBUG: Fetching BOOKED transactions"
203+ And the library should log "DEBUG: Fetching ALL transactions for account {accountId} (state: BOOKED) "
212204 And the library should return only booked transactions
213205
214- Scenario : Parse transaction response into typed structures
215- Given the library receives a valid transactions response
216- When the library parses the response
217- Then each transaction should be converted to a Transaction object
218- And each Transaction should have a bookingStatus property of type str
219- And each Transaction should have a bookingDate property of type Optional[date]
220- And each Transaction should have an amount property of type Optional[AmountValue]
221- And each Transaction should have optional remitter property of type Optional[AccountInformation]
222- And each Transaction should have optional creditor property of type Optional[AccountInformation]
223- And each Transaction should have a reference property of type str
224- And each Transaction should have a transactionType property of type Optional[EnumText]
225- And each Transaction should have a remittanceInfo property of type Optional[str]
226- And negative amounts should indicate outgoing transactions
227- And positive amounts should indicate incoming transactions
228- And the library should log "DEBUG: Parsed {count} transaction objects"
229-
230- Scenario : Handle transactions with null optional fields gracefully
231- Given the library receives a transactions response with null fields
232- And some transactions have null amount
233- And some transactions have null transactionType
234- And some transactions have null remittanceInfo
235- And some transactions have null bookingDate
236- And some AccountInformation objects have null iban
237- When the library parses the response
238- Then the library should not raise an exception
239- And Transaction objects should be created with None values for null fields
240- And the library should safely handle from_dict() calls on null nested objects
241- And the library should log "DEBUG: Parsed {count} transaction objects"
206+ Scenario : Parse transaction response into typed structures
207+ Given the library receives a valid transactions response
208+ When the library parses the response
209+ Then each transaction should be converted to a Transaction object
210+ And each Transaction should have a bookingStatus property of type str
211+ And each Transaction should have a bookingDate property of type Optional[date]
212+ And each Transaction should have an amount property of type Optional[AmountValue]
213+ And each Transaction should have optional remitter property of type Optional[AccountInformation]
214+ And each Transaction should have optional creditor property of type Optional[AccountInformation]
215+ And each Transaction should have a reference property of type str
216+ And each Transaction should have a transactionType property of type Optional[EnumText]
217+ And each Transaction should have a remittanceLines field of type list[str]
218+ And each Transaction should expose a remittance_lines property returning the same list
219+ And negative amounts should indicate outgoing transactions
220+ And positive amounts should indicate incoming transactions
221+ And the library should log "DEBUG: Parsed {count} transaction objects"
222+
223+
224+ Scenario : Handle transactions with null optional fields gracefully
225+ Given the library receives a transactions response with null fields
226+ And some transactions have null amount
227+ And some transactions have null transactionType
228+ And some transactions have null bookingDate
229+ And some AccountInformation objects have null iban
230+ When the library parses the response
231+ Then the library should not raise an exception
232+ And Transaction objects should be created with None values for null fields
233+ And Transaction objects should have an empty remittanceLines list when remittanceInfo is missing or empty
234+ And the library should safely handle from_dict() calls on null nested objects
235+ And the library should log "DEBUG: Parsed {count} transaction objects"
236+
242237
243238 # ============================================================================
244239 # Error Handling and Logging
@@ -551,3 +546,32 @@ Feature: Comdirect API Client Library
551546 And transaction.debtor should be populated from "debtor"
552547 And "deptor" should be ignored
553548
549+ # ============================================================================
550+ # New: remittance line marker handling
551+ # ============================================================================
552+
553+ Scenario : Parse remittanceInfo with numbered line prefixes into remittanceLines
554+ Given the library receives a valid transactions response
555+ And some transactions have remittanceInfo values with numbered line prefixes
556+ When the library parses the response
557+ Then each Transaction should have a remittanceLines field of type list[str]
558+ And each Transaction should expose a remittance_lines property returning the same list
559+ And the library should detect numbered line markers (01, 02, 03, ... up to 99)
560+ And the library should support both short test-format remittanceInfo strings
561+ And the library should support long fixed-width remittanceInfo strings from the real API
562+ And for long-format strings, the library should detect markers using approximate spacing between markers
563+ And the library should extract the content after each marker as a logical line
564+ And the library should populate remittanceLines with one entry per logical line, in order
565+ And example "01AA02 N84G BFT2 Y5KY 02End-to-End-Ref.: 03nicht angegeben " should produce remittanceLines:
566+ | AA02 N84G BFT2 Y5KY
567+ | End -to -End -Ref .:
568+ | nicht angegeben
569+ And example "01Storno Echtzeit überweisung 02AA02 N84G BFT2 Y5KY 03R ückgabegrund : 04Auf Veranlassung der Bank " should produce remittanceLines :
570+ | Storno Echtzeit überweisung
571+ | AA02 N84G BFT2 Y5KY
572+ | R ückgabegrund :
573+ | Auf Veranlassung der Bank
574+ And the library should strip trailing whitespace from each line
575+ And the library should skip empty lines after stripping
576+
577+
0 commit comments