<commit_before>package model

import "time"

// AccountInfo holds all information for an account from the oldest to
// the latest transaction
type AccountInfo struct {
	IBAN              string         `json:"iban"`
	BIC               string         `json:"bic"`
	Balance           int32          `json:"balance"`
	Predeccessor      string         `json:"predeccessor"`
	OldestTransaction string         `json:"oldestTransaction"`
	LatestTransaction string         `json:"latestTransaction"`
	Transactions      []*Transaction `json:"transactions"`
}

// GetTransactionsAfter returns all transaction of the given accountinfo
func (ai *AccountInfo) GetTransactionsAfter(after time.Time) []*Transaction {
	length := len(ai.Transactions)

	for i := 0; i < length; i++ {
		if ai.Transactions[i].BookingDate.After(after) ||
			ai.Transactions[i].BookingDate.Equal(after) {
			return ai.Transactions[i:]
		}
	}

	return []*Transaction{}
}

// NewAccountInfo creates a new accountInf
func NewAccountInfo(bic string, iban string, balance int32, transactions []*Transaction) *AccountInfo {
	return &AccountInfo{BIC: bic, IBAN: iban, Balance: balance, Transactions: transactions}
}<commit_msg>Omit last transaction, oldest transaction when empty<commit_after>package model

import "time"

// AccountInfo holds all information for an account from the oldest to
// the latest transaction
type AccountInfo struct {
	IBAN              string         `json:"iban"`
	BIC               string         `json:"bic"`
	Balance           int32          `json:"balance"`
	Predeccessor      string         `json:"predeccessor,omitempty"`
	OldestTransaction string         `json:"oldestTransaction,omitempty"`
	LatestTransaction string         `json:"latestTransaction,omitempty"`
	Transactions      []*Transaction `json:"transactions"`
}

// GetTransactionsAfter returns all transaction of the given accountinfo
func (ai *AccountInfo) GetTransactionsAfter(after time.Time) []*Transaction {
	length := len(ai.Transactions)

	for i := 0; i < length; i++ {
		if ai.Transactions[i].BookingDate.After(after) ||
			ai.Transactions[i].BookingDate.Equal(after) {
			return ai.Transactions[i:]
		}
	}

	return []*Transaction{}
}

// NewAccountInfo creates a new accountInf
func NewAccountInfo(bic string, iban string, balance int32, transactions []*Transaction) *AccountInfo {
	return &AccountInfo{BIC: bic, IBAN: iban, Balance: balance, Transactions: transactions}
}
{'fraction_non_alphanumeric': 0.10521989313604603, 'fraction_numerical': 0.004110152075626798, 'mean_word_length': 3.7446393762183234, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2392079', 'n_tokens_mistral': 707, 'n_tokens_neox': 671, 'n_words': 196}