~mendelmaleh/pfin

ref: 1f051309601a4da2841fade1e72cb120bccab370 pfin/parser/bofa/types.go -rw-r--r-- 429 bytes
1f051309Mendel E Add license 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package bofa

import "time"

type RawTransaction struct {
	DateField      Date    `csv:"Date"`
	Description    string  `csv:"Description"`
	AmountField    float64 `csv:"Amount,omitempty"`
	RunningBalance float64 `csv:"Running Bal."`
}

type Date struct {
	time.Time
}

func (d *Date) UnmarshalText(data []byte) error {
	t, err := time.Parse("01/02/2006", string(data))
	if err != nil {
		return err
	}

	d.Time = t
	return nil
}