Logger, utils and typescript interfaces, types and enums

This commit is contained in:
2022-12-11 18:18:06 +01:00
parent 57327e63d1
commit b636f86151
17 changed files with 426 additions and 0 deletions

15
src/interfaces/ICart.ts Normal file
View File

@@ -0,0 +1,15 @@
export default interface ICart {
client_id: string;
cart_id: number;
lineitem_id: number;
quantity: number;
sku_id: number;
size: string;
price: number;
product_no: number;
name: string;
description: string;
subtext: string;
image: string;
primary_color: string;
}

View File

@@ -0,0 +1,9 @@
export default interface ICustomer {
city: string;
customer_no?: string;
email: string;
first_name: string;
last_name: string;
street_address: string;
zip_code: number;
}

View File

@@ -0,0 +1,7 @@
export default interface IDeliveryAddress {
firstName: string;
lastName: string;
address: string;
zipCode: string;
city: string;
}

61
src/interfaces/IOrder.ts Normal file
View File

@@ -0,0 +1,61 @@
// import type IProduct from './IProduct';
// import type BadgeType from './BadgeType';
import type ICustomer from "./ICustomer";
export interface IStripePayment {
amount: number;
currency: string;
}
export interface IOrderSummary {
created: Date;
email: string;
first_name: string;
last_name: string;
order_id: string;
order_sum: number;
status: string;
}
export interface IOrder {
customer: ICustomer;
lineItems: ILineItem[];
orderid: string;
shipping: IShipping;
status: string;
updated?: Date;
created?: Date;
}
export interface ILineItem {
sku_id: number;
image: string;
name: string;
price: number;
quantity: number;
size: string;
}
export interface IShipping {
company: string;
tracking_code: string;
tracking_link: string;
user_notified: null;
}
export interface IOrdersLineitem {
orders_lineitem_id: string;
order_id: string;
product_no: number;
product_sku_no: number;
quantity: number;
created?: Date;
updated?: Date;
}
export interface ITracking {
orderId: string;
trackingCode: string;
trackingCompany: string;
trackingLink: string;
}

View File

@@ -0,0 +1,25 @@
export interface IProduct {
product_no: number;
name: string;
subtext?: string;
description?: string;
image?: string;
variation_count?: string;
sum_stock?: number;
updated?: Date;
created?: Date;
}
export interface IProductSku {
sku_id: number;
price: number;
size: number;
stock: number;
default_price: boolean;
updated?: Date;
created?: Date;
}
export interface IProductWithSkus extends IProduct {
variations: IProductSku[] | number;
}