Documentation
¶
Index ¶
- Constants
- func ConvertRawWithMonthToMovement(row pdftable.Row, cuotasSubDetailRegex *regexp.Regexp) (pdfcardsummary.Movement, error)
- func ConvertRawWithoutMonthToMovement(row pdftable.Row, cuotasSubDetailRegex *regexp.Regexp, ...) (pdfcardsummary.Movement, error)
- func ConvertToFullDate(movWithOnlyDay pdfcardsummary.MovementWithOnlyDay, ...) (pdfcardsummary.Movement, error)
- func ConvertToSaldoAnteriorMovement(rawMovement pdftable.Row) (pdfcardsummary.Movement, error)
- func ExtendPreviousMovementDetail(prevMov *pdfcardsummary.Movement, ...) error
- type AnomalyAdjustment
- type AnomalyDetectionInfo
- type Currency
- type SantanderExtractor
- type SantanderExtractorConfig
- type SantanderTableExtractor
Constants ¶
View Source
const (
// AnomalyAdjustmentDetail is the detail text for anomaly adjustment movements
AnomalyAdjustmentDetail = "WARNING: AJUSTE POR FILA DESALINEADA - DECIMALES PERDIDOS"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertToFullDate ¶
func ConvertToFullDate(movWithOnlyDay pdfcardsummary.MovementWithOnlyDay, prevMov pdfcardsummary.Movement) (pdfcardsummary.Movement, error)
func ConvertToSaldoAnteriorMovement ¶
func ConvertToSaldoAnteriorMovement(rawMovement pdftable.Row) (pdfcardsummary.Movement, error)
func ExtendPreviousMovementDetail ¶
func ExtendPreviousMovementDetail(prevMov *pdfcardsummary.Movement, movExtension pdfcardsummary.MovementExtension) error
Types ¶
type AnomalyAdjustment ¶
AnomalyAdjustment represents a calculated anomaly adjustment
type AnomalyDetectionInfo ¶
type AnomalyDetectionInfo struct {
// HasAmountOnlyRowWithoutDecimals indicates if an amount-only row without decimals was detected
HasAmountOnlyRowWithoutDecimals bool
// AffectedCardIndex is the index of the card that had the glitched movement
AffectedCardIndex int
// AffectedMovementIndex is the index of the movement within the card that was glitched
AffectedMovementIndex int
}
AnomalyDetectionInfo tracks when an amount-only row without decimals is detected
type SantanderExtractor ¶
type SantanderExtractor struct {
// contains filtered or unexported fields
}
SantanderExtractor extracts the Card Summary from Santander PDFs The inspection is ignored because having the name in the structs helps to disambiguate the files between different extractors
func NewSantanderExtractor ¶
func NewSantanderExtractor(cfg SantanderExtractorConfig) *SantanderExtractor
func NewSantanderExtractorFromDefaultCfg ¶
func NewSantanderExtractorFromDefaultCfg() *SantanderExtractor
func (*SantanderExtractor) ExtractFromBytes ¶
func (r *SantanderExtractor) ExtractFromBytes(rawBytes []byte) (pdfcardsummary.CardSummary, error)
func (*SantanderExtractor) ExtractFromDocument ¶
func (r *SantanderExtractor) ExtractFromDocument(pdfDoc pdfwrapper.Document) (pdfcardsummary.CardSummary, error)
type SantanderExtractorConfig ¶
type SantanderExtractorConfig struct {
ClosingDateRegex *regexp.Regexp
ExpirationDateRegex *regexp.Regexp
SaldoAnteriorRegex *regexp.Regexp
EndOfPastPaymentsRegex *regexp.Regexp
TotalConsumosTarjetaRegex *regexp.Regexp
CuotasSubDetailRegex *regexp.Regexp
AmountOnlyRowRegex *regexp.Regexp
TableColumnPositions pdftable.PDFTablePositions
TableFirstRowPositionInPage int
TotalAmountsPage int
TotalAmountsRow int
TotalAmountsSanityCheckRegex *regexp.Regexp
}
func DefaultConfig ¶
func DefaultConfig() SantanderExtractorConfig
type SantanderTableExtractor ¶
type SantanderTableExtractor struct {
// contains filtered or unexported fields
}
func NewSantanderTableExtractor ¶
func NewSantanderTableExtractor(cfg SantanderExtractorConfig) *SantanderTableExtractor
func (*SantanderTableExtractor) Extract ¶
func (te *SantanderTableExtractor) Extract(rowIterator pdftable.TableIterator) (pdfcardsummary.Table, error)
TODO: Add unit test for Extract method - test complete table extraction with mock iterator Test cases: empty iterator, only SALDO ANTERIOR, complete table with cards and taxes
func (*SantanderTableExtractor) GetAnomalyInfo ¶
func (te *SantanderTableExtractor) GetAnomalyInfo() AnomalyDetectionInfo
GetAnomalyInfo returns the anomaly detection information
Click to show internal directories.
Click to hide internal directories.