1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-02 04:18:38 -04:00

Store currency/security values/prices using big.Rat natively

This adds 'shadow' types used only by the store/db internal package whch
handle converting these types to their DB-equivalent values. This change
should allow reports to be generated significantly faster since it
allows a large portion of the computation to be shifted to the database
engines.
This commit is contained in:
2017-12-12 19:40:38 -05:00
parent 483adb5c56
commit a357d38eee
22 changed files with 695 additions and 201 deletions

View File

@ -213,35 +213,35 @@ var data = []TestData{
SecurityId: 1,
CurrencyId: 0,
Date: time.Date(2017, time.January, 2, 21, 0, 0, 0, time.UTC),
Value: "225.24",
Value: NewAmount("225.24"),
RemoteId: "12387-129831-1238",
},
{
SecurityId: 1,
CurrencyId: 0,
Date: time.Date(2017, time.January, 3, 21, 0, 0, 0, time.UTC),
Value: "226.58",
Value: NewAmount("226.58"),
RemoteId: "12387-129831-1239",
},
{
SecurityId: 1,
CurrencyId: 0,
Date: time.Date(2017, time.January, 4, 21, 0, 0, 0, time.UTC),
Value: "226.40",
Value: NewAmount("226.40"),
RemoteId: "12387-129831-1240",
},
{
SecurityId: 1,
CurrencyId: 0,
Date: time.Date(2017, time.January, 5, 21, 0, 0, 0, time.UTC),
Value: "227.21",
Value: NewAmount("227.21"),
RemoteId: "12387-129831-1241",
},
{
SecurityId: 0,
CurrencyId: 3,
Date: time.Date(2017, time.November, 16, 18, 49, 53, 0, time.UTC),
Value: "0.85",
Value: NewAmount("0.85"),
RemoteId: "USDEUR819298714",
},
},
@ -313,13 +313,13 @@ var data = []TestData{
Status: models.Reconciled,
AccountId: 1,
SecurityId: -1,
Amount: "-5.6",
Amount: NewAmount("-5.6"),
},
{
Status: models.Reconciled,
AccountId: 3,
SecurityId: -1,
Amount: "5.6",
Amount: NewAmount("5.6"),
},
},
},
@ -332,13 +332,13 @@ var data = []TestData{
Status: models.Reconciled,
AccountId: 1,
SecurityId: -1,
Amount: "-81.59",
Amount: NewAmount("-81.59"),
},
{
Status: models.Reconciled,
AccountId: 3,
SecurityId: -1,
Amount: "81.59",
Amount: NewAmount("81.59"),
},
},
},
@ -351,13 +351,13 @@ var data = []TestData{
Status: models.Reconciled,
AccountId: 1,
SecurityId: -1,
Amount: "-39.99",
Amount: NewAmount("-39.99"),
},
{
Status: models.Entered,
AccountId: 4,
SecurityId: -1,
Amount: "39.99",
Amount: NewAmount("39.99"),
},
},
},
@ -370,13 +370,13 @@ var data = []TestData{
Status: models.Reconciled,
AccountId: 5,
SecurityId: -1,
Amount: "-24.56",
Amount: NewAmount("-24.56"),
},
{
Status: models.Entered,
AccountId: 6,
SecurityId: -1,
Amount: "24.56",
Amount: NewAmount("24.56"),
},
},
},