diff --git a/.github/workflows/auto-merge-staging-into-main.yml b/.github/workflows/auto-merge-staging-into-main.yml deleted file mode 100644 index f233b3ad..00000000 --- a/.github/workflows/auto-merge-staging-into-main.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Auto Merge Staging into Main - -on: - schedule: - - cron: '0 2 * * *' # 2:00 UTC = 4:00 Europäische Zeit - workflow_dispatch: - -jobs: - merge: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set Git user - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Fetch all branches - run: | - git fetch origin main - git fetch origin staging - - - name: Check if main has commits not in staging - id: check - run: | - git fetch origin - if [ $(git rev-list --count origin/staging..origin/main) -gt 0 ]; then - echo "❌ Staging is behind main and requires manual merging." - exit 1 - fi - - - name: Create PR from staging to main - id: create_pr - run: | - PR_URL=$(gh pr create --base main --head staging --title "Auto-merge staging into main" --body "This PR was created automatically by GitHub Actions. It merges the latest \`staging\` into \`main\`.") - echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT - PR_NUMBER=$(echo $PR_URL | awk -F'/' '{print $NF}') - echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Enable auto-merge on PR - if: steps.create_pr.outputs.PR_NUMBER != '' - run: | - gh pr merge ${{ steps.create_pr.outputs.PR_NUMBER }} --merge --auto - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - notify_failure: - needs: merge - if: failure() - runs-on: ubuntu-latest - steps: - - name: Send Discord notification on failure - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d "{\"content\": \"🚨 Auto-Merge fehlgeschlagen! Bitte manuell prüfen: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}" \ - ${{ secrets.DISCORD_WEBHOOK_URL }} - - notify_success: - needs: merge - if: success() - runs-on: ubuntu-latest - steps: - - name: Send Discord notification on success - run: | - curl -H "Content-Type: application/json" \ - -X POST \ - -d "{\"content\": \"✅ Auto-Merge ausgeführt! Ergebnis jetzt auf [GitHub](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) und [online-energieausweis.org](https://online-energieausweis.org) einsehen.\"}" \ - ${{ secrets.DISCORD_WEBHOOK_URL }} \ No newline at end of file diff --git a/Makefile b/Makefile index 26be7c6e..a2a498da 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,9 @@ run-database: stop-database docker volume create $(DB_VOLUME) docker build -t $(DB_CONTAINER_NAME) . docker run -d --name $(DB_CONTAINER_NAME) \ + --log-driver=json-file \ + --log-opt max-size=50m \ + --log-opt max-file=3 \ --restart=always \ -e POSTGRES_USER=$(DB_USER) \ -e POSTGRES_PASSWORD=$(DB_PASSWORD) \ diff --git a/bun.lock b/bun.lock index 0af6ee99..bf5a8067 100644 --- a/bun.lock +++ b/bun.lock @@ -36,7 +36,7 @@ "jwt-decode": "^4.0.0", "mime": "^4.0.6", "moment": "^2.30.1", - "moment-timezone": "^0.5.46", + "moment-timezone": "^0.6.0", "nodemailer": "^6.10.0", "pdf-lib": "^1.17.1", "postcss-nested": "^7.0.2", @@ -1965,7 +1965,7 @@ "moment": ["moment@2.30.1", "", {}, "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="], - "moment-timezone": ["moment-timezone@0.5.47", "", { "dependencies": { "moment": "^2.29.4" } }, "sha512-UbNt/JAWS0m/NJOebR0QMRHBk0hu03r5dx9GK8Cs0AS3I81yDcOc9k+DytPItgVvBP7J6Mf6U2n3BPAacAV9oA=="], + "moment-timezone": ["moment-timezone@0.6.0", "", { "dependencies": { "moment": "^2.29.4" } }, "sha512-ldA5lRNm3iJCWZcBCab4pnNL3HSZYXVb/3TYr75/1WCTWYuTqYUb5f/S384pncYjJ88lbO8Z4uPDvmoluHJc8Q=="], "mrmime": ["mrmime@2.0.0", "", {}, "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw=="], diff --git a/package.json b/package.json index 12e5f6fd..5fd7c213 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "jwt-decode": "^4.0.0", "mime": "^4.0.6", "moment": "^2.30.1", - "moment-timezone": "^0.5.46", + "moment-timezone": "^0.6.0", "nodemailer": "^6.10.0", "pdf-lib": "^1.17.1", "postcss-nested": "^7.0.2", diff --git a/prisma/migrations/20250805131533_partner_code/migration.sql b/prisma/migrations/20250805131533_partner_code/migration.sql new file mode 100644 index 00000000..e251e2a3 --- /dev/null +++ b/prisma/migrations/20250805131533_partner_code/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "benutzer" ADD COLUMN "partner_code" TEXT; diff --git a/prisma/schema/Benutzer.prisma b/prisma/schema/Benutzer.prisma index a4eb8ffe..836889fa 100644 --- a/prisma/schema/Benutzer.prisma +++ b/prisma/schema/Benutzer.prisma @@ -21,6 +21,7 @@ model Benutzer { rolle BenutzerRolle @default(USER) firma String? lex_office_id String? + partner_code String? verified Boolean @default(false) diff --git a/prisma/schema/Provisionen.prisma b/prisma/schema/Provisionen.prisma index 5921048f..460800fc 100644 --- a/prisma/schema/Provisionen.prisma +++ b/prisma/schema/Provisionen.prisma @@ -1,6 +1,7 @@ model Provisionen { id Int @id @default(autoincrement()) ausweisart Ausweisart + ausweistyp AusweisTyp provision_prozent Float provision_betrag Float benutzer_id String? @db.VarChar(11) diff --git a/src/astro-typesafe-api-caller.ts b/src/astro-typesafe-api-caller.ts index 7b6d9fb1..6a6f79e0 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"), + "aufnahme": await import("../src/pages/api/aufnahme/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,7 +13,6 @@ 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"), - "aufnahme": await import("../src/pages/api/aufnahme/index.ts"), "ausweise": await import("../src/pages/api/ausweise/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"), @@ -30,18 +30,16 @@ export const createCaller = createCallerFactory({ "rechnung/anfordern": await import("../src/pages/api/rechnung/anfordern.ts"), "rechnung": await import("../src/pages/api/rechnung/index.ts"), "objekt": await import("../src/pages/api/objekt/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"), + "ticket": await import("../src/pages/api/ticket/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"), - "user": await import("../src/pages/api/user/index.ts"), - "user/self": await import("../src/pages/api/user/self.ts"), "verbrauchsausweis-wohnen/[id]": await import("../src/pages/api/verbrauchsausweis-wohnen/[id].ts"), "verbrauchsausweis-wohnen": await import("../src/pages/api/verbrauchsausweis-wohnen/index.ts"), - "webhooks/mollie": await import("../src/pages/api/webhooks/mollie.ts"), + "objekt/[id]": await import("../src/pages/api/objekt/[id]/index.ts"), "aufnahme/[id]/bilder": await import("../src/pages/api/aufnahme/[id]/bilder.ts"), "aufnahme/[id]": await import("../src/pages/api/aufnahme/[id]/index.ts"), "aufnahme/[id]/unterlagen": await import("../src/pages/api/aufnahme/[id]/unterlagen.ts"), - "objekt/[id]": await import("../src/pages/api/objekt/[id]/index.ts"), + "webhooks/mollie": await import("../src/pages/api/webhooks/mollie.ts"), }) \ No newline at end of file diff --git a/src/components/Abrechnung/AbrechnungTable.svelte b/src/components/Abrechnung/AbrechnungTable.svelte index c43f4495..b7994999 100644 --- a/src/components/Abrechnung/AbrechnungTable.svelte +++ b/src/components/Abrechnung/AbrechnungTable.svelte @@ -1,7 +1,8 @@ diff --git a/src/components/UploadImages.svelte b/src/components/UploadImages.svelte index 0180b817..6bd0aa27 100644 --- a/src/components/UploadImages.svelte +++ b/src/components/UploadImages.svelte @@ -128,6 +128,7 @@
-

Immowelt GmbH

-

Nordostpark 3-5

-

90411 Nürnberg

+

{{ @root.firma }}

+

{{ @root.adresse }}

+

{{ @root.plz }} {{ @root.ort }}

{{/if}}
{{#if @first}}
-

Erzielte Conversions {{ @root.monat }}

-

Erstellt am 16.11.23

+
+

Erzielte Conversions {{ @root.monat }}

+

Erstellt am {{ @root.heute }}

+
+

Gesamt {{ @root.gesamt }} €

{{/if}} @@ -63,10 +66,10 @@ {{#with ausweis}} {{/with}}
- {{get-provision-prozent ausweisart}} % + {{get-provision-prozent ausweisart ausweistyp}} % - {{get-provision-betrag ausweisart}} € + {{get-provision-betrag ausweisart ausweistyp}} €