Table of Contents

Class Order

Namespace
GastroSky.Models
Assembly
GastroSky.Models.dll

An order placed via the Gastrosky website.

[Table("Orders")]
[Index("Slug", new string[] { }, IsUnique = true)]
[Index("Guid", new string[] { }, IsUnique = true)]
[Index("TimestampUTC", new string[] { }, IsUnique = false)]
[Index("FulfillmentUTC", new string[] { }, IsUnique = false)]
[Index("FullPaymentUTC", new string[] { }, IsUnique = false)]
public class Order
Inheritance
Order
Inherited Members

Properties

Address

Customer's address.

public string? Address { get; set; }

Property Value

string

BusinessIdentificationNumber

E.g. CHE-000.000.000

public string? BusinessIdentificationNumber { get; set; }

Property Value

string

Company

Optional company with which this order is associated.

[ForeignKey("CompanyId")]
public Company? Company { get; set; }

Property Value

Company

CompanyId

ID of the user with which this order is associated.

public long? CompanyId { get; set; }

Property Value

long?

CompanyName

Customer company name. Full (including legal form suffix).

public string? CompanyName { get; set; }

Property Value

string

CountryCodeISO

Customer's country ISO code.

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

Property Value

string

Currency

The currency that was used (that the order was paid in or needs to be paid in).

Changing the currency of an existing (pending) order is not possible: create a new order instead!
[MaxLength(4)]
public required string Currency { get; set; }

Property Value

string

Remarks

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

DateOfBirth

Customer's date of birth.

public DateOnly? DateOfBirth { get; set; }

Property Value

DateOnly?

Email

Email address of the customer with which this Order was placed.

public required string Email { get; set; }

Property Value

string

FirstName

First name of the customer.

public string? FirstName { get; set; }

Property Value

string

FulfillmentUTC

If and when this Order was fulfilled by the backend.

This is null from the very first moment of order placement until shortly after successful fulfillment.

E.g. if an order needs to be delivered physically, set this to the unix-timestamp when the parcel was handed over to the logistics partner company, or if the order requires the Gastrosky backend to perform some action on the user's behalf (for instance updating some columns in the DB), set this to the unix-timestamp of when that was done.
public long? FulfillmentUTC { get; set; }

Property Value

long?

FullPaymentUTC

If this Order has had technical difficulties or is still pending/awaiting payment, FullPaymentUTC is null; else (if it has been paid in full by the customer) true.

public long? FullPaymentUTC { get; set; }

Property Value

long?

Guid

Globally-unique identifier associated with this Order. Can be used for anonymous access (therefore needs to be kept secret and only be returned in response DTOs meant for Gastrosky admin accounts or in the email that goes out to the customer).

public required Guid Guid { get; set; }

Property Value

Guid

Id

Sequential integer primary key.

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

Property Value

long

Language

The customer's preferred Language.

public required Language Language { get; set; }

Property Value

Language

LastName

Last name of the customer.

public string? LastName { get; set; }

Property Value

string

Location

Customer's location name/city name/town name/village name.

public string? Location { get; set; }

Property Value

string

Message

The (optional) text message attachment from the customer.

public string? Message { get; set; }

Property Value

string

OrderedProducts

The Products that were purchased in this Order.

public ICollection<OrderedProduct> OrderedProducts { get; set; }

Property Value

ICollection<OrderedProduct>

PaymentData

Additional payment-related data that helps identifying the payment on the PSP's side.

In case of cryptocurrency payments, this is gonna be the address to which the amount should be paid.

For Stripe payments, this will be the Stripe session ID, for 1Pay payments it'll be the invoice ID, etc... (you get the point).
public string? PaymentData { get; set; }

Property Value

string

PaymentMethod

Which payment method the customer has chosen for paying this Order's SalePriceSubunit.

public required PaymentMethod PaymentMethod { get; set; }

Property Value

PaymentMethod

PaymentUrl

The PSP's payment URL that was (or should be) used for the Order's payment.

public string? PaymentUrl { get; set; }

Property Value

string

PhoneNumber

Customer's phone nr.

public string? PhoneNumber { get; set; }

Property Value

string

Post

The Post for which the OrderedProducts have been bought. Can be null if only a Subscription has been ordered (without any Post Boosters or premium shizzles).

[ForeignKey("PostId")]
public Post? Post { get; set; }

Property Value

Post

PostId

The ID of the Post for which the OrderedProducts have been bought. Can be null if only a Subscription has been ordered (without any Post Boosters or premium shizzles).

public long? PostId { get; set; }

Property Value

long?

RawPaymentData

Raw, unformatted and untouched payment details as returned from the payment gateway's backend in the HTTP response.

You never know if this could be useful, best to keep the raw payment service provider's response as-is.
public string? RawPaymentData { get; set; }

Property Value

string

SalePriceSubunit

Sub-unit of the order price.

This is the amount of money that needs to be paid in order (hah) for fulfillment to be triggered.

public required long SalePriceSubunit { get; set; }

Property Value

long

Remarks

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.

Slug

String between 4 and 8 characters that uniquely identifies this Order.

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

Property Value

string

TestMode

Whether this Order was placed in dev mode (for testing/in staging environment) or live.

public bool TestMode { get; set; }

Property Value

bool

TimestampUTC

Exact timestamp (in UTC) of the transaction.

public long TimestampUTC { get; set; }

Property Value

long

User

User with which this order is associated.

If this User has a Company associated with them, this order is associated with that Company.

If not, the order is for an individual person.
[ForeignKey("UserId")]
public User? User { get; set; }

Property Value

User

UserId

ID of the user with which this order is associated.

public long? UserId { get; set; }

Property Value

long?

ValueAddedTaxIdentificationNumber

E.g. CHE-000.000.000 MWST

public string? ValueAddedTaxIdentificationNumber { get; set; }

Property Value

string

ZipCode

Customer's ZIP code.

public string? ZipCode { get; set; }

Property Value

string