diff --git a/.gitignore b/.gitignore index 23888616..9b882e74 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,5 @@ bun.lockb public/fonts/ *.Identifier - -src/lib/Berechnungen/BedarfsausweisWohnen/18599-Tabellenverfahren-Wohngebaeude-komplett-ocr.pdf + +src/lib/Berechnungen/BedarfsausweisWohnen/18599-Tabellenverfahren-Wohngebaeude-komplett-ocr.pdf diff --git a/astro.config.mjs b/astro.config.mjs index 95a93596..868ad9da 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -5,12 +5,13 @@ 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()], + integrations: [svelte(), tailwind(), mdx(), astroTypesafeAPI()], outDir: "./dist", output: "server", vite: { diff --git a/openapi.json b/openapi.json new file mode 100644 index 00000000..037f9db3 --- /dev/null +++ b/openapi.json @@ -0,0 +1 @@ +{"openapi":"3.0.3","info":{"title":"Title","version":"1.0.0","description":""},"paths":{"[id]":{"patch":{"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{}}}}}}},"index":{"post":{"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{}}}}}}}}} \ No newline at end of file diff --git a/package.json b/package.json index 5c3f51eb..2c133863 100644 --- a/package.json +++ b/package.json @@ -25,40 +25,41 @@ "@ibcornelsen/database": "link:@ibcornelsen/database", "@ibcornelsen/ui": "^0.0.2", "@mollie/api-client": "^3.7.0", - "@pdfme/common": "^5.1.7", - "@pdfme/generator": "^5.2.11", - "@pdfme/ui": "^5.1.7", + "@pdfme/common": "^5.2.16", + "@pdfme/generator": "^5.2.16", + "@pdfme/ui": "^5.2.16", "@trpc/client": "^10.45.2", "@trpc/server": "^10.45.2", - "astro": "^4.16.10", + "astro": "^4.16.18", "body-scroll-lock": "^4.0.0-beta.0", "buffer": "^6.0.3", - "bun": "^1.1.34", + "bun": "^1.1.45", "csvtojson": "^2.0.10", - "express": "^4.21.1", + "express": "^4.21.2", "flag-icons": "^6.15.0", "fontkit": "^2.0.4", "js-cookie": "^3.0.5", "js-interpolate": "^1.3.2", + "jsonwebtoken": "^9.0.2", "moment": "^2.30.1", "moment-timezone": "^0.5.46", "pdf-lib": "^1.17.1", "postcss-nested": "^7.0.2", "radix-svelte-icons": "^1.0.0", - "sass": "^1.80.6", + "sass": "^1.83.4", "svelte": "^3.59.2", "svelte-dialogs": "^1.2.2", "svelte-preprocess": "^5.1.4", "svelte-ripple-action": "^1.0.6", - "tailwindcss": "^3.4.14", + "tailwindcss": "^3.4.17", "trpc-openapi": "^1.2.0", "uuid": "^9.0.1", - "zod": "^3.23.8" + "zod": "^3.24.1" }, "devDependencies": { "@faker-js/faker": "^8.4.1", "@rollup/plugin-dsv": "^3.0.5", - "@tailwindcss/typography": "^0.5.15", + "@tailwindcss/typography": "^0.5.16", "@types/body-scroll-lock": "^3.1.2", "@types/express": "^5.0.0", "@types/fontkit": "^2.0.7", @@ -67,13 +68,13 @@ "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "autoprefixer": "^10.4.20", - "bun-types": "^1.1.34", - "cypress": "^13.15.2", + "bun-types": "^1.1.45", + "cypress": "^13.17.0", "cypress-file-upload": "^5.0.8", - "daisyui": "^4.12.14", + "daisyui": "^4.12.23", "eslint": "~8.15.0", "eslint-config-prettier": "8.1.0", - "postcss": "^8.4.49", + "postcss": "^8.5.1", "postcss-import": "^16.1.0", "postcss-nesting": "^13.0.1", "prettier": "^2.8.8", diff --git a/src/astro-typesafe-api-caller.ts b/src/astro-typesafe-api-caller.ts new file mode 100644 index 00000000..fdea9c81 --- /dev/null +++ b/src/astro-typesafe-api-caller.ts @@ -0,0 +1,16 @@ +import { createCallerFactory } from "astro-typesafe-api/server"; +import { type AstroGlobal } from "astro"; + +export const createCaller = createCallerFactory({ + "aufnahme/[id]": await import("../src/pages/api/aufnahme/[id].ts"), + "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), + "auth/access-token": await import("../src/pages/api/auth/access-token.ts"), + "auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"), + "user/self": await import("../src/pages/api/user/self.ts"), + "bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"), + "objekt/[id]": await import("../src/pages/api/objekt/[id].ts"), + "objekt": await import("../src/pages/api/objekt/index.ts"), + "verbrauchsausweis-gewerbe": await import("../src/pages/api/verbrauchsausweis-gewerbe/index.ts"), + "verbrauchsausweis-wohnen/[id]": await import("../src/pages/api/verbrauchsausweis-wohnen/[id].ts"), + "verbrauchsausweis-wohnen": await import("../src/pages/api/verbrauchsausweis-wohnen/index.ts"), +}) \ No newline at end of file diff --git a/src/client/lib/verbrauchsausweisWohnenSpeichern.ts b/src/client/lib/verbrauchsausweisWohnenSpeichern.ts index 607e166a..dcb1177a 100644 --- a/src/client/lib/verbrauchsausweisWohnenSpeichern.ts +++ b/src/client/lib/verbrauchsausweisWohnenSpeichern.ts @@ -22,6 +22,8 @@ export async function verbrauchsausweisWohnenSpeichern( // Anscheinend wurde der Ausweis bereits erstellt und hat eine UID. // Jetzt müssen wir ihn nun nur noch abspeichern. try { + await client.v1.objekt.speichern.mutate() + await client.v1.verbrauchsausweisWohnen[2016].speichern.mutate({ ...ausweis, gebaeude_aufnahme_allgemein: { @@ -41,7 +43,6 @@ export async function verbrauchsausweisWohnenSpeichern( return { uid: ausweis.uid, gebaeude_uid: gebaeude.uid, gebaeude_aufnahme_uid: gebaeude_aufnahme_allgemein.uid }; } catch (e) { - // TODO: Ticket mit Fehldermeldung abschicken. } } else { // Wir speichern den Ausweis ab und leiten auf die "ausweis-gespeichert" Seite weiter. @@ -69,7 +70,6 @@ export async function verbrauchsausweisWohnenSpeichern( ausweis, }), }); - // TODO: Ticket mit Fehldermeldung abschicken. } } diff --git a/src/components/Ausweis/Ausweisart.svelte b/src/components/Ausweis/Ausweisart.svelte index dd8ad7d8..81325337 100644 --- a/src/components/Ausweis/Ausweisart.svelte +++ b/src/components/Ausweis/Ausweisart.svelte @@ -1,8 +1,8 @@