@fuzzle/opencode-accountant 0.14.0-next.1 → 0.15.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +8 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -17188,6 +17188,11 @@ function getYesterday() {
17188
17188
  d.setDate(d.getDate() - 1);
17189
17189
  return formatDateISO(d);
17190
17190
  }
17191
+ function getOneMonthAgo() {
17192
+ const d = new Date;
17193
+ d.setMonth(d.getMonth() - 1);
17194
+ return formatDateISO(d);
17195
+ }
17191
17196
  function getNextDay(dateStr) {
17192
17197
  const date5 = new Date(dateStr);
17193
17198
  date5.setDate(date5.getDate() + 1);
@@ -17228,6 +17233,8 @@ function buildPricehistArgs(startDate, endDate, config2) {
17228
17233
  "fetch",
17229
17234
  "-o",
17230
17235
  "ledger",
17236
+ "--quantize",
17237
+ "2",
17231
17238
  "-s",
17232
17239
  startDate,
17233
17240
  "-e",
@@ -17273,7 +17280,7 @@ function filterAndSortPriceLinesByDateRange(priceLines, startDate, endDate) {
17273
17280
  }).sort((a, b) => a.date.localeCompare(b.date)).map((parsed) => parsed.formattedLine);
17274
17281
  }
17275
17282
  async function fetchAndWritePrices(ticker, config2, outputSubdir, directory, endDate, defaultBackfillDate, backfill, priceFetcher) {
17276
- const startDate = backfill ? config2.backfill_date || defaultBackfillDate : endDate;
17283
+ const startDate = backfill ? config2.backfill_date || defaultBackfillDate : getOneMonthAgo();
17277
17284
  const cmdArgs = buildPricehistArgs(startDate, endDate, config2);
17278
17285
  const output = await priceFetcher(cmdArgs);
17279
17286
  const rawPriceLines = output.split(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuzzle/opencode-accountant",
3
- "version": "0.14.0-next.1",
3
+ "version": "0.15.0-next.1",
4
4
  "description": "An OpenCode accounting agent, specialized in double-entry-bookkepping with hledger",
5
5
  "author": {
6
6
  "name": "ali bengali",