Class Post
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
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
ArchivalTimestampUTC
If this is not null, the post is archived. This wins against PublicationTimestampUTC.
public long? ArchivalTimestampUTC { get; set; }
Property Value
- long?
AuthorCompany
public Company? AuthorCompany { get; set; }
Property Value
AuthorCompanyId
[ForeignKey("AuthorCompany")]
public long? AuthorCompanyId { get; set; }
Property Value
- long?
AuthorUser
[ForeignKey("AuthorUserId")]
public User? AuthorUser { get; set; }
Property Value
AuthorUserId
public required long AuthorUserId { get; set; }
Property Value
AvailableFromUTC
The date from when the Post'ed object is available
public long? AvailableFromUTC { get; set; }
Property Value
- long?
Boosters
public ICollection<Booster> Boosters { get; set; }
Property Value
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
Category
Post category.
public required PostCategory Category { get; set; }
Property Value
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
ConstructionYear
The year of the Post'ed object's construction.
public short? ConstructionYear { get; set; }
Property Value
ContactEmail
Post contact email address.
public string? ContactEmail { get; set; }
Property Value
ContactName
Post contact name and last name.
public string? ContactName { get; set; }
Property Value
ContactPhone
Post contact phone number.
public string? ContactPhone { get; set; }
Property Value
Remarks
This is a premium feature.
ContactWebsiteURL
Post contact website URL.
public string? ContactWebsiteURL { get; set; }
Property Value
Remarks
This is a premium feature.
CountryCodeISO
3-letter ISO country code.
[MaxLength(3)]
public string? CountryCodeISO { get; set; }
Property Value
CreationTimestampUTC
Unix-timestamp of when this Post was created.
public required long CreationTimestampUTC { get; set; }
Property Value
Currency
ISO 4217 string of the currency this Post is published under. E.g. CHF
[MaxLength(4)]
public string Currency { get; set; }
Property Value
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
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
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
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
Location
[ForeignKey("LocationId")]
public Location? Location { get; set; }
Property Value
LocationId
public long? LocationId { get; set; }
Property Value
- long?
MainPostImage
Main image of this Post.
public PostImage? MainPostImage { get; set; }
Property Value
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
public ICollection<PostBooster> PostBoosters { get; set; }
Property Value
PostImages
Images that were uploaded in the context of this Post.
public ICollection<PostImage>? PostImages { get; set; }
Property Value
PostPremiumUpgrades
Premium upgrades for this Post.
public ICollection<PostPremiumUpgrade> PostPremiumUpgrades { get; set; }
Property Value
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
SubtitleTranslationsJson
Translations payload in JSON format for thePost's subtitle.
[Column(TypeName = "jsonb")]
public required TranslatableField SubtitleTranslationsJson { get; set; }
Property Value
TitleTranslationsJson
Translations payload in JSON format for thePost's title.
[Column(TypeName = "jsonb")]
public required TranslatableField TitleTranslationsJson { get; set; }
Property Value
UserFavorites
UserFavorites associated with this Post.
public ICollection<UserFavorite> UserFavorites { get; set; }
Property Value
UserInteractions
UserPostInteractions associated with this Post.
public ICollection<UserPostInteraction> UserInteractions { get; set; }
Property Value
UserSubscription
[ForeignKey("PublishedWithUserSubscriptionId")]
public UserSubscription? UserSubscription { get; set; }
Property Value
VideoURL
Link to video related to the object.
public string? VideoURL { get; set; }
Property Value
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
HasGoldenBorder()
Checks whether this Post has a golden border booster
public bool HasGoldenBorder()
Returns
IsPremium()
Checks whether this Post is premium-allocated or not.
public bool IsPremium()
Returns
IsPublishable()
Checks whether this Post is publishable or not.
public bool IsPublishable()