initial commit
This commit is contained in:
119
docs/architecture/4-data-models.md
Normal file
119
docs/architecture/4-data-models.md
Normal file
@@ -0,0 +1,119 @@
|
||||
# 4. Data Models
|
||||
|
||||
## Entity Relationship Diagram
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
||||
│ User │ │ Account │ │ Character │
|
||||
├─────────────┤ ├─────────────┤ ├─────────────┤
|
||||
│ id │ │ id │ │ id │
|
||||
│ email │──┐ │ name │──┐ │ name │
|
||||
│ password │ │ │ userId ◄─┘ │ │ level │
|
||||
│ createdAt │ └───►│ createdAt │ └───►│ classId │
|
||||
│ updatedAt │ │ updatedAt │ │ serverId │
|
||||
└─────────────┘ └─────────────┘ │ accountId ◄─┘
|
||||
│ createdAt │
|
||||
│ updatedAt │
|
||||
└──────┬──────┘
|
||||
│
|
||||
┌────────────────────────────┼────────────────────────────┐
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
||||
│ Team │ │TeamMember │ │ CharProgress│
|
||||
├─────────────┤ ├─────────────┤ ├─────────────┤
|
||||
│ id │◄─────────────│ teamId │ │ id │
|
||||
│ name │ │ characterId │◄─────────────│ characterId │
|
||||
│ type │ │ joinedAt │ │ progressId │
|
||||
│ userId │ └─────────────┘ │ completed │
|
||||
│ createdAt │ │ completedAt │
|
||||
│ updatedAt │ └─────────────┘
|
||||
└─────────────┘ │
|
||||
│
|
||||
▼
|
||||
┌─────────────┐
|
||||
│ Progression │
|
||||
├─────────────┤
|
||||
│ id │
|
||||
│ name │
|
||||
│ type │
|
||||
│ category │
|
||||
│ dofusDbId │
|
||||
└─────────────┘
|
||||
```
|
||||
|
||||
## Core Entities
|
||||
|
||||
### User
|
||||
```typescript
|
||||
interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
passwordHash: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
```
|
||||
|
||||
### Account
|
||||
```typescript
|
||||
interface Account {
|
||||
id: string;
|
||||
name: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
```
|
||||
|
||||
### Character
|
||||
```typescript
|
||||
interface Character {
|
||||
id: string;
|
||||
name: string;
|
||||
level: number;
|
||||
classId: number;
|
||||
className: string;
|
||||
serverId: number;
|
||||
serverName: string;
|
||||
accountId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
```
|
||||
|
||||
### Team
|
||||
```typescript
|
||||
interface Team {
|
||||
id: string;
|
||||
name: string;
|
||||
type: 'MAIN' | 'SECONDARY' | 'CUSTOM';
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
```
|
||||
|
||||
### Progression
|
||||
```typescript
|
||||
interface Progression {
|
||||
id: string;
|
||||
name: string;
|
||||
type: 'QUEST' | 'DUNGEON' | 'ACHIEVEMENT' | 'DOFUS';
|
||||
category: string;
|
||||
dofusDbId: number | null;
|
||||
}
|
||||
```
|
||||
|
||||
### CharacterProgression
|
||||
```typescript
|
||||
interface CharacterProgression {
|
||||
id: string;
|
||||
characterId: string;
|
||||
progressionId: string;
|
||||
completed: boolean;
|
||||
completedAt: Date | null;
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user