@bit-ui-libs/common
Version:
This library was generated with [Nx](https://nx.dev).
188 lines (169 loc) • 3.69 kB
text/typescript
import { BaseAddress } from '../../users';
import { OrderStatusEnum } from '../enums';
import { DeliveredRequest, OrderShippingInfoRequest } from '../services';
export interface Order {
id: string;
listingId: string;
assetId: string;
sellerId: string;
buyerId: string;
price: number;
status: string;
createdAt: string;
concurrencyStamp: string;
flagged: boolean;
suspended: boolean;
attachments: OrderAttachment[][];
listing: OrderListing;
asset: OrderAsset;
}
interface OrderAttachment {
id: string;
orderId: string;
classification: string;
path: string;
pathUrl?: string | null;
createdAt: string;
}
interface OrderListing {
id: string;
assetId: string;
createdBy: string;
price: number;
sellingMethod: string;
status: string;
startAt: string;
endAt: string;
concurrencyStamp: string;
}
interface OrderAsset {
id: string;
appName: string;
qrCodeRef?: string | null;
eventIdRef: string;
name: string;
level: string;
ownerId: string;
isVerifiedByWitness: boolean;
isVerifiedByOfficial: boolean;
platform: string;
isListed: boolean;
orgId?: string | null;
typeId: string;
createdAt: string;
}
export interface OrderStore {
id: string;
orderId: string;
prevActionId: string;
operation: OrderStatusEnum;
version: number;
createdAt: string;
createdBy: string;
isEncrypted: true;
data: OrderStoreData;
}
// Combine a bunch of existing types to reduce
// redundant type property definitions
export type OrderStoreData = Omit<DeliveredRequest, 'id' | 'feedback' | 'image'> &
Omit<OrderShippingInfoRequest, 'id'> & {
id: string;
cvv?: string;
paypalId?: string;
createdAt?: string;
cardNumber?: string;
expiryDate?: string;
nameOnCard?: string;
paymentMethod?: string;
paymentType?: string;
transactionId?: string;
ownershipChangedAt?: string;
assetId?: string;
buyerId?: string;
sellerId?: string;
listingId?: string;
updatedAt?: string;
};
export interface Question {
id: string;
question: string;
parentId: string;
hint: string;
createdAt: string;
}
export interface BuyerShippingAddress extends BaseAddress {
phone?: string;
}
export interface BuyerBillingAddress extends BaseAddress {
phone?: string;
}
export interface ExtraCharges {
id: number;
gasFee: number;
costTax: number;
shippingCost: number;
}
export interface OrderFeedback {
id: string;
answer: string;
parentId: string;
}
export interface DeliveryOrderRequest {
id?: string;
concurrencyStamp?: string;
status?: OrderStatusEnum;
feedback?: OrderFeedback[];
image?: string;
courier?: string;
trackingId?: string;
}
export interface DeliveryOrderResponse {
id: string;
listingId: string;
assetId: string;
sellerId: string;
buyerId: string;
price: number;
status: OrderStatusEnum;
createdAt: string;
concurrencyStamp: string;
}
export interface TotalSales {
monthlySales: number;
totalSales: number;
totalAssetsSold: number;
totalListings: number;
}
export interface OrderStatistics {
month: string;
sale: number;
}
export interface SalesTaxRequest {
listingId: string;
country: string;
city: string;
state: string;
zipCode: string;
}
export interface SalesTax {
listingId: string;
costTax: number;
}
export interface ShippingCostReq extends BaseAddress {
listingId: string;
phone?: string;
}
export interface ShippingCost {
service: {
code: string;
description: string;
};
totalCharges: {
currencyCode: string;
monetaryValue: string;
};
guaranteedDelivery: {
businessDaysInTransit: string;
deliveryByTime: string;
};
}