From 1e0286fd74ba8623ee820b4ffb99dce9bf4cd71d Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Tue, 9 May 2023 11:16:09 -0500 Subject: [PATCH] Update owner structure --- package-lock.json | 188 +++++++++--------- src/app/business/business.component.ts | 115 +++++------ src/app/db-export/db-export.component.ts | 11 - src/app/fullnode.service.ts | 11 - src/app/header/header.component.ts | 12 -- .../items/item-list/item-list.component.ts | 14 +- src/app/listorders/listorders.component.ts | 12 -- src/app/login/login.component.ts | 11 - src/app/order/order.service.ts | 11 - src/app/owner.model.ts | 11 - src/app/pmtservice/pmtservice.component.ts | 16 +- src/app/receipt.service.ts | 11 - src/app/settings/settings.component.ts | 24 ++- src/app/user.service.ts | 40 ++-- src/app/viewer/viewer.component.ts | 13 +- src/app/xeroreg/xeroreg.component.ts | 39 ++-- 16 files changed, 192 insertions(+), 347 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9e0da7..463ab68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "zgo", - "version": "1.4.1", + "version": "2.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "zgo", - "version": "1.4.1", + "version": "2.1.0", "dependencies": { "@angular-material-components/datetime-picker": "^9.0.0", "@angular/animations": "^15.1.2", @@ -3924,6 +3924,12 @@ "yarn": ">= 1.13.0" } }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", + "dev": true + }, "node_modules/@supercharge/request-ip": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@supercharge/request-ip/-/request-ip-1.2.0.tgz", @@ -3963,12 +3969,6 @@ "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", "dev": true }, - "node_modules/@types/component-emitter": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", - "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==", - "dev": true - }, "node_modules/@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", @@ -3995,10 +3995,13 @@ "dev": true }, "node_modules/@types/cors": { - "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true + "version": "2.8.13", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", + "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } }, "node_modules/@types/eslint": { "version": "8.4.10", @@ -5438,12 +5441,6 @@ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, "node_modules/compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -6167,9 +6164,9 @@ } }, "node_modules/engine.io": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.1.tgz", - "integrity": "sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.2.tgz", + "integrity": "sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg==", "dev": true, "dependencies": { "@types/cookie": "^0.4.1", @@ -6181,16 +6178,16 @@ "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" + "ws": "~8.11.0" }, "engines": { "node": ">=10.0.0" } }, "node_modules/engine.io-parser": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz", - "integrity": "sha512-+nVFp+5z1E3HcToEnO7ZIj3g+3k9389DvWtvJZz0T6/eOCPIyyxehFcedoYrZQrp0LgQbD9pPXhpMBKMd5QURg==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz", + "integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==", "dev": true, "engines": { "node": ">=10.0.0" @@ -7129,9 +7126,9 @@ "license": "MIT" }, "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "node_modules/http-deceiver": { @@ -9358,8 +9355,9 @@ }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -10895,36 +10893,38 @@ } }, "node_modules/socket.io": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.1.tgz", - "integrity": "sha512-0y9pnIso5a9i+lJmsCdtmTTgJFFSvNQKDnPQRz28mGNnxbmqYg2QPtJTLFxhymFZhAIn50eHAKzJeiNaKr+yUQ==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.1.tgz", + "integrity": "sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA==", "dev": true, "dependencies": { "accepts": "~1.3.4", "base64id": "~2.0.0", "debug": "~4.3.2", - "engine.io": "~6.2.0", - "socket.io-adapter": "~2.4.0", - "socket.io-parser": "~4.0.4" + "engine.io": "~6.4.1", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.1" }, "engines": { "node": ">=10.0.0" } }, "node_modules/socket.io-adapter": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz", - "integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==", - "dev": true - }, - "node_modules/socket.io-parser": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.5.tgz", - "integrity": "sha512-sNjbT9dX63nqUFIOv95tTVm6elyIU4RvB1m8dOeZt+IgWwcWklFDOdmGcfo3zSiRsnR/3pJkjY5lfoGqEe4Eig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", + "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", "dev": true, "dependencies": { - "@types/component-emitter": "^1.2.10", - "component-emitter": "~1.3.0", + "ws": "~8.11.0" + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz", + "integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==", + "dev": true, + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" }, "engines": { @@ -12113,9 +12113,10 @@ "license": "ISC" }, "node_modules/ws": { - "version": "8.2.3", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", "dev": true, - "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -15059,6 +15060,12 @@ "jsonc-parser": "3.2.0" } }, + "@socket.io/component-emitter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz", + "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", + "dev": true + }, "@supercharge/request-ip": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@supercharge/request-ip/-/request-ip-1.2.0.tgz", @@ -15095,12 +15102,6 @@ "integrity": "sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w==", "dev": true }, - "@types/component-emitter": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", - "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==", - "dev": true - }, "@types/connect": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", @@ -15127,10 +15128,13 @@ "dev": true }, "@types/cors": { - "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true + "version": "2.8.13", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", + "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", + "dev": true, + "requires": { + "@types/node": "*" + } }, "@types/eslint": { "version": "8.4.10", @@ -16253,12 +16257,6 @@ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, "compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -16798,9 +16796,9 @@ } }, "engine.io": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.2.1.tgz", - "integrity": "sha512-ECceEFcAaNRybd3lsGQKas3ZlMVjN3cyWwMP25D2i0zWfyiytVbTpRPa34qrr+FHddtpBVOmq4H/DCv1O0lZRA==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.4.2.tgz", + "integrity": "sha512-FKn/3oMiJjrOEOeUub2WCox6JhxBXq/Zn3fZOMCBxKnNYtsdKjxhl7yR3fZhM9PV+rdE75SU5SYMc+2PGzo+Tg==", "dev": true, "requires": { "@types/cookie": "^0.4.1", @@ -16812,13 +16810,13 @@ "cors": "~2.8.5", "debug": "~4.3.1", "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" + "ws": "~8.11.0" } }, "engine.io-parser": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.4.tgz", - "integrity": "sha512-+nVFp+5z1E3HcToEnO7ZIj3g+3k9389DvWtvJZz0T6/eOCPIyyxehFcedoYrZQrp0LgQbD9pPXhpMBKMd5QURg==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.6.tgz", + "integrity": "sha512-tjuoZDMAdEhVnSFleYPCtdL2GXwVTGtNjoeJd9IhIG3C1xs9uwxqRNEu5WpnDZCaozwVlK/nuQhpodhXSIMaxw==", "dev": true }, "enhanced-resolve": { @@ -17520,9 +17518,9 @@ "dev": true }, "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "http-deceiver": { @@ -19140,6 +19138,8 @@ }, "object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true }, "object-inspect": { @@ -20240,33 +20240,35 @@ "dev": true }, "socket.io": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.5.1.tgz", - "integrity": "sha512-0y9pnIso5a9i+lJmsCdtmTTgJFFSvNQKDnPQRz28mGNnxbmqYg2QPtJTLFxhymFZhAIn50eHAKzJeiNaKr+yUQ==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.6.1.tgz", + "integrity": "sha512-KMcaAi4l/8+xEjkRICl6ak8ySoxsYG+gG6/XfRCPJPQ/haCRIJBTL4wIl8YCsmtaBovcAXGLOShyVWQ/FG8GZA==", "dev": true, "requires": { "accepts": "~1.3.4", "base64id": "~2.0.0", "debug": "~4.3.2", - "engine.io": "~6.2.0", - "socket.io-adapter": "~2.4.0", - "socket.io-parser": "~4.0.4" + "engine.io": "~6.4.1", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.1" } }, "socket.io-adapter": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.4.0.tgz", - "integrity": "sha512-W4N+o69rkMEGVuk2D/cvca3uYsvGlMwsySWV447y99gUPghxq42BxqLNMndb+a1mm/5/7NeXVQS7RLa2XyXvYg==", - "dev": true - }, - "socket.io-parser": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.5.tgz", - "integrity": "sha512-sNjbT9dX63nqUFIOv95tTVm6elyIU4RvB1m8dOeZt+IgWwcWklFDOdmGcfo3zSiRsnR/3pJkjY5lfoGqEe4Eig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.2.tgz", + "integrity": "sha512-87C3LO/NOMc+eMcpcxUBebGjkpMDkNBS9tf7KJqcDsmL936EChtVva71Dw2q4tQcuVC+hAUy4an2NO/sYXmwRA==", "dev": true, "requires": { - "@types/component-emitter": "^1.2.10", - "component-emitter": "~1.3.0", + "ws": "~8.11.0" + } + }, + "socket.io-parser": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.2.tgz", + "integrity": "sha512-DJtziuKypFkMMHCm2uIshOYC7QaylbtzQwiMYDuCKy3OPkjLzu4B2vAhTlqipRHHzrI0NJeBAizTK7X+6m1jVw==", + "dev": true, + "requires": { + "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1" } }, @@ -21085,7 +21087,9 @@ "dev": true }, "ws": { - "version": "8.2.3", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", "dev": true, "requires": {} }, diff --git a/src/app/business/business.component.ts b/src/app/business/business.component.ts index 074d537..1c47abf 100644 --- a/src/app/business/business.component.ts +++ b/src/app/business/business.component.ts @@ -15,7 +15,6 @@ import { ScanComponent } from '../scan/scan.component'; import { TermsComponent } from '../terms/terms.component'; import { LanguageService } from '../language.service'; -import { LanguageData } from '../language.model'; @Component({ selector: 'app-business', @@ -51,28 +50,17 @@ export class BusinessComponent implements OnInit { countries: Country[] = []; owner: Owner = { address: '', + name: '', currency: 'usd', tax: false, taxValue: 0, vat: false, vatValue: 0, - phone: '', paid: false, - first: '', - last: '', - name: '', - street: '', - city: '', - state: '', - postal: '', - country: '', - email: '', - website: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' } public countriesUpdate: Observable; @@ -83,45 +71,58 @@ export class BusinessComponent implements OnInit { sessionId = ''; ownerKnown = false; termsChecked = false; + ownerdata = { + first: '', + last: '', + phone: '', + name: '', + street: '', + city: '', + state: '', + postal: '', + country: '', + email: '', + website: '' + }; // ------------------------------------- // // Language Support // - vE = { - businessSignupTitle : '', - businessBizInfo : '', - businessAddrsNobiz : '', - businessBizNamelbl : '', - businessBizNameholder : '', - businessContactFnamelbl : '', - businessContactFnholder : '', - businessContactLnamelbl : '', - businessContactLnholder : '', - businessBizAddresslbl : '', - businessBizAddressholder : '', - businessBizCitylbl : '', - businessBizCityholder : '', - businessBizStatelbl : '', - businessBizStateholder : '', - businessBizPcodelbl : '', - businessBizPcodeholder : '', - businessBizCountrylbl : '', - businessBizCountryholder : '', - businessBizMaillbl : '', - businessBizMailholder : '', - businessBizWebsitelbl : '', - businessBizWebsiteholder : '', - businessAcceptTerms : '', - businessTermsOfuse : '', - businessSaveBtn : '', - businessSessionLengthlbl : '', - businessSelectSession : '', - businessSessionLabel : '', - businessSessionPaylbl : '', - businessZGoConfirmlbl : '' + vE = { + businessSignupTitle : '', + businessBizInfo : '', + businessAddrsNobiz : '', + businessBizNamelbl : '', + businessBizNameholder : '', + businessContactFnamelbl : '', + businessContactFnholder : '', + businessContactLnamelbl : '', + businessContactLnholder : '', + businessBizAddresslbl : '', + businessBizAddressholder : '', + businessBizCitylbl : '', + businessBizCityholder : '', + businessBizStatelbl : '', + businessBizStateholder : '', + businessBizPcodelbl : '', + businessBizPcodeholder : '', + businessBizCountrylbl : '', + businessBizCountryholder : '', + businessBizMaillbl : '', + businessBizMailholder : '', + businessBizWebsitelbl : '', + businessBizWebsiteholder : '', + businessAcceptTerms : '', + businessTermsOfuse : '', + businessSaveBtn : '', + businessSessionLengthlbl : '', + businessSelectSession : '', + businessSessionLabel : '', + businessSessionPaylbl : '', + businessZGoConfirmlbl : '' - }; - // + }; + // // constructor( private languageService : LanguageService, @@ -203,18 +204,10 @@ export class BusinessComponent implements OnInit { } save() { - this.owner = { - _id: '', - address: '', - currency: 'usd', - tax: false, - taxValue: 0, - vat: false, - vatValue: 0, + this.ownerdata = { first: this.bizForm.get('first')!.value, last: this.bizForm.get('last')!.value, phone: '', - paid: false, name: this.bizForm.get('name')!.value, street: this.bizForm.get('street')!.value, city: this.bizForm.get('city')!.value, @@ -222,15 +215,9 @@ export class BusinessComponent implements OnInit { postal: this.bizForm.get('postal')!.value, country: this.bizForm.get('country')!.value, email: this.bizForm.get('email')!.value, - website: this.bizForm.get('website')!.value, - zats: false, - invoices: false, - expiration: new Date(Date.now()).toISOString(), - payconf: false, - viewkey: '', - crmToken: '' + website: this.bizForm.get('website')!.value }; - this.userService.addOwner(this.owner); + this.userService.addOwner(this.ownerdata); this.stepper!.next(); } diff --git a/src/app/db-export/db-export.component.ts b/src/app/db-export/db-export.component.ts index 71aec27..138b48e 100644 --- a/src/app/db-export/db-export.component.ts +++ b/src/app/db-export/db-export.component.ts @@ -33,22 +33,11 @@ export class DbExportComponent implements OnInit { taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }; diff --git a/src/app/fullnode.service.ts b/src/app/fullnode.service.ts index ef3eb11..e88b436 100644 --- a/src/app/fullnode.service.ts +++ b/src/app/fullnode.service.ts @@ -34,22 +34,11 @@ export class FullnodeService{ taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }; diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts index d382a87..ca3096b 100644 --- a/src/app/header/header.component.ts +++ b/src/app/header/header.component.ts @@ -28,25 +28,13 @@ export class HeaderComponent implements OnInit, OnDestroy { taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }; - private session: string | null = ''; public heightUpdate: Observable; public ownerUpdate: Observable; public uZaddrUpdate: Observable; diff --git a/src/app/items/item-list/item-list.component.ts b/src/app/items/item-list/item-list.component.ts index 5888973..e3bb5b6 100644 --- a/src/app/items/item-list/item-list.component.ts +++ b/src/app/items/item-list/item-list.component.ts @@ -1,4 +1,4 @@ -import { Input, Inject, Component, OnInit } from '@angular/core'; +import { Input, Component, OnInit } from '@angular/core'; import { MatDialog, MatDialogConfig} from '@angular/material/dialog'; import { faCartShopping } from '@fortawesome/free-solid-svg-icons'; @@ -17,7 +17,6 @@ import { ItemAddComponent } from '../item-add/item-add.component'; import { NotifierService } from '../../notifier.service'; import { LanguageService } from '../../language.service'; -import { LanguageData } from '../../language.model'; @Component({ selector: 'app-item-list', @@ -42,22 +41,11 @@ export class ItemListComponent implements OnInit{ taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }; diff --git a/src/app/listorders/listorders.component.ts b/src/app/listorders/listorders.component.ts index 64afc8b..a78e3bc 100644 --- a/src/app/listorders/listorders.component.ts +++ b/src/app/listorders/listorders.component.ts @@ -20,7 +20,6 @@ import { faHourglass } from '@fortawesome/free-solid-svg-icons'; import { faTrash } from '@fortawesome/free-solid-svg-icons'; import { LanguageService } from '../language.service'; -import { LanguageData } from '../language.model'; import {SessionpayComponent} from '../sessionpay/sessionpay.component'; @Component({ @@ -55,22 +54,11 @@ export class ListOrdersComponent implements OnInit, OnDestroy{ taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }; zecPrice: number = 1; diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 9d6b9d0..7f7afb0 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -43,22 +43,11 @@ export class LoginComponent implements OnInit, AfterViewInit { taxValue:0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }; private FullnodeSub: Subscription = new Subscription(); diff --git a/src/app/order/order.service.ts b/src/app/order/order.service.ts index fa2b663..ad0732d 100644 --- a/src/app/order/order.service.ts +++ b/src/app/order/order.service.ts @@ -35,22 +35,11 @@ export class OrderService { taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }, order: { diff --git a/src/app/owner.model.ts b/src/app/owner.model.ts index dca2e2e..6e13d54 100644 --- a/src/app/owner.model.ts +++ b/src/app/owner.model.ts @@ -7,21 +7,10 @@ export interface Owner { taxValue: number; vat: boolean; vatValue: number; - first: string; - last: string; - email: string; - street: string; - city: string; - state: string; - postal: string; - phone: string; paid: boolean; - website: string; - country: string; zats: boolean; invoices: boolean; expiration: string; payconf: boolean; - viewkey: string; crmToken: string; } diff --git a/src/app/pmtservice/pmtservice.component.ts b/src/app/pmtservice/pmtservice.component.ts index 334f4d7..0318f7b 100644 --- a/src/app/pmtservice/pmtservice.component.ts +++ b/src/app/pmtservice/pmtservice.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { Router, ActivatedRoute, Params } from "@angular/router"; +import { ActivatedRoute} from "@angular/router"; import { HttpClient, HttpParams, HttpHeaders } from "@angular/common/http"; import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; import { PmtData } from "./pmtservice.model"; @@ -17,7 +17,6 @@ var URLSafeBase64 = require('urlsafe-base64'); var Buffer = require('buffer/').Buffer; import { LanguageService } from '../language.service'; -import { LanguageData } from '../language.model'; @Component({ selector: 'app-pmtservice', @@ -64,23 +63,12 @@ export class PmtserviceComponent implements OnInit { taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', - crmToken: '' + crmToken: '' }; public order: Order = { diff --git a/src/app/receipt.service.ts b/src/app/receipt.service.ts index 6cbead0..fe713e5 100644 --- a/src/app/receipt.service.ts +++ b/src/app/receipt.service.ts @@ -24,22 +24,11 @@ export class ReceiptService { taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }, order: { diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index 75990db..433503a 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -34,6 +34,7 @@ export class SettingsComponent implements OnInit { linkMsg: string = ''; xeroAccCod: string = ''; saveAccOk: boolean = false; + private viewkey: string = ''; coins = [ { @@ -126,25 +127,26 @@ export class SettingsComponent implements OnInit { public xeroService: XeroService, public wooService: WoocommerceService, private dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: Owner) { - this.useZats = data.zats; - this.useVKey = data.payconf; + @Inject(MAT_DIALOG_DATA) public data: {o: Owner, v: string}) { + this.useZats = data.o.zats; + this.useVKey = data.o.payconf; this.settingsForm = fb.group({ - name: [data.name, Validators.required], - currency: [data.currency, Validators.required], - useZats: [data.zats, Validators.required], - useVKey: [data.payconf, Validators.required], + name: [data.o.name, Validators.required], + currency: [data.o.currency, Validators.required], + useZats: [data.o.zats, Validators.required], + useVKey: [data.o.payconf, Validators.required], // proVersion: [data.invoices, Validators.required], - vKey: [data.viewkey] + vKey: [data.v] }); this.accCodForm = fb.group ({ xAcc: [this.xeroAccCod] }); - if (data.payconf) { + if (data.o.payconf) { this.settingsForm.get('vKey')!.enable(); } - this.owner = data; + this.owner = data.o; + this.viewkey = data.v; this.proVersion = this.owner.invoices; if ( this.owner.crmToken !== '' ) { this.linked2Xero = true; @@ -222,7 +224,7 @@ export class SettingsComponent implements OnInit { this.owner.currency = this.settingsForm.value.currency; this.owner.zats = this.settingsForm.value.useZats; this.owner.payconf = this.settingsForm.value.useVKey; - this.owner.viewkey = this.settingsForm.value.vKey; + this.viewkey = this.settingsForm.value.vKey; //this.owner.invoices = this.settingsForm.value.proVersion this.dialogRef.close(this.owner); } diff --git a/src/app/user.service.ts b/src/app/user.service.ts index ef9be93..eba6832 100644 --- a/src/app/user.service.ts +++ b/src/app/user.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { Subject, BehaviorSubject, Observable } from 'rxjs'; +import { BehaviorSubject, Observable } from 'rxjs'; import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http'; @@ -34,22 +34,11 @@ export class UserService{ taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }, txs : [], @@ -70,6 +59,7 @@ export class UserService{ public readonly paidUpdate: Observable = this._paidUpdated.asObservable(); public readonly countriesUpdate: Observable = this._countriesUpdated.asObservable(); private reqHeaders: HttpHeaders; + private reqParams: HttpParams; constructor(private http: HttpClient, private notifierService : NotifierService ){ @@ -77,14 +67,14 @@ export class UserService{ this.reqHeaders = new HttpHeaders().set('Authorization', auth); //console.log('US:', this.reqHeaders); this.session = localStorage.getItem('s4z_token'); + this.reqParams = new HttpParams().append('session', this.session!); if (this.session != null) { this.findUser(); } } getCountries() { - const params = new HttpParams().append('session', this.session!); - let obs = this.http.get<{message: string, countries: any}>(this.beUrl+'api/countries', { headers: this.reqHeaders, params: params, observe: 'response'}); + let obs = this.http.get<{message: string, countries: any}>(this.beUrl+'api/countries', { headers: this.reqHeaders, params: this.reqParams, observe: 'response'}); obs.subscribe((CountryResponse) => { if (CountryResponse.status == 200) { @@ -95,10 +85,8 @@ export class UserService{ } findUser() { - this.session = localStorage.getItem('s4z_token'); if (this.session != null) { - const params = new HttpParams().append('session', this.session!); - let obs = this.http.get<{message: string, user: any}>(this.beUrl+'api/user', { headers: this.reqHeaders, params: params, observe: 'response'}); + let obs = this.http.get<{message: string, user: any}>(this.beUrl+'api/user', { headers: this.reqHeaders, params: this.reqParams, observe: 'response'}); obs.subscribe((UserDataResponse) => { //console.log(UserDataResponse.status); @@ -130,7 +118,7 @@ export class UserService{ } validateUser(pinString:string){ - const params = new HttpParams().append('session', this.dataStore.user.session).append('pin', pinString); + const params = this.reqParams.append('pin', pinString); let obs = this.http.post(this.beUrl+'validateuser', {}, {headers: this.reqHeaders, params: params, observe: 'response'}); obs.subscribe((responseData) => { if (responseData.status == 202) { @@ -145,14 +133,12 @@ export class UserService{ return obs; } - addOwner(owner: Owner) { + addOwner(oData: {first: string, last: string, phone: string, name: string, street: string, city: string, state: string, postal: string, country: string, email: string, website: string}) { - owner.address = this.dataStore.user.address; - const params = new HttpParams().append('session', this.session!); - let obs = this.http.post(this.beUrl+'api/owner', {payload: owner}, {headers: this.reqHeaders, params: params}); + let obs = this.http.post(this.beUrl+'api/owner', {payload: oData}, {headers: this.reqHeaders, params: this.reqParams}); obs.subscribe({ - next: (responseData) => { + next: () => { //console.log("Entra a console log"); this.getOwner(this.dataStore.user.address); }, @@ -169,7 +155,7 @@ export class UserService{ getOwner(address: string) { //console.log('getOwner', address); - const ownParams = new HttpParams().append('address', address).append('session', this.session!); + const ownParams = this.reqParams.append('address', address) let obs = this.http.get<{message:string, owner: any}>(this.beUrl+'api/owner', { headers: this.reqHeaders, params: ownParams, observe: 'response'}); obs.subscribe((OwnerDataResponse) => { @@ -188,8 +174,7 @@ export class UserService{ } deleteUser() { - const params = new HttpParams().append('session', this.session!); - let obs = this.http.delete<{message: string}>(this.beUrl+'api/user/'+this.dataStore.user._id, {headers: this.reqHeaders, params: params }); + let obs = this.http.delete<{message: string}>(this.beUrl+'api/user/'+this.dataStore.user._id, {headers: this.reqHeaders, params: this.reqParams }); obs.subscribe({next: () => { //console.log('User delete request sent.'); @@ -199,6 +184,9 @@ export class UserService{ return obs; } + saveSettings(o: Owner) { + } + currentOwner() : Owner { return this.dataStore.owner; } diff --git a/src/app/viewer/viewer.component.ts b/src/app/viewer/viewer.component.ts index a206df9..cc6fc8d 100644 --- a/src/app/viewer/viewer.component.ts +++ b/src/app/viewer/viewer.component.ts @@ -38,22 +38,11 @@ export class ViewerComponent implements OnInit { taxValue: 0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }; public price: number = 1; @@ -133,7 +122,7 @@ export class ViewerComponent implements OnInit { dialogRef.afterClosed().subscribe((val) => { if (val != null) { //console.log('Saving settings', val); - this.userService.addOwner(val); + //this.userService.addOwner(val); this.fullnodeService.getPrice(val.currency); this.loginCheck(); } diff --git a/src/app/xeroreg/xeroreg.component.ts b/src/app/xeroreg/xeroreg.component.ts index 8ec4ae7..5bd1b0f 100644 --- a/src/app/xeroreg/xeroreg.component.ts +++ b/src/app/xeroreg/xeroreg.component.ts @@ -6,7 +6,6 @@ import { Owner } from '../owner.model'; import { Observable } from 'rxjs'; import { LanguageService } from '../language.service'; -import { LanguageData } from '../language.model'; var Buffer = require('buffer/').Buffer; @@ -27,6 +26,7 @@ async function redirect(r: Router) { export class XeroRegComponent implements OnInit { public owner:Owner = { + _id: '', address: '', name: '', currency: '', @@ -34,22 +34,11 @@ export class XeroRegComponent implements OnInit { taxValue:0, vat: false, vatValue: 0, - first: '', - last: '', - email: '', - street: '', - city: '', - state: '', - postal: '', - phone: '', paid: false, - website: '', - country: '', zats: false, invoices: false, expiration: new Date(Date.now()).toISOString(), payconf: false, - viewkey: '', crmToken: '' }; public ownerUpdate:Observable; @@ -85,15 +74,15 @@ export class XeroRegComponent implements OnInit { this.ownerUpdate.subscribe((owner) => { this.owner = owner; this.activatedRoute.queryParams.subscribe((params) => { - console.log(params); + //console.log(params); if (params.state === this.owner.address.substring(0,6)) { this.xeroService.getXeroAccessToken(params.code, this.owner.address).subscribe(tokenData => { if (tokenData.status == 200) { - console.log(tokenData.body!); + //console.log(tokenData.body!); this.flag = true; redirect(this.router); } else { - console.log('Error: '+tokenData.status); + //console.log('Error: '+tokenData.status); this.flag = false; } }); @@ -106,20 +95,20 @@ export class XeroRegComponent implements OnInit { } chgUILanguage(){ - console.log('XERO.chgUILanguage Called '); - this.languageService.getViewElements('xero').subscribe( - response => { - console.log('Received >> ', response ); - console.log('Language Code : ', response.language); - console.log('Component Name : ',response.component); - console.log('Language data : ',response.data); + //console.log('XERO.chgUILanguage Called '); + this.languageService.getViewElements('xero').subscribe({ + next: response => { + //console.log('Received >> ', response ); + //console.log('Language Code : ', response.language); + //console.log('Component Name : ',response.component); + //console.log('Language data : ',response.data); this.vE.xeroConnecting2xero = response.data.xero_connecting_2xero; this.vE.xeroConnected2xero = response.data.xero_connected_2xero; - }, - error => { console.log('Error >> ',error); } - ); + }, + error: error => { console.log('Error >> ',error); } + }); } }