-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(commons): describe Order interface (#533)
- Loading branch information
Showing
2 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
109 changes: 108 additions & 1 deletion
109
packages/commons/interfaces/models/checkout/order/Order.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,108 @@ | ||
export interface Order {} | ||
import { CustomerAddress } from "@shopware-pwa/commons/interfaces/models/checkout/customer/CustomerAddress"; | ||
import { OrderLineItem } from "@shopware-pwa/commons/interfaces/models/checkout/order/OrderLineItem"; | ||
import { StateMachineState } from "@shopware-pwa/commons/interfaces/models/system/state-machine/StateMachineState"; | ||
import { OrderTransaction } from "./OrderTransaction"; | ||
import { Tag } from "@shopware-pwa/commons/interfaces/models/system/tag/Tag"; | ||
import { Currency } from "@shopware-pwa/commons/interfaces/models/system/currency/Currency"; | ||
import { Language } from "@shopware-pwa/commons/interfaces/models/framework/language/Language"; | ||
import { SalesChannel } from "@shopware-pwa/commons/interfaces/models/system/sales-channel/SalesChannel"; | ||
import { CustomFields } from "@shopware-pwa/commons/interfaces/models/common/CustomField"; | ||
|
||
interface CalculatedTax { | ||
tax: number; | ||
taxRate: number; | ||
price: number; | ||
extensions: any[]; | ||
} | ||
interface TaxRule { | ||
taxRate: number; | ||
percentage: number; | ||
extensions: any[]; | ||
} | ||
interface Price { | ||
netPrice: number; | ||
totalPrice: number; | ||
calculatedTaxes: CalculatedTax[]; | ||
taxRules: TaxRule[]; | ||
positionPrice: number; | ||
taxStatus: string; | ||
extensions: any[]; | ||
} | ||
|
||
interface ShippingCost { | ||
unitPrice: number; | ||
quantity: number; | ||
totalPrice: number; | ||
calculatedTaxes: CalculatedTax[]; | ||
taxRules: TaxRule[]; | ||
referencePrice: number | null; | ||
listPrice: number | null; | ||
extensions: any[]; | ||
} | ||
|
||
interface OrderCustomer { | ||
email: string; | ||
orderId: string; | ||
salutationId: string; | ||
firstName: string; | ||
lastName: string; | ||
title: null; | ||
company: null; | ||
customerNumber: number; | ||
customerId: string; | ||
customer: null; | ||
salutation: null; | ||
order: null; | ||
customFields: null; | ||
remoteAddress: string; | ||
_uniqueIdentifier: string; | ||
versionId: string; | ||
translated: []; | ||
createdAt: Date; | ||
updatedAt: null; | ||
extensions: any; | ||
id: string; | ||
orderVersionId: string; | ||
} | ||
|
||
export interface Order { | ||
orderNumber: number; | ||
currencyId: string; | ||
currencyFactor: number; | ||
salesChannelId: string; | ||
billingAddressId: string; | ||
orderDateTime: Date; | ||
orderDate: Date; | ||
price: Price; | ||
amountTotal: number; | ||
amountNet: number; | ||
positionPrice: number; | ||
taxStatus: string; | ||
shippingCosts: ShippingCost; | ||
shippingTotal: number; | ||
orderCustomer: OrderCustomer; | ||
currency: Currency | null; | ||
languageId: string; | ||
language: Language | null; | ||
salesChannel: SalesChannel | null; | ||
addresses: CustomerAddress[]; | ||
deliveries: null; | ||
lineItems: OrderLineItem[] | null; | ||
transactions: OrderTransaction[] | null; | ||
deepLinkCode: string; | ||
stateMachineState: StateMachineState; | ||
stateId: string; | ||
customFields: CustomFields; | ||
documents: null; | ||
tags: Tag[] | null; | ||
affiliateCode: string | null; | ||
campaignCode: string | null; | ||
_uniqueIdentifier: string; | ||
versionId: string; | ||
translated: any[]; | ||
createdAt: Date; | ||
updatedAt: Date | null; | ||
extensions: any; | ||
id: string; | ||
billingAddressVersionId: string; | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/commons/interfaces/request/CreateGuestOrderParams.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
interface BillingAddress { | ||
countryId: string; | ||
salutationId: string; | ||
street: string; | ||
zipcode: string; | ||
city: string; | ||
title?: string; | ||
additionalAddressLine1?: string; | ||
additionalAddressLine2?: string; | ||
phoneNumber?: string; | ||
} | ||
|
||
interface ShippingAddress extends BillingAddress { | ||
firstName: string; | ||
lastName: string; | ||
} | ||
|
||
export interface CreateGuestOrderParams { | ||
email: string; | ||
salutationId: string; | ||
firstName: string; | ||
lastName: string; | ||
billingAddress: BillingAddress; | ||
shippingAddress: ShippingAddress; | ||
affiliateCode?: string; | ||
campaignCode?: string; | ||
phoneNumber?: string; | ||
} |