Table of Contents

Class User

Namespace
GastroSky.Models
Assembly
GastroSky.Models.dll

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

string

Companies

The User's list of Company.

public ICollection<Company> Companies { get; set; }

Property Value

ICollection<Company>

CountryCodeISO

3-letter ISO country code of where the User lives.

[MaxLength(3)]
public string? CountryCodeISO { get; set; }

Property Value

string

CreationTimestampUTC

Unix-timestamp of when this User was first created.

public required long CreationTimestampUTC { get; set; }

Property Value

long

Email

The User's email address (this is also the username with which they login).

public required string Email { get; set; }

Property Value

string

ExpirationUTC

Unix-timestamp of when this User is set to expire. If null, the User does not expire.

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

long

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

bool

Language

The User's preferred Language.

public Language Language { get; set; }

Property Value

Language

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

string

Location

The address location (e.g. city name).

public string? Location { get; set; }

Property Value

string

Name

User name (ideally this is going to be first + last name, whitespace-separated).

public string? Name { get; set; }

Property Value

string

News

The news articles that this User is responsible for.

public ICollection<News>? News { get; set; }

Property Value

ICollection<News>

Orders

The Orders associated with this User.

public ICollection<Order>? Orders { get; set; }

Property Value

ICollection<Order>

PasswordHash

The User's hashed password.

public string? PasswordHash { get; set; }

Property Value

string

PepperBrand

The used pepper brand. Bad pepper can ruin good meat: one must be careful!

[ForeignKey("PepperBrandId")]
public PepperBrand? PepperBrand { get; set; }

Property Value

PepperBrand

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

string

Posts

The User's Posts.

public ICollection<Post>? Posts { get; set; }

Property Value

ICollection<Post>

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

string

TotpEnabled

Whether this User has 2FA enabled.

public bool TotpEnabled { get; }

Property Value

bool

TotpSecret

The User's TOTP-secret. Used for two-factor-authentication.

public string? TotpSecret { get; set; }

Property Value

string

UserClaims

The User's auth claims.

public ICollection<UserClaim>? UserClaims { get; set; }

Property Value

ICollection<UserClaim>

UserCompanies

The User's list of UserCompany.

public ICollection<UserCompany> UserCompanies { get; set; }

Property Value

ICollection<UserCompany>

UserSubscriptions

public ICollection<UserSubscription>? UserSubscriptions { get; set; }

Property Value

ICollection<UserSubscription>

WebsiteURL

The User's website URL (if they have one).

public string? WebsiteURL { get; set; }

Property Value

string

ZipCode

ZIP-code.

public string? ZipCode { get; set; }

Property Value

string

Methods

GetActiveSubscriptions()

public IEnumerable<UserSubscription>? GetActiveSubscriptions()

Returns

IEnumerable<UserSubscription>

GetInvites()

public IEnumerable<UserCompany> GetInvites()

Returns

IEnumerable<UserCompany>

GetJoinedCompanies()

public IEnumerable<Company> GetJoinedCompanies()

Returns

IEnumerable<Company>