Skip to content

Instantly share code, notes, and snippets.

@codemariner
Created January 25, 2019 17:21
Show Gist options
  • Save codemariner/751e3361d9e90c84d77809830160c6b6 to your computer and use it in GitHub Desktop.
Save codemariner/751e3361d9e90c84d77809830160c6b6 to your computer and use it in GitHub Desktop.
export type DbFields<T> = {
[K in keyof T]-?: T[K] | null;
}
export interface OrderFields {
currency?: string;
customerId?: string;
customerName?: string;
creationDate?: Date;
email?: string;
lastModified?: Date;
orderId?: string;
orderNo?: string;
orderStatusId?: number;
orderTotal?: number;
productTotal?: number;
recordCreated?: Date;
recordUpdated?: Date;
region?: string;
shippingTotal?: number;
siteId?: string;
taxTotal?: number;
}
export type NewOrderData = DbFields<OrderFields> & {
orderStatusId: number;
orderNo: string;
}
export type OrderData = DbFields<OrderFields> & {
orderId: number;
orderStatusId: number;
recordCreated: Date;
recordUpdated: Date;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment