mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 10:33:02 -05:00
Import category notes from YNAB4 exports (#1515)
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
This commit is contained in:
committed by
GitHub
parent
b325bd9b18
commit
71f885b899
@@ -16,6 +16,7 @@ export namespace YNAB4 {
|
||||
export interface MasterCategory {
|
||||
entityType: string;
|
||||
expanded: boolean;
|
||||
note?: string;
|
||||
name: string;
|
||||
type: string;
|
||||
deleteable: boolean;
|
||||
@@ -31,6 +32,7 @@ export namespace YNAB4 {
|
||||
export interface SubCategory {
|
||||
entityType: string;
|
||||
name: string;
|
||||
note?: string;
|
||||
type: string;
|
||||
// cachedBalance: null;
|
||||
masterCategoryId: string;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// into Actual itself. We only want to pull in the methods in that
|
||||
// case and ignore everything else; otherwise we'd be pulling in the
|
||||
// entire backend bundle from the API
|
||||
import { send } from '@actual-app/api/injected';
|
||||
import * as actual from '@actual-app/api/methods';
|
||||
import { amountToInteger } from '@actual-app/api/utils';
|
||||
import AdmZip from 'adm-zip';
|
||||
@@ -54,6 +55,9 @@ async function importCategories(
|
||||
is_income: false,
|
||||
});
|
||||
entityIdMap.set(masterCategory.entityId, id);
|
||||
if (masterCategory.note) {
|
||||
send('notes-save', { id, note: masterCategory.note });
|
||||
}
|
||||
|
||||
if (masterCategory.subCategories) {
|
||||
const subCategories = sortByKey(
|
||||
@@ -71,6 +75,9 @@ async function importCategories(
|
||||
group_id: entityIdMap.get(category.masterCategoryId),
|
||||
});
|
||||
entityIdMap.set(category.entityId, id);
|
||||
if (category.note) {
|
||||
send('notes-save', { id, note: category.note });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
upcoming-release-notes/1515.md
Normal file
6
upcoming-release-notes/1515.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Enhancements
|
||||
authors: [kyrias]
|
||||
---
|
||||
|
||||
Import category notes from YNAB4 exports.
|
||||
Reference in New Issue
Block a user