From a8be6db8aa2da0cf0d0727255169d6a8dce2a0ef Mon Sep 17 00:00:00 2001 From: Moritz Utcke Date: Tue, 29 Apr 2025 10:39:11 -0300 Subject: [PATCH] Ausweis erstellen --- bun.lock | 105 ++++++++++++++- package.json | 1 + src/astro-typesafe-api-caller.ts | 18 +-- src/components/Ausweis/types.ts | 4 +- src/lib/db.ts | 2 +- src/lib/filters.ts | 4 +- .../[ausweisart]/index.astro | 18 ++- src/pages/api/admin/registriernummer.ts | 4 +- src/pages/api/admin/stornieren.ts | 4 +- src/pages/api/aufnahme/[id]/bilder.ts | 4 +- src/pages/api/aufnahme/[id]/index.ts | 2 +- src/pages/api/aufnahme/[id]/unterlagen.ts | 4 +- src/pages/api/aufnahme/index.ts | 10 +- src/pages/api/ausweise/index.ts | 2 +- src/pages/api/auth/refresh-token.ts | 4 +- src/pages/api/bedarfsausweis-gewerbe/[id].ts | 14 +- src/pages/api/bedarfsausweis-gewerbe/index.ts | 10 +- src/pages/api/bedarfsausweis-wohnen/[id].ts | 14 +- src/pages/api/bedarfsausweis-wohnen/index.ts | 10 +- src/pages/api/bild.ts | 80 ++++++------ src/pages/api/bilder/[id].ts | 4 +- src/pages/api/geg-nachweis-gewerbe/[id].ts | 14 +- src/pages/api/geg-nachweis-gewerbe/index.ts | 14 +- src/pages/api/geg-nachweis-wohnen/[id].ts | 14 +- src/pages/api/geg-nachweis-wohnen/index.ts | 14 +- src/pages/api/objekt/index.ts | 8 +- src/pages/api/rechnung/[id].ts | 4 +- src/pages/api/rechnung/anfordern.ts | 10 +- src/pages/api/rechnung/index.ts | 10 +- src/pages/api/ticket/index.ts | 8 +- src/pages/api/unterlage.ts | 8 +- src/pages/api/user/index.ts | 10 +- .../api/verbrauchsausweis-gewerbe/[id].ts | 10 +- .../api/verbrauchsausweis-gewerbe/index.ts | 14 +- .../api/verbrauchsausweis-wohnen/[id].ts | 10 +- .../api/verbrauchsausweis-wohnen/index.ts | 120 ++++++++++-------- .../[ausweisart]/index.astro | 8 +- src/testing/ausweise-fix-rechnungsid.ts | 2 +- src/testing/daten-umziehen.ts | 10 +- src/testing/nutzer-fix-alteid.ts | 2 +- src/testing/nutzer-umziehen.ts | 4 +- src/testing/rechnungen-umziehen.ts | 4 +- 42 files changed, 377 insertions(+), 239 deletions(-) diff --git a/bun.lock b/bun.lock index 4025e1f8..e83dca80 100644 --- a/bun.lock +++ b/bun.lock @@ -38,6 +38,7 @@ "nodemailer": "^6.10.0", "pdf-lib": "^1.17.1", "postcss-nested": "^7.0.2", + "puppeteer": "^24.7.2", "radix-svelte-icons": "^1.0.0", "sass": "^1.83.4", "sharp": "^0.33.5", @@ -519,6 +520,8 @@ "@proload/core": ["@proload/core@0.3.3", "", { "dependencies": { "deepmerge": "^4.2.2", "escalade": "^3.1.1" } }, "sha512-7dAFWsIK84C90AMl24+N/ProHKm4iw0akcnoKjRvbfHifJZBLhaDsDus1QJmhG12lXj4e/uB/8mB/0aduCW+NQ=="], + "@puppeteer/browsers": ["@puppeteer/browsers@2.10.2", "", { "dependencies": { "debug": "^4.4.0", "extract-zip": "^2.0.1", "progress": "^2.0.3", "proxy-agent": "^6.5.0", "semver": "^7.7.1", "tar-fs": "^3.0.8", "yargs": "^17.7.2" }, "bin": { "browsers": "lib/cjs/main-cli.js" } }, "sha512-i4Ez+s9oRWQbNjtI/3+jxr7OH508mjAKvza0ekPJem0ZtmsYHP3B5dq62+IaBHKaGCOuqJxXzvFLUhJvQ6jtsQ=="], + "@rc-component/async-validator": ["@rc-component/async-validator@5.0.4", "", { "dependencies": { "@babel/runtime": "^7.24.4" } }, "sha512-qgGdcVIF604M9EqjNF0hbUTz42bz/RDtxWdWuU5EQe3hi7M8ob54B6B35rOsvX5eSvIHIzT9iH1R3n+hk3CGfg=="], "@rc-component/color-picker": ["@rc-component/color-picker@2.0.1", "", { "dependencies": { "@ant-design/fast-color": "^2.0.6", "@babel/runtime": "^7.23.6", "classnames": "^2.2.6", "rc-util": "^5.38.1" }, "peerDependencies": { "react": ">=16.9.0", "react-dom": ">=16.9.0" } }, "sha512-WcZYwAThV/b2GISQ8F+7650r5ZZJ043E57aVBFkQ+kSY4C6wdofXgB0hBx+GPGpIU0Z81eETNoDUJMr7oy/P8Q=="], @@ -713,6 +716,8 @@ "@tailwindcss/typography": ["@tailwindcss/typography@0.5.16", "", { "dependencies": { "lodash.castarray": "^4.4.0", "lodash.isplainobject": "^4.0.6", "lodash.merge": "^4.6.2", "postcss-selector-parser": "6.0.10" }, "peerDependencies": { "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1" } }, "sha512-0wDLwCVF5V3x3b1SGXPCDcdsbDHMBe+lkFzBRaHeLvNi+nrrnZ1lA18u+OTWO8iSWU2GxUOCvlXtDuqftc1oiA=="], + "@tootallnate/quickjs-emscripten": ["@tootallnate/quickjs-emscripten@0.23.0", "", {}, "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA=="], + "@trpc/client": ["@trpc/client@10.45.2", "", { "peerDependencies": { "@trpc/server": "10.45.2" } }, "sha512-ykALM5kYWTLn1zYuUOZ2cPWlVfrXhc18HzBDyRhoPYN0jey4iQHEFSEowfnhg1RvYnrAVjNBgHNeSAXjrDbGwg=="], "@trpc/server": ["@trpc/server@10.45.2", "", {}, "sha512-wOrSThNNE4HUnuhJG6PfDRp4L2009KDVxsd+2VYH8ro6o/7/jwYZ8Uu5j+VaW+mOmc8EHerHzGcdbGNQSAUPgg=="], @@ -909,6 +914,8 @@ "assert-plus": ["assert-plus@1.0.0", "", {}, "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw=="], + "ast-types": ["ast-types@0.13.4", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w=="], + "astral-regex": ["astral-regex@2.0.0", "", {}, "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ=="], "astring": ["astring@1.9.0", "", { "bin": { "astring": "bin/astring" } }, "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg=="], @@ -939,16 +946,30 @@ "axobject-query": ["axobject-query@4.1.0", "", {}, "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ=="], + "b4a": ["b4a@1.6.7", "", {}, "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg=="], + "babel-runtime": ["babel-runtime@6.26.0", "", { "dependencies": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" } }, "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g=="], "bail": ["bail@2.0.2", "", {}, "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw=="], "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + "bare-events": ["bare-events@2.5.4", "", {}, "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA=="], + + "bare-fs": ["bare-fs@4.1.3", "", { "dependencies": { "bare-events": "^2.5.4", "bare-path": "^3.0.0", "bare-stream": "^2.6.4" }, "peerDependencies": { "bare-buffer": "*" }, "optionalPeers": ["bare-buffer"] }, "sha512-OeEZYIg+2qepaWLyphaOXHAHKo3xkM8y3BeGAvHdMN8GNWvEAU1Yw6rYpGzu/wDDbKxgEjVeVDpgGhDzaeMpjg=="], + + "bare-os": ["bare-os@3.6.1", "", {}, "sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g=="], + + "bare-path": ["bare-path@3.0.0", "", { "dependencies": { "bare-os": "^3.0.1" } }, "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw=="], + + "bare-stream": ["bare-stream@2.6.5", "", { "dependencies": { "streamx": "^2.21.0" }, "peerDependencies": { "bare-buffer": "*", "bare-events": "*" }, "optionalPeers": ["bare-buffer", "bare-events"] }, "sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA=="], + "base-64": ["base-64@1.0.0", "", {}, "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg=="], "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], + "basic-ftp": ["basic-ftp@5.0.5", "", {}, "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg=="], + "bcrypt-pbkdf": ["bcrypt-pbkdf@1.0.2", "", { "dependencies": { "tweetnacl": "^0.14.3" } }, "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w=="], "binary-extensions": ["binary-extensions@2.3.0", "", {}, "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw=="], @@ -1031,6 +1052,8 @@ "chownr": ["chownr@2.0.0", "", {}, "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="], + "chromium-bidi": ["chromium-bidi@4.1.1", "", { "dependencies": { "mitt": "^3.0.1", "zod": "^3.24.1" }, "peerDependencies": { "devtools-protocol": "*" } }, "sha512-biR7t4vF3YluE6RlMSk9IWk+b9U+WWyzHp+N2pL9vRTk+UXHYRTVp7jTK58ZNzMLBgoLMHY4QyJMbeuw3eKxqg=="], + "ci-info": ["ci-info@4.1.0", "", {}, "sha512-HutrvTNsF48wnxkzERIXOe5/mlcfFcbfCmwcg6CJnizbSue78AbDt+1cgl26zwn61WFxhcPykPfZrbqjGmBb4A=="], "cjs-module-lexer": ["cjs-module-lexer@1.4.3", "", {}, "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q=="], @@ -1049,6 +1072,8 @@ "cli-truncate": ["cli-truncate@2.1.0", "", { "dependencies": { "slice-ansi": "^3.0.0", "string-width": "^4.2.0" } }, "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg=="], + "cliui": ["cliui@8.0.1", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="], + "clone": ["clone@2.1.2", "", {}, "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w=="], "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="], @@ -1119,6 +1144,8 @@ "core-util-is": ["core-util-is@1.0.2", "", {}, "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ=="], + "cosmiconfig": ["cosmiconfig@9.0.0", "", { "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg=="], + "cpu-features": ["cpu-features@0.0.10", "", { "dependencies": { "buildcheck": "~0.0.6", "nan": "^2.19.0" } }, "sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA=="], "crc-32": ["crc-32@1.2.2", "", { "bin": { "crc32": "bin/crc32.njs" } }, "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="], @@ -1155,6 +1182,8 @@ "dashdash": ["dashdash@1.14.1", "", { "dependencies": { "assert-plus": "^1.0.0" } }, "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g=="], + "data-uri-to-buffer": ["data-uri-to-buffer@6.0.2", "", {}, "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw=="], + "date-fns": ["date-fns@4.1.0", "", {}, "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg=="], "dayjs": ["dayjs@1.11.13", "", {}, "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="], @@ -1175,6 +1204,8 @@ "defu": ["defu@6.1.4", "", {}, "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg=="], + "degenerator": ["degenerator@5.0.1", "", { "dependencies": { "ast-types": "^0.13.4", "escodegen": "^2.1.0", "esprima": "^4.0.1" } }, "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ=="], + "del": ["del@6.1.1", "", { "dependencies": { "globby": "^11.0.1", "graceful-fs": "^4.2.4", "is-glob": "^4.0.1", "is-path-cwd": "^2.2.0", "is-path-inside": "^3.0.2", "p-map": "^4.0.0", "rimraf": "^3.0.2", "slash": "^3.0.0" } }, "sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg=="], "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="], @@ -1203,6 +1234,8 @@ "devlop": ["devlop@1.1.0", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="], + "devtools-protocol": ["devtools-protocol@0.0.1425554", "", {}, "sha512-uRfxR6Nlzdzt0ihVIkV+sLztKgs7rgquY/Mhcv1YNCWDh5IZgl5mnn2aeEnW5stYTE0wwiF4RYVz8eMEpV1SEw=="], + "dezalgo": ["dezalgo@1.0.4", "", { "dependencies": { "asap": "^2.0.0", "wrappy": "1" } }, "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig=="], "dfa": ["dfa@1.2.0", "", {}, "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q=="], @@ -1277,6 +1310,8 @@ "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], + "escodegen": ["escodegen@2.1.0", "", { "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", "esutils": "^2.0.2" }, "optionalDependencies": { "source-map": "~0.6.1" }, "bin": { "esgenerate": "bin/esgenerate.js", "escodegen": "bin/escodegen.js" } }, "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w=="], + "eslint": ["eslint@8.15.0", "", { "dependencies": { "@eslint/eslintrc": "^1.2.3", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", "globals": "^13.6.0", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "bin": { "eslint": "bin/eslint.js" } }, "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA=="], "eslint-config-prettier": ["eslint-config-prettier@8.1.0", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "bin/cli.js" } }, "sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw=="], @@ -1337,6 +1372,8 @@ "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], + "fast-fifo": ["fast-fifo@1.3.2", "", {}, "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ=="], + "fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="], "fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="], @@ -1421,6 +1458,8 @@ "gesto": ["gesto@1.19.4", "", { "dependencies": { "@daybrush/utils": "^1.13.0", "@scena/event-emitter": "^1.0.2" } }, "sha512-hfr/0dWwh0Bnbb88s3QVJd1ZRJeOWcgHPPwmiH6NnafDYvhTsxg+SLYu+q/oPNh9JS3V+nlr6fNs8kvPAtcRDQ=="], + "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="], + "get-east-asian-width": ["get-east-asian-width@1.3.0", "", {}, "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ=="], "get-intrinsic": ["get-intrinsic@1.2.7", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", "get-proto": "^1.0.0", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA=="], @@ -1433,6 +1472,8 @@ "get-tsconfig": ["get-tsconfig@4.10.0", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A=="], + "get-uri": ["get-uri@6.0.4", "", { "dependencies": { "basic-ftp": "^5.0.2", "data-uri-to-buffer": "^6.0.2", "debug": "^4.3.4" } }, "sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ=="], + "getopts": ["getopts@2.3.0", "", {}, "sha512-5eDf9fuSXwxBL6q5HX+dhDj+dslFGWzU5thZ9kNKUkcPtaPdatmUFKwHFrLb/uf/WpA4BHET+AX3Scl56cAjpA=="], "getos": ["getos@3.2.1", "", { "dependencies": { "async": "^3.2.0" } }, "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q=="], @@ -1555,6 +1596,8 @@ "intersection-observer": ["intersection-observer@0.12.2", "", {}, "sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg=="], + "ip-address": ["ip-address@9.0.5", "", { "dependencies": { "jsbn": "1.1.0", "sprintf-js": "^1.1.3" } }, "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g=="], + "ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="], "iron-webcrypto": ["iron-webcrypto@1.2.1", "", {}, "sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg=="], @@ -1563,7 +1606,7 @@ "is-alphanumerical": ["is-alphanumerical@2.0.1", "", { "dependencies": { "is-alphabetical": "^2.0.0", "is-decimal": "^2.0.0" } }, "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw=="], - "is-arrayish": ["is-arrayish@0.3.2", "", {}, "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="], + "is-arrayish": ["is-arrayish@0.2.1", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="], "is-base64": ["is-base64@1.1.0", "", { "bin": { "is-base64": "bin/is-base64", "is_base64": "bin/is-base64" } }, "sha512-Nlhg7Z2dVC4/PTvIFkgVVNvPHSO2eR/Yd0XzhGiXCXEvWnptXlXa/clQ8aePPiMuxEGcWfzWbGw2Fe3d+Y3v1g=="], @@ -1891,6 +1934,8 @@ "minizlib": ["minizlib@2.1.2", "", { "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" } }, "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg=="], + "mitt": ["mitt@3.0.1", "", {}, "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="], + "mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="], "module-details-from-path": ["module-details-from-path@1.0.3", "", {}, "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A=="], @@ -1917,6 +1962,8 @@ "neotraverse": ["neotraverse@0.6.18", "", {}, "sha512-Z4SmBUweYa09+o6pG+eASabEpP6QkQ70yHj351pQoEXIs8uHbaU2DWVmzBANKgflPa47A50PtB2+NgRpQvr7vA=="], + "netmask": ["netmask@2.0.2", "", {}, "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg=="], + "new-github-issue-url": ["new-github-issue-url@0.2.1", "", {}, "sha512-md4cGoxuT4T4d/HDOXbrUHkTKrp/vp+m3aOA7XXVYwNsUNMK49g3SQicTSeV5GIz/5QVGAeYRAOlyp9OvlgsYA=="], "nlcst-to-string": ["nlcst-to-string@4.0.0", "", { "dependencies": { "@types/nlcst": "^2.0.0" } }, "sha512-YKLBCcUYKAg0FNlOBT6aI91qFmSiFKiluk655WzPF+DDMA02qIyy8uiRqI8QXtcFpEvll12LpL5MXqEmAZ+dcA=="], @@ -1999,6 +2046,10 @@ "p-try": ["p-try@2.2.0", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="], + "pac-proxy-agent": ["pac-proxy-agent@7.2.0", "", { "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.6", "pac-resolver": "^7.0.1", "socks-proxy-agent": "^8.0.5" } }, "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA=="], + + "pac-resolver": ["pac-resolver@7.0.1", "", { "dependencies": { "degenerator": "^5.0.0", "netmask": "^2.0.2" } }, "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg=="], + "package-json-from-dist": ["package-json-from-dist@1.0.1", "", {}, "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw=="], "pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="], @@ -2109,12 +2160,18 @@ "proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="], + "proxy-agent": ["proxy-agent@6.5.0", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "^4.3.4", "http-proxy-agent": "^7.0.1", "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", "socks-proxy-agent": "^8.0.5" } }, "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A=="], + "proxy-from-env": ["proxy-from-env@1.0.0", "", {}, "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A=="], "pump": ["pump@3.0.2", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw=="], "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], + "puppeteer": ["puppeteer@24.7.2", "", { "dependencies": { "@puppeteer/browsers": "2.10.2", "chromium-bidi": "4.1.1", "cosmiconfig": "^9.0.0", "devtools-protocol": "0.0.1425554", "puppeteer-core": "24.7.2", "typed-query-selector": "^2.12.0" }, "bin": { "puppeteer": "lib/cjs/puppeteer/node/cli.js" } }, "sha512-ifYqoY6wGs0yZeFuFPn8BE9FhuveXkarF+eO18I2e/axdoCh4Qh1AE+qXdJBhdaeoPt6eRNTY4Dih29Jbq8wow=="], + + "puppeteer-core": ["puppeteer-core@24.7.2", "", { "dependencies": { "@puppeteer/browsers": "2.10.2", "chromium-bidi": "4.1.1", "debug": "^4.4.0", "devtools-protocol": "0.0.1425554", "typed-query-selector": "^2.12.0", "ws": "^8.18.1" } }, "sha512-P9pZyTmJqKODFCnkZgemCpoFA4LbAa8+NumHVQKyP5X9IgdNS1ZnAnIh1sMAwhF8/xEUGf7jt+qmNLlKieFw1Q=="], + "qs": ["qs@6.13.0", "", { "dependencies": { "side-channel": "^1.0.6" } }, "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg=="], "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], @@ -2279,6 +2336,8 @@ "request-progress": ["request-progress@3.0.0", "", { "dependencies": { "throttleit": "^1.0.0" } }, "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg=="], + "require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="], + "require-in-the-middle": ["require-in-the-middle@7.5.2", "", { "dependencies": { "debug": "^4.3.5", "module-details-from-path": "^1.0.3", "resolve": "^1.22.8" } }, "sha512-gAZ+kLqBdHarXB64XpAe2VCjB7rIRv+mU8tfRWziHRJ5umKsIHN2tLLv6EtMw7WCdP19S0ERVMldNvxYCHnhSQ=="], "resize-observer-polyfill": ["resize-observer-polyfill@1.5.1", "", {}, "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="], @@ -2387,8 +2446,14 @@ "slice-ansi": ["slice-ansi@3.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" } }, "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ=="], + "smart-buffer": ["smart-buffer@4.2.0", "", {}, "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg=="], + "soap": ["soap@1.1.8", "", { "dependencies": { "axios": "^1.7.9", "axios-ntlm": "^1.4.2", "debug": "^4.4.0", "formidable": "^3.5.2", "get-stream": "^6.0.1", "lodash": "^4.17.21", "sax": "^1.4.1", "strip-bom": "^3.0.0", "whatwg-mimetype": "4.0.0", "xml-crypto": "^6.0.0" } }, "sha512-fDNGyGsPkQP3bZX/366Ud5Kpjo9mCMh7ZKYIc3uipBEPPM2ZqCNkv1Z2/w0qpzpYFLL7do8WWwVUAjAwuUe1AQ=="], + "socks": ["socks@2.8.4", "", { "dependencies": { "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" } }, "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ=="], + + "socks-proxy-agent": ["socks-proxy-agent@8.0.5", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "^4.3.4", "socks": "^2.8.3" } }, "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw=="], + "sorcery": ["sorcery@0.11.1", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.14", "buffer-crc32": "^1.0.0", "minimist": "^1.2.0", "sander": "^0.5.0" }, "bin": { "sorcery": "bin/sorcery" } }, "sha512-o7npfeJE6wi6J9l0/5LKshFzZ2rMatRiCDwYeDQaOzqdzRJwALhX7mk/A/ecg6wjMu7wdZbmXfD2S/vpOg0bdQ=="], "source-map": ["source-map@0.7.4", "", {}, "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA=="], @@ -2419,6 +2484,8 @@ "stdin-discarder": ["stdin-discarder@0.2.2", "", {}, "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ=="], + "streamx": ["streamx@2.22.0", "", { "dependencies": { "fast-fifo": "^1.3.2", "text-decoder": "^1.1.0" }, "optionalDependencies": { "bare-events": "^2.2.0" } }, "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw=="], + "string-convert": ["string-convert@0.2.1", "", {}, "sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A=="], "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], @@ -2473,6 +2540,8 @@ "tar": ["tar@6.2.1", "", { "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" } }, "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A=="], + "tar-fs": ["tar-fs@3.0.8", "", { "dependencies": { "pump": "^3.0.0", "tar-stream": "^3.1.5" }, "optionalDependencies": { "bare-fs": "^4.0.1", "bare-path": "^3.0.0" } }, "sha512-ZoROL70jptorGAlgAYiLoBLItEKw/fUxg9BSYK/dF/GAGYFJOJJJMvjPAKDJraCXFwadD456FCuvLWgfhMsPwg=="], + "tar-stream": ["tar-stream@2.2.0", "", { "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="], "tarn": ["tarn@3.0.2", "", {}, "sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ=="], @@ -2485,6 +2554,8 @@ "terminal-link": ["terminal-link@2.1.1", "", { "dependencies": { "ansi-escapes": "^4.2.1", "supports-hyperlinks": "^2.0.0" } }, "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ=="], + "text-decoder": ["text-decoder@1.2.3", "", { "dependencies": { "b4a": "^1.6.4" } }, "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA=="], + "text-table": ["text-table@0.2.0", "", {}, "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="], "thenify": ["thenify@3.3.1", "", { "dependencies": { "any-promise": "^1.0.0" } }, "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw=="], @@ -2557,6 +2628,8 @@ "type-is": ["type-is@1.6.18", "", { "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" } }, "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="], + "typed-query-selector": ["typed-query-selector@2.12.0", "", {}, "sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg=="], + "typedarray": ["typedarray@0.0.6", "", {}, "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="], "typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="], @@ -2663,16 +2736,22 @@ "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], + "ws": ["ws@8.18.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w=="], + "xml-crypto": ["xml-crypto@6.0.0", "", { "dependencies": { "@xmldom/is-dom-node": "^1.0.1", "@xmldom/xmldom": "^0.8.10", "xpath": "^0.0.33" } }, "sha512-L3RgnkaDrHaYcCnoENv4Idzt1ZRj5U1z1BDH98QdDTQfssScx8adgxhd9qwyYo+E3fXbQZjEQH7aiXHLVgxGvw=="], "xpath": ["xpath@0.0.33", "", {}, "sha512-NNXnzrkDrAzalLhIUc01jO2mOzXGXh1JwPgkihcLLzw98c0WgYDmmjSh1Kl3wzaxSVWMuA+fe0WTWOBDWCBmNA=="], "xxhash-wasm": ["xxhash-wasm@1.1.0", "", {}, "sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA=="], + "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], + "yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], "yaml": ["yaml@2.7.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA=="], + "yargs": ["yargs@17.7.2", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="], + "yargs-parser": ["yargs-parser@21.1.1", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="], "yauzl": ["yauzl@2.10.0", "", { "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } }, "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g=="], @@ -2757,6 +2836,8 @@ "@prisma/schema-files-loader/fs-extra": ["fs-extra@11.1.1", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ=="], + "@puppeteer/browsers/semver": ["semver@7.7.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA=="], + "@rollup/pluginutils/estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="], "@sveltejs/vite-plugin-svelte/vitefu": ["vitefu@0.2.5", "", { "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, "optionalPeers": ["vite"] }, "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q=="], @@ -2815,7 +2896,7 @@ "dir-glob/path-type": ["path-type@4.0.0", "", {}, "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="], - "error-ex/is-arrayish": ["is-arrayish@0.2.1", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="], + "escodegen/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], "eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@2.1.0", "", {}, "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw=="], @@ -2853,6 +2934,10 @@ "ignore-walk/minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="], + "ip-address/jsbn": ["jsbn@1.1.0", "", {}, "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="], + + "ip-address/sprintf-js": ["sprintf-js@1.1.3", "", {}, "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA=="], + "is-wsl/is-docker": ["is-docker@2.2.1", "", { "bin": { "is-docker": "cli.js" } }, "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="], "knex/commander": ["commander@10.0.1", "", {}, "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug=="], @@ -2911,6 +2996,10 @@ "p-locate/p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], + "pac-proxy-agent/http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="], + + "pac-proxy-agent/https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], + "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], "path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], @@ -2931,6 +3020,14 @@ "prop-types/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="], + "proxy-agent/http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="], + + "proxy-agent/https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], + + "proxy-agent/lru-cache": ["lru-cache@7.18.3", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="], + + "proxy-agent/proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="], + "rc-align/rc-util": ["rc-util@4.21.1", "", { "dependencies": { "add-dom-event-listener": "^1.1.0", "prop-types": "^15.5.10", "react-is": "^16.12.0", "react-lifecycles-compat": "^3.0.4", "shallowequal": "^1.1.0" } }, "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg=="], "rc-animate/rc-util": ["rc-util@4.21.1", "", { "dependencies": { "add-dom-event-listener": "^1.1.0", "prop-types": "^15.5.10", "react-is": "^16.12.0", "react-lifecycles-compat": "^3.0.4", "shallowequal": "^1.1.0" } }, "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg=="], @@ -2963,6 +3060,8 @@ "serve-static/send": ["send@0.19.0", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", "http-errors": "2.0.0", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "2.4.1", "range-parser": "~1.2.1", "statuses": "2.0.1" } }, "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw=="], + "simple-swizzle/is-arrayish": ["is-arrayish@0.3.2", "", {}, "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="], + "soap/strip-bom": ["strip-bom@3.0.0", "", {}, "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="], "sorcery/buffer-crc32": ["buffer-crc32@1.0.0", "", {}, "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w=="], @@ -2981,6 +3080,8 @@ "tar/yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], + "tar-fs/tar-stream": ["tar-stream@3.1.7", "", { "dependencies": { "b4a": "^1.6.4", "fast-fifo": "^1.2.0", "streamx": "^2.15.0" } }, "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ=="], + "temp-write/temp-dir": ["temp-dir@1.0.0", "", {}, "sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ=="], "temp-write/uuid": ["uuid@3.4.0", "", { "bin": { "uuid": "./bin/uuid" } }, "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="], diff --git a/package.json b/package.json index 2cb61050..4a984edb 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "nodemailer": "^6.10.0", "pdf-lib": "^1.17.1", "postcss-nested": "^7.0.2", + "puppeteer": "^24.7.2", "radix-svelte-icons": "^1.0.0", "sass": "^1.83.4", "sharp": "^0.33.5", diff --git a/src/astro-typesafe-api-caller.ts b/src/astro-typesafe-api-caller.ts index a440b7ab..18c14e4b 100644 --- a/src/astro-typesafe-api-caller.ts +++ b/src/astro-typesafe-api-caller.ts @@ -5,6 +5,7 @@ export const createCaller = createCallerFactory({ "klimafaktoren": await import("../src/pages/api/klimafaktoren.ts"), "postleitzahlen": await import("../src/pages/api/postleitzahlen.ts"), "unterlage": await import("../src/pages/api/unterlage.ts"), + "ausweise": await import("../src/pages/api/ausweise/index.ts"), "admin/ausstellen": await import("../src/pages/api/admin/ausstellen.ts"), "admin/bedarfsausweis-ausstellen": await import("../src/pages/api/admin/bedarfsausweis-ausstellen.ts"), "admin/bestellbestaetigung": await import("../src/pages/api/admin/bestellbestaetigung.ts"), @@ -12,31 +13,30 @@ export const createCaller = createCallerFactory({ "admin/nicht-ausstellen": await import("../src/pages/api/admin/nicht-ausstellen.ts"), "admin/registriernummer": await import("../src/pages/api/admin/registriernummer.ts"), "admin/stornieren": await import("../src/pages/api/admin/stornieren.ts"), - "ausweise": await import("../src/pages/api/ausweise/index.ts"), "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), - "auth/access-token": await import("../src/pages/api/auth/access-token.ts"), - "auth/passwort-vergessen": await import("../src/pages/api/auth/passwort-vergessen.ts"), - "auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"), "bedarfsausweis-gewerbe/[id]": await import("../src/pages/api/bedarfsausweis-gewerbe/[id].ts"), "bedarfsausweis-gewerbe": await import("../src/pages/api/bedarfsausweis-gewerbe/index.ts"), "bedarfsausweis-wohnen/[id]": await import("../src/pages/api/bedarfsausweis-wohnen/[id].ts"), "bedarfsausweis-wohnen": await import("../src/pages/api/bedarfsausweis-wohnen/index.ts"), - "bilder/[id]": await import("../src/pages/api/bilder/[id].ts"), + "auth/access-token": await import("../src/pages/api/auth/access-token.ts"), + "auth/passwort-vergessen": await import("../src/pages/api/auth/passwort-vergessen.ts"), + "auth/refresh-token": await import("../src/pages/api/auth/refresh-token.ts"), "geg-nachweis-gewerbe/[id]": await import("../src/pages/api/geg-nachweis-gewerbe/[id].ts"), "geg-nachweis-gewerbe": await import("../src/pages/api/geg-nachweis-gewerbe/index.ts"), + "bilder/[id]": await import("../src/pages/api/bilder/[id].ts"), "geg-nachweis-wohnen/[id]": await import("../src/pages/api/geg-nachweis-wohnen/[id].ts"), "geg-nachweis-wohnen": await import("../src/pages/api/geg-nachweis-wohnen/index.ts"), - "objekt": await import("../src/pages/api/objekt/index.ts"), "rechnung/[id]": await import("../src/pages/api/rechnung/[id].ts"), "rechnung/anfordern": await import("../src/pages/api/rechnung/anfordern.ts"), "rechnung": await import("../src/pages/api/rechnung/index.ts"), - "ticket": await import("../src/pages/api/ticket/index.ts"), - "user": await import("../src/pages/api/user/index.ts"), - "user/self": await import("../src/pages/api/user/self.ts"), + "objekt": await import("../src/pages/api/objekt/index.ts"), "verbrauchsausweis-gewerbe/[id]": await import("../src/pages/api/verbrauchsausweis-gewerbe/[id].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"), + "ticket": await import("../src/pages/api/ticket/index.ts"), + "user": await import("../src/pages/api/user/index.ts"), + "user/self": await import("../src/pages/api/user/self.ts"), "webhooks/mollie": await import("../src/pages/api/webhooks/mollie.ts"), "aufnahme/[id]/bilder": await import("../src/pages/api/aufnahme/[id]/bilder.ts"), "aufnahme/[id]": await import("../src/pages/api/aufnahme/[id]/index.ts"), diff --git a/src/components/Ausweis/types.ts b/src/components/Ausweis/types.ts index 701c6ccb..fc71991c 100644 --- a/src/components/Ausweis/types.ts +++ b/src/components/Ausweis/types.ts @@ -100,7 +100,7 @@ export type OptionalNullable = T extends object ? { [K in keyof PickNotNullable]: OptionalNullable } : T; -export const UUidWithPrefix = z.string().refine((value) => { +export const IDWithPrefix = z.string().refine((value) => { const prefixedUUidRegex = /^([A-Z]{2})[0-9A-Z]{6,9}$/i const match = value.match(prefixedUUidRegex) @@ -113,7 +113,7 @@ export const UUidWithPrefix = z.string().refine((value) => { }) export function getAusweisartFromId(id: string): Enums.Ausweisart | null { - if (!UUidWithPrefix.safeParse(id).success) { + if (!IDWithPrefix.safeParse(id).success) { return null } diff --git a/src/lib/db.ts b/src/lib/db.ts index c4be0766..32983bfd 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -6,7 +6,7 @@ import * as crypto from "crypto"; * @param prefix Ein Optionales Präfix, welches vor die ID geschrieben wird, damit diese identifizierbar bleibt. * @returns Die generierte ID */ -export function generatePrefixedId(length: number, prefix: string = ""): string { +export function generateIDWithPrefix(length: number, prefix: string = ""): string { // Generating entropy is faster than complex math operations, so we use the simplest way const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789" const characterCount = characters.length; diff --git a/src/lib/filters.ts b/src/lib/filters.ts index aee8ef36..b915593d 100644 --- a/src/lib/filters.ts +++ b/src/lib/filters.ts @@ -1,9 +1,9 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { Enums } from "#lib/client/prisma"; import { z } from "zod"; export const filterAusweise = z.object({ - uid: UUidWithPrefix.optional(), + uid: IDWithPrefix.optional(), ausgestellt: z.boolean().optional(), ausstellgrund: z.nativeEnum(Enums.Ausstellgrund).optional(), bestellt: z.boolean().optional(), diff --git a/src/pages/[partner]/energieausweis-erstellen/[ausweisart]/index.astro b/src/pages/[partner]/energieausweis-erstellen/[ausweisart]/index.astro index 25a25f39..533f7731 100644 --- a/src/pages/[partner]/energieausweis-erstellen/[ausweisart]/index.astro +++ b/src/pages/[partner]/energieausweis-erstellen/[ausweisart]/index.astro @@ -97,6 +97,20 @@ if (typ === AusstellungsTyp.Neuausstellung) { ausweis.id = null; aufnahme.id = null; + delete aufnahme.erstellungsdatum; + ausweis.created_at = new Date() + ausweis.updated_at = new Date(); + ausweis.alte_ausweis_id = null; + ausweis.ausgestellt = false; + ausweis.bestellt = false; + ausweis.kontrolldatei_angefragt = false; + ausweis.energieeffizienzklasse = null; + ausweis.ausstellungsdatum = null; + ausweis.ausweistyp = Enums.AusweisTyp.Standard; + ausweis.zurueckgestellt = false; + ausweis.storniert = false; + ausweis.rechnung_id = null; + ausweis.registriernummer = null; // Die Daten sollen nicht aus dem localStorage genommen werden sonst kann es vorkommen, dass die ID noch besteht und der Vorgang nicht neu angelegt wird. loadFromDatabase = true; } else if (typ === AusstellungsTyp.Speichern) { @@ -176,7 +190,7 @@ if (typ === AusstellungsTyp.Neuausstellung) { } ausweis.id = null; - aufnahme.erstellungsdatum = null + delete aufnahme.erstellungsdatum; ausweis.created_at = new Date() ausweis.updated_at = new Date(); ausweis.alte_ausweis_id = null; @@ -188,6 +202,8 @@ if (typ === AusstellungsTyp.Neuausstellung) { ausweis.ausweistyp = Enums.AusweisTyp.Standard; ausweis.zurueckgestellt = false; ausweis.storniert = false; + ausweis.rechnung_id = null; + ausweis.registriernummer = null; // Die Daten sollen nicht aus dem localStorage genommen werden sonst kann es vorkommen, dass die ID noch besteht und der Vorgang nicht neu angelegt wird. loadFromDatabase = true; } diff --git a/src/pages/api/admin/registriernummer.ts b/src/pages/api/admin/registriernummer.ts index bf3f3ddc..20bbc581 100644 --- a/src/pages/api/admin/registriernummer.ts +++ b/src/pages/api/admin/registriernummer.ts @@ -1,6 +1,6 @@ import { getAusweisartFromId, - UUidWithPrefix, + IDWithPrefix, } from "#components/Ausweis/types.js"; import { adminMiddleware, @@ -18,7 +18,7 @@ import { getPrismaAusweisAdapter } from "#lib/server/ausweis.js"; export const GET = defineApiRoute({ input: z.object({ - id: UUidWithPrefix, + id: IDWithPrefix, }), headers: authorizationHeaders, middleware: adminMiddleware, diff --git a/src/pages/api/admin/stornieren.ts b/src/pages/api/admin/stornieren.ts index 2eb551fd..b9ab2cbb 100644 --- a/src/pages/api/admin/stornieren.ts +++ b/src/pages/api/admin/stornieren.ts @@ -1,4 +1,4 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { transport } from "#lib/mail.js"; import { adminMiddleware } from "#lib/middleware/authorization.js"; import { mollieClient } from "#lib/mollie.js"; @@ -10,7 +10,7 @@ import { z } from "zod"; export const PUT = defineApiRoute({ input: z.object({ - ausweis_id: UUidWithPrefix + ausweis_id: IDWithPrefix }), middleware: adminMiddleware, async fetch(input, context, transfer) { diff --git a/src/pages/api/aufnahme/[id]/bilder.ts b/src/pages/api/aufnahme/[id]/bilder.ts index 47b6f10a..8cf0d3fa 100644 --- a/src/pages/api/aufnahme/[id]/bilder.ts +++ b/src/pages/api/aufnahme/[id]/bilder.ts @@ -2,11 +2,11 @@ import { authorizationMiddleware } from "#lib/middleware/authorization.js"; import { Enums, prisma } from "#lib/server/prisma.js"; import { APIError, defineApiRoute } from "astro-typesafe-api/server"; import { z } from "zod"; -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { BildSchema } from "src/generated/zod/bild.js"; export const PUT = defineApiRoute({ - input: z.array(UUidWithPrefix), + input: z.array(IDWithPrefix), output: z.void(), middleware: authorizationMiddleware, async fetch(input, ctx, user) { diff --git a/src/pages/api/aufnahme/[id]/index.ts b/src/pages/api/aufnahme/[id]/index.ts index 49f72673..3f330279 100644 --- a/src/pages/api/aufnahme/[id]/index.ts +++ b/src/pages/api/aufnahme/[id]/index.ts @@ -1,4 +1,4 @@ -import { AufnahmeClient, OptionalNullable, UUidWithPrefix, ZodOverlap } from "#components/Ausweis/types.js"; +import { AufnahmeClient, OptionalNullable, IDWithPrefix, ZodOverlap } from "#components/Ausweis/types.js"; import { exclude } from "#lib/exclude.js"; import { authorizationMiddleware } from "#lib/middleware/authorization.js"; import { Enums, prisma } from "#lib/server/prisma.js"; diff --git a/src/pages/api/aufnahme/[id]/unterlagen.ts b/src/pages/api/aufnahme/[id]/unterlagen.ts index b1ec91da..7b5eae4f 100644 --- a/src/pages/api/aufnahme/[id]/unterlagen.ts +++ b/src/pages/api/aufnahme/[id]/unterlagen.ts @@ -2,11 +2,11 @@ import { authorizationMiddleware } from "#lib/middleware/authorization.js"; import { prisma } from "#lib/server/prisma.js"; import { APIError, defineApiRoute } from "astro-typesafe-api/server"; import { z } from "zod"; -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { UnterlageSchema } from "src/generated/zod/unterlage.js"; export const PUT = defineApiRoute({ - input: z.array(UUidWithPrefix), + input: z.array(IDWithPrefix), output: z.void(), middleware: authorizationMiddleware, async fetch(input, ctx, user) { diff --git a/src/pages/api/aufnahme/index.ts b/src/pages/api/aufnahme/index.ts index 9a836b2d..6f15b4fd 100644 --- a/src/pages/api/aufnahme/index.ts +++ b/src/pages/api/aufnahme/index.ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js" +import { IDWithPrefix } from "#components/Ausweis/types.js" import { VALID_UUID_PREFIXES } from "#lib/constants.js" -import { generatePrefixedId } from "#lib/db.js" +import { generateIDWithPrefix } from "#lib/db.js" import { authorizationMiddleware } from "#lib/middleware/authorization.js" import { prisma } from "#lib/server/prisma.js" import { APIError, defineApiRoute } from "astro-typesafe-api/server" @@ -16,10 +16,10 @@ export const PUT = defineApiRoute({ }).merge(z.object({ baujahr_klima: z.array(z.number().int().positive()).optional() })), - objekt_id: UUidWithPrefix + objekt_id: IDWithPrefix }), output: z.object({ - id: UUidWithPrefix + id: IDWithPrefix }), middleware: authorizationMiddleware, async fetch(input, context, user) { @@ -39,7 +39,7 @@ export const PUT = defineApiRoute({ }) } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.Aufnahme) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Aufnahme) const aufnahme = await prisma.aufnahme.create({ data: { diff --git a/src/pages/api/ausweise/index.ts b/src/pages/api/ausweise/index.ts index a03fbad3..353976c4 100644 --- a/src/pages/api/ausweise/index.ts +++ b/src/pages/api/ausweise/index.ts @@ -1,4 +1,4 @@ -import { AufnahmeClient, ObjektClient, BildClient, UUidWithPrefix, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js"; +import { AufnahmeClient, ObjektClient, BildClient, IDWithPrefix, VerbrauchsausweisWohnenClient } from "#components/Ausweis/types.js"; import { filterAusweise } from "#lib/filters.js"; import { omit } from "#lib/helpers.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; diff --git a/src/pages/api/auth/refresh-token.ts b/src/pages/api/auth/refresh-token.ts index 7d041cc4..3ed57135 100644 --- a/src/pages/api/auth/refresh-token.ts +++ b/src/pages/api/auth/refresh-token.ts @@ -5,7 +5,7 @@ import { encodeToken } from "../../../lib/auth/token.js"; import { validatePassword } from "../../../lib/password.js"; import { APIError, defineApiRoute } from "astro-typesafe-api/server"; import { TokenType } from "#lib/auth/types.js"; -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; export const GET = defineApiRoute({ @@ -20,7 +20,7 @@ export const GET = defineApiRoute({ passwort: z.string().min(8).max(100), }), output: z.object({ - id: UUidWithPrefix, + id: IDWithPrefix, accessToken: z.string(), refreshToken: z.string(), refreshTokenBase64: z.string(), diff --git a/src/pages/api/bedarfsausweis-gewerbe/[id].ts b/src/pages/api/bedarfsausweis-gewerbe/[id].ts index be3a40f1..c2c74657 100644 --- a/src/pages/api/bedarfsausweis-gewerbe/[id].ts +++ b/src/pages/api/bedarfsausweis-gewerbe/[id].ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { exclude } from "#lib/exclude.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; @@ -64,7 +64,7 @@ export const DELETE = defineApiRoute({ async fetch(input, ctx, user) { const { id } = ctx.params; - if (!UUidWithPrefix.safeParse(id).success) { + if (!IDWithPrefix.safeParse(id).success) { throw new APIError({ code: "BAD_REQUEST", message: "UID konnte nicht verifiziert werden." @@ -122,7 +122,7 @@ export const DELETE = defineApiRoute({ } }) - const event_id = generatePrefixedId(9, VALID_UUID_PREFIXES.Ticket) + const event_id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Ticket) // Wir erstellen ein Event, dass der Nachweis storniert wurde // Dann können wir das in der Historie anzeigen @@ -164,9 +164,9 @@ export const GET = defineApiRoute({ } }, output: BedarfsausweisGewerbeSchema.merge(z.object({ - aufnahme_id: UUidWithPrefix, - objekt_id: UUidWithPrefix, - benutzer_id: UUidWithPrefix.optional() + aufnahme_id: IDWithPrefix, + objekt_id: IDWithPrefix, + benutzer_id: IDWithPrefix.optional() })).omit({ id: true, aufnahme_id: true, diff --git a/src/pages/api/bedarfsausweis-gewerbe/index.ts b/src/pages/api/bedarfsausweis-gewerbe/index.ts index 726a3b70..af81a364 100644 --- a/src/pages/api/bedarfsausweis-gewerbe/index.ts +++ b/src/pages/api/bedarfsausweis-gewerbe/index.ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; import { Enums, prisma } from "#lib/server/prisma.js"; @@ -29,9 +29,9 @@ export const PUT = defineApiRoute({ zurueckgestellt: true, ausweisart: true }), - aufnahme_id: UUidWithPrefix + aufnahme_id: IDWithPrefix }), - output: UUidWithPrefix, + output: IDWithPrefix, headers: authorizationHeaders, middleware: authorizationMiddleware, async fetch(input, ctx, user) { @@ -48,7 +48,7 @@ export const PUT = defineApiRoute({ }) } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.BedarfsausweisGewerbe) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.BedarfsausweisGewerbe) const nachweis = await prisma.bedarfsausweisGewerbe.create({ data: { diff --git a/src/pages/api/bedarfsausweis-wohnen/[id].ts b/src/pages/api/bedarfsausweis-wohnen/[id].ts index 1dccd9c8..75901097 100644 --- a/src/pages/api/bedarfsausweis-wohnen/[id].ts +++ b/src/pages/api/bedarfsausweis-wohnen/[id].ts @@ -1,6 +1,6 @@ -import { BedarfsausweisWohnenClient, OptionalNullable, UUidWithPrefix, ZodOverlap } from "#components/Ausweis/types.js"; +import { BedarfsausweisWohnenClient, OptionalNullable, IDWithPrefix, ZodOverlap } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { exclude } from "#lib/exclude.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; @@ -63,7 +63,7 @@ export const DELETE = defineApiRoute({ async fetch(input, ctx, user) { const { id } = ctx.params; - if (!UUidWithPrefix.safeParse(id).success) { + if (!IDWithPrefix.safeParse(id).success) { throw new APIError({ code: "BAD_REQUEST", message: "UID konnte nicht verifiziert werden." @@ -124,7 +124,7 @@ export const DELETE = defineApiRoute({ } }) - const event_id = generatePrefixedId(9, VALID_UUID_PREFIXES.Ticket) + const event_id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Ticket) // Wir erstellen ein Event, dass der Ausweis storniert wurde // Dann können wir das in der Historie anzeigen @@ -166,9 +166,9 @@ export const GET = defineApiRoute({ } }, output: ZodOverlap>(BedarfsausweisWohnenSchema.merge(z.object({ - aufnahme_id: UUidWithPrefix, - objekt_id: UUidWithPrefix, - benutzer_id: UUidWithPrefix.optional() + aufnahme_id: IDWithPrefix, + objekt_id: IDWithPrefix, + benutzer_id: IDWithPrefix.optional() })).omit({ id: true, aufnahme_id: true, diff --git a/src/pages/api/bedarfsausweis-wohnen/index.ts b/src/pages/api/bedarfsausweis-wohnen/index.ts index ca6e96f2..8fbe1439 100644 --- a/src/pages/api/bedarfsausweis-wohnen/index.ts +++ b/src/pages/api/bedarfsausweis-wohnen/index.ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { authorizationHeaders, authorizationMiddleware, @@ -32,9 +32,9 @@ export const PUT = defineApiRoute({ storniert: true, ausweisart: true }), - aufnahme_id: UUidWithPrefix, + aufnahme_id: IDWithPrefix, }), - output: UUidWithPrefix, + output: IDWithPrefix, headers: authorizationHeaders, middleware: authorizationMiddleware, async fetch(input, ctx, user) { @@ -52,7 +52,7 @@ export const PUT = defineApiRoute({ }); } - const id = generatePrefixedId( + const id = generateIDWithPrefix( 9, VALID_UUID_PREFIXES.BedarfsausweisWohnen ); diff --git a/src/pages/api/bild.ts b/src/pages/api/bild.ts index 2670cb61..498507b3 100644 --- a/src/pages/api/bild.ts +++ b/src/pages/api/bild.ts @@ -3,23 +3,25 @@ import { prisma } from "#lib/server/prisma.js"; import { defineApiRoute, APIError } from "astro-typesafe-api/server"; import { z } from "astro:content"; import isBase64 from "is-base64"; -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { BildSchema } from "src/generated/zod/bild.js"; -import sharp from "sharp" +import sharp from "sharp"; import { PutObjectCommand } from "@aws-sdk/client-s3"; import { s3Client } from "#lib/s3.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; export const PUT = defineApiRoute({ input: BildSchema.pick({ kategorie: true, - name: true - }).merge(z.object({ - data: z.string() - })), + name: true, + }).merge( + z.object({ + data: z.string(), + }) + ), output: z.object({ - id: z.string({ description: "Die id des Bildes." }) + id: z.string({ description: "Die id des Bildes." }), }), async fetch(input) { const data = input.data; @@ -31,44 +33,40 @@ export const PUT = defineApiRoute({ }); } - const dataWithoutPrefix = data.replace( - /^data:image\/\w+;base64,/, - "" - ); + const dataWithoutPrefix = data.replace(/^data:image\/\w+;base64,/, ""); const buffer = Buffer.from(dataWithoutPrefix, "base64"); - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.Bild) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Bild); const bild = await prisma.bild.create({ data: { id, kategorie: input.kategorie, - name: input.name - } + name: input.name, + }, }); - - - try { // Wir optimieren das Bild und konvertieren es in JPEG - const optimizedBuffer = await sharp(buffer).jpeg({ quality: 80 }).toBuffer(); + const optimizedBuffer = await sharp(buffer) + .jpeg({ quality: 80 }) + .toBuffer(); const command = new PutObjectCommand({ Bucket: "ibc-images", Key: `${id}.jpg`, Body: optimizedBuffer, - ACL: "private" - }) + ACL: "private", + }); - const response = await s3Client.send(command) - } catch(e) { + const response = await s3Client.send(command); + } catch (e) { // Bild wurde nicht gespeichert, wir löschen den Eintrag wieder await prisma.bild.delete({ where: { - id - } - }) + id, + }, + }); // Und geben einen Fehler zurück throw new APIError({ code: "INTERNAL_SERVER_ERROR", @@ -77,14 +75,14 @@ export const PUT = defineApiRoute({ } return { - id + id, }; }, -}) +}); export const DELETE = defineApiRoute({ input: z.object({ - id: UUidWithPrefix + id: IDWithPrefix, }), middleware: maybeAuthorizationMiddleware, async fetch(input, context, user) { @@ -95,24 +93,24 @@ export const DELETE = defineApiRoute({ id: input.id, aufnahme: { benutzer: { - id: user.id - } - } - } - }) + id: user.id, + }, + }, + }, + }); } else { await prisma.bild.delete({ where: { id: input.id, - aufnahme_id: null - } - }) + aufnahme_id: null, + }, + }); } - } catch(e) { + } catch (e) { throw new APIError({ code: "INTERNAL_SERVER_ERROR", - message: "Bild konnte nicht gelöscht werden." - }) + message: "Bild konnte nicht gelöscht werden.", + }); } }, -}) \ No newline at end of file +}); diff --git a/src/pages/api/bilder/[id].ts b/src/pages/api/bilder/[id].ts index 0a1730d5..2204f371 100644 --- a/src/pages/api/bilder/[id].ts +++ b/src/pages/api/bilder/[id].ts @@ -5,7 +5,7 @@ import { z } from "zod"; import isBase64 from "is-base64"; import { fileURLToPath } from "url"; import { writeFileSync } from "fs"; -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import sharp from "sharp" import { BildSchema } from "src/generated/zod/bild.js"; import { PERSISTENT_DIR } from "#lib/server/constants.js"; @@ -19,7 +19,7 @@ export const PATCH = defineApiRoute({ output: z.void(), middleware: authorizationMiddleware, async fetch(input, ctx, user) { - if (!UUidWithPrefix.safeParse(ctx.params.uid).success) { + if (!IDWithPrefix.safeParse(ctx.params.uid).success) { throw new APIError({ code: "BAD_REQUEST", message: "UID konnte nicht verifiziert werden." diff --git a/src/pages/api/geg-nachweis-gewerbe/[id].ts b/src/pages/api/geg-nachweis-gewerbe/[id].ts index da805fb1..1c5419fc 100644 --- a/src/pages/api/geg-nachweis-gewerbe/[id].ts +++ b/src/pages/api/geg-nachweis-gewerbe/[id].ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { exclude } from "#lib/exclude.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; @@ -63,7 +63,7 @@ export const DELETE = defineApiRoute({ async fetch(input, ctx, user) { const { id } = ctx.params; - if (!UUidWithPrefix.safeParse(id).success) { + if (!IDWithPrefix.safeParse(id).success) { throw new APIError({ code: "BAD_REQUEST", message: "UID konnte nicht verifiziert werden." @@ -122,7 +122,7 @@ export const DELETE = defineApiRoute({ }) - const event_id = generatePrefixedId(9, VALID_UUID_PREFIXES.Ticket) + const event_id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Ticket) // Wir erstellen ein Event, dass der Nachweis storniert wurde // Dann können wir das in der Historie anzeigen await prisma.event.create({ @@ -163,9 +163,9 @@ export const GET = defineApiRoute({ } }, output: GEGNachweisGewerbeSchema.merge(z.object({ - aufnahme_id: UUidWithPrefix, - objekt_id: UUidWithPrefix, - benutzer_id: UUidWithPrefix.optional() + aufnahme_id: IDWithPrefix, + objekt_id: IDWithPrefix, + benutzer_id: IDWithPrefix.optional() })).omit({ id: true, aufnahme_id: true, diff --git a/src/pages/api/geg-nachweis-gewerbe/index.ts b/src/pages/api/geg-nachweis-gewerbe/index.ts index 82c253a0..f1e0f2a7 100644 --- a/src/pages/api/geg-nachweis-gewerbe/index.ts +++ b/src/pages/api/geg-nachweis-gewerbe/index.ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; import { Enums, prisma } from "#lib/server/prisma.js"; @@ -29,12 +29,12 @@ export const PUT = defineApiRoute({ zurueckgestellt: true, ausweisart: true }), - aufnahme_id: UUidWithPrefix + aufnahme_id: IDWithPrefix }), output: z.object({ - id: UUidWithPrefix, - objekt_id: UUidWithPrefix, - aufnahme_id: UUidWithPrefix, + id: IDWithPrefix, + objekt_id: IDWithPrefix, + aufnahme_id: IDWithPrefix, }), headers: authorizationHeaders, middleware: authorizationMiddleware, @@ -52,7 +52,7 @@ export const PUT = defineApiRoute({ }) } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.GEGNachweisGewerbe) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.GEGNachweisGewerbe) const nachweis = await prisma.gEGNachweisGewerbe.create({ data: { diff --git a/src/pages/api/geg-nachweis-wohnen/[id].ts b/src/pages/api/geg-nachweis-wohnen/[id].ts index 81bd7b19..34b4830a 100644 --- a/src/pages/api/geg-nachweis-wohnen/[id].ts +++ b/src/pages/api/geg-nachweis-wohnen/[id].ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { exclude } from "#lib/exclude.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; @@ -63,7 +63,7 @@ export const DELETE = defineApiRoute({ async fetch(input, ctx, user) { const { id } = ctx.params; - if (!UUidWithPrefix.safeParse(id).success) { + if (!IDWithPrefix.safeParse(id).success) { throw new APIError({ code: "BAD_REQUEST", message: "UID konnte nicht verifiziert werden." @@ -127,7 +127,7 @@ export const DELETE = defineApiRoute({ // Dann können wir das in der Historie anzeigen await prisma.event.create({ data: { - id: generatePrefixedId(9, VALID_UUID_PREFIXES.Event), + id: generateIDWithPrefix(9, VALID_UUID_PREFIXES.Event), title: "Nachweis storniert", description: ((user.rolle === "ADMIN") && (nachweis.benutzer_id !== user.id)) ? "Nachweis wurde von einem Administrator storniert." : "Nachweis wurde vom Besitzer storniert.", benutzer: { @@ -163,9 +163,9 @@ export const GET = defineApiRoute({ } }, output: GEGNachweisWohnenSchema.merge(z.object({ - aufnahme_id: UUidWithPrefix, - objekt_id: UUidWithPrefix, - benutzer_id: UUidWithPrefix.optional() + aufnahme_id: IDWithPrefix, + objekt_id: IDWithPrefix, + benutzer_id: IDWithPrefix.optional() })).omit({ id: true, aufnahme_id: true, diff --git a/src/pages/api/geg-nachweis-wohnen/index.ts b/src/pages/api/geg-nachweis-wohnen/index.ts index 3de71e47..b0f8c420 100644 --- a/src/pages/api/geg-nachweis-wohnen/index.ts +++ b/src/pages/api/geg-nachweis-wohnen/index.ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; import { Enums, prisma } from "#lib/server/prisma.js"; @@ -29,12 +29,12 @@ export const PUT = defineApiRoute({ zurueckgestellt: true, ausweisart: true }), - aufnahme_id: UUidWithPrefix + aufnahme_id: IDWithPrefix }), output: z.object({ - id: UUidWithPrefix, - objekt_id: UUidWithPrefix, - aufnahme_id: UUidWithPrefix, + id: IDWithPrefix, + objekt_id: IDWithPrefix, + aufnahme_id: IDWithPrefix, }), headers: authorizationHeaders, middleware: authorizationMiddleware, @@ -52,7 +52,7 @@ export const PUT = defineApiRoute({ }) } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.GEGNachweisWohnen) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.GEGNachweisWohnen) const nachweis = await prisma.gEGNachweisWohnen.create({ data: { diff --git a/src/pages/api/objekt/index.ts b/src/pages/api/objekt/index.ts index 6f17a37a..6fbe0177 100644 --- a/src/pages/api/objekt/index.ts +++ b/src/pages/api/objekt/index.ts @@ -1,5 +1,5 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { authorizationMiddleware } from "#lib/middleware/authorization.js"; import { prisma } from "#lib/server/prisma.js"; import { defineApiRoute } from "astro-typesafe-api/server"; @@ -13,11 +13,11 @@ export const PUT = defineApiRoute({ erstellungsdatum: true }), output: z.object({ - id: UUidWithPrefix + id: IDWithPrefix }), middleware: authorizationMiddleware, async fetch(input, context, user) { - const id = generatePrefixedId(9, "OB") + const id = generateIDWithPrefix(9, "OB") console.log(id); diff --git a/src/pages/api/rechnung/[id].ts b/src/pages/api/rechnung/[id].ts index 9eb8a345..e19131b3 100644 --- a/src/pages/api/rechnung/[id].ts +++ b/src/pages/api/rechnung/[id].ts @@ -1,4 +1,4 @@ -import { UUidWithPrefix, getAusweisartFromId } from "#components/Ausweis/types.js" +import { IDWithPrefix, getAusweisartFromId } from "#components/Ausweis/types.js" import { Enums } from "#lib/client/prisma.js" import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js" import { mollieClient } from "#lib/mollie.js" @@ -25,7 +25,7 @@ export const PATCH = defineApiRoute({ }), output: z.object({ checkout_url: z.string().optional(), - id: UUidWithPrefix, + id: IDWithPrefix, }), middleware: authorizationMiddleware, headers: authorizationHeaders, diff --git a/src/pages/api/rechnung/anfordern.ts b/src/pages/api/rechnung/anfordern.ts index ba1a21cf..4339623f 100644 --- a/src/pages/api/rechnung/anfordern.ts +++ b/src/pages/api/rechnung/anfordern.ts @@ -1,6 +1,6 @@ -import { getAusweisartFromId, UUidWithPrefix } from "#components/Ausweis/types.js"; +import { getAusweisartFromId, IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { omit } from "#lib/helpers.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendGEGAnforderungsMail } from "#lib/server/mail/geg-anfordern.js"; @@ -15,10 +15,10 @@ export const PUT = defineApiRoute({ id: true, status: true, }).merge(z.object({ - nachweis_id: UUidWithPrefix + nachweis_id: IDWithPrefix })), output: z.object({ - id: UUidWithPrefix + id: IDWithPrefix }), headers: authorizationHeaders, middleware: authorizationMiddleware, @@ -59,7 +59,7 @@ export const PUT = defineApiRoute({ }) } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.GEGEinpreisung) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.GEGEinpreisung) if (ausweisart === Enums.Ausweisart.GEGNachweisWohnen) { einpreisung = await prisma.gEGEinpreisung.create({ diff --git a/src/pages/api/rechnung/index.ts b/src/pages/api/rechnung/index.ts index 7550e8ac..466d3e4e 100644 --- a/src/pages/api/rechnung/index.ts +++ b/src/pages/api/rechnung/index.ts @@ -7,12 +7,12 @@ import { authorizationHeaders, authorizationMiddleware, } from "#lib/middleware/authorization.js"; -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { getPrismaAusweisAdapter } from "#lib/server/ausweis.js"; import { PRICES, SERVICES, VALID_UUID_PREFIXES } from "#lib/constants.js"; import { Rechnung } from "#lib/client/prisma.js"; import { RechnungSchema } from "src/generated/zod/rechnung.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; export const PUT = defineApiRoute({ meta: { @@ -25,7 +25,7 @@ export const PUT = defineApiRoute({ input: z .object({ ausweisart: z.nativeEnum(Enums.Ausweisart), - ausweis_id: UUidWithPrefix, + ausweis_id: IDWithPrefix, }) .merge( RechnungSchema.omit({ @@ -43,7 +43,7 @@ export const PUT = defineApiRoute({ ), output: z.object({ checkout_url: z.string().optional(), - id: UUidWithPrefix, + id: IDWithPrefix, }), headers: authorizationHeaders, middleware: authorizationMiddleware, @@ -99,7 +99,7 @@ export const PUT = defineApiRoute({ betrag += servicePriceList[service] } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.Rechnung); + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Rechnung); // Wir erstellen eine neue Rechnung in unserer Datenbank. let rechnung: Rechnung | null = null; diff --git a/src/pages/api/ticket/index.ts b/src/pages/api/ticket/index.ts index 46a4f722..1367b309 100644 --- a/src/pages/api/ticket/index.ts +++ b/src/pages/api/ticket/index.ts @@ -1,9 +1,9 @@ import { z } from "zod"; import { prisma } from "#lib/server/prisma.js"; import { defineApiRoute } from "astro-typesafe-api/server"; -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { TicketsSchema } from "src/generated/zod/tickets.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; export const PUT = defineApiRoute({ @@ -25,10 +25,10 @@ export const PUT = defineApiRoute({ updated_at: true, }), output: z.object({ - id: UUidWithPrefix, + id: IDWithPrefix, }), async fetch(input, ctx) { - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.Ticket) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Ticket) const ticket = await prisma.tickets.create({ data: { diff --git a/src/pages/api/unterlage.ts b/src/pages/api/unterlage.ts index 84516d8c..c12ae602 100644 --- a/src/pages/api/unterlage.ts +++ b/src/pages/api/unterlage.ts @@ -3,9 +3,9 @@ import { prisma } from "#lib/server/prisma.js"; import { APIError, defineApiRoute } from "astro-typesafe-api/server"; import { z } from "zod"; import { UnterlageSchema } from "src/generated/zod/unterlage.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { PutObjectCommand } from "@aws-sdk/client-s3"; import { s3Client } from "#lib/s3.js"; import mime from "mime" @@ -18,7 +18,7 @@ export const PUT = defineApiRoute({ data: z.string(), })), output: z.object({ - id: UUidWithPrefix + id: IDWithPrefix }), async fetch({ data, name, kategorie, mime: mimeType }, ctx, user) { const extension = mime.getExtension(mimeType); @@ -29,7 +29,7 @@ export const PUT = defineApiRoute({ }) } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.Unterlage) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Unterlage) await prisma.unterlage.create({ data: { diff --git a/src/pages/api/user/index.ts b/src/pages/api/user/index.ts index beb42b3c..4c769cc5 100644 --- a/src/pages/api/user/index.ts +++ b/src/pages/api/user/index.ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { adminMiddleware, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { hashPassword } from "#lib/password.js"; import { createLexOfficeCustomer } from "#lib/server/lexoffice.js"; @@ -47,7 +47,7 @@ export const POST = defineApiRoute({ export const GET = defineApiRoute({ input: z.object({ - id: UUidWithPrefix + id: IDWithPrefix }).or(z.object({ take: z.number(), email: z.string() @@ -90,7 +90,7 @@ export const PUT = defineApiRoute({ name: z.string() }), output: z.object({ - id: UUidWithPrefix + id: IDWithPrefix }), async fetch(input) { const existingUser = await prisma.benutzer.findUnique({ @@ -106,7 +106,7 @@ export const PUT = defineApiRoute({ }) } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.User); + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.User); const user = await prisma.benutzer.create({ data: { diff --git a/src/pages/api/verbrauchsausweis-gewerbe/[id].ts b/src/pages/api/verbrauchsausweis-gewerbe/[id].ts index 8a90b0f4..6c6f52ef 100644 --- a/src/pages/api/verbrauchsausweis-gewerbe/[id].ts +++ b/src/pages/api/verbrauchsausweis-gewerbe/[id].ts @@ -1,6 +1,6 @@ -import { OptionalNullable, UUidWithPrefix, VerbrauchsausweisGewerbeClient, ZodOverlap } from "#components/Ausweis/types.js"; +import { OptionalNullable, IDWithPrefix, VerbrauchsausweisGewerbeClient, ZodOverlap } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { exclude } from "#lib/exclude.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; @@ -61,7 +61,7 @@ export const DELETE = defineApiRoute({ async fetch(input, ctx, user) { const { id } = ctx.params; - if (!UUidWithPrefix.safeParse(id).success) { + if (!IDWithPrefix.safeParse(id).success) { throw new APIError({ code: "BAD_REQUEST", message: "id konnte nicht verifiziert werden." @@ -123,7 +123,7 @@ export const DELETE = defineApiRoute({ // Dann können wir das in der Historie anzeigen await prisma.event.create({ data: { - id: generatePrefixedId(9, VALID_UUID_PREFIXES.Event), + id: generateIDWithPrefix(9, VALID_UUID_PREFIXES.Event), title: "Ausweis storniert", description: ((user.rolle === "ADMIN") && (ausweis.benutzer_id !== user.id)) ? "Ausweis wurde von einem Administrator storniert." : "Ausweis wurde vom Besitzer storniert.", benutzer: { @@ -159,7 +159,7 @@ export const GET = defineApiRoute({ } }, output: ZodOverlap>(VerbrauchsausweisGewerbeSchema.merge(z.object({ - objekt_id: UUidWithPrefix, + objekt_id: IDWithPrefix, }))), middleware: authorizationMiddleware, async fetch(input, context, user) { diff --git a/src/pages/api/verbrauchsausweis-gewerbe/index.ts b/src/pages/api/verbrauchsausweis-gewerbe/index.ts index d5127bbf..b9d9ff51 100644 --- a/src/pages/api/verbrauchsausweis-gewerbe/index.ts +++ b/src/pages/api/verbrauchsausweis-gewerbe/index.ts @@ -1,6 +1,6 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; import { prisma } from "#lib/server/prisma.js"; @@ -27,12 +27,12 @@ export const PUT = defineApiRoute({ }).merge(z.object({ startdatum: z.coerce.date().nullable() })), - aufnahme_id: UUidWithPrefix + aufnahme_id: IDWithPrefix }), output: z.object({ - id: UUidWithPrefix, - objekt_id: UUidWithPrefix, - aufnahme_id: UUidWithPrefix, + id: IDWithPrefix, + objekt_id: IDWithPrefix, + aufnahme_id: IDWithPrefix, }), headers: authorizationHeaders, middleware: authorizationMiddleware, @@ -50,7 +50,7 @@ export const PUT = defineApiRoute({ }) } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.VerbrauchsausweisGewerbe) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.VerbrauchsausweisGewerbe) const createdAusweis = await prisma.verbrauchsausweisGewerbe.create({ data: { diff --git a/src/pages/api/verbrauchsausweis-wohnen/[id].ts b/src/pages/api/verbrauchsausweis-wohnen/[id].ts index 43678e8e..b960bf04 100644 --- a/src/pages/api/verbrauchsausweis-wohnen/[id].ts +++ b/src/pages/api/verbrauchsausweis-wohnen/[id].ts @@ -1,6 +1,6 @@ -import { OptionalNullable, UUidWithPrefix, VerbrauchsausweisWohnenClient, ZodOverlap } from "#components/Ausweis/types.js"; +import { OptionalNullable, IDWithPrefix, VerbrauchsausweisWohnenClient, ZodOverlap } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { exclude } from "#lib/exclude.js"; import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; @@ -62,7 +62,7 @@ export const DELETE = defineApiRoute({ async fetch(input, ctx, user) { const { id } = ctx.params; - if (!UUidWithPrefix.safeParse(id).success) { + if (!IDWithPrefix.safeParse(id).success) { throw new APIError({ code: "BAD_REQUEST", message: "UID konnte nicht verifiziert werden." @@ -124,7 +124,7 @@ export const DELETE = defineApiRoute({ // Dann können wir das in der Historie anzeigen await prisma.event.create({ data: { - id: generatePrefixedId(9, VALID_UUID_PREFIXES.Event), + id: generateIDWithPrefix(9, VALID_UUID_PREFIXES.Event), title: "Ausweis storniert", description: ((user.rolle === "ADMIN") && (ausweis.benutzer_id !== user.id)) ? "Ausweis wurde von einem Administrator storniert." : "Ausweis wurde vom Besitzer storniert.", benutzer: { @@ -160,7 +160,7 @@ export const GET = defineApiRoute({ } }, output: ZodOverlap>(VerbrauchsausweisWohnenSchema.merge(z.object({ - objekt_id: UUidWithPrefix + objekt_id: IDWithPrefix }))), middleware: authorizationMiddleware, async fetch(input, context, user) { diff --git a/src/pages/api/verbrauchsausweis-wohnen/index.ts b/src/pages/api/verbrauchsausweis-wohnen/index.ts index 7f01fe4f..f2708961 100644 --- a/src/pages/api/verbrauchsausweis-wohnen/index.ts +++ b/src/pages/api/verbrauchsausweis-wohnen/index.ts @@ -1,7 +1,10 @@ -import { UUidWithPrefix } from "#components/Ausweis/types.js"; +import { IDWithPrefix } from "#components/Ausweis/types.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; -import { generatePrefixedId } from "#lib/db.js"; -import { authorizationHeaders, authorizationMiddleware } from "#lib/middleware/authorization.js"; +import { generateIDWithPrefix } from "#lib/db.js"; +import { + authorizationHeaders, + authorizationMiddleware, +} from "#lib/middleware/authorization.js"; import { sendAusweisGespeichertMail } from "#lib/server/mail/speichern-erfolgreich.js"; import { Enums, prisma } from "#lib/server/prisma.js"; import { APIError, defineApiRoute } from "astro-typesafe-api/server"; @@ -20,87 +23,102 @@ export const PUT = defineApiRoute({ tags: ["Verbrauchsausweis Wohnen"], }, input: z.object({ - ausweis: VerbrauchsausweisWohnenSchema.merge(z.object({ - startdatum: z.coerce.date().nullable() - })).omit({ + ausweis: VerbrauchsausweisWohnenSchema.merge( + z.object({ + startdatum: z.coerce.date().nullable(), + }) + ).omit({ id: true, benutzer_id: true, aufnahme_id: true, rechnung_id: true, created_at: true, updated_at: true, - ausweisart: true + ausweisart: true, + alte_ausweis_id: true, + ausgestellt: true, + bestellt: true, + ausstellungsdatum: true, + kontrolldatei_angefragt: true, + registriernummer: true, + storniert: true, + zurueckgestellt: true, }), - aufnahme_id: UUidWithPrefix + aufnahme_id: IDWithPrefix, }), output: z.object({ - id: UUidWithPrefix, - objekt_id: UUidWithPrefix, - aufnahme_id: UUidWithPrefix, + id: IDWithPrefix, + objekt_id: IDWithPrefix, + aufnahme_id: IDWithPrefix, }), headers: authorizationHeaders, middleware: authorizationMiddleware, async fetch(input, ctx, user) { const aufnahme = await prisma.aufnahme.findUnique({ where: { - id: input.aufnahme_id - } - }) + id: input.aufnahme_id, + }, + }); if (!aufnahme || aufnahme.benutzer_id !== user.id) { throw new APIError({ code: "FORBIDDEN", - message: "Aufnahme konnte nicht gefunden werden oder gehört nicht zu diesem Benutzer." - }) + message: + "Aufnahme konnte nicht gefunden werden oder gehört nicht zu diesem Benutzer.", + }); } - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.VerbrauchsausweisWohnen); + const id = generateIDWithPrefix( + 9, + VALID_UUID_PREFIXES.VerbrauchsausweisWohnen + ); - const createdAusweis = await prisma.verbrauchsausweisWohnen.create({ - data: { - id, - ...input.ausweis, - benutzer: { - connect: { - id: user.id, - }, - }, - aufnahme: { - connect: { - id: aufnahme.id, - }, + const ausweis = await prisma.verbrauchsausweisWohnen.create({ + data: { + id, + ...input.ausweis, + benutzer: { + connect: { + id: user.id, }, }, - select: { - id: true, - aufnahme: { - select: { - id: true, - objekt: { - select: { - id: true, - }, + aufnahme: { + connect: { + id: aufnahme.id, + }, + }, + }, + select: { + id: true, + aufnahme: { + select: { + id: true, + objekt: { + select: { + id: true, }, }, }, }, - }); - - if (user.rolle === Enums.BenutzerRolle.USER) { - await sendAusweisGespeichertMail(user, id) - } - return { - id: createdAusweis.id, - objekt_id: createdAusweis.aufnahme.objekt.id, - aufnahme_id: createdAusweis.aufnahme.id, - }; + }, + }); + + if (user.rolle === Enums.BenutzerRolle.USER) { + await sendAusweisGespeichertMail(user, id); + } + return { + id: ausweis.id, + objekt_id: ausweis.aufnahme.objekt.id, + aufnahme_id: ausweis.aufnahme.id, + }; }, }); export const GET = defineApiRoute({ meta: { - description: "Gibt ein spezifisches Gebäude des Benutzers zurück.", - tags: ["Gebäude"], + description: + "Gibt einen spezifischen Verbrauchsausweis Wohngebäude des Benutzers zurück.", + tags: ["Verbrauchsausweis Wohnen"], headers: { Authorization: { description: "Ein gültiger Authentifizierungstoken", diff --git a/src/pages/energieausweis-erstellen/[ausweisart]/index.astro b/src/pages/energieausweis-erstellen/[ausweisart]/index.astro index 6c41ae67..b6cf3be6 100644 --- a/src/pages/energieausweis-erstellen/[ausweisart]/index.astro +++ b/src/pages/energieausweis-erstellen/[ausweisart]/index.astro @@ -96,7 +96,7 @@ if (typ === AusstellungsTyp.Neuausstellung) { ausweis.id = null; aufnahme.id = null; - aufnahme.erstellungsdatum = null + delete aufnahme.erstellungsdatum; ausweis.created_at = new Date() ausweis.updated_at = new Date(); ausweis.alte_ausweis_id = null; @@ -108,6 +108,8 @@ if (typ === AusstellungsTyp.Neuausstellung) { ausweis.ausweistyp = Enums.AusweisTyp.Standard; ausweis.zurueckgestellt = false; ausweis.storniert = false; + ausweis.rechnung_id = null; + ausweis.registriernummer = null; // Die Daten sollen nicht aus dem localStorage genommen werden sonst kann es vorkommen, dass die ID noch besteht und der Vorgang nicht neu angelegt wird. loadFromDatabase = true; } else if (typ === AusstellungsTyp.Speichern) { @@ -187,7 +189,7 @@ if (typ === AusstellungsTyp.Neuausstellung) { } ausweis.id = null; - aufnahme.erstellungsdatum = null + delete aufnahme.erstellungsdatum; ausweis.created_at = new Date() ausweis.updated_at = new Date(); ausweis.alte_ausweis_id = null; @@ -199,6 +201,8 @@ if (typ === AusstellungsTyp.Neuausstellung) { ausweis.ausweistyp = Enums.AusweisTyp.Standard; ausweis.zurueckgestellt = false; ausweis.storniert = false; + ausweis.rechnung_id = null; + ausweis.registriernummer = null; // Die Daten sollen nicht aus dem localStorage genommen werden sonst kann es vorkommen, dass die ID noch besteht und der Vorgang nicht neu angelegt wird. loadFromDatabase = true; } diff --git a/src/testing/ausweise-fix-rechnungsid.ts b/src/testing/ausweise-fix-rechnungsid.ts index 4d9aced7..a64e718c 100644 --- a/src/testing/ausweise-fix-rechnungsid.ts +++ b/src/testing/ausweise-fix-rechnungsid.ts @@ -2,7 +2,7 @@ import { Enums, prisma } from "#lib/server/prisma.js"; import Papa from "papaparse" import * as fs from "fs"; import { fileURLToPath } from "url"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; const path = fileURLToPath(new URL("./rechnungen.csv", import.meta.url)); diff --git a/src/testing/daten-umziehen.ts b/src/testing/daten-umziehen.ts index 915d2f40..48c3a5ce 100644 --- a/src/testing/daten-umziehen.ts +++ b/src/testing/daten-umziehen.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import { fileURLToPath } from "url"; import { hashPassword } from "#lib/password.js"; import Papa from "papaparse"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; import { tryCatch } from "#lib/tryCatch.js"; @@ -78,7 +78,7 @@ Papa.parse(file, { console.log(`Missing user ${user_id}`); if (email) { - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.User); + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.User); user = await prisma.benutzer.create({ data: { @@ -104,7 +104,7 @@ Papa.parse(file, { } } - const objekt_id = generatePrefixedId(9, VALID_UUID_PREFIXES.Objekt); + const objekt_id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Objekt); const [objekt, objekt_error] = await tryCatch(prisma.objekt.create({ data: { id: objekt_id, @@ -137,7 +137,7 @@ Papa.parse(file, { continue; } - const aufnahme_id = generatePrefixedId( + const aufnahme_id = generateIDWithPrefix( 9, VALID_UUID_PREFIXES.Aufnahme ); @@ -263,7 +263,7 @@ Papa.parse(file, { heizung: Enums.BilderKategorie.Heizung, }; - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.Bild); + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Bild); const img = await prisma.bild.create({ data: { id, diff --git a/src/testing/nutzer-fix-alteid.ts b/src/testing/nutzer-fix-alteid.ts index 4eca767c..5adfdf3f 100644 --- a/src/testing/nutzer-fix-alteid.ts +++ b/src/testing/nutzer-fix-alteid.ts @@ -2,7 +2,7 @@ import { Enums, prisma } from "#lib/server/prisma.js"; import Papa from "papaparse" import * as fs from "fs"; import { fileURLToPath } from "url"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; const path = fileURLToPath(new URL("./users.csv", import.meta.url)); diff --git a/src/testing/nutzer-umziehen.ts b/src/testing/nutzer-umziehen.ts index 157e0e6b..a66ac642 100644 --- a/src/testing/nutzer-umziehen.ts +++ b/src/testing/nutzer-umziehen.ts @@ -2,7 +2,7 @@ import { Enums, prisma } from "#lib/server/prisma.js"; import Papa from "papaparse" import * as fs from "fs"; import { fileURLToPath } from "url"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; const path = fileURLToPath(new URL("./users.csv", import.meta.url)); @@ -36,7 +36,7 @@ Papa.parse(file, { } try { - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.User) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.User) await prisma.benutzer.create({ data: { diff --git a/src/testing/rechnungen-umziehen.ts b/src/testing/rechnungen-umziehen.ts index de56470a..51fe974b 100644 --- a/src/testing/rechnungen-umziehen.ts +++ b/src/testing/rechnungen-umziehen.ts @@ -2,7 +2,7 @@ import { Enums, Prisma, prisma } from "#lib/server/prisma.js"; import Papa from "papaparse" import * as fs from "fs"; import { fileURLToPath } from "url"; -import { generatePrefixedId } from "#lib/db.js"; +import { generateIDWithPrefix } from "#lib/db.js"; import { VALID_UUID_PREFIXES } from "#lib/constants.js"; import moment from "moment"; @@ -45,7 +45,7 @@ Papa.parse(file, { } try { - const id = generatePrefixedId(9, VALID_UUID_PREFIXES.Rechnung) + const id = generateIDWithPrefix(9, VALID_UUID_PREFIXES.Rechnung) const services: Enums.Service[] = []