From 310adecdc05c41b0183a490a98f1ec0e344603aa Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Sat, 13 Apr 2019 21:57:01 +0100 Subject: [PATCH] Added functionality for adding and deleting transactions manually, and loading and saving using localstorage, however there is a bug with the job passed to localstorage. Also changed the data structure slightly. --- README.md | 2 +- package-lock.json | 3 +- package.json | 1 + src/App.vue | 42 ------------- src/components/AddTransaction.vue | 51 ++++++++++++++++ src/components/TransactionLine.vue | 35 +++++++++++ src/components/Transactions.vue | 21 +++++++ src/views/Home.vue | 96 ++++++++++++++++++++++++++++-- 8 files changed, 200 insertions(+), 51 deletions(-) create mode 100644 src/components/AddTransaction.vue create mode 100644 src/components/TransactionLine.vue create mode 100644 src/components/Transactions.vue diff --git a/README.md b/README.md index 4865c37..aa26b9b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ If you wish to contribute other bank statement csv formats or features then plea ### Things for version 1.0 -1. Set up adding statement lines and displaying them +1. ~~Set up adding statement lines and displaying them~~ 2. Set up adding and saving statement lines with localstorage, and reloading from localstorage 3. Set up importing a csv file (bank statement) to the data structure, adding each line 4. Modify that to ignore any entries that already exist upon import diff --git a/package-lock.json b/package-lock.json index 76c08ea..7d8bb64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10566,8 +10566,7 @@ "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", - "dev": true + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "validate-npm-package-license": { "version": "3.0.4", diff --git a/package.json b/package.json index 2d42dab..5879eca 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ }, "dependencies": { "core-js": "^2.6.5", + "uuid": "^3.3.2", "vue": "^2.6.6", "vue-router": "^3.0.1" }, diff --git a/src/App.vue b/src/App.vue index 2e0ce4b..fb191bf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,48 +11,6 @@ export default { name: 'app', components: { Header - }, - data: function() { - return { - accounts: [ - { - "AccountName": "", - "Bank": "", - "Transactions": [ - { - "Date": "", - "TransactionTypeDescription": "", - "Description": "", - "IsExpenditure": true, - "Amount": 0, - "Balance": 0, - "Tags": [] - } - ] - } - ], - tagsExpenditure: [ - "Appearance", - "Bills - Car", - "Bills - Home", - "Bills - Subscriptions", - "Eating out", - "Enjoyment", - "Family", - "Home", - "Insurance", - "One-off or other", - "Repayments", - "Savings", - "Transfers", - "Transport" - ], - tagsIncome: [ - "Other", - "Savings", - "Wages" - ] - } } } diff --git a/src/components/AddTransaction.vue b/src/components/AddTransaction.vue new file mode 100644 index 0000000..9f61281 --- /dev/null +++ b/src/components/AddTransaction.vue @@ -0,0 +1,51 @@ + + + + + \ No newline at end of file diff --git a/src/components/TransactionLine.vue b/src/components/TransactionLine.vue new file mode 100644 index 0000000..b6d7c69 --- /dev/null +++ b/src/components/TransactionLine.vue @@ -0,0 +1,35 @@ + + + + + \ No newline at end of file diff --git a/src/components/Transactions.vue b/src/components/Transactions.vue new file mode 100644 index 0000000..eb2806b --- /dev/null +++ b/src/components/Transactions.vue @@ -0,0 +1,21 @@ + + + + + \ No newline at end of file diff --git a/src/views/Home.vue b/src/views/Home.vue index fc2e940..1122558 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,18 +1,102 @@ + + \ No newline at end of file