3 Commits

Author SHA1 Message Date
Moritz Utcke
f600670e60 Cookie Fehler 2024-11-20 12:24:04 +11:00
Moritz Utcke
60c6785abd Ausweis ohne Pfeile und Bedarfsausweis Nachricht überarbeitet. 2024-11-20 12:15:19 +11:00
Moritz Utcke
39c681cd51 Update Makefile 2024-11-14 15:23:18 +11:00
481 changed files with 9413 additions and 43787 deletions

View File

@@ -19,7 +19,7 @@ jobs:
port: 22
script: |
cd ~/online-energieausweis
git reset --hard origin/main
git reset --hard HEAD
git clean -f -d
git pull origin main
git status

62
.gitignore vendored
View File

@@ -1,34 +1,28 @@
# build output
dist/
# generated types
.astro/
# log files
logs/
# dependencies
node_modules/
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# lockfile
pnpm-lock.yaml
bun.lockb
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store
public/fonts/
*.Identifier
src/lib/Berechnungen/BedarfsausweisWohnen/18599-Tabellenverfahren-Wohngebaeude-komplett-ocr.pdf
# build output
dist/
# generated types
.astro/
# log files
logs/
# dependencies
node_modules/
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# lockfile
pnpm-lock.yaml
bun.lockb
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store

View File

@@ -8,10 +8,9 @@
"css.lint.unknownAtRules": "ignore",
"scss.lint.unknownAtRules": "ignore",
"less.lint.unknownAtRules": "ignore"
}
"workbench.colorCustomizations": {
"minimap.background": "#00000000",
"scrollbar.shadow": "#00000000"
},
}
}

View File

@@ -1,9 +1,9 @@
.PHONY: dev database online-energieausweis all prod bun-install-database # api bun-install-api
.PHONY: dev database api online-energieausweis all prod bun-install-database bun-install-api
online-energieausweis:
bun run dev --host
bun run dev
dev: database online-energieausweis # api
dev: online-energieausweis api database
database:
$(MAKE) -C ../database dev
@@ -13,19 +13,21 @@ bun-install-database:
bun link
bun install
# bun-install-api: bun-install-database
# cd ../api
# bun install
# bun link @ibcornelsen/database
bun-install-api: bun-install-database
cd ../api
bun install
bun link @ibcornelsen/database
# api:
# $(MAKE) -C ../api dev
api:
$(MAKE) -C ../api dev
all:
mkdir -p ~/logs
bun run dev 2>&1 | tee ~/logs/`date '+%d-%m-%Y_%H:%M:%S'`.log
prod: bun-install-database # bun-install-api
prod: bun-install-api bun-install-database
bun install
bun pm trust @ibcornelsen/database
mkdir -p ~/logs
mkdir -p ~/persistent/online-energieausweis
@@ -37,11 +39,11 @@ prod: bun-install-database # bun-install-api
fi
# Auch die API sollte bereits laufen
# @if [ $$(pm2 pid api) -eq "0" ]; then \
# cd ../api; \
# $(MAKE) prod; \
# cd ../online-energieausweis; \
# fi
@if [ $$(pm2 pid api) -eq "0" ]; then \
cd ../api; \
$(MAKE) prod; \
cd ../online-energieausweis; \
fi
- rm -f ~/online-energieausweis/.env;
- touch ~/online-energieausweis/.env;

View File

@@ -4,14 +4,12 @@ import svelte from "@astrojs/svelte";
import tailwind from "@astrojs/tailwind";
import node from "@astrojs/node";
import mdx from "@astrojs/mdx";
import dsv from "@rollup/plugin-dsv"
import astroTypesafeAPI from "astro-typesafe-api"
import { fileURLToPath } from "url";
// https://astro.build/config
export default defineConfig({
integrations: [svelte(), tailwind(), mdx(), astroTypesafeAPI()],
integrations: [svelte(), tailwind(), mdx()],
outDir: "./dist",
output: "server",
vite: {
@@ -30,16 +28,12 @@ export default defineConfig({
commonjsOptions: {
transformMixedEsModules: false
}
},
plugins: [dsv()]
}
},
adapter: node({
mode: "middleware"
}),
server: {
port: 3000
},
devToolbar: {
enabled: false
}
});

2527
bun.lock

File diff suppressed because it is too large Load Diff

View File

@@ -1,42 +1,17 @@
import { defineConfig } from "cypress";
import dsv from "@rollup/plugin-dsv"
import { fileURLToPath } from "url";
import vitePreprocessor from "cypress-vite";
export default defineConfig({
e2e: {
baseUrl: "http://localhost:3000",
supportFile: false,
viewportHeight: 900,
viewportWidth: 1660,
supportFile: false,
specPattern: "./src/cypress/e2e/**/*.{ts,js}",
setupNodeEvents(on, config) {
on("file:preprocessor", vitePreprocessor({
optimizeDeps: {
exclude: ["@ibcornelsen/database"]
},
resolve: {
alias: {
"#": fileURLToPath(new URL("./src", import.meta.url)),
"#components": fileURLToPath(new URL("./src/components", import.meta.url)),
"#lib": fileURLToPath(new URL("./src/lib", import.meta.url))
}
},
base: fileURLToPath(new URL("./src", import.meta.url)),
build: {
commonjsOptions: {
transformMixedEsModules: false
}
},
plugins: [dsv()]
}))
},
},
component: {
devServer: {
framework: "svelte",
bundler: "vite"
bundler: "vite",
},
}
},
});

