Class User
A GastroSky user account.
[Table("Users")]
[Index("Slug", new string[] { }, IsUnique = true)]
[Index("Email", new string[] { }, IsUnique = true)]
public class User
- Inheritance
-
User
- Inherited Members
Properties
Address
The User's address (street name + house nr.)
public string? Address { get; set; }
Property Value
Companies
public ICollection<Company> Companies { get; set; }
Property Value
CountryCodeISO
3-letter ISO country code of where the User lives.
[MaxLength(3)]
public string? CountryCodeISO { get; set; }
Property Value
CreationTimestampUTC
Unix-timestamp of when this User was first created.
public required long CreationTimestampUTC { get; set; }
Property Value
The User's email address (this is also the username with which they login).
public required string Email { get; set; }
Property Value
ExpirationUTC
public long? ExpirationUTC { get; set; }
Property Value
- long?
Id
Meaningless sequential integer that serves purely as a DB primary key.
[Key]
public long Id { get; set; }
Property Value
IsAdmin
Is this User an admin? Typically, only devs and GastroSky management employees will have this set to true.
public bool IsAdmin { get; set; }
Property Value
Language
public Language Language { get; set; }
Property Value
LastLoginTimestampUTC
Unix-timestamp of when this User last logged in.
public long? LastLoginTimestampUTC { get; set; }
Property Value
- long?
LastModificationTimestampUTC
Unix-timestamp of when this User's account details were last modified.
public long? LastModificationTimestampUTC { get; set; }
Property Value
- long?
LastPasswordModificationTimestampUTC
Unix-timestamp of when this User's password was last modified.
public long? LastPasswordModificationTimestampUTC { get; set; }
Property Value
- long?
LastTotp
The last TOTP that was successfully used for login.
public string? LastTotp { get; set; }
Property Value
Location
The address location (e.g. city name).
public string? Location { get; set; }
Property Value
Name
User name (ideally this is going to be first + last name, whitespace-separated).
public string? Name { get; set; }
Property Value
News
The news articles that this User is responsible for.
public ICollection<News>? News { get; set; }
Property Value
Orders
public ICollection<Order>? Orders { get; set; }
Property Value
PasswordHash
The User's hashed password.
public string? PasswordHash { get; set; }
Property Value
PepperBrand
The used pepper brand. Bad pepper can ruin good meat: one must be careful!
[ForeignKey("PepperBrandId")]
public PepperBrand? PepperBrand { get; set; }
Property Value
PepperBrandId
ID of the pepper brand. Can't wait for the spice!
public byte? PepperBrandId { get; set; }
Property Value
- byte?
Phone
Phone number.
public string? Phone { get; set; }
Property Value
Posts
public ICollection<Post>? Posts { get; set; }
Property Value
ProfilePictureBytes
Profile picture bytes. Could be PNG, could be JPG, could be anything. Client implementation decides. The only important thing to keep in mind here is that response DTO's (and requests too) encode this as Base64!
[NotMapped]
public byte[]? ProfilePictureBytes { get; set; }
Property Value
- byte[]
ProfilePictureFileGuid
Remote file access token of the User's profile picture. Could be PNG, could be JPG, could be anything.
public Guid? ProfilePictureFileGuid { get; set; }
Property Value
- Guid?
Remarks
Client implementation decides. The only important thing to keep in mind here is that response DTO's (and requests too) encode this as Base64!
Slug
Unique identifier.
[MaxLength(8)]
public required string Slug { get; set; }
Property Value
TotpEnabled
Whether this User has 2FA enabled.
public bool TotpEnabled { get; }
Property Value
TotpSecret
The User's TOTP-secret. Used for two-factor-authentication.
public string? TotpSecret { get; set; }
Property Value
UserClaims
The User's auth claims.
public ICollection<UserClaim>? UserClaims { get; set; }
Property Value
UserCompanies
The User's list of UserCompany.
public ICollection<UserCompany> UserCompanies { get; set; }
Property Value
UserSubscriptions
The User's Subscriptions.
public ICollection<UserSubscription>? UserSubscriptions { get; set; }
Property Value
WebsiteURL
The User's website URL (if they have one).
public string? WebsiteURL { get; set; }
Property Value
ZipCode
ZIP-code.
public string? ZipCode { get; set; }
Property Value
Methods
GetActiveSubscriptions()
public IEnumerable<UserSubscription>? GetActiveSubscriptions()
Returns
GetInvites()
public IEnumerable<UserCompany> GetInvites()
Returns
GetJoinedCompanies()
public IEnumerable<Company> GetJoinedCompanies()