Table of Contents

Class Post

Namespace
GastroSky.Models
Assembly
GastroSky.Models.dll

A post. Main domain model class for this project. Everything revolves around this.

[Table("Posts")]
[Index("Slug", new string[] { }, IsUnique = true)]
[Index("Category", new string[] { }, IsUnique = false)]
[Index("PublicationTimestampUTC", new string[] { "ArchivalTimestampUTC", "DeletionTimestampUTC" }, IsUnique = false)]
public class Post : ICloneable
Inheritance
Post
Implements
Inherited Members

Properties

Address

Physical address.

public string? Address { get; set; }

Property Value

string

AnnualRevenueBracket

Bracket in which the annual revenue of the business falls.

  • < 100'000
  • 100'000-200'000
  • 200'000-500'000
  • 500'000-750'000
  • 750'000-1'000'000
  • 1'000'000-2'000'000
  • > 2'000'000
public PostAnnualRevenueBracket? AnnualRevenueBracket { get; set; }

Property Value

PostAnnualRevenueBracket?

ArchivalTimestampUTC

If this is not null, the post is archived. This wins against PublicationTimestampUTC.

public long? ArchivalTimestampUTC { get; set; }

Property Value

long?

AuthorCompany

Company who created this Post.

public Company? AuthorCompany { get; set; }

Property Value

Company

AuthorCompanyId

Id of the Company who created this Post.

[ForeignKey("AuthorCompany")]
public long? AuthorCompanyId { get; set; }

Property Value

long?

AuthorUser

User who created this Post.

[ForeignKey("AuthorUserId")]
public User? AuthorUser { get; set; }

Property Value

User

AuthorUserId

Id of the User who created this Post.

public required long AuthorUserId { get; set; }

Property Value

long

AvailableFromUTC

The date from when the Post'ed object is available

public long? AvailableFromUTC { get; set; }

Property Value

long?

Boosters

The Boosters that have been applied to this Post.

public ICollection<Booster> Boosters { get; set; }

Property Value

ICollection<Booster>

BusinessCreationDateUTC

The date of when the Post'ed business was created

public long? BusinessCreationDateUTC { get; set; }

Property Value

long?

BusinessLegalForm

The legal form of the Post'ed business

public BusinessLegalForm? BusinessLegalForm { get; set; }

Property Value

BusinessLegalForm?

Category

Post category.

public required PostCategory Category { get; set; }

Property Value

PostCategory

ChosenIllustration

Illustration chosen from a preset of images

public int? ChosenIllustration { get; set; }

Property Value

int?

CompanySubscription

[ForeignKey("PublishedWithCompanySubscriptionId")]
public CompanySubscription? CompanySubscription { get; set; }

Property Value

CompanySubscription

ConstructionYear

The year of the Post'ed object's construction.

public short? ConstructionYear { get; set; }

Property Value

short?

ContactEmail

Post contact email address.

public string? ContactEmail { get; set; }

Property Value

string

ContactName

Post contact name and last name.

public string? ContactName { get; set; }

Property Value

string

ContactPhone

Post contact phone number.

public string? ContactPhone { get; set; }

Property Value

string

Remarks

This is a premium feature.

ContactWebsiteURL

Post contact website URL.

public string? ContactWebsiteURL { get; set; }

Property Value

string

Remarks

This is a premium feature.

CountryCodeISO

3-letter ISO country code.

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

Property Value

string

CreationTimestampUTC

Unix-timestamp of when this Post was created.

public required long CreationTimestampUTC { get; set; }

Property Value

long

Currency

ISO 4217 string of the currency this Post is published under. E.g. CHF

[MaxLength(4)]
public string Currency { get; set; }

Property Value

string

DeletionTimestampUTC

If this is not null, the post was deleted. This wins against both ArchivalTimestampUTC and PublicationTimestampUTC.

public long? DeletionTimestampUTC { get; set; }

Property Value

long?

DescriptionMarkdownTranslationsJson

Translations payload in JSON format for the Post's description markdown.

[Column(TypeName = "jsonb")]
public TranslatableField? DescriptionMarkdownTranslationsJson { get; set; }

Property Value

TranslatableField

ExternalSeatCount

External seat count (if applicable, e.g. for restaurants and bars with tables and chairs).

public int? ExternalSeatCount { get; set; }

Property Value

int?

ExternalSurfaceSquareMeters

External surface area in square meters.

public int? ExternalSurfaceSquareMeters { get; set; }

Property Value

int?

HasGarden

Whether the Post'ed object has a garden or not

public bool? HasGarden { get; set; }

Property Value

bool?

HideContactData

Whether the Post's contact fields should be hidden or not

public bool? HideContactData { get; set; }

Property Value

bool?

Id

DB primary key. Sequential integer. Meaningless without a Slug.

[Key]
public long Id { get; set; }

Property Value

long

InternalSeatCount

Internal seat count (if applicable, e.g. for restaurants and bars with tables and chairs).

public int? InternalSeatCount { get; set; }

Property Value

int?

InternalSurfaceSquareMeters

Internal surface area in square meters.

public int? InternalSurfaceSquareMeters { get; set; }

Property Value

