Finished documentation

This commit is contained in:
2024-11-22 14:18:40 +01:00
parent 0c2c02136d
commit fee99c60b6
5 changed files with 98 additions and 32 deletions

71
docs/models.md Normal file
View File

@@ -0,0 +1,71 @@
# HopFrame base models
All models listed below are part of the core HopFrame components and accessible in all installation variations
> **Note:** All properties of the models that are `virtual` are relational properties and don't directly correspond to columns in the database.
## User
```csharp
public class User : IPermissionOwner {
public Guid Id { get; init; }
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public DateTime CreatedAt { get; set; }
public virtual List<Permission> Permissions { get; set; }
public virtual List<Token> Tokens { get; set; }
}
```
## PermissionGroup
```csharp
public class PermissionGroup : IPermissionOwner {
public string Name { get; init; }
public bool IsDefaultGroup { get; set; }
public string Description { get; set; }
public DateTime CreatedAt { get; set; }
public virtual List<Permission> Permissions { get; set; }
}
```
## Permission
```csharp
public class Permission {
public long Id { get; init; }
public string PermissionName { get; set; }
public DateTime GrantedAt { get; set; }
public virtual User User { get; set; }
public virtual PermissionGroup Group { get; set; }
}
```
## Token
```csharp
public class Token {
public int Type { get; set; }
public Guid Content { get; set; }
public DateTime CreatedAt { get; set; }
public virtual User Owner { get; set; }
}
```
## UserLogin
```csharp
public class UserLogin {
public string Email { get; set; }
public string Password { get; set; }
}
```
## UserRegister
```csharp
public class UserRegister {
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
}
```
## IPermissionOwner
```csharp
public interface IPermissionOwner;
```