feat: Adds some documenation comments
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import Dependencies
|
||||
import Foundation
|
||||
|
||||
/// Represents a user database model.
|
||||
///
|
||||
/// User's are who can login to the system and generate purchase orders, manage
|
||||
/// employees, vendors, etc.
|
||||
///
|
||||
public struct User: Codable, Equatable, Identifiable, Sendable {
|
||||
|
||||
public var id: UUID
|
||||
@@ -26,6 +31,7 @@ public struct User: Codable, Equatable, Identifiable, Sendable {
|
||||
|
||||
public extension User {
|
||||
|
||||
/// Represents the fields needed to generate a new user in the database.
|
||||
struct Create: Codable, Sendable, Equatable {
|
||||
public let username: String
|
||||
public let email: String
|
||||
@@ -45,6 +51,7 @@ public extension User {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the fields needed for new user to login.
|
||||
struct Login: Codable, Sendable, Equatable {
|
||||
public let username: String?
|
||||
public let email: String?
|
||||
@@ -61,6 +68,7 @@ public extension User {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the fields needed to reset the password of a user.
|
||||
struct ResetPassword: Codable, Equatable, Sendable {
|
||||
public let password: String
|
||||
public let confirmPassword: String
|
||||
@@ -74,6 +82,8 @@ public extension User {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a user token that can be used to authenticate a user, typically
|
||||
/// used for interacting with api routes remotely.
|
||||
struct Token: Codable, Equatable, Identifiable, Sendable {
|
||||
public let id: UUID
|
||||
public let userID: User.ID
|
||||
@@ -90,6 +100,7 @@ public extension User {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the fields needed to update a user's attributes in the database.
|
||||
struct Update: Codable, Equatable, Sendable {
|
||||
public let username: String?
|
||||
public let email: String?
|
||||
|
||||
Reference in New Issue
Block a user