int?

ItemTypes

ItemType associated with this Post.

public required ItemType[] ItemTypes { get; set; }

Property Value

ItemType[]

LastModificationTimestampUTC

Unix-timestamp of when the Post was last modified.

public long? LastModificationTimestampUTC { get; set; }

Property Value

long?

LastRenovationYear

The year of the Post'ed object's last renovation.

public short? LastRenovationYear { get; set; }

Property Value

short?

Location

[ForeignKey("LocationId")]
public Location? Location { get; set; }

Property Value

Location

LocationId

public long? LocationId { get; set; }

Property Value

long?

MainPostImage

Main image of this Post.

public PostImage? MainPostImage { get; set; }

Property Value

PostImage

MainPostImageGuid

ID of main image of this Post.

[ForeignKey("MainPostImage")]
public Guid? MainPostImageGuid { get; set; }

Property Value

Guid?

MonthlyRentPriceSubunit

Sub-unit of the monthly rent price. E.g. 1 CHF would be 100 sub-units. This is to remove the floating point and maintain precision and performance. It is even required to be this way by many payment gateway APIs such as Stripe.

public long? MonthlyRentPriceSubunit { get; set; }

Property Value

long?

NumberOfBedrooms

How many bedrooms are in the Post'ed object

public int? NumberOfBedrooms { get; set; }

Property Value

int?

NumberOfBeds

How many beds are in the Post'ed object

public int? NumberOfBeds { get; set; }

Property Value

int?

NumberOfEmployees

How many employees are working in the Post'ed object ex. 1 employee at 100% and 2 employees at 50% = 2 employees

public int? NumberOfEmployees { get; set; }

Property Value

int?

NumberOfFloors

How many floors are in the Post'ed object

public int? NumberOfFloors { get; set; }

Property Value

int?

NumberOfParkingLots

How many parking lots are available for the Post'ed object

public int? NumberOfParkingLots { get; set; }

Property Value

int?

NumberOfRooms

How many rooms are in the Post'ed object

public int? NumberOfRooms { get; set; }

Property Value

int?

NumberOfTerraces

How many terraces are available for the Post'ed object

public int? NumberOfTerraces { get; set; }

Property Value

int?

PostBoosters

The Boosters that have been applied to this Post.

public ICollection<PostBooster> PostBoosters { get; set; }

Property Value

ICollection<PostBooster>

PostImages

Images that were uploaded in the context of this Post.

public ICollection<PostImage>? PostImages { get; set; }

Property Value

ICollection<PostImage>

PostPremiumUpgrades

Premium upgrades for this Post.

public ICollection<PostPremiumUpgrade> PostPremiumUpgrades { get; set; }

Property Value

ICollection<PostPremiumUpgrade>

PublicationTimestampUTC

If this is null the post is a draft.

public long? PublicationTimestampUTC { get; set; }

Property Value

long?

PublishedWithCompanySubscriptionId

public long? PublishedWithCompanySubscriptionId { get; set; }

Property Value

long?

PublishedWithUserSubscriptionId

public long? PublishedWithUserSubscriptionId { get; set; }

Property Value

long?

SalePriceSubunit

Sub-unit of the sale price. E.g. 1 CHF would be 100 sub-units. This is to remove the floating point and maintain precision and performance. It is even required to be this way by many payment gateway APIs such as Stripe.

public long? SalePriceSubunit { get; set; }

Property Value

long?

Slug

Uniquely identifying slug string. Can be custom-defined for premium posts.

[MaxLength(8)]
public required string Slug { get; set; }

Property Value

string

SubtitleTranslationsJson

Translations payload in JSON format for thePost's subtitle.

[Column(TypeName = "jsonb")]
public required TranslatableField SubtitleTranslationsJson { get; set; }

Property Value

TranslatableField

TitleTranslationsJson

Translations payload in JSON format for thePost's title.

[Column(TypeName = "jsonb")]
public required TranslatableField TitleTranslationsJson { get; set; }

Property Value

TranslatableField

UserFavorites

UserFavorites associated with this Post.

public ICollection<UserFavorite> UserFavorites { get; set; }

Property Value

ICollection<UserFavorite>

UserInteractions

UserPostInteractions associated with this Post.

public ICollection<UserPostInteraction> UserInteractions { get; set; }

Property Value

ICollection<UserPostInteraction>

UserSubscription

[ForeignKey("PublishedWithUserSubscriptionId")]
public UserSubscription? UserSubscription { get; set; }

Property Value

UserSubscription

VideoURL

Link to video related to the object.

public string? VideoURL { get; set; }

Property Value

string

Methods

Clone()

Creates a new object that is a copy of the current instance.

public object Clone()

Returns

object

A new object that is a copy of this instance.

GetExpirationTimestampUTC()

public long GetExpirationTimestampUTC()

Returns

long

HasGoldenBorder()

Checks whether this Post has a golden border booster

public bool HasGoldenBorder()

Returns

bool

IsPremium()

Checks whether this Post is premium-allocated or not.

public bool IsPremium()

Returns

bool

IsPublishable()

Checks whether this Post is publishable or not.

public bool IsPublishable()

Returns

bool