woms 3.0
This commit is contained in:
195
WSID_QUICKSTART.md
Normal file
195
WSID_QUICKSTART.md
Normal file
@@ -0,0 +1,195 @@
|
||||
# WSID System - Quick Start Guide
|
||||
|
||||
## 🚀 Schnellstart in 5 Minuten
|
||||
|
||||
### Schritt 1: Collection in Appwrite erstellen
|
||||
|
||||
1. Gehe zu **https://appwrite.webklar.com**
|
||||
2. Login mit deinen Credentials
|
||||
3. Öffne Projekt **woms**
|
||||
4. Gehe zu **Databases** → **woms-database**
|
||||
5. Klicke **Create Collection**
|
||||
- Collection ID: `worksheets`
|
||||
- Name: `Work Sheets`
|
||||
6. Klicke **Create**
|
||||
|
||||
### Schritt 2: Attribute hinzufügen
|
||||
|
||||
Klicke auf **Attributes** und füge folgende Attribute hinzu:
|
||||
|
||||
#### Required Attributes (Pflicht):
|
||||
|
||||
```
|
||||
1. wsid | String | Size: 10 | Required: ✓ | Default: -
|
||||
2. woid | String | Size: 10 | Required: ✓ | Default: -
|
||||
3. workorderId | String | Size: 50 | Required: ✓ | Default: -
|
||||
4. employeeId | String | Size: 50 | Required: ✓ | Default: -
|
||||
5. employeeName | String | Size: 255 | Required: ✓ | Default: -
|
||||
6. serviceType | String | Size: 50 | Required: ✓ | Default: Remote
|
||||
7. oldStatus | String | Size: 50 | Required: ✓ | Default: -
|
||||
8. newStatus | String | Size: 50 | Required: ✓ | Default: -
|
||||
9. totalTime | Integer | - | Required: ✓ | Default: 0
|
||||
10. startDate | String | Size: 50 | Required: ✓ | Default: -
|
||||
11. endDate | String | Size: 50 | Required: ✓ | Default: -
|
||||
12. details | String | Size: 10000 | Required: ✓ | Default: -
|
||||
13. createdAt | DateTime| - | Required: - | Default: -
|
||||
```
|
||||
|
||||
#### Optional Attributes (Optional):
|
||||
|
||||
```
|
||||
14. employeeShort | String | Size: 10 | Required: - | Default: -
|
||||
15. oldResponseLevel | String | Size: 50 | Required: - | Default: -
|
||||
16. newResponseLevel | String | Size: 50 | Required: - | Default: -
|
||||
17. startTime | String | Size: 10 | Required: - | Default: -
|
||||
18. endTime | String | Size: 10 | Required: - | Default: -
|
||||
19. isComment | Boolean | - | Required: - | Default: false
|
||||
```
|
||||
|
||||
### Schritt 3: Permissions setzen
|
||||
|
||||
1. Gehe zu **Settings** → **Permissions**
|
||||
2. Setze folgende Berechtigungen:
|
||||
|
||||
**Read Access:**
|
||||
- ✅ `Users` (All users)
|
||||
|
||||
**Create Access:**
|
||||
- ✅ `Users` (All users)
|
||||
|
||||
**Update Access:**
|
||||
- ✅ `Users` (All users)
|
||||
|
||||
**Delete Access:**
|
||||
- ❌ Keine (für Audit Trail)
|
||||
|
||||
### Schritt 4: Indexes erstellen
|
||||
|
||||
Gehe zu **Indexes** und erstelle:
|
||||
|
||||
1. **woid_index**
|
||||
- Key: `woid`
|
||||
- Type: `key`
|
||||
- Order: `DESC`
|
||||
|
||||
2. **employee_index**
|
||||
- Key: `employeeId`
|
||||
- Type: `key`
|
||||
- Order: `DESC`
|
||||
|
||||
3. **date_index**
|
||||
- Key: `startDate`
|
||||
- Type: `key`
|
||||
- Order: `DESC`
|
||||
|
||||
### Schritt 5: Collection ID kopieren
|
||||
|
||||
1. Gehe zurück zur Collection-Übersicht
|
||||
2. Kopiere die **Collection ID** (z.B. `694xyz123abc456def789`)
|
||||
|
||||
### Schritt 6: Collection ID im Code eintragen
|
||||
|
||||
Öffne `src/lib/appwrite.js` und trage die Collection ID ein:
|
||||
|
||||
```javascript
|
||||
export const COLLECTIONS = {
|
||||
WORKORDERS: '6943bf7d001901baa60c',
|
||||
CUSTOMERS: '694bd1fb002b2e583d13',
|
||||
EMPLOYEES: '695280510031c6c6153b',
|
||||
WORKSHEETS: '694xyz123abc456def789', // ← Hier deine Collection ID eintragen!
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
### Schritt 7: Optional - WSID aus workorders entfernen
|
||||
|
||||
Falls du bereits ein `wsid`-Attribut in der `workorders` Collection hast:
|
||||
|
||||
1. Gehe zu **workorders** Collection
|
||||
2. Gehe zu **Attributes**
|
||||
3. Lösche Attribut `wsid` (falls vorhanden)
|
||||
|
||||
⚠️ **Hinweis:** Stelle sicher, dass du ein Backup hast!
|
||||
|
||||
### Schritt 8: Anwendung neu starten
|
||||
|
||||
```bash
|
||||
# Terminal öffnen
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### Schritt 9: Testen!
|
||||
|
||||
1. Öffne die Anwendung im Browser
|
||||
2. Gehe zu **Tickets**
|
||||
3. Öffne ein Ticket (Lock-Icon klicken)
|
||||
4. Klicke **"Add Worksheet"**
|
||||
5. Fülle das Formular aus:
|
||||
- Service Type: `Remote`
|
||||
- New Status: `Occupied`
|
||||
- Start Time: `1000`
|
||||
- End Time: `1030`
|
||||
- Details: `Test-Worksheet`
|
||||
6. Klicke **"CREATE NOW"**
|
||||
|
||||
**Erwartetes Ergebnis:**
|
||||
- WSID sollte `100000` sein
|
||||
- Worksheet sollte in der Liste erscheinen
|
||||
- Statistiken sollten angezeigt werden
|
||||
|
||||
---
|
||||
|
||||
## ✅ Fertig!
|
||||
|
||||
Das WSID-System ist jetzt einsatzbereit!
|
||||
|
||||
### Nächste Schritte:
|
||||
|
||||
- Erstelle weitere Worksheets
|
||||
- Prüfe Statistiken
|
||||
- Teste Status-Änderungen
|
||||
- Prüfe Zeitaggregation
|
||||
|
||||
---
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Problem: "Collection nicht gefunden"
|
||||
|
||||
**Lösung:**
|
||||
- Überprüfe Collection ID in `src/lib/appwrite.js`
|
||||
- Stelle sicher, dass Collection wirklich existiert
|
||||
|
||||
### Problem: "Unauthorized"
|
||||
|
||||
**Lösung:**
|
||||
- Überprüfe Permissions in Appwrite
|
||||
- `Users` muss Read/Create Zugriff haben
|
||||
|
||||
### Problem: "Attribute nicht gefunden"
|
||||
|
||||
**Lösung:**
|
||||
- Überprüfe, ob alle Required Attributes erstellt wurden
|
||||
- Attribute-Namen müssen exakt übereinstimmen (case-sensitive!)
|
||||
|
||||
### Problem: "WSID wird nicht generiert"
|
||||
|
||||
**Lösung:**
|
||||
- Überprüfe Browser-Konsole auf Fehler
|
||||
- Stelle sicher, dass `wsid` Attribut existiert
|
||||
- Überprüfe, ob Collection ID korrekt ist
|
||||
|
||||
---
|
||||
|
||||
## 📚 Weitere Dokumentation
|
||||
|
||||
- **Detaillierte Setup-Anleitung:** `WORKSHEETS_COLLECTION_SETUP.md`
|
||||
- **Implementierungs-Details:** `WSID_IMPLEMENTATION_SUMMARY.md`
|
||||
- **Appwrite Setup:** `APPWRITE_SETUP.md`
|
||||
|
||||
---
|
||||
|
||||
## 🎉 Viel Erfolg!
|
||||
|
||||
Bei Fragen: Siehe ausführliche Dokumentation oder Code-Kommentare.
|
||||
|
||||
Reference in New Issue
Block a user