View File

@@ -1,26 +1,24 @@
import fuelList from "#components/Ausweis/brennstoffListe.js";
import fuelList from "#components/Ausweis/brennstoffListe";
import { faker } from "@faker-js/faker";
import { type Enums } from "@ibcornelsen/database/client";
import { Enums } from "@ibcornelsen/database/client";
import "cypress-file-upload"
import moment from "moment";
describe("Verbrauchsausweis erstellen Schritt 1", () => {
const ausstellgrund = (["Modernisierung", "Neubau", "Sonstiges", "Verkauf", "Vermietung"] as Enums.Ausstellgrund[]);
const heizungsstatus = (["BEHEIZT", "NICHT_VORHANDEN", "UNBEHEIZT"] as Enums.Heizungsstatus[]);
it("erstellt einen neuen Verbrauchsausweis Wohngebäude.", () => {
cy.visit("/energieausweis-erstellen/verbrauchsausweis-gewerbe");
cy.wait(1000);
// Wir überprüfen, ob alle Ausstelgründe vorhanden sind, diese sollten genau so viele sein wie in der Datenbank vorhanden sind.
cy.get("select[data-cy='ausstellgrund']")
.select(
cy.get("input[name='ausstellgrund']")
.should("have.length", Object.values(Enums.Ausstellgrund).length)
.eq(
faker.number.int({
min: 0,
max: (["Modernisierung", "Neubau", "Sonstiges", "Verkauf", "Vermietung"] as Enums.Ausstellgrund[]).length - 1,
max: Object.values(Enums.Ausstellgrund).length - 1,
})
)
.check();
// Jetzt Füllen wir das Baujahr vom Gebäude aus.
cy.get("input[name='baujahr_gebaeude']")
@@ -73,14 +71,14 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
.type(faker.number.int({ min: 50, max: 1000 }).toString());
// Keller
cy.get("select[name='keller']").find("option:not([disabled])").should("have.length", heizungsstatus.length).parent().select(faker.number.int({
max: heizungsstatus.length,
cy.get("select[name='keller']").find("option:not([disabled])").should("have.length", Object.values(Enums.Heizungsstatus).length).parent().select(faker.number.int({
max: Object.values(Enums.Heizungsstatus).length,
min: 1
}));
// Dachgeschoss
cy.get("select[name='dachgeschoss']").find("option:not([disabled])").should("have.length", heizungsstatus.length).parent().select(faker.number.int({
max: heizungsstatus.length,
cy.get("select[name='dachgeschoss']").find("option:not([disabled])").should("have.length", Object.values(Enums.Heizungsstatus).length).parent().select(faker.number.int({
max: Object.values(Enums.Heizungsstatus).length,
min: 1
}));
@@ -90,22 +88,9 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
cy.get("select[name='brennstoff_1']").select(brennstoffKombo[0]);
cy.get("select[name='einheit_1']").select(brennstoffKombo[1]);
let availableDates = [];
const startDate = moment()
.subtract(4, "years")
.subtract(6, "months");
const endDate = moment().subtract(3, "years");
for (let m = moment(startDate); m.isBefore(endDate); m.add(1, "month")) {
availableDates.push({
year: m.year(),
month: m.month(),
});
}
// Verbrauchszeitraum
cy.get("select[name='energieverbrauch_zeitraum_monat']").select(availableDates[0].month.toString());
cy.get("select[name='energieverbrauch_zeitraum_jahr']").select(availableDates[0].year.toString());
cy.get("select[name='energieverbrauch_zeitraum_monat']").select(faker.number.int({ min: 1, max: 12 }).toString());
cy.get("select[name='energieverbrauch_zeitraum_jahr']").select(faker.number.int({ min: 2018, max: 2019 }).toString());
// Verbrauch
cy.get("input[name='verbrauch_1']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
@@ -116,18 +101,18 @@ let availableDates = [];
const zusaetzlicheHeizquelle = Math.random() > 0.5;
if (zusaetzlicheHeizquelle) {
cy.get("[data-cy='zusaetzliche_heizquelle']").check();
cy.get("input[name='zusaetzliche_heizquelle']").check();
// Brennstoff und Einheit 2
const brennstoffKombo2 = fuelList[faker.number.int({ min: 0, max: fuelList.length - 1 })];
cy.get("[data-cy='brennstoff_2']").select(brennstoffKombo2[0], { force: true });
cy.get("[data-cy='einheit_2']").select(brennstoffKombo2[1], { force: true });
cy.get("select[name='brennstoff_2']").select(brennstoffKombo2[0]);
cy.get("select[name='einheit_2']").select(brennstoffKombo2[1]);
// Verbrauch
cy.get("input[name='verbrauch_4']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_5']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_6']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_4']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
cy.get("input[name='verbrauch_5']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
cy.get("input[name='verbrauch_6']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
}
// Gebäudestrom
@@ -184,7 +169,7 @@ let availableDates = [];
// Gebäudetyp
cy.get("select[name='gebaeudetyp']").then(($dropdown) => {
const options = $dropdown.find('option:not([disabled])');
const options = $dropdown.find('option');
// Select the option at the random index
cy.get("select[name='gebaeudetyp']").select(options.eq(faker.number.int({ min: 1, max: options.length - 1 })).val() as string);
});
@@ -225,7 +210,7 @@ let availableDates = [];
if (Math.random() > 0.5) cy.get("input[name='warmwasser_rohre_gedaemmt']").check();
if (Math.random() > 0.5) cy.get("input[name='heizungsrohre_gedaemmt']").check();
if (Math.random() > 0.5) cy.get("input[name='zirkulation']").check();
// if (Math.random() > 0.5) cy.get("input[name='raum_temperatur_regler']").check();
if (Math.random() > 0.5) cy.get("input[name='raum_temperatur_regler']").check();
// Heizungsanlage Bilder
cy.get("input[name='heizung_image']").should("have.attr", "type", "file").attachFile("images/heizungsanlage/1.jpeg", { subjectType: "input" });
@@ -262,14 +247,14 @@ let availableDates = [];
cy.get("input[name='gebaeude_image']").should("have.attr", "type", "file").attachFile("images/gebaeude/1.jpeg", { subjectType: "input" });
// Jetzt können wir den Verbrauchsausweis erstellen.
cy.get("form[name='ausweis'] button[data-cy='weiter']").click({ force: true });
cy.get("form[name='ausweis'] button[type='submit']").click({ force: true });
// Wir sind nicht eingeloggt also sollte jetzt ein Login Screen erscheinen.
// Wir klicken auf registrieren und erstellen einen neuen Benutzer, danach loggen wir uns mit diesem ein.
cy.get("[data-cy='registrieren']").click();
cy.get("button[name='registrieren']").click();
const email = faker.internet.email();
const passwort = "test1234";
const passwort = faker.internet.password();
const vorname = faker.person.firstName();
const nachname = faker.person.lastName();
@@ -287,37 +272,6 @@ let availableDates = [];
cy.get("form[name='login'] button[type='submit']").click();
// Der Ausweis sollte jetzt schon erstellt worden sein und wir sollten auf die kundendaten seite weitergeleitet worden sein.
cy.url().should("contain", "/kundendaten");
cy.wait(1000)
// Wir füllen jetzt die Kundendaten aus.
// cy.get("select[name='anrede']").select(Math.random() > 0.5 ? "Herr" : "Frau");
cy.get("input[name='vorname']").should("contain.value", vorname);
cy.get("input[name='name']").should("contain.value", nachname);
// cy.get("input[name='email']").should("contain.value", email);
// cy.get("input[name='telefon']").type(faker.phone.number());
cy.get("input[name='rechnung_empfaenger']").type(`${vorname} ${nachname}`);
cy.get("input[name='rechnung_strasse']").type(faker.location.streetAddress());
// TODO: Random Plz generieren, allerdings muss die auch in der Datenbank vorhanden sein...
cy.get("input[name='rechnung_plz']").type("2103");
// Jetzt sollte der PLZ Container erscheinen, dort klicken wir einfach das erste Element an.
cy.get("div[data-test='plz-container']").children().first().click();
// cy.get("input[name='rechnung_telefon']").type(faker.phone.number());
cy.get("input[name='rechnung_email']").should("contain.value", email);
cy.get("input[data-cy='paypal']").click();
// Datenschutz und AGB akzeptieren, dann schicken wir das Formular ab.
// cy.get("input[name='agb-akzeptieren']").check()
// cy.get("input[name='datenschutz-akzeptieren']").check()
cy.get("button[data-cy='bestellen']").click();
cy.origin('https://www.mollie.com', () => {
// Jetzt sind wir auf der Mollie Seite, dort wählen wir den "paid" status aus
cy.get("input[type='radio'][name='final_state'][value='paid']").check();
// Da wird unser Test fehlschlagen, da die localhost domain von Mollie aus nicht erreichbar ist.
})
// Der Ausweis sollte jetzt schon erstellt worden sein.
});
});

View File

@@ -1,25 +1,24 @@
import fuelList from "#components/Ausweis/brennstoffListe.js";
import fuelList from "#components/Ausweis/brennstoffListe";
import { faker } from "@faker-js/faker";
import { type Enums } from "@ibcornelsen/database/client";
import { Enums } from "@ibcornelsen/database/client";
import "cypress-file-upload"
import moment from "moment";
describe("Verbrauchsausweis erstellen Schritt 1", () => {
it("erstellt einen neuen Verbrauchsausweis Wohngebäude.", () => {
cy.visit("/energieausweis-erstellen/verbrauchsausweis-wohngebaeude");
cy.visit("/energieausweis-erstellen/verbrauchsausweis-wohnen");
cy.wait(1000);
// Wir überprüfen, ob alle Ausstelgründe vorhanden sind, diese sollten genau so viele sein wie in der Datenbank vorhanden sind.
cy.get("select[data-cy='ausstellgrund']")
.select(
cy.get("input[name='ausstellgrund']")
.should("have.length", Object.values(Enums.Ausstellgrund).length)
.eq(
faker.number.int({
min: 0,
max: (["Modernisierung", "Neubau", "Sonstiges", "Verkauf", "Vermietung"] as Enums.Ausstellgrund[]).length - 1,
max: Object.values(Enums.Ausstellgrund).length - 1,
})
)
.check();
// Jetzt Füllen wir das Baujahr vom Gebäude aus.
cy.get("input[name='baujahr_gebaeude']")
@@ -72,14 +71,14 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
.type(faker.number.int({ min: 50, max: 1000 }).toString());
// Keller
cy.get("select[name='keller']").find("option:not([disabled])").should("have.length", (["BEHEIZT", "NICHT_VORHANDEN", "UNBEHEIZT"] as Enums.Heizungsstatus[]).length).parent().select(faker.number.int({
max: (["BEHEIZT", "NICHT_VORHANDEN", "UNBEHEIZT"] as Enums.Heizungsstatus[]).length,
cy.get("select[name='keller']").find("option:not([disabled])").should("have.length", Object.values(Enums.Heizungsstatus).length).parent().select(faker.number.int({
max: Object.values(Enums.Heizungsstatus).length,
min: 1
}));
// Dachgeschoss
cy.get("select[name='dachgeschoss']").find("option:not([disabled])").should("have.length", (["BEHEIZT", "NICHT_VORHANDEN", "UNBEHEIZT"] as Enums.Heizungsstatus[]).length).parent().select(faker.number.int({
max: (["BEHEIZT", "NICHT_VORHANDEN", "UNBEHEIZT"] as Enums.Heizungsstatus[]).length,
cy.get("select[name='dachgeschoss']").find("option:not([disabled])").should("have.length", Object.values(Enums.Heizungsstatus).length).parent().select(faker.number.int({
max: Object.values(Enums.Heizungsstatus).length,
min: 1
}));
@@ -89,44 +88,31 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
cy.get("select[name='brennstoff_1']").select(brennstoffKombo[0]);
cy.get("select[name='einheit_1']").select(brennstoffKombo[1]);
let availableDates = [];
const startDate = moment()
.subtract(4, "years")
.subtract(6, "months");
const endDate = moment().subtract(3, "years");
for (let m = moment(startDate); m.isBefore(endDate); m.add(1, "month")) {
availableDates.push({
year: m.year(),
month: m.month(),
});
}
// Verbrauchszeitraum
cy.get("select[name='energieverbrauch_zeitraum_monat']").select(availableDates[0].month.toString());
cy.get("select[name='energieverbrauch_zeitraum_jahr']").select(availableDates[0].year.toString());
cy.get("select[name='energieverbrauch_zeitraum_monat']").select(faker.number.int({ min: 1, max: 12 }).toString());
cy.get("select[name='energieverbrauch_zeitraum_jahr']").select(faker.number.int({ min: 2018, max: 2019 }).toString());
// Verbrauch
cy.get("input[name='verbrauch_1']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_2']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_3']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_1']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
cy.get("input[name='verbrauch_2']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
cy.get("input[name='verbrauch_3']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
const zusaetzlicheHeizquelle = Math.random() > 0.5;
if (zusaetzlicheHeizquelle) {
cy.get("[data-cy='zusaetzliche_heizquelle']").check();
cy.get("input[name='zusaetzliche_heizquelle']").check();
// Brennstoff und Einheit 2
const brennstoffKombo2 = fuelList[faker.number.int({ min: 0, max: fuelList.length - 1 })];
cy.get("[data-cy='brennstoff_2']").select(brennstoffKombo2[0], { force: true });
cy.get("[data-cy='einheit_2']").select(brennstoffKombo2[1], { force: true });
cy.get("select[name='brennstoff_2']").select(brennstoffKombo2[0]);
cy.get("select[name='einheit_2']").select(brennstoffKombo2[1]);
// Verbrauch
cy.get("input[name='verbrauch_4']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_5']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_6']").type(faker.number.int({ min: 4000, max: 15000 }).toString(), { force: true });
cy.get("input[name='verbrauch_4']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
cy.get("input[name='verbrauch_5']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
cy.get("input[name='verbrauch_6']").type(faker.number.int({ min: 4000, max: 15000 }).toString());
}
// Warmwasser enthalten und bekannt
@@ -144,7 +130,7 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
if (zusaetzlicheHeizquelle) {
// Zusätzliche Heizquelle existiert, also müssen wir auch hier den Anteil angeben.
cy.get("input[name='anteil_warmwasser_2']").type(faker.number.int({ min: 0, max: 50 }).toString(), {force: true});
cy.get("input[name='anteil_warmwasser_2']").type(faker.number.int({ min: 0, max: 50 }).toString());
}
}
}
@@ -180,25 +166,25 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
cy.get("select[name='kuehlung']").then(($dropdown) => {
const options = $dropdown.find('option');
// Select the option at the random index
cy.get("select[name='kuehlung']").select(options.eq(faker.number.int({ min: 1, max: options.length - 1 })).val() as string, { force: true });
cy.get("select[name='kuehlung']").select(options.eq(faker.number.int({ min: 1, max: options.length - 1 })).val() as string);
});
// Leerstand
cy.get("input[name='leerstand']").should("have.attr", "type", "number").type(faker.number.int({ min: 0, max: 30 }).toString());
// Heizungsanlage Daten
if (Math.random() > 0.5) cy.get("[data-cy='zentralheizung']").check();
if (Math.random() > 0.5) cy.get("[data-cy='einzelofen']").check();
if (Math.random() > 0.5) cy.get("[data-cy='durchlauf_erhitzer']").check();
if (Math.random() > 0.5) cy.get("[data-cy='standard_kessel']").check();
if (Math.random() > 0.5) cy.get("[data-cy='solarsystem_warmwasser']").check();
if (Math.random() > 0.5) cy.get("[data-cy='waermepumpe']").check();
if (Math.random() > 0.5) cy.get("[data-cy='niedertemperatur_kessel']").check();
if (Math.random() > 0.5) cy.get("[data-cy='brennwert_kessel']").check();
if (Math.random() > 0.5) cy.get("[data-cy='warmwasser_rohre_gedaemmt']").check();
if (Math.random() > 0.5) cy.get("[data-cy='heizungsrohre_gedaemmt']").check();
if (Math.random() > 0.5) cy.get("[data-cy='zirkulation']").check();
// if (Math.random() > 0.5) cy.get("[data-cy='raum_temperatur_regler']").check();
if (Math.random() > 0.5) cy.get("input[name='zentralheizung']").check();
if (Math.random() > 0.5) cy.get("input[name='einzelofen']").check();
if (Math.random() > 0.5) cy.get("input[name='durchlauf_erhitzer']").check();
if (Math.random() > 0.5) cy.get("input[name='standard_kessel']").check();
if (Math.random() > 0.5) cy.get("input[name='solarsystem_warmwasser']").check();
if (Math.random() > 0.5) cy.get("input[name='waermepumpe']").check();
if (Math.random() > 0.5) cy.get("input[name='niedertemperatur_kessel']").check();
if (Math.random() > 0.5) cy.get("input[name='brennwert_kessel']").check();
if (Math.random() > 0.5) cy.get("input[name='warmwasser_rohre_gedaemmt']").check();
if (Math.random() > 0.5) cy.get("input[name='heizungsrohre_gedaemmt']").check();
if (Math.random() > 0.5) cy.get("input[name='zirkulation']").check();
if (Math.random() > 0.5) cy.get("input[name='raum_temperatur_regler']").check();
// Heizungsanlage Bilder
cy.get("input[name='heizung_image']").should("have.attr", "type", "file").attachFile("images/heizungsanlage/1.jpeg", { subjectType: "input" });
@@ -235,11 +221,11 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
cy.get("input[name='gebaeude_image']").should("have.attr", "type", "file").attachFile("images/gebaeude/1.jpeg", { subjectType: "input" });
// Jetzt können wir den Verbrauchsausweis erstellen.
cy.get("form[name='ausweis'] button[data-cy='weiter']").click({ force: true });
cy.get("form[name='ausweis'] button[type='submit']").click({ force: true });
// Wir sind nicht eingeloggt also sollte jetzt ein Login Screen erscheinen.
// Wir klicken auf registrieren und erstellen einen neuen Benutzer, danach loggen wir uns mit diesem ein.
cy.get("[data-cy='registrieren']").click();
cy.get("button[name='registrieren']").click();
const email = faker.internet.email();
const passwort = "test1234";
@@ -266,11 +252,11 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
cy.wait(1000)
// Wir füllen jetzt die Kundendaten aus.
// cy.get("select[name='anrede']").select(Math.random() > 0.5 ? "Herr" : "Frau");
cy.get("select[name='anrede']").select(Math.random() > 0.5 ? "Herr" : "Frau");
cy.get("input[name='vorname']").should("contain.value", vorname);
cy.get("input[name='name']").should("contain.value", nachname);
// cy.get("input[name='email']").should("contain.value", email);
// cy.get("input[name='telefon']").type(faker.phone.number());
cy.get("input[name='email']").should("contain.value", email);
cy.get("input[name='telefon']").type(faker.phone.number());
cy.get("input[name='rechnung_empfaenger']").type(`${vorname} ${nachname}`);
cy.get("input[name='rechnung_strasse']").type(faker.location.streetAddress());
@@ -278,14 +264,14 @@ describe("Verbrauchsausweis erstellen Schritt 1", () => {
cy.get("input[name='rechnung_plz']").type("2103");
// Jetzt sollte der PLZ Container erscheinen, dort klicken wir einfach das erste Element an.
cy.get("div[data-test='plz-container']").children().first().click();
// cy.get("input[name='rechnung_telefon']").type(faker.phone.number());
cy.get("input[name='rechnung_email']").should("contain.value", email);
cy.get("input[data-cy='paypal']").click();
cy.get("input[name='rechnung_telefon']").type(faker.phone.number());
cy.get("input[name='rechnung_email']").type(faker.internet.email());
cy.get("button[data-test='paypal']").click();
// Datenschutz und AGB akzeptieren, dann schicken wir das Formular ab.
// cy.get("input[name='agb-akzeptieren']").check()
// cy.get("input[name='datenschutz-akzeptieren']").check()
cy.get("button[data-cy='bestellen']").click();
cy.get("input[name='agb-akzeptieren']").check()
cy.get("input[name='datenschutz-akzeptieren']").check()
cy.get("button[type='submit']").click();
cy.origin('https://www.mollie.com', () => {
// Jetzt sind wir auf der Mollie Seite, dort wählen wir den "paid" status aus

View File

@@ -1,7 +1,7 @@
import { API_ACCESS_TOKEN_COOKIE_NAME, API_REFRESH_TOKEN_COOKIE_NAME } from "#lib/constants.js";
import { API_ACCESS_TOKEN_COOKIE_NAME, API_REFRESH_TOKEN_COOKIE_NAME } from "#lib/constants";
import {faker} from "@faker-js/faker";
describe('Benutzer Registrierung', () => {
describe('Benutzer Authentifizierung', () => {
// Wir generieren uns einen zufälligen Nutzer
const email = faker.internet.email()
const password = faker.internet.password()
@@ -11,8 +11,6 @@ describe('Benutzer Registrierung', () => {
it("erstellt einen Nutzer und leitet auf die Login Seite weiter", () => {
cy.visit("/auth/signup")
cy.wait(1000)
cy.get('input[name="email"]').type(email)
cy.get('input[name="passwort"]').type(password)
cy.get('input[name="vorname"]').type(name)
@@ -26,14 +24,12 @@ describe('Benutzer Registrierung', () => {
it("meldet einen Nutzer an und leitet auf die Startseite weiter", () => {
cy.visit("/auth/login")
cy.wait(1000)
cy.get('input[name="email"]').type(email)
cy.get('input[name="passwort"]').type(password)
cy.get('button[type="submit"]').click()
cy.url().should("include", "/dashboard")
cy.url().should("include", "/user")
// Wir sollten nun einen Access Token und Refresh Token in unseren Cookies sehen.
cy.getCookie(API_ACCESS_TOKEN_COOKIE_NAME).should("exist")

View File

@@ -14,7 +14,7 @@
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands.js'
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')

View File

@@ -13,7 +13,7 @@ services:
- ./:/online-energieausweis
- ./node_modules/@ibcornelsen/ui:/online-energieausweis/node_modules/@ibcornelsen/ui
- ./node_modules/@ibcornelsen/database:/online-energieausweis/node_modules/@ibcornelsen/database
# - ./node_modules/@ibcornelsen/api:/online-energieausweis/node_modules/@ibcornelsen/api
- ./node_modules/@ibcornelsen/api:/online-energieausweis/node_modules/@ibcornelsen/api
- ./node_modules/radix-svelte-icons:/online-energieausweis/node_modules/radix-svelte-icons
- ../api/persistent:/persistent
ibcornelsen-api:

File diff suppressed because it is too large Load Diff

View File

@@ -11,10 +11,9 @@
"test:e2e": "cypress run",
"test:unit": "bun test",
"format": "prettier --write .",
"build:production": "astro build && bun --bun server.ts",
"build:production": "astro build && bun --bun server.js",
"i18n:generate": "bunx astro-i18next generate",
"prisma:studio": "bunx prisma studio --schema=./node_modules/@ibcornelsen/database/prisma/schema.prisma",
"openapi:generate": "bun astro-typesafe-api generate"
"prisma:studio": "bunx prisma studio --schema=./node_modules/@ibcornelsen/database/prisma/schema.prisma"
},
"private": true,
"dependencies": {
@@ -22,73 +21,59 @@
"@astrojs/node": "^8.3.4",
"@astrojs/svelte": "^2.2.0",
"@astrojs/tailwind": "^3.1.3",
"@ibcornelsen/api": "link:@ibcornelsen/api",
"@ibcornelsen/database": "link:@ibcornelsen/database",
"@ibcornelsen/ui": "^0.0.2",
"@mollie/api-client": "^4.1.0",
"@pdfme/common": "^5.2.16",
"@pdfme/generator": "^5.2.16",
"@pdfme/ui": "^5.2.16",
"@mollie/api-client": "^3.7.0",
"@pdfme/common": "^5.1.7",
"@pdfme/generator": "^5.1.7",
"@pdfme/ui": "^5.1.7",
"@trpc/client": "^10.45.2",
"@trpc/server": "^10.45.2",
"astro": "^4.16.17",
"astro-typesafe-api": "^0.2.1",
"astro": "^4.16.10",
"astro-i18next": "1.0.0-beta.21",
"body-scroll-lock": "^4.0.0-beta.0",
"buffer": "^6.0.3",
"bun": "^1.1.45",
"bun": "^1.1.34",
"csvtojson": "^2.0.10",
"express": "^4.21.2",
"express": "^4.21.1",
"flag-icons": "^6.15.0",
"fontkit": "^2.0.4",
"is-base64": "^1.1.0",
"i18next": "^23.16.5",
"i18next-fs-backend": "^2.3.2",
"i18next-http-backend": "^2.6.2",
"js-cookie": "^3.0.5",
"js-interpolate": "^1.3.2",
"jsonwebtoken": "^9.0.2",
"jwt-decode": "^4.0.0",
"js-interpolate": "^1.0.1",
"katex": "^0.16.11",
"moment": "^2.30.1",
"moment-timezone": "^0.5.46",
"nodemailer": "^6.10.0",
"pdf-lib": "^1.17.1",
"postcss-nested": "^7.0.2",
"radix-svelte-icons": "^1.0.0",
"sass": "^1.83.4",
"sass": "^1.80.6",
"svelte": "^3.59.2",
"svelte-dialogs": "^1.2.2",
"svelte-preprocess": "^5.1.4",
"svelte-ripple-action": "^1.0.6",
"tailwindcss": "^3.4.17",
"tailwindcss": "^3.4.14",
"trpc-openapi": "^1.2.0",
"uuid": "^9.0.1",
"zod": "^3.24.1"
"zod": "^3.23.8"
},
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@rollup/plugin-dsv": "^3.0.5",
"@tailwindcss/typography": "^0.5.16",
"@tailwindcss/typography": "^0.5.15",
"@types/body-scroll-lock": "^3.1.2",
"@types/express": "^5.0.0",
"@types/fontkit": "^2.0.7",
"@types/is-base64": "^1.1.3",
"@types/js-cookie": "^3.0.6",
"@types/jsonwebtoken": "^9.0.7",
"@types/nodemailer": "^6.4.17",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"autoprefixer": "^10.4.20",
"bun-types": "^1.1.45",
"cypress": "^13.17.0",
"bun-types": "^1.1.34",
"cypress": "^13.15.2",
"cypress-file-upload": "^5.0.8",
"cypress-vite": "^1.6.0",
"daisyui": "^4.12.23",
"daisyui": "^4.12.14",
"eslint": "~8.15.0",
"eslint-config-prettier": "8.1.0",
"postcss": "^8.5.1",
"postcss-import": "^16.1.0",
"postcss-nesting": "^13.0.1",
"prettier": "^2.8.8",
"typescript": "^4.9.5"
},
"overrides": {
"zod": "^3.24.1"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@@ -1,8 +0,0 @@
module.exports = {
plugins: {
'postcss-import': {},
'tailwindcss/nesting': {},
tailwindcss: {},
autoprefixer: {},
}
}

View File

@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\all\Downloads\antique-olive-std.zip

View File

@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\all\Downloads\font (1).zip

View File

@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\all\Downloads\font (1).zip

View File

@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\all\Downloads\font (1).zip

View File

@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\all\Downloads\font (1).zip

View File

@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\all\Downloads\font (1).zip

View File

@@ -0,0 +1,3 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=C:\Users\all\Downloads\font (1).zip

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 53 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 51 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Ebene_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 143 163.6">
<!-- Generator: Adobe Illustrator 29.1.0, SVG Export Plug-In . SVG Version: 2.1.0 Build 142) -->
<defs>
<style>
.st0 {
display: none;
fill: #878787;
}
.st1 {
fill: #445096;
}
.st2 {
fill: #c6c6c6;
}
</style>
</defs>
<path class="st0" d="M387,57.9c0,3.8-1,6.9-3.1,9.2-2.1,2.3-4.9,3.4-8.5,3.4h-16c-3.8,0-6.8-1.3-8.8-3.9-1.8-2.2-2.7-5-2.7-8.5V21.2c0-3.6,1-6.6,3-8.9,2-2.3,4.8-3.5,8.3-3.5h16.1c3.7,0,6.6,1.2,8.6,3.5s3,5.4,3,9.2l-10.9,2.8c0-3-1.5-4.5-4.6-4.5h-8.5c-2.7,0-4.1,1.3-4.1,3.9v32.1c0,2.5,1.4,3.7,4.1,3.7h9c2.8,0,4.1-1.5,4.1-4.4l10.9,2.7h.1Z"/>
<g>
<path class="st1" d="M17.6,144.6H3.2V63.3h14.4v81.2h0Z"/>
<path class="st1" d="M84.3,128c0,4.8-1.3,8.7-3.8,11.7-2.7,3.1-6.4,4.7-11.1,4.7h-36.5v-14.4h3.6v-52.4h-3.6v-14.4h36.5c4.7,0,8.4,1.6,11.1,4.7,2.5,3,3.8,6.9,3.8,11.7v11c0,6-1.8,10.3-5.4,13,3.6,3,5.4,7.4,5.4,13.2v11.2ZM70,92v-9.3c0-3.2-1.7-4.8-5.1-4.8h-13.9v19h14.1c3.3,0,4.9-1.6,4.9-4.8h0ZM70,125.4v-9.2c0-1.4-.5-2.6-1.4-3.5s-2.1-1.4-3.5-1.4h-14.1v19h13.9c3.4,0,5.1-1.6,5.1-4.8h0Z"/>
<path class="st1" d="M17.6,77.7v-14.4h3.7v14.4h-3.7Z"/>
<path class="st1" d="M-.5,77.7v-14.4h3.7v14.4H-.5Z"/>
<path class="st1" d="M17.6,144.6v-14.4h3.7v14.4h-3.7Z"/>
<path class="st1" d="M-.5,144.6v-14.4h3.7v14.4H-.5Z"/>
<path class="st2" d="M124.5,130.2h-11.8c-3.6,0-5.3-1.6-5.3-4.9v-43.1c0-3.3,1.8-4.9,5.3-4.9h11.8c3.6,0,5.4,1.9,5.4,5.7h13.1c0-7.4,0-12.7-2.7-15.7s-6.4-4.5-11.1-4.5h-21.1c-5.1,0-8.9,1.7-11.6,5.1-2.3,2.9-3.5,6.6-3.5,11.2v49.1c0,4.6,1.2,8.3,3.5,11.2,2.7,3.4,6.5,5.1,11.6,5.1h21.1c4.7,0,8.4-1.5,11.1-4.5,2.7-3,2.7-8.3,2.7-15.7h-13.1c0,3.8-1.8,5.7-5.4,5.7v.2Z"/>
<polygon class="st1" points="90.4 14.4 71.3 .8 52.2 14.4 -.5 52.4 18.7 52.4 71.3 14.4 123.9 52.4 143 52.4 90.4 14.4"/>
<path class="st1" d="M-.3,164.1v-9.3h143.4v9.3H-.3Z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 143.6 163.3">
<defs>
<style>
.cls-1 {
fill: #fff;
}
.cls-2 {
fill: #dae6f7;
}
</style>
</defs>
<path class="cls-1" d="M18.1,143.8H3.7V62.5h14.4v81.2h0v.1Z"/>
<path class="cls-1" d="M84.8,127.2c0,4.8-1.3,8.7-3.8,11.7-2.7,3.1-6.4,4.7-11.1,4.7h-36.5v-14.4h3.6v-52.4h-3.6v-14.4h36.5c4.7,0,8.4,1.6,11.1,4.7,2.5,3,3.8,6.9,3.8,11.7v11c0,6-1.8,10.3-5.4,13,3.6,3,5.4,7.4,5.4,13.2v11.2h0ZM70.5,91.2v-9.3c0-3.2-1.7-4.8-5.1-4.8h-13.9v19h14.1c3.3,0,4.9-1.6,4.9-4.8h0v-.1ZM70.5,124.6v-9.2c0-1.4-.5-2.6-1.4-3.5s-2.1-1.4-3.5-1.4h-14.1v19h13.9c3.4,0,5.1-1.6,5.1-4.8h0v-.1Z"/>
<path class="cls-1" d="M18.1,76.9v-14.4h3.7v14.4h-3.7Z"/>
<path class="cls-1" d="M0,76.9v-14.4h3.7v14.4H0Z"/>
<path class="cls-1" d="M18.1,143.8v-14.4h3.7v14.4h-3.7Z"/>
<path class="cls-1" d="M0,143.8v-14.4h3.7v14.4H0Z"/>
<path class="cls-2" d="M125,129.4h-11.8c-3.6,0-5.3-1.6-5.3-4.9v-43.1c0-3.3,1.8-4.9,5.3-4.9h11.8c3.6,0,5.4,1.9,5.4,5.7h13.1c0-7.4,0-12.7-2.7-15.7s-6.4-4.5-11.1-4.5h-21.1c-5.1,0-8.9,1.7-11.6,5.1-2.3,2.9-3.5,6.6-3.5,11.2v49.1c0,4.6,1.2,8.3,3.5,11.2,2.7,3.4,6.5,5.1,11.6,5.1h21.1c4.7,0,8.4-1.5,11.1-4.5,2.7-3,2.7-8.3,2.7-15.7h-13.1c0,3.8-1.8,5.7-5.4,5.7v.2h0Z"/>
<polygon class="cls-1" points="90.9 13.6 71.8 0 52.7 13.6 0 51.6 19.2 51.6 71.8 13.6 124.4 51.6 143.5 51.6 90.9 13.6"/>
<path class="cls-1" d="M.2,163.3v-9.3h143.4v9.3H.2Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

Some files were not shown because too many files have changed in this diff Show More