Skip to content

Commit 7231ce2

Browse files
committed
Refactor Gliederung email handling to domain; remove unused Keycloak service
- Deleted gliederungen.xlsx file from seeders. - Updated access.requestGliederungCreate.ts to replace email with domain for Gliederung contact. - Updated accountGliederungCreate.ts to replace email with domain for Gliederung contact. - Removed Keycloak service configuration from docker-compose.
1 parent d8dc223 commit 7231ce2

7 files changed

Lines changed: 7972 additions & 2022 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
Warnings:
3+
4+
- You are about to drop the column `email` on the `Gliederung` table. All the data in the column will be lost.
5+
6+
*/
7+
-- AlterTable
8+
ALTER TABLE "Gliederung" DROP COLUMN "email",
9+
ADD COLUMN "domain" TEXT;

apps/api/prisma/schema/Gliederung.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ model Gliederung {
22
id String @id @default(uuid(7))
33
name String
44
edv String @unique
5-
email String?
5+
domain String?
66
unterveranstaltungen Unterveranstaltung[]
77
personen Person[]
88
GliederungToAccount GliederungToAccount[]

apps/api/prisma/seeders/gliederungen.ts

Lines changed: 7954 additions & 2005 deletions
Large diffs are not rendered by default.
-14.6 KB
Binary file not shown.

apps/api/src/services/access/access.requestGliederungCreate.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ export const requestGliederungAccessCreateProcedure = defineProtectedMutateProce
3333
},
3434
select: {
3535
name: true,
36-
email: true,
36+
domain: true,
3737
},
3838
})
3939

40-
if (!gliederung.email) {
40+
if (!gliederung.domain) {
4141
throw new TRPCError({
4242
code: 'INTERNAL_SERVER_ERROR',
43-
message: `Die Gliederung ${gliederung.name} hat keine Kontaktadresse hinterlegt!`,
43+
message: `Die Gliederung ${gliederung.name} hat keine Domain hinterlegt!`,
4444
})
4545
}
4646

@@ -59,7 +59,7 @@ export const requestGliederungAccessCreateProcedure = defineProtectedMutateProce
5959
})
6060

6161
await sendMail({
62-
to: `${gliederung.email}`,
62+
to: `info@${gliederung.domain}`,
6363
subject: 'Zugriffsanfrage auf deine Gliederung',
6464
template: 'gliederung-access-request-info',
6565
categories: ['access', 'gliederung'],

apps/api/src/services/account/accountGliederungCreate.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const accountGliederungCreateProcedure = definePublicMutateProcedure({
1818
const gliederung = await prisma.gliederung.findUnique({
1919
where: {
2020
id: input.gliederungId,
21-
}
21+
},
2222
})
2323
if (gliederung === null) {
2424
throw new TRPCError({
@@ -42,10 +42,10 @@ export const accountGliederungCreateProcedure = definePublicMutateProcedure({
4242
})
4343
}
4444

45-
if (!gliederung.email) {
45+
if (!gliederung.domain) {
4646
throw new TRPCError({
4747
code: 'INTERNAL_SERVER_ERROR',
48-
message: `Die Gliederung ${gliederung.name} hat keine Kontaktadresse hinterlegt!`,
48+
message: `Die Gliederung ${gliederung.name} hat keine Domain hinterlegt!`,
4949
})
5050
}
5151

@@ -85,7 +85,7 @@ export const accountGliederungCreateProcedure = definePublicMutateProcedure({
8585

8686
await sendMailConfirmEmailRequest(accountData.email, accountData.activationToken)
8787
await sendMail({
88-
to: `${gliederung.email}`,
88+
to: `info@${gliederung.domain}`,
8989
subject: 'Zugriffsanfrage auf deine Gliederung',
9090
template: 'gliederung-access-request-info',
9191
categories: ['access', 'gliederung'],

docker-compose-services.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@ services:
1919
- meilisearch-data:/data.ms
2020
restart: unless-stopped
2121

22-
keycloak:
23-
image: quay.io/keycloak/keycloak:26.4.7
24-
command: start-dev
25-
environment:
26-
- KC_BOOTSTRAP_ADMIN_USERNAME=admin
27-
- KC_BOOTSTRAP_ADMIN_PASSWORD=admin
28-
- KC_HTTP_PORT=6060
29-
3022
volumes:
3123
postgres-data:
3224
admin-data:

0 commit comments

Comments
 (0)