Interface IUserRegistrationTokenRepository
Repository interface for managing user registration tokens
Namespace: OEMS.Core.Domain.RepoInterfaces
Assembly: OEMS.Core.dll
Syntax
public interface IUserRegistrationTokenRepository
Methods
CreateTokenAsync(UserRegistrationToken)
Creates a new user registration token
Declaration
Task<bool> CreateTokenAsync(UserRegistrationToken token)
Parameters
Type | Name | Description |
---|---|---|
UserRegistrationToken | token | The token entity to create |
Returns
Type | Description |
---|---|
Task<bool> | True if creation was successful, false otherwise |
DeleteAllForUserAsync(Guid)
Deletes all tokens for a specific user
Declaration
Task<int> DeleteAllForUserAsync(Guid userId)
Parameters
Type | Name | Description |
---|---|---|
Guid | userId | The user ID to delete tokens for |
Returns
Type | Description |
---|---|
Task<int> | Number of tokens deleted |
DeleteAsync(int)
Deletes a token by its ID
Declaration
Task<bool> DeleteAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | The token ID to delete |
Returns
Type | Description |
---|---|
Task<bool> | True if deletion was successful, false otherwise |
DeleteExpiredTokensAsync()
Deletes all expired tokens
Declaration
Task<int> DeleteExpiredTokensAsync()
Returns
Type | Description |
---|---|
Task<int> | Number of tokens deleted |
GetActiveTokensByOrganizationIdAsync(Guid, TokenType)
Gets all active tokens for a specific organization and token type
Declaration
Task<IEnumerable<UserRegistrationToken>> GetActiveTokensByOrganizationIdAsync(Guid organizationId, TokenType tokenType)
Parameters
Type | Name | Description |
---|---|---|
Guid | organizationId | The organization ID to find tokens for |
TokenType | tokenType | The type of token to find |
Returns
Type | Description |
---|---|
Task<IEnumerable<UserRegistrationToken>> | Collection of active token entities |
GetActiveTokensByUserIdAsync(Guid, TokenType)
Gets all active tokens for a specific user and token type
Declaration
Task<IEnumerable<UserRegistrationToken>> GetActiveTokensByUserIdAsync(Guid userId, TokenType tokenType)
Parameters
Type | Name | Description |
---|---|---|
Guid | userId | The user ID to find tokens for |
TokenType | tokenType | The type of token to find |
Returns
Type | Description |
---|---|
Task<IEnumerable<UserRegistrationToken>> | Collection of active token entities |
GetByIdAsync(int)
Gets a token by its ID
Declaration
Task<UserRegistrationToken> GetByIdAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
int | id | The token ID |
Returns
Type | Description |
---|---|
Task<UserRegistrationToken> | The matching token entity, or null if not found |
GetByTokenValueAsync(string)
Gets a token by its string value
Declaration
Task<UserRegistrationToken> GetByTokenValueAsync(string tokenValue)
Parameters
Type | Name | Description |
---|---|---|
string | tokenValue | The token string to find |
Returns
Type | Description |
---|---|
Task<UserRegistrationToken> | The matching token entity, or null if not found |
MarkAsUsedAsync(UserRegistrationToken)
Marks a token as used
Declaration
Task<bool> MarkAsUsedAsync(UserRegistrationToken token)
Parameters
Type | Name | Description |
---|---|---|
UserRegistrationToken | token | The token entity to update |
Returns
Type | Description |
---|---|
Task<bool> | True if update was successful, false otherwise |