diff --git a/ExpressForDevelopment/team_modules/smartinsurance/routehandler.js b/ExpressForDevelopment/team_modules/smartinsurance/routehandler.js index 81c0a6183b2b8f3281eb28c1cdae348f76db91f5..fcd4e95ac0567dc50c467145aafe70a34bcb5406 100644 --- a/ExpressForDevelopment/team_modules/smartinsurance/routehandler.js +++ b/ExpressForDevelopment/team_modules/smartinsurance/routehandler.js @@ -18,8 +18,6 @@ module.exports = function() { router.post('/filter', ts.filterVersicherung); - router.post('/filter/count', ts.filterVersicherungCount); - router.get('/kategorien', ts.getKategorien); router.post('/investieren', [validate.parameterZurInvestitionsErstellung, validate.obVersicherungGekuendigtIstOderWird, validate.obVersicherungSchonVollIst, ts.erstelleInvestition]); @@ -40,8 +38,6 @@ module.exports = function() { router.get('/profil/:profilID', [validate.profilID, ts.getProfilByID]); - router.post('/profil', validate.parameterProfilAendern, validate.obUserExistiert, ts.changeProfil); - router.get('/schadensfaelle/:versicherungID', [validate.versicherungID, ts.getSchadensfaelleByVersicherung]); router.post('/schadensfallmelden', [validate.parameterSchadensfall, validate.obVersicherungExistiert, ts.erstelleSchadensfall]); diff --git a/ExpressForDevelopment/team_modules/smartinsurance/tabledatagateway.js b/ExpressForDevelopment/team_modules/smartinsurance/tabledatagateway.js index a3b4d1994f07434b3c89c398faff2cd7c6925f60..70c0c99f53ad4b940b6765f9d712645429273bcb 100644 --- a/ExpressForDevelopment/team_modules/smartinsurance/tabledatagateway.js +++ b/ExpressForDevelopment/team_modules/smartinsurance/tabledatagateway.js @@ -38,11 +38,6 @@ exports.filterVersicherung = function(kategorie, orderby, asc_desc, limit, skip, exports.orderVersicherung = function(orderby, asc_desc, limit, skip, onSuccess, onError){ db.func('orderversicherung',[orderby, (asc_desc?"ASC":"DESC"), limit, skip]).then(onSuccess).catch(onError); }; - -// Zaehlen von Versicherungen -exports.filterVersicherungCount = function(kategorie, onSuccess, onError){ - db.func('filterversicherungcount',[kategorie]).then(onSuccess).catch(onError); -} // //1.2 Kategorien der Versicherungen //--------------------------------- @@ -158,7 +153,7 @@ exports.setinvestitionbewertung = function(investitionID, bewertung, onSuccess, }; -//3.2 Kuendigungen +//2.2 Kuendigungen //----------------- exports.updateVersicherungGekuendigt = function(onSuccess, onError){ db.func('finalizeversicherungskuendigung').then(onSuccess).catch(onError); @@ -169,51 +164,44 @@ exports.investitionKuendigungEinreichen = function(investitionID, onSuccess, onE }; // -//3.2 Schadensfall +//2.2 Schadensfall //----------------- exports.updateSchadensfall = function(schadensfallID, bezeichnung, beschreibung, schadenshoehe, onSuccess, onError){ db.func('updateschadensfall', [schadensfallID,bezeichnung,beschreibung,schadenshoehe]).then(onSuccess).catch(onError); }; // -//3.2.1 Schadensfall ausgezahlt = true +//2.2.1 Schadensfall ausgezahlt = true exports.finalizeSchadensfall = function(onSuccess, onError){ db.func('finalizeschadensfall').then(onSuccess).catch(onError); }; // -//3.2.2 Schaden auszahlen +//2.2.2 Schaden auszahlen exports.paySchadensfaelle = function(onSuccess, onError){ db.func('payschadensfaelle').then(onSuccess).catch(onError); }; // -//3.2.3 Schaden von den Investitionshoehen abziehen +//2.2.3 Schaden von den Investitionshoehen abziehen exports.reduceInvestitionenWegenSchaden = function(onSuccess, onError){ db.func('reduceinvestitionenwegenschaden').then(onSuccess).catch(onError); }; // -//3.3 Versicherung +//2.3 Versicherung //----------------- exports.updateVersicherung = function(versicherungID, name, beschreibung, kategorie, onSuccess, onError){ db.func('updateversicherung', [versicherungID,name,beschreibung,kategorie]).then(onSuccess).catch(onError); }; // -//3.4 Investition +//2.4 Investition //----------------- exports.updateInvestition = function(investitionID, investitionshoehe, onSuccess, onError){ db.func('updateinvestition', [investitionID,investitionshoehe]).then(onSuccess).catch(onError); }; -// -//3.5 Profil bearbeiten -//----------------- -exports.changeProfil = function(personID, name, prename, email, iban, bic, bankinstitut, birthday, onSuccess, onError){ - db.func('updateprofil', [personID, name, prename, email, iban, bic, bankinstitut, birthday]).then(onSuccess).catch(onError); -}; - // //4. Komplexe / Zusammengesetzte Abfragen //========================================== diff --git a/ExpressForDevelopment/team_modules/smartinsurance/transactionscript.js b/ExpressForDevelopment/team_modules/smartinsurance/transactionscript.js index 5784f7621c43c78588d1c7de88cc7e3893ef78ce..9ec342814b4ef591bb4d02a0f66cbaab20432915 100644 --- a/ExpressForDevelopment/team_modules/smartinsurance/transactionscript.js +++ b/ExpressForDevelopment/team_modules/smartinsurance/transactionscript.js @@ -76,38 +76,6 @@ exports.getBewertungen = function (req, res, next) { ); }; -exports.filterVersicherungCount = function (req, res, next) { - var kategorie = req.body.kategorie; - if (kategorie == undefined) { - tdg.filterVersicherungCount(null, - function(data){ - if(data.length != 0) { - res.status(200).json(data); - } else{ - res.status(404).send('Filter Count auf ' + kategorie +' fehlgeschlagen.') - } - }, - function(err){ - logger.info('Fehler beim Filter Count'+ ' - ' + err); - res.status(500).send('Fehler beim Filter Count'); - } - ); - } else { - tdg.filterVersicherungCount(kategorie, - function(data){ - if(data.length != 0) { - res.status(200).json(data); - } else{ - res.status(404).send('Filter Count auf ' + kategorie +' fehlgeschlagen.') - } - }, - function(err){ - logger.info('Fehler beim Filter Count'+ ' - ' + err); - res.status(500).send('Fehler beim Filter Count'); - } - ); - } -} // Filtern und sortieren der Versicherungen exports.filterVersicherung = function (req, res, next) { var withFilter = true; @@ -328,28 +296,6 @@ exports.getProfilByID = function (req, res, next) { } }; -exports.changeProfil = function(req, res, next){ - var personID = req.body.personID; - var name = req.body.name; - var prename = req.body.prename; - var email = req.body.email; - var iban = req.body.iban; - var bic = req.body.bic; - var bankinstitut = req.body.bankinstitut; - var birthday = req.body.birthday; - tdg.changeProfil(personID, name, prename, email, iban, bic, bankinstitut, birthday, - function(data){ - logger.info('Profil der Person ' + personID + 'erfolgreich geaendert.'); - res.status(201).send('Erfolgreich geandert'); - }, - function(err){ - logger.error('Fehler beim Aendern des Profils der Person ' + pID + ' - ' + err); - res.status(500).send('Fehler beim Laden des Profils.'); - } - ); - -} - exports.getKommentareByVID = function (req, res, next) { var versicherungID = req.params.versicherungID; tdg.getKommentareByVID(versicherungID, diff --git a/ExpressForDevelopment/team_modules/smartinsurance/validator.js b/ExpressForDevelopment/team_modules/smartinsurance/validator.js index b2623a707636aeac36a5a9c4da3f22882c2aba3b..bdd40eccc6848954e56c13e44822bbd229707753 100644 --- a/ExpressForDevelopment/team_modules/smartinsurance/validator.js +++ b/ExpressForDevelopment/team_modules/smartinsurance/validator.js @@ -341,42 +341,3 @@ exports.obInvestitionGekuendigtIstOderWird = function(req,res,next){ } ); }; - -exports.obUserExistiert = function(req,res,next){ - var personID = req.body.personID; - if (personID == undefined){ - personID = req.params.personID; - } - tdg.getProfilByID(personID, - function(data){ - //logger.consoleInfo('VersicherungID: ' + versicherungID + ' Data: ' + JSON.stringify(data)); - if(data[0].id != null){ - next(); - } else{ - res.status(404).send('Angegebener User/Person existiert nicht.'); - } - }, - function(err){ - logger.error('Fehler beim Laden der User/Person ' + personID + ' zum Zweck der Validierung - ' + err); - res.status(500).send('Es konnte nicht festgestellt werden ob der angegebene User/Person existiert.'); - } - ); -} - -exports.parameterProfilAendern = function(req,res,next){ - logger.consoleInfo("validate.parameterProfilAendern noch nicht implementiert"); - var personID = req.body.personID; - var name = req.body.name; - var prename = req.body.prename; - var email = req.body.email; - var iban = req.body.iban; - var bic = req.body.bic; - var bankinstitut = req.body.bankinstitut; - var birthday = req.body.birthday; - if(personID == undefined || name == undefined || prename == undefined || email == undefined || iban == undefined || bic == undefined || bankinstitut == undefined || birthday == undefined){ - res.status(400).send('Die Anfrage ist unterdefiniert (Es fehlen Felder).') - } - else{ - next(); - } -} diff --git a/ExpressForDevelopment/test/data/general/createSchemas.sql b/ExpressForDevelopment/test/data/general/createSchemas.sql index 3929ddcaf57765f3dd1f7dec58eddd224578739e..8971c5f5a5b6eae1f892bd93dc4d393284579869 100644 --- a/ExpressForDevelopment/test/data/general/createSchemas.sql +++ b/ExpressForDevelopment/test/data/general/createSchemas.sql @@ -134,7 +134,7 @@ CREATE FUNCTION createinvestition(integer, uuid, money) RETURNS integer ("versicherungID", "personID", betrag) VALUES ($1, $2, $3); INSERT INTO smartinsurance."Investition" - (id, "versicherungID", "personID", investitionshoehe) + (id, "versicherungID", "personID", investitionshoehe) VALUES (DEFAULT, $1, $2, $3) RETURNING id; $_$; @@ -160,7 +160,7 @@ CREATE FUNCTION createschadensfall(integer, text, money) RETURNS integer LANGUAGE sql AS $_$ INSERT INTO smartinsurance."Schadensfall" - (id, "versicherungID", beschreibung, schadenshoehe) + (id, "versicherungID", beschreibung, schadenshoehe) VALUES (DEFAULT, $1, $2, $3) RETURNING id; $_$; @@ -173,7 +173,7 @@ CREATE FUNCTION createschadensfall(integer, text, text, money) RETURNS integer LANGUAGE sql AS $_$ INSERT INTO smartinsurance."Schadensfall" - (id, "versicherungID", bezeichnung, beschreibung, schadenshoehe) + (id, "versicherungID", bezeichnung, beschreibung, schadenshoehe) VALUES (DEFAULT, $1, $2, $3, $4) RETURNING id; $_$; @@ -343,7 +343,7 @@ CREATE FUNCTION filterversicherung(kategorie, text, text, integer DEFAULT 0, int LANGUAGE plpgsql AS $_$ BEGIN -if $4 > 0 then +if $4 > 0 then RETURN QUERY EXECUTE 'SELECT "id", "name", "versicherungshoehe", @@ -357,10 +357,10 @@ if $4 > 0 then "kategorie", "anzahl_investoren", "bewertung", - "rendite" - FROM smartinsurance."VersicherungFilter" + "rendite" + FROM smartinsurance."VersicherungFilter" WHERE "kategorie" = $1 AND "istGekuendigt"=false AND "wirdGekuendigt"=false ORDER BY ' - || quote_ident($2) || ' ' || $3 || + || quote_ident($2) || ' ' || $3 || ' LIMIT $4 OFFSET $5 ;' USING $1,$2,$3,$4,$5; @@ -378,37 +378,16 @@ else "kategorie", "anzahl_investoren", "bewertung", - "rendite" - FROM smartinsurance."VersicherungFilter" + "rendite" + FROM smartinsurance."VersicherungFilter" WHERE "kategorie" = $1 AND "istGekuendigt"=false AND "wirdGekuendigt"=false ORDER BY ' - || quote_ident($2) || ' ' || $3 || + || quote_ident($2) || ' ' || $3 || ';' USING $1,$2,$3; end if; END; $_$; --- --- Name: filterversicherungcount(kategorie, text, text, integer, integer); Type: FUNCTION; Schema: smartinsurance; Owner: - --- - -CREATE FUNCTION filterversicherungcount(kategorie DEFAULT NULL::kategorie, text DEFAULT ''::text, text DEFAULT ''::text, integer DEFAULT 0, integer DEFAULT 0) RETURNS bigint - LANGUAGE plpgsql - AS $_$ -BEGIN - if $1 is null then - RETURN (SELECT count(*) - FROM smartinsurance."VersicherungFilter" - WHERE "istGekuendigt"=false AND "wirdGekuendigt"=false); - else - RETURN (SELECT count(*) - FROM smartinsurance."VersicherungFilter" - WHERE "kategorie" = $1 AND "istGekuendigt"=false AND "wirdGekuendigt"=false); - end if; -END; -$_$; - - -- -- Name: finalizeinvestitionskuendigung(); Type: FUNCTION; Schema: smartinsurance; Owner: - -- @@ -417,11 +396,11 @@ CREATE FUNCTION finalizeinvestitionskuendigung() RETURNS void LANGUAGE sql AS $$ INSERT INTO smartinsurance."Zahlungsstrom"("versicherungID", "personID", betrag) - SELECT "versicherungID", "personID", investitionshoehe * (-1) - FROM smartinsurance."Investition" + SELECT "versicherungID", "personID", investitionshoehe * (-1) + FROM smartinsurance."Investition" WHERE smartinsurance."Investition"."wirdGekuendigt"=true; UPDATE smartinsurance."Investition" - SET "istGekuendigt"=true, "wirdGekuendigt"=false, "kuendigungsZeitpunkt"=now() + SET "istGekuendigt"=true, "wirdGekuendigt"=false, "kuendigungsZeitpunkt"=now() WHERE "wirdGekuendigt"=true; $$; @@ -460,7 +439,7 @@ CREATE FUNCTION finalizeversicherungskuendigung() RETURNS void LANGUAGE sql AS $$ UPDATE smartinsurance."Versicherung" - SET "istGekuendigt"=true, "wirdGekuendigt"=false, "kuendigungsZeitpunkt"=now() + SET "istGekuendigt"=true, "wirdGekuendigt"=false, "kuendigungsZeitpunkt"=now() WHERE "wirdGekuendigt"=true; $$; @@ -601,15 +580,15 @@ CREATE FUNCTION getinvestitionssummebyvid(integer) RETURNS money AS $_$ /* SELECT sum(smartinsurance."Investition"."investitionshoehe") as suminvestition FROM smartinsurance."Versicherung" INNER JOIN smartinsurance."Investition" - ON smartinsurance."Versicherung".id=smartinsurance."Investition"."versicherungID" + ON smartinsurance."Versicherung".id=smartinsurance."Investition"."versicherungID" WHERE smartinsurance."Versicherung".id=$1 AND smartinsurance."Investition"."istGekuendigt"=false; */ /* SELECT COALESCE(sum(smartinsurance."Investition"."investitionshoehe"), '0.00 €') as suminvestition FROM smartinsurance."Versicherung" LEFT OUTER JOIN smartinsurance."Investition" - ON smartinsurance."Versicherung".id=smartinsurance."Investition"."versicherungID" + ON smartinsurance."Versicherung".id=smartinsurance."Investition"."versicherungID" AND smartinsurance."Investition"."istGekuendigt"=false;*/ - SELECT COALESCE(sum(i."investitionshoehe"), '0.00 €') as suminvestition FROM + SELECT COALESCE(sum(i."investitionshoehe"), '0.00 €') as suminvestition FROM (SELECT * FROM "Versicherung") v LEFT OUTER JOIN (SELECT * FROM "Investition" WHERE "istGekuendigt"=false) i @@ -986,7 +965,7 @@ CREATE FUNCTION orderversicherung(text, text, integer DEFAULT 0, integer DEFAULT LANGUAGE plpgsql AS $_$ BEGIN -if $3 > 0 then +if $3 > 0 then RETURN QUERY EXECUTE 'SELECT "id", "name", "versicherungshoehe", @@ -1000,11 +979,11 @@ if $3 > 0 then "kategorie", "anzahl_investoren", "bewertung", - "rendite" + "rendite" FROM smartinsurance."VersicherungFilter" ' || 'WHERE "istGekuendigt"=false AND "wirdGekuendigt"=false ' || 'ORDER BY ' - || quote_ident($1) || ' ' || $2 || + || quote_ident($1) || ' ' || $2 || ' LIMIT $3 OFFSET $4 ;' USING $1,$2,$3,$4; @@ -1022,7 +1001,7 @@ else "kategorie", "anzahl_investoren", "bewertung", - "rendite" + "rendite" FROM smartinsurance."VersicherungFilter" ' || 'WHERE "istGekuendigt"=false AND "wirdGekuendigt"=false ' || 'ORDER BY ' @@ -1052,7 +1031,7 @@ $$; CREATE FUNCTION reduceinvestitionenwegenschaden() RETURNS void LANGUAGE sql AS $$ - UPDATE "Investition" + UPDATE "Investition" SET investitionshoehe = (SELECT s."neueInvestitionshoehe" FROM "SchadensfallAbzugDerInvestition" s WHERE "Investition".id = s."investitionID") @@ -1068,7 +1047,7 @@ $$; CREATE FUNCTION setinvestitionbewertung("investitionID" integer, "Bewertung" bewertung) RETURNS void LANGUAGE sql - AS $_$Update "Investition" + AS $_$Update "Investition" set bewertung =$2 where id=$1;$_$; @@ -1094,8 +1073,8 @@ CREATE FUNCTION submitversicherungskuendigung(integer) RETURNS void AS $_$ UPDATE smartinsurance."Versicherung" SET "wirdGekuendigt"=true WHERE id=$1; - UPDATE smartinsurance."Investition" - SET "wirdGekuendigt"=true + UPDATE smartinsurance."Investition" + SET "wirdGekuendigt"=true WHERE "versicherungID"=$1 AND "istGekuendigt"=false; $_$; @@ -1129,44 +1108,6 @@ CREATE FUNCTION updateinvestition(integer, money) RETURNS void $_$; --- --- Name: updateprofil(uuid, text, text, text, text, text, text); Type: FUNCTION; Schema: smartinsurance; Owner: - --- - -CREATE FUNCTION updateprofil(uuid, text, text, text, text, text, text) RETURNS void - LANGUAGE sql - AS $_$ - UPDATE smartbackend.user - SET name=$2, prename=$3, email=$4 - WHERE id=$1; - UPDATE smartinsurance.userbank - SET iban=$5, bic=$6, bankinstitut=$7 - WHERE id=$1; - INSERT INTO smartinsurance.userbank (id, iban, bic, bankinstitut) - SELECT $1,$5,$6,$7 FROM smartinsurance.userbank - WHERE NOT EXISTS (SELECT 1 FROM smartinsurance.userbank WHERE id=$1); -$_$; - - --- --- Name: updateprofil(uuid, text, text, text, text, text, text, date); Type: FUNCTION; Schema: smartinsurance; Owner: - --- - -CREATE FUNCTION updateprofil(uuid, text, text, text, text, text, text, date) RETURNS void - LANGUAGE sql - AS $_$ - UPDATE smartbackend.user - SET name=$2, prename=$3, email=$4, birthday=$8 - WHERE id=$1; - UPDATE smartinsurance.userbank - SET iban=$5, bic=$6, bankinstitut=$7 - WHERE id=$1; - INSERT INTO smartinsurance.userbank (id, iban, bic, bankinstitut) - SELECT $1,$5,$6,$7 FROM smartinsurance.userbank - WHERE NOT EXISTS (SELECT 1 FROM smartinsurance.userbank WHERE id=$1); -$_$; - - -- -- Name: updateschadensfall(integer, text, text, money); Type: FUNCTION; Schema: smartinsurance; Owner: - -- @@ -1313,32 +1254,6 @@ CREATE TABLE user_password ( ); --- --- Name: user_accesstoken_password; Type: VIEW; Schema: smartbackend; Owner: - --- - -CREATE VIEW user_accesstoken_password AS - SELECT "user".id, - user_token.access_token, - user_password.password, - "user".email - FROM "user", - user_token, - user_password - WHERE (("user".id = user_token.fk_user) AND ("user".id = user_password.id)); - - --- --- Name: user_friends; Type: TABLE; Schema: smartbackend; Owner: - --- - -CREATE TABLE user_friends ( - "userId" uuid NOT NULL, - "friendId" uuid NOT NULL, - "isFriend" boolean DEFAULT false -); - - -- -- Name: user_password_view; Type: VIEW; Schema: smartbackend; Owner: - -- @@ -1823,14 +1738,6 @@ ALTER TABLE ONLY "user" ADD CONSTRAINT user_email_key UNIQUE (email); --- --- Name: user_friends_pkey; Type: CONSTRAINT; Schema: smartbackend; Owner: - --- - -ALTER TABLE ONLY user_friends - ADD CONSTRAINT user_friends_pkey PRIMARY KEY ("userId", "friendId"); - - -- -- Name: user_password_pkey; Type: CONSTRAINT; Schema: smartbackend; Owner: - -- @@ -1986,22 +1893,6 @@ ALTER TABLE ONLY push_user_device ADD CONSTRAINT user_fkey FOREIGN KEY (userid) REFERENCES "user"(id) ON DELETE CASCADE; --- --- Name: user_friends_friendId_fkey; Type: FK CONSTRAINT; Schema: smartbackend; Owner: - --- - -ALTER TABLE ONLY user_friends - ADD CONSTRAINT "user_friends_friendId_fkey" FOREIGN KEY ("friendId") REFERENCES "user"(id); - - --- --- Name: user_friends_userId_fkey; Type: FK CONSTRAINT; Schema: smartbackend; Owner: - --- - -ALTER TABLE ONLY user_friends - ADD CONSTRAINT "user_friends_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"(id); - - -- -- Name: user_token_fk_user_fkey; Type: FK CONSTRAINT; Schema: smartbackend; Owner: - -- @@ -2103,3 +1994,4 @@ ALTER TABLE ONLY userbank -- -- PostgreSQL database dump complete -- + diff --git a/ExpressForDevelopment/test/testAPI.js b/ExpressForDevelopment/test/testAPI.js index 6db118c0c042943db37632a484cd1f7ad616c73b..c7b6de435c956afe265a8b9c0d1ee5b61843bd34 100644 --- a/ExpressForDevelopment/test/testAPI.js +++ b/ExpressForDevelopment/test/testAPI.js @@ -881,104 +881,6 @@ describe("Test API:", function(){ }); }); - describe("post /api/smartinsurance/profil", function(){ - it('Erfolgreiches erstes Aendern eines Profils', function(done){ - var url = "http://localhost:3000/api/smartinsurance/profil"; - var postbody = { - "personID":"bfa7b3ca-21f7-11e6-b56d-17b5af93fd5a", - "name":"NewName", - "prename":"NewPrename", - "email":"new(at)email.com", - "iban":"AL90208110080000001039531801", - "bic":"OKOYFIHH", - "bankinstitut":"Deutsche Bank AG", - "birthday":"31.12.1999" - }; - request({ - "url":url, - "method":"POST", - "body" : postbody, - "json" : true - }, function(error, response, body) { - expect(response.statusCode).to.equal(201); - done(); - }); - }); - it('Erfolgreiches zweites Aendern eines Profils', function(done){ - var url = "http://localhost:3000/api/smartinsurance/profil"; - var postbody = { - "personID":"bfa7b3ca-21f7-11e6-b56d-17b5af93fd5a", - "name":"NewName", - "prename":"NewPrename", - "email":"new(at)email.com", - "iban":"AL90208110080000001039531801", - "bic":"OKOYFIHH", - "bankinstitut":"Deutsche Bank AG", - "birthday":"31.12.1999" - }; - request({ - "url":url, - "method":"POST", - "body" : postbody, - "json" : true - }, function(error, response, body) { - postbody.name = "NewNewName"; - request({ - "url":url, - "method":"POST", - "body" : postbody, - "json" : true - }, function(error, response, body) { - expect(response.statusCode).to.equal(201); - done(); - }); - }); - }); - it('Fehlschlag Profil existiert nicht', function(done){ - var url = "http://localhost:3000/api/smartinsurance/profil"; - var postbody = { - "personID":"4c4e8280-2d89-11e6-855f-536fc1f21fa3", - "name":"NewName", - "prename":"NewPrename", - "email":"new(at)email.com", - "iban":"AL90208110080000001039531801", - "bic":"OKOYFIHH", - "bankinstitut":"Deutsche Bank AG", - "birthday":"31.12.1999" - }; - request({ - "url":url, - "method":"POST", - "body" : postbody, - "json" : true - }, function(error, response, body) { - expect(response.statusCode).to.equal(404); - done(); - }); - }); - it('Fehlschlag Parameter unterdefiniert', function(done){ - var url = "http://localhost:3000/api/smartinsurance/profil"; - var postbody = { - "personID":"4c4e8280-2d89-11e6-855f-536fc1f21fa3", - "prename":"NewPrename", - "email":"new(at)email.com", - "bic":"OKOYFIHH", - "bankinstitut":"Deutsche Bank AG", - "birthday":"31.12.1999" - }; - request({ - "url":url, - "method":"POST", - "body" : postbody, - "json" : true - }, function(error, response, body) { - expect(response.statusCode).to.equal(400); - done(); - }); - }); - it('Fehlschlag anderes Profil bearbeiten als das, mit dem man eingeloggt ist'); - }); - describe("get /api/smartinsurance/versicherung/:versicherungID/bewertungen", function(){ it('Erfolgreiches Laden der Bewertungen einer existierenden Versicherung',function(done){ var url = "http://localhost:3000/api/smartinsurance/versicherung/89/bewertungen"; diff --git a/SmartInsurance/bower.json b/SmartInsurance/bower.json index 3021b5aa8887bef253138767ed4d791a354555eb..f0580a07627f6b60c47cb6b55db14dffe43f0ea1 100644 --- a/SmartInsurance/bower.json +++ b/SmartInsurance/bower.json @@ -6,10 +6,6 @@ }, "dependencies": { "angular-socialshare": "angularjs-socialshare#^2.1.12", - "angular-responsive-tables": "^0.1.3", - "angular-chart.js": "^0.10.2", - "ionic-material": "^0.4.2", - "angular-google-chart": "^0.1.0", - "Chart.js": "^2.1.6" + "angular-responsive-tables": "^0.1.3" } } diff --git a/SmartInsurance/package.json b/SmartInsurance/package.json index 756b2150ef26b4deece463ececc6a36ce5698a56..43bdd3c371e27af290896425e90388509af6b01e 100644 --- a/SmartInsurance/package.json +++ b/SmartInsurance/package.json @@ -1,30 +1,28 @@ { - "name": "SmartInsurance", - "version": "1.1.1", - "description": "SmartInsurance: An Ionic project", - "dependencies": { - /*"angular-chart.js": "^1.0.0-alpha8",*/ - /*"angular-google-chart": "^0.1.0",*/ - "gulp": "^3.5.6", - "gulp-concat": "^2.2.0", - "gulp-minify-css": "^0.3.0", - "gulp-rename": "^1.2.0", - "gulp-sass": "^2.0.4" - }, - "devDependencies": { - "bower": "^1.3.3", - "gulp-util": "^2.2.14", - "shelljs": "^0.3.0" - }, - "cordovaPlugins": [ - "cordova-plugin-device", - "cordova-plugin-console", - "cordova-plugin-whitelist", - "cordova-plugin-splashscreen", - "cordova-plugin-statusbar", - "ionic-plugin-keyboard" - ], - "cordovaPlatforms": [ - "android" - ] + "name": "SmartInsurance", + "version": "1.1.1", + "description": "SmartInsurance: An Ionic project", + "dependencies": { + "gulp": "^3.5.6", + "gulp-sass": "^2.0.4", + "gulp-concat": "^2.2.0", + "gulp-minify-css": "^0.3.0", + "gulp-rename": "^1.2.0" + }, + "devDependencies": { + "bower": "^1.3.3", + "gulp-util": "^2.2.14", + "shelljs": "^0.3.0" + }, + "cordovaPlugins": [ + "cordova-plugin-device", + "cordova-plugin-console", + "cordova-plugin-whitelist", + "cordova-plugin-splashscreen", + "cordova-plugin-statusbar", + "ionic-plugin-keyboard" + ], + "cordovaPlatforms": [ + "android" + ] } diff --git a/SmartInsurance/www/Module/Allgemein/Controller/uebersichtCtrl.js b/SmartInsurance/www/Module/Allgemein/Controller/uebersichtCtrl.js index 6154275b0538ab17e6720e7507eda4c06d58eba9..1bac18331e8e680110f06ba27c3aa51e5201b2ec 100644 --- a/SmartInsurance/www/Module/Allgemein/Controller/uebersichtCtrl.js +++ b/SmartInsurance/www/Module/Allgemein/Controller/uebersichtCtrl.js @@ -11,352 +11,13 @@ appController.controller('uebersichtCtrl', function($scope, $http, $state, money $http.get(apiendpoint.url + '/api/smartinsurance/versicherung').success(function(response) { $scope.versicherungen = Status.versicherung(response); $scope.noVersicherung = false; -<<<<<<< HEAD -======= - - $scope.chartObject = { - "type": "PieChart", - "displayed": false, - "data": { - "cols": [ - { - "id": "kategorie", - "label": "Kategorie", - "type": "string", - "p": {} - }, - { - "id": "anzahl", - "label": "Anzahl", - "type": "number", - "p": {} - }, - ], - "rows": [ - { - "c": [ - { - "v": "Autos" - }, - { - "v": $scope.versicherungen.length - - - }, - ] - }, - { - "c": [ - { - "v": "Schiff" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Flugzeug" - }, - { - "v": 24 - }, - ] - }, - { - "c": [ - { - "v": "Haus" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Küchengeräte" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Möbel" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Maschinen" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Uhr" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Sonstiges" - }, - { - "v": 13 - }, - ] - } - ] - }, - "options": { - "title": "Versicherungsangebote pro Kategorie", - "isStacked": "true", - "fill": 20, - "displayExactValues": true, - "vAxis": { - "title": "Sales unit", - "gridlines": { - "count": 10 - } - }, - "hAxis": { - "title": "Date" - } - }, - "formatters": {} -} - - - - ->>>>>>> frontend_profil2 }); - $http.get(apiendpoint.url + '/api/smartinsurance/investition').success(function(response) { $scope.investitionen = Status.investition(response); $scope.noInvestition = false; - - $scope.chartObject2 = { - "type": "PieChart", - "displayed": false, - "data": { - "cols": [ - { - "id": "kategorie", - "label": "Kategorie", - "type": "string", - "p": {} - }, - { - "id": "anzahl", - "label": "Anzahl", - "type": "number", - "p": {} - }, - ], - "rows": [ - { - "c": [ - { - "v": "Autos" - }, - { - "v": $scope.investitionen.length - - }, - ] - }, - { - "c": [ - { - "v": "Schiff" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Flugzeug" - }, - { - "v": 24 - }, - ] - }, - { - "c": [ - { - "v": "Haus" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Küchengeräte" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Möbel" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Maschinen" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Uhr" - }, - { - "v": 13 - }, - ] - }, - { - "c": [ - { - "v": "Sonstiges" - }, - { - "v": 13 - }, - ] - } - ] - }, - "options": { - "title": "Investitionen pro Kategorie", - "isStacked": "true", - "fill": 20, - "displayExactValues": true, - "vAxis": { - "title": "Sales unit", - "gridlines": { - "count": 10 - } - }, - "hAxis": { - "title": "Date" - } - }, - "formatters": {} - } - - - $scope.chartObject3 = { - "type": "ColumnChart", - "displayed": false, - "data": { - "cols": [ - { - "id": "art", - "label": "", - "type": "string", - "p": {} - }, - { - "id": "summe", - "label": "Geld", - "type": "number", - "p": {} - }, - ], - "rows": [ - { - "c": [ - { - "v": "Versicherungshöhe" - }, - { - "v": $scope.versicherungengesamt() - - }, - ] - }, - { - "c": [ - { - "v": "Investitionshöhe" - }, - { - "v": $scope.investhoehegesamt() - }, - ] - } - - ] - }, - "options": { - "title": "Versicherungshöhe im Vergleich zur Investitionshöhe", - "isStacked": "true", - "fill": 20, - "displayExactValues": true, - "vAxis": { - "title": "€", - "gridlines": { - "count": 10 - } - }, - "hAxis": { - "title": "Art" - } - }, - "formatters": {} -} - - - - - }); - - - $scope.versicherungShow = function(id) { $state.go("app.versicherungDetail",{id: id}); }; @@ -388,11 +49,7 @@ appController.controller('uebersichtCtrl', function($scope, $http, $state, money for (var i = 0; i < $scope.investitionen.length; i++){ gesamtbetrag += moneyParser.moneyparsen($scope.investitionen[i].investitionshoehe); } - return moneyFormatter.formatMoney(gesamtbetrag); - - - }; $scope.renditemax = function() { @@ -416,12 +73,6 @@ appController.controller('uebersichtCtrl', function($scope, $http, $state, money return moneyFormatter.formatMoney(monatsbeitrag * investitionshoehe /versicherungshoehe); }; - - - - - - }); diff --git a/SmartInsurance/www/Module/Allgemein/Views/menu.html b/SmartInsurance/www/Module/Allgemein/Views/menu.html index ae769ce27c37da0a977c4bb2563a283aad0e0710..a43dde6ced44c428aeb76c7808fa88dfca3305c8 100644 --- a/SmartInsurance/www/Module/Allgemein/Views/menu.html +++ b/SmartInsurance/www/Module/Allgemein/Views/menu.html @@ -1,49 +1,42 @@ <ion-side-menus enable-menu-with-back-views="false"> <ion-side-menu-content> - <ion-nav-bar class="bar-assertive"> - <ion-nav-back-button class="no-text"> + <ion-nav-bar class="bar-stable"> + <ion-nav-back-button> </ion-nav-back-button> + <ion-nav-buttons side="left"> - <button class="button button-icon button-clear ion-navicon" menu-toggle="left"></button> - </ion-nav-buttons> - <ion-nav-buttons side="right"> - <button class="button button-icon button-clear ion-android-more-vertical" id="menu-popover" ng-click="popover.show($event)"></button> + <button class="button button-icon button-clear ion-navicon" menu-toggle="left"> + </button> </ion-nav-buttons> </ion-nav-bar> - <button id="fab" class="button button-positive button-fab button-fab-bottom-right"> - <i class="icon ion-social-facebook"></i> - </button> <ion-nav-view name="menuContent"></ion-nav-view> </ion-side-menu-content> <ion-side-menu side="left"> - <ion-header-bar class="expanded"> - <img src="img/logo.png" class="avatar motion spin fade"> - <div class="menu-bottom"> - Smart Insurance - </div> + <ion-header-bar class="bar-stable"> + <h1 class="title">Smart Insurance</h1> </ion-header-bar> - <ion-content class="stable-bg has-expanded-header"> + <ion-content> <ion-list> <!-- <ion-item menu-close ng-click="login()"> Login </ion-item> --> - <ion-item nav-clear menu-close href="#!/app/uebersicht"> + <ion-item menu-close href="#!/app/uebersicht"> Übersicht </ion-item> - <ion-item nav-clear menu-close href="#!/app/profil"> + <ion-item menu-close href="#!/app/profil"> Profil </ion-item> - <ion-item nav-clear menu-close href="#!/app/versicherungAdd"> + <ion-item menu-close href="#!/app/versicherungAdd"> Versicherung anlegen </ion-item> - <ion-item nav-clear menu-close href="#!/app/investitionSearch"> + <ion-item menu-close href="#!/app/investitionSearch"> Investition suchen </ion-item> - <ion-item nav-clear menu-close href="#!/app/faq"> + <ion-item menu-close href="#!/app/faq"> FAQ </ion-item> - <ion-item nav-clear menu-close href="#!/app/impressum"> + <ion-item menu-close href="#!/app/impressum"> Impressum </ion-item> </ion-list> diff --git a/SmartInsurance/www/Module/Allgemein/Views/uebersicht.html b/SmartInsurance/www/Module/Allgemein/Views/uebersicht.html index e0725e12cd2974595023ddf57b4db77403735795..8bdacb1d81a6f86fda63a464f96d653dcdbcc11b 100644 --- a/SmartInsurance/www/Module/Allgemein/Views/uebersicht.html +++ b/SmartInsurance/www/Module/Allgemein/Views/uebersicht.html @@ -7,9 +7,6 @@ <h2 class=" " style="color: rgb(0, 0, 0);" id="Bersicht-heading2" ng-show="(noInvestition && noVersicherung)">Es liegen aktuelle weder Versicherungen noch Investitionen vor. </h2> <ion-list class=" " id="Bersicht-list8"> <ion-item style="" class=" " id="Bersicht-list-item14"> - - <div google-chart chart="chartObject3" style="{{cssStyle}}"></div> - <div ng-show="!(noVersicherung)"> <h2> Versicherung </h2> <table class="tableMobile"> @@ -27,11 +24,6 @@ </tr> </table> </div> - - -<div google-chart chart="chartObject" style="{{cssStyle}}"></div> - - <div ng-show="!(noInvestition)"> <span class="input-label"></span> <span class="input-label"></span> @@ -52,9 +44,6 @@ </tr> </table> </div> - -<div google-chart chart="chartObject2" style="{{cssStyle}}"></div> - </ion-item> </ion-list> </div> diff --git a/SmartInsurance/www/Module/Investition_Add/Controller/investitionAddedCtrl.js b/SmartInsurance/www/Module/Investition_Add/Controller/investitionAddedCtrl.js index dd020497b3f12d5a610660aa9dca0b32b9c446f8..82cd05abfab161ba15a87835de3645addab5d570 100644 --- a/SmartInsurance/www/Module/Investition_Add/Controller/investitionAddedCtrl.js +++ b/SmartInsurance/www/Module/Investition_Add/Controller/investitionAddedCtrl.js @@ -59,9 +59,6 @@ appController.controller('investitionAddedCtrl',function($scope, $http, $state, case "Übersicht": $state.go('app.uebersicht'); break; - case "Detail": - $state.go('app.investitionDetail',{id: $scope.investitionID}); - break; } }; diff --git a/SmartInsurance/www/Module/Investition_Add/Views/investitionAdded.html b/SmartInsurance/www/Module/Investition_Add/Views/investitionAdded.html index 6790d94a3f04927522f348f9dcaacaf87171015c..095646f85514c0b6bf818ec07a3fe7616e86cb3b 100644 --- a/SmartInsurance/www/Module/Investition_Add/Views/investitionAdded.html +++ b/SmartInsurance/www/Module/Investition_Add/Views/investitionAdded.html @@ -21,11 +21,7 @@ </tr> </table> </div> - <div class=" button-bar " id="versicherungsdetails-button-bar1"> - <button class=" button button-positive button-block " id="investitionErfolgreichGetTigt-button17" ng-click="navigate('Übersicht')">Übersicht</button> - <button class=" button button-positive button-block " id="investitionErfolgreichGetTigt-button17" ng-click="navigate('Detail')">Detailansicht</button> - </div> - <button class=" button button-positive button-block " id="investitionErfolgreichGetTigt-button17" ng-click="navigate('suchen')">Investition suchen</button> + <button class=" button button-positive button-block " id="investitionErfolgreichGetTigt-button17" ng-click="navigate('Übersicht')">Zur Übersicht</button> <div id="investitionErfolgreichGetTigt-card219" class="list card "> <p class=" " style="margin-top:0px;color:#000000;font-size:18px;" id="investitionErfolgreichGetTigt-markdown11">Wollen Sie die Investitionsmöglichkeit teilen?</p> <div class = "row"> diff --git a/SmartInsurance/www/Module/Sonstiges/Controller/profilBearbeitenCtrl.js b/SmartInsurance/www/Module/Sonstiges/Controller/profilBearbeitenCtrl.js index eb6778008b98d839909ae6c147e87be6bd38923b..76c37f5270bfecd1a701539290f8ef98da8ce786 100644 --- a/SmartInsurance/www/Module/Sonstiges/Controller/profilBearbeitenCtrl.js +++ b/SmartInsurance/www/Module/Sonstiges/Controller/profilBearbeitenCtrl.js @@ -1,33 +1,18 @@ appController.controller('profilBearbeitenCtrl',function($scope, $http, $state, $stateParams, apiendpoint){ - $scope.submitted = false; - + + $http.get(apiendpoint.url + '/api/smartinsurance/profil').success(function(response) { $scope.profil = response[0]; + $scope.prename = response[0].prename; + $scope.name = response[0].name; + $scope.email = response[0].email; + $scope.iban = response[0].iban; + $scope.email = response[0].bic; }); + + - $scope.checkIBAN = /[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}/; - - $scope.funcIBAN = function(field){ - return field.$error.pattern && (field.$touched || $scope.submitted); - } - - $scope.isInvalid = function(field){ - return field.$error.required && (field.$touched || $scope.submitted); - }; - - - - - $scope.profilBearbeiten = function(form) { - - $scope.submitted = true; - - if (form.$valid){ - $state.go('app.profil'); - } - - } -}); +}); \ No newline at end of file diff --git a/SmartInsurance/www/Module/Sonstiges/Views/profil_bearbeiten.html b/SmartInsurance/www/Module/Sonstiges/Views/profil_bearbeiten.html index 86a3951f5afe993f0a5b4e1396005fb124f006a8..5bb84ee05f17cd1489207831c6a5315fcdac4eb8 100644 --- a/SmartInsurance/www/Module/Sonstiges/Views/profil_bearbeiten.html +++ b/SmartInsurance/www/Module/Sonstiges/Views/profil_bearbeiten.html @@ -1,70 +1,60 @@ <ion-view title="Profil bearbeiten" id="page22" class=" "> <ion-content padding="true" class="has-header"> - - <!-- <div class="list card " id="profilBearbeiten-card222"> --> + <div class="list card " id="profilBearbeiten-card222"> <ion-item class="item-avatar " id="profilBearbeiten-list-item15"> <h2>Item</h2> </ion-item> - <button id="profilBearbeiten-button12" class=" button button-positive button-block ">Bild hochladen</button> - - <form id="profilBearbeiten-form63" class="list " name="profilBearbeitenForm"> - + <form id="profilBearbeiten-form63" class="list "> <h1 id="profilBearbeiten-heading3" style="color:#000000;" class=" "></h1> - - <p id="profilBearbeiten-markdown40" style="color:#000000;font-size:18px;" class=" ">Vorname:</p> + <p id="profilBearbeiten-markdown40" style="color:#000000;" class=" ">Vorname:</p> <label class="item item-input " id="profilBearbeiten-input16"> + <input type="text" placeholder="" value={{profil.prename}}> </label> - - <p id="profilBearbeiten-markdown51" style="color:#000000;font-size:18px;" class=" ">Nachname:</p> + <p id="profilBearbeiten-markdown51" style="color:#000000;" class=" ">Nachname:</p> <label class="item item-input " id="profilBearbeiten-input17"> + <input type="text" placeholder="" value={{profil.name}}> </label> - - <p id="profilBearbeiten-markdown53" style="color:#000000;font-size:18px;" class=" ">E-Mail:</p> + <p id="profilBearbeiten-markdown53" style="color:#000000;" class=" ">E-Mail:</p> <label class="item item-input " id="profilBearbeiten-input18"> + <input type="text" placeholder="" value={{profil.email}}> </label> - <!-- <form id="profilBearbeiten-form64" class="list "> --> - - <p id="profilBearbeiten-markdown54" style="color:#000000;font-size:18px;" class=" ">Neues Passwort:</p> + <form id="profilBearbeiten-form64" class="list "> + <p id="profilBearbeiten-markdown54" style="color:#000000;" class=" ">Neues Passwort:</p> <label class="item item-input " id="profilBearbeiten-input19"> + <input type="text" placeholder=""> </label> - - <p id="profilBearbeiten-markdown55" style="color:#000000;font-size:18px;" class=" ">Passwort bestätigen:</p> + <p id="profilBearbeiten-markdown55" style="color:#000000;" class=" ">Passwort bestätigen:</p> <label class="item item-input " id="profilBearbeiten-input21"> + <input type="text" placeholder=""> </label> - <!-- <form id="profilBearbeiten-form65" class="list "> --> - - <p id="profilBearbeiten-markdown57" style="color:#000000;font-size:18px;" class=" ">Bankinstitut:</p> + <form id="profilBearbeiten-form65" class="list "> + <p id="profilBearbeiten-markdown57" style="color:#000000;" class=" ">Bankinstitut:</p> <label class="item item-input " id="profilBearbeiten-input22"> - <input type="text" placeholder=""> + + <input type="text" placeholder=""> </label> - - - <p id="profilBearbeiten-markdown58" style="color:#000000;font-size:18px;" class=" ">IBAN:</p> + <p id="profilBearbeiten-markdown58" style="color:#000000;" class=" ">IBAN:</p> <label class="item item-input " id="profilBearbeiten-input23"> - <input type="text" name="iban" id ="iban" ng-model="profil.iban" ng-pattern="checkIBAN" placeholder="" value={{profil.iban}} required> + + <input type="text" placeholder="" value={{profil.iban}}> </label> - <div style="color:red"> - <span ng-show="funcIBAN(profilBearbeitenForm.iban)" >Bitte geben Sie eine gültige IBAN ein.</span> - </div> - - - <p id="profilBearbeiten-markdown59" style="color:#000000;font-size:18px;" class=" ">BIC:</p> + <p id="profilBearbeiten-markdown59" style="color:#000000;" class=" ">BIC:</p> <label class="item item-input " id="profilBearbeiten-input24"> - <input type="text" placeholder="" value={{profil.bic}}> + + <input type="text" placeholder="" value={{profil.bic}}> </label> - - <button id="profilBearbeiten-button14" ng-click="profilBearbeiten(profilBearbeitenForm)" - class=" button button-positive button-block ">Speichern</button> - + + <button id="profilBearbeiten-button14" class=" button button-positive button-block ">Speichern</button> + </form> </form> </form> - <!-- </div> --> + </div> </ion-content> -</ion-view> +</ion-view> \ No newline at end of file diff --git a/SmartInsurance/www/Module/Sonstiges/Views/profil_fremd.html b/SmartInsurance/www/Module/Sonstiges/Views/profil_fremd.html index 0a75a58e5d19c7aea2691e2c2ca8084b9b9cf77c..6ecc2878ee0773797b0efc7de3513683ec23815a 100644 --- a/SmartInsurance/www/Module/Sonstiges/Views/profil_fremd.html +++ b/SmartInsurance/www/Module/Sonstiges/Views/profil_fremd.html @@ -16,40 +16,7 @@ </tr> <tr> <td> <b> Versicherungen: </b> </td> - - <div id="Bersicht-card21" class="list card " ng-show="!(noVersicherung)" > - <ion-item style="" class=" " id="Bersicht-list-item4">Versicherungen</ion-item> - <div style="" id="Bersicht-list-item-container1" class="item item-body "> - <ion-list class=" " id="Bersicht-list6"> - <a ng-click="versicherungShow({{versicherung.id}})" ng-repeat="versicherung in versicherungen"> - <ion-item style="" id="Bersicht-list-item10" class="item-icon-left "> - <i class="icon ion-ionic"></i> - <table> - <tr> - <td> <b>Bezeichnung: </b> </td> - <td> {{versicherung.name}} </td> - </tr> - <tr> - <td> <b> Versicherungshöhe: </b> </td> - <td> {{versicherung.versicherungshoehe}} </td> - </tr> - <tr> - <td> <b> Monatsbeitrag: </b> </td> - <td> {{versicherung.beitrag}} </td> - </tr> - <tr ng-show="versicherung.wirdGekuendigt"> - <td> </td> - <td> <b> Kündigung zum Monatsende </b> </td> - - </tr> - </table> - </ion-item> - </a> - <p class=" " style="margin-top:0px;color:#000000;" id="Bersicht-markdown26" ng-show="noVersicherung">Es liegen keine Versicherungen vor.</p> - </ion-list> - </div> - </div> - + <td> {{versicherungen[0].name}}, {{versicherungen[1].name}} </td> </tr> diff --git a/SmartInsurance/www/Module/Versicherung_Add/Controller/versicherungAddCtrl.js b/SmartInsurance/www/Module/Versicherung_Add/Controller/versicherungAddCtrl.js index 6aeafece58f3e5f56f2374f54704fdbbf0d233b3..5169193044624aa31ae196f2c0429f7458e87040 100644 --- a/SmartInsurance/www/Module/Versicherung_Add/Controller/versicherungAddCtrl.js +++ b/SmartInsurance/www/Module/Versicherung_Add/Controller/versicherungAddCtrl.js @@ -26,7 +26,8 @@ appController.controller('versicherungAddCtrl',function($scope, $http, $state, m $scope.isNaN = function(field) { return field.$error.pattern && (field.$touched || $scope.submitted); - } + }; + diff --git a/SmartInsurance/www/Module/Versicherung_Add/Controller/versicherungAddedCtrl.js b/SmartInsurance/www/Module/Versicherung_Add/Controller/versicherungAddedCtrl.js index 53e917e11ab2a847b1d1fe336fefb3e486586f3f..1bf70ebce19dfada59c14b4b81966ac1309289e9 100644 --- a/SmartInsurance/www/Module/Versicherung_Add/Controller/versicherungAddedCtrl.js +++ b/SmartInsurance/www/Module/Versicherung_Add/Controller/versicherungAddedCtrl.js @@ -58,9 +58,6 @@ appController.controller('versicherungAddedCtrl',function($scope, $http, $state, case "Übersicht": $state.go('app.uebersicht'); break; - case "Detail": - $state.go('app.versicherungDetail',{id: $scope.versicherungId}); - break; } }; diff --git a/SmartInsurance/www/Module/Versicherung_Add/Views/versicherungAdd.html b/SmartInsurance/www/Module/Versicherung_Add/Views/versicherungAdd.html index 59463599103f18143632c82ff2e3ba44ea758dac..14b4739644f39af76320ce95243a0cefcb079c0a 100644 --- a/SmartInsurance/www/Module/Versicherung_Add/Views/versicherungAdd.html +++ b/SmartInsurance/www/Module/Versicherung_Add/Views/versicherungAdd.html @@ -17,8 +17,8 @@ <p class=" " style="color:#000000;font-size:18px;" id="versicherungAnlegen-markdown5">Kategorie:</p> <label id="versicherungAnlegen-select1" class="item item-select "> <span class="input-label"></span> - <select ng-model="versicherung.kategorie" name="kategorie" style="width:100%;" required> - <option ng-repeat = "x in kategorien"> + <select ng-model="versicherung.kategorie" name="kategorie" required> + <option ng-repeat = "x in kategorien" > {{x}} </option> </select> diff --git a/SmartInsurance/www/Module/Versicherung_Add/Views/versicherungAdded.html b/SmartInsurance/www/Module/Versicherung_Add/Views/versicherungAdded.html index 661a598bad8c2f507fc48af4f76fad2d208a4372..38725e8fe71d50bd996ba1c3dd48bd30c26b9cd2 100644 --- a/SmartInsurance/www/Module/Versicherung_Add/Views/versicherungAdded.html +++ b/SmartInsurance/www/Module/Versicherung_Add/Views/versicherungAdded.html @@ -20,12 +20,9 @@ </tr> </table> </div> - <div class=" button-bar " id="versicherungsdetails-button-bar1"> - <button class=" button button-positive button-block " id="versicherungsangebotEingestellt-button22" ng-click="navigate('Übersicht')">Übersicht</button> - <button class=" button button-positive button-block " id="versicherungsangebotEingestellt-button17" ng-click="navigate('Detail')">Detailansicht</button> - </div> - <button class=" button button-positive button-block " id="versicherungsangebotEingestellt-button21" ng-click="navigate('hinzufügen')">Weitere Versicherung anbieten</button> + <button class=" button button-positive button-block " id="versicherungsangebotEingestellt-button21" ng-click="navigate('hinzufügen')">Weitere Versicherung anbieten</button> + <button class=" button button-positive button-block " id="versicherungsangebotEingestellt-button22" ng-click="navigate('Übersicht')">Zur Übersicht</button> <div id="versicherungsangebotEingestellt-card219" class="list card "> <p class=" " style="margin-top:0px;color:#000000;font-size:18px;" id="versicherungsangebotEingestellt-markdown11">Wollen Sie die Investitionsmöglichkeit teilen?</p> <div class = "row"> diff --git a/SmartInsurance/www/Module/Versicherung_Edit/Views/schadensfallMelden.html b/SmartInsurance/www/Module/Versicherung_Edit/Views/schadensfallMelden.html index c482f7a902889db0bee3f76265a88b8da7deb39f..fdc04d4c6081212aa1b39c1d7d4296ccc47ce333 100644 --- a/SmartInsurance/www/Module/Versicherung_Edit/Views/schadensfallMelden.html +++ b/SmartInsurance/www/Module/Versicherung_Edit/Views/schadensfallMelden.html @@ -31,37 +31,9 @@ <span ng-show="isInvalid(reportSchadenForm.beschreibung)" >Bitte geben Sie eine Beschreibung an. </br></span> </div> - - - - - <p class=" " style="color:#000000;font-size:18px;" id="schadensfallMelden-bildhinzu">Bilder hinzufügen:</p> - - <style type="text/css"> - img { padding:4px; } - </style> - - - <div> - <!-- <span>Thumbnails:</span> --> - <div id="thumbnail"></div> - </div> - - <form method="post" enctype="multipart/form-data"> - <input type="file" name="fileInput" accept="image/*" multiple onChange="fileThumbnail(this.files);"> - </form> - - - - - - <button class=" button button-positive button-block " id="schadensfallMelden-button25" ng-click="reportSchaden(reportSchadenForm)" ng-hide="edit()">Schaden melden</button> <button class=" button button-positive button-block " id="schadensfallMelden-button25" ng-click="editSchaden(reportSchadenForm)" ng-show="edit()">Änderung speichern</button> - </form> </ion-content> </ion-view> - - \ No newline at end of file diff --git a/SmartInsurance/www/Module/apiendpoint.js b/SmartInsurance/www/Module/apiendpoint.js index cd7ba3d17c53610d9d1986cc12e92f6947e4a37b..43320c47b852571b01c2b125129ede237b3961da 100644 --- a/SmartInsurance/www/Module/apiendpoint.js +++ b/SmartInsurance/www/Module/apiendpoint.js @@ -2,6 +2,6 @@ angular.module("smartInsurance").factory('apiendpoint', function() { var service={}; service.url = "http://localhost:3000"; // service.url = "http://crowdinsurance.cloudf.de"; - service.backend = "https://sb.pftclan.de:546"; + return service; }); diff --git a/SmartInsurance/www/app.js b/SmartInsurance/www/app.js index dfbe9819d23ec3c8dcc80949003e00dae87222cd..5fb0425872a2f56cc072103aae5164bb58f2b939 100644 --- a/SmartInsurance/www/app.js +++ b/SmartInsurance/www/app.js @@ -4,7 +4,7 @@ // 'starter' is the name of this angular module example (also set in a <body> attribute in index.html) // the 2nd parameter is an array of 'requires' // 'starter.controllers' is found in controllers.js -var app = angular.module('smartInsurance', ['ionic', 'smartInsurance.controllers', '720kb.socialshare', 'googlechart']); +var app = angular.module('smartInsurance', ['ionic', 'smartInsurance.controllers', '720kb.socialshare']); app.run(function($ionicPlatform) { $ionicPlatform.ready(function() { @@ -24,7 +24,9 @@ app.run(function($ionicPlatform) { app.config(function($stateProvider, $urlRouterProvider, $locationProvider) { + $stateProvider + .state('app', { url: '/app', abstract: true, @@ -247,26 +249,6 @@ app.config(function($stateProvider, $urlRouterProvider, $locationProvider) { } }) - .state('app.login', { - url: '/login', - views: { - 'menuContent': { - templateUrl: 'Module/Allgemein/Views/login.html', - controller: 'loginCtrl' - } - } - }) - - .state('app.signup', { - url: '/signup', - views: { - 'menuContent': { - templateUrl: 'Module/Allgemein/Views/signup.html', - controller: 'signupCtrl' - } - } - }) - .state('app.investitionSocial', { url: '/investitionSocial/:id', views: { @@ -303,3 +285,8 @@ app.config(function($stateProvider, $urlRouterProvider, $locationProvider) { $locationProvider.html5Mode(false).hashPrefix('!'); }); + + + + + diff --git a/SmartInsurance/www/css/style.css b/SmartInsurance/www/css/style.css index 8c716604aec0381363d922d748b4091581010472..fa63b0bd489ab29dd2a21ca4591a340a80a0a58c 100644 --- a/SmartInsurance/www/css/style.css +++ b/SmartInsurance/www/css/style.css @@ -1,129 +1,25 @@ /* Empty. Add your own CSS if you like */ -/* Utilities */ - -.link { - color: #116262; +td.linebreak p { + width: 120%; + font-size: inherit; + color: inherit; font-weight: bold; } -h4 { - color: #116262; - font-size: 22px; - margin-bottom: 16px; -} - -h4:first-child { - border-top: none; - padding-top: initial; -} - -.title-bordered { - border-top: solid 2px #bbb; - padding-top: 30px; -} - -p { - color: #555; - margin: 0 0 25px; -} - -.no-border { - border: none; -} - -.static { - position: static; -} - -.bold { - font-weight: bold; -} - -.border-top { - border-top: solid 1px #ccc; - padding-top: 30px; -} - -.blue-grey-900 { - background-color: #263238 !important; - color: #fff; -} -/* Menu */ - -.menu .bar.bar-header.expanded { - background-image: url('../img/material-graphite.jpg'); - background-size: 120%; - background-position: 0%; - transition: all .5s ease-in-out; -} - -.menu.menu-left * { - font-weight: bold; -} - -.item-radio input:checked ~ .item-content { - background: transparent; -} - -.menu-open .ion-navicon { - transform: rotate(-360deg); - -webkit-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} - -.menu-open .ion-navicon:before { - content: "\f2ca"; -} - -.item.item-radio .radio-icon { - opacity: 1; - -webkit-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} - -.item.item-radio:active .radio-icon { - opacity: 0; - transform: scale(1.6); - -webkit-transition: all 0.1s ease-in-out; - transition: all 0.1s ease-in-out; -} - -.directions.button-bar { - margin: 0 auto; - width: 33.333%; -} - -.directions.button-bar button { - line-height: 26px; -} - -.ion-arrow-right-c.top-left:before { - transform: rotate(-135deg); -} - -.ion-arrow-right-c.top-right:before { - transform: rotate(-45deg); -} - -.ion-arrow-right-c.bottom-left:before { - transform: rotate(-225deg); -} - -.ion-arrow-right-c.bottom-right:before { - transform: rotate(45deg); -} - .styleTable { width: 100%; border-collapse: collapse; } + .styleData { padding: 6px; border: 1px solid #ccc; text-align: left; } + + @media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) { @@ -204,102 +100,3 @@ only screen and (max-width: 760px), .labelData:nth-of-type(6):before { content: "Anzahl Investoren"; font-weight: bold;} } - -#modal { - background-color: #ef4e3a; - border-radius: 100%; - box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.2); - position: fixed; - height: 50%; - bottom: 0; - opacity: 0; - width: 700px; - -webkit-transition: all 0.3s ease-in-out; - transition: all 0.3s ease-in-out; -} - -.expand #modal { - background-color: #DBDBDB; - border-radius: 0; - border-top: solid 4px #ef4e3a; - opacity: 1; - z-index: 9; -} -/* CODE */ - -.code { - color: #333; - font-family: monospace; - padding: 10px; - white-space: pre; -} - -.code-wrapper { - padding-bottom: 30px; - padding-top: 15px; -} - -.code-wrapper::before { - color: #1B5E20; - font-family: "Ionicons"; - speak: none; - font-size: 18px; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - text-rendering: auto; - line-height: 1; - -webkit-font-smoothing: antialiased; - content: '\f216 '; -} - -.code-wrapper.active::before { - content: '\f207 '; -} - -.code-wrapper .toggle { - color: #4CAF50; - cursor: pointer; - display: inline-block; - font-size: 16px; - font-weight: bold; - padding: 10px 8px; - text-decoration: underline; -} - -.code-wrapper .code { - opacity: 0; - margin-top: -20px; - height: 0; - overflow: hidden; - position: absolute; - transition: 0.1s all ease-in-out; - z-index: 9999999999; -} - -.code-wrapper.code-wrapper-last .code { - position: relative; -} - -.code-wrapper.active .code { - background: #f9f9f9; - box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5); - left: 16px; - height: initial; - margin-top: 15px; - padding: 15px; - right: 16px; - opacity: 1; - transition: 0.3s all ease-in-out; - width: initial; -} - -.popover { - left: initial !important; - right: 16px !important; - top: 16px !important; -} -.platform-android .popover{ -margin-top:10px; -} diff --git a/SmartInsurance/www/index.html b/SmartInsurance/www/index.html index 584914c84376cde4f3c3dfe6e87b6938ed01288c..2c3fce726805ca7fc6750756bfc08f6f2db2f3c7 100644 --- a/SmartInsurance/www/index.html +++ b/SmartInsurance/www/index.html @@ -6,7 +6,6 @@ <title></title> <link href="lib/ionic/css/ionic.css" rel="stylesheet"> - <link href="lib/ionic-material/dist/ionic.material.min.css" rel="stylesheet" /> <link href="css/style.css" rel="stylesheet"> <link rel="icon" href="favicon.ico" type="image/x-icon"> @@ -38,9 +37,9 @@ } </style> + <!-- ionic/angularjs js --> <script src="lib/ionic/js/ionic.bundle.js"></script> - <script src="lib/ionic-material/dist/ionic.material.min.js"></script> <!-- cordova script (this will be a 404 during development) --> <script src="cordova.js"></script> @@ -65,11 +64,6 @@ <!-- Allgemein --> <script src="Module/Allgemein/Controller/uebersichtCtrl.js"></script> <script src="Module/Allgemein/Controller/errorCtrl.js"></script> - - <!-- Allgemein - Login und Signup --> - <script src="Module/Allgemein/Controller/loginCtrl.js"></script> - <script src="Module/Allgemein/Controller/signupCtrl.js"></script> - <!-- Investition_Add --> <script src="Module/Investition_Add/Controller/investitionSearchCtrl.js"></script> <script src="Module/Investition_Add/Controller/investitionInfoCtrl.js"></script> @@ -82,9 +76,9 @@ <script src="Module/Investition_Edit/Controller/investitionSocialCtrl.js"></script> <!-- Sonstige --> <script src="Module/Sonstiges/Controller/faqCtrl.js"></script> - <script src="Module/Sonstiges/Controller/profilCtrl.js"></script> - <script src="Module/Sonstiges/Controller/profilBearbeitenCtrl.js"></script> - <script src="Module/Sonstiges/Controller/profilFremdCtrl.js"></script> + <script src="Module/Sonstiges/Controller/profilCtrl.js"></script> + <script src="Module/Sonstiges/Controller/profilBearbeitenCtrl.js"></script> + <script src="Module/Sonstiges/Controller/profilFremdCtrl.js"></script> <!-- Versicherung_Add --> <script src="Module/Versicherung_Add/Controller/versicherungAddCtrl.js"></script> <script src="Module/Versicherung_Add/Controller/versicherungCheckCtrl.js"></script> @@ -97,52 +91,6 @@ <script src="Module/Versicherung_Edit/Controller/versicherungSocialCtrl.js"></script> - <!-- angularchart --> - <script src="lib/angular/angular.min.js"></script> - <script src="lib/Chart.js/dist/Chart.min.js"></script> - <script src="lib/angular-chart.js/dist/angular-chart.min.js"></script> - - - <script type="text/javascript" src="lib/angularjs/angular-fusioncharts.min.js"></script> - - <script src="lib/angular-google-chart/ng-google-chart.js"></script> - <script src="lib/angular-google-chart/ng-google-chart.min.js"></script> - - - - <script type="text/javascript"> - function fileThumbnail(files) - { - var thumb = document.getElementById("thumbnail"); - - thumb.innerHTML = ""; - - if(!files) - return; - - for(var i = 0; i < files.length; i++) - { - var file = files[i]; - - if(!file.type.match(/image.*/)) - continue; - - var img = document.createElement("img"); - var reader = new FileReader(); - - reader.onload = (function(tImg) { - return function(e) { - tImg.src = e.target.result; - }; - })(img); - - reader.readAsDataURL(file); - - img.width = 100; - thumb.appendChild(img); - } - } - </script> </head> <body ng-app="smartInsurance">