Files
Webklar-Kundenbereich/APPWRITE_SCHEMA.md
2026-05-22 23:51:20 +02:00

82 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Appwrite Schema Kundenportal (woms-database)
**Nur diese Datenbank** keine separate Portal-Datenbank (`appwrite.webklar.com` / Legacy-IDs wie `6943bf0e0003291f8c35` werden nicht verwendet).
Endpoint: `https://ticket.webklar.com/v1`
Project ID: `6a1058610003c5a13a05`
Database ID: **`woms-database`** (fest im Code)
Alle Collections liegen in `woms-database`. **Read/Create/Update/Delete** nur für API-Key-Rolle (Server) und Admin-Team. Kein `Any`-Read auf Kundendaten.
---
## customers (erweitern)
Bestehende Felder beibehalten. Zusätzlich:
| Attribut | Typ | Required | Index |
|----------|-----|----------|-------|
| companyName | string (255) | nein | |
| portalAccessEnabled | boolean | nein | |
| appwriteUserId | string (64) | nein | unique |
| customerStatus | string (50) | nein | |
| notes | string (5000) | nein | |
| createdAt | datetime | nein | |
| updatedAt | datetime | nein | |
---
## customerPortalAccess (neu)
Collection ID: `customerPortalAccess`
| Attribut | Typ | Required | Index |
|----------|-----|----------|-------|
| customerId | string (64) | ja | |
| enabled | boolean | ja | |
| passwordSet | boolean | nein | |
| appwriteUserId | string (64) | nein | |
| lastLoginAt | datetime | nein | |
Index: `customerId`, `appwriteUserId`
---
## websiteProjects (neu)
Collection ID: `websiteProjects`
| Attribut | Typ | Required | Index |
|----------|-----|----------|-------|
| customerId | string (64) | ja | ja |
| ticketId | string (64) | nein | |
| projectName | string (255) | ja | |
| templateName | string (255) | nein | |
| giteaRepoUrl | string (512) | nein | |
| giteaRepoName | string (255) | nein | |
| repoFullName | string (255) | nein | unique |
| subdomain | string (128) | nein | unique |
| previewUrl | string (512) | nein | |
| liveDomain | string (255) | nein | |
| status | string (50) | nein | |
| provisioningStatus | string (50) | nein | |
| createdAt | datetime | nein | |
| updatedAt | datetime | nein | |
---
## portalFeatures (neu)
Collection ID: `portalFeatures`
| Attribut | Typ | Required | Index |
|----------|-----|----------|-------|
| customerId | string (64) | ja | ja |
| projectId | string (64) | nein | |
| featureKey | string (128) | ja | |
| enabled | boolean | ja | |
| unlockedByPurchase | boolean | nein | |
| purchaseStatus | string (50) | nein | |
Index: `customerId`, `projectId`