@alwatr/type
Advanced tools
Comparing version 0.29.0 to 0.30.0
@@ -6,2 +6,17 @@ # Change Log | ||
# [0.30.0](https://github.com/AliMD/alwatr/compare/v0.29.0...v0.30.0) (2023-03-06) | ||
### Bug Fixes | ||
- **type:** com orderStatusCS ([b789640](https://github.com/AliMD/alwatr/commit/b789640b01165e403e9e12a014c9c777b61689b7)) | ||
- **type:** export user and photo ([27e352e](https://github.com/AliMD/alwatr/commit/27e352e231aed966d4d049cc2f1f93781f386952)) | ||
### Features | ||
- **button:** click signal with detail ([03c2dc1](https://github.com/AliMD/alwatr/commit/03c2dc1e64562815505b468c761ac245554470ed)) | ||
- **com-pwa:** carType/ladingType ([94a2e96](https://github.com/AliMD/alwatr/commit/94a2e969465c20f7b52b7f18050b9ae0d3fec62d)) | ||
- **i18n:** l18eReadyPromise ([85c7570](https://github.com/AliMD/alwatr/commit/85c7570d71c3d5b9ec87b0e357ecf41f47f96227)) | ||
- **type/com:** OrderDraft, orderDeliverySchema ([4417877](https://github.com/AliMD/alwatr/commit/44178779fbeba5d14a465380541c64ffb3f4f597)) | ||
- **type:** ProductPrice ([7fe7b32](https://github.com/AliMD/alwatr/commit/7fe7b321c0ab94c8abc4527b4aa33191cf5a9213)) | ||
# [0.29.0](https://github.com/AliMD/alwatr/compare/v0.28.0...v0.29.0) (2023-02-10) | ||
@@ -8,0 +23,0 @@ |
@@ -5,7 +5,8 @@ import type { MultiLangStringObj } from './i18n.js'; | ||
import type { StringifyableRecord } from './type-helper.js'; | ||
export declare const shipmentTypeCS: readonly ["x", "y"]; | ||
export declare const carTypeCS: readonly ["x", "y"]; | ||
export declare const timePeriodCS: readonly ["1-2w", "2-3w", "3-4w"]; | ||
export declare const ladingTypeCS: readonly ["hand", "pallet"]; | ||
export declare const carTypeCS: readonly ["nissan", "one_wheel", "ten_wheel", "trolley"]; | ||
export declare const carTypePriceCS: readonly [110000, 140000, 170000, 200000]; | ||
export declare const timePeriodCS: readonly ["auto", "1_2w", "2_3w", "3_4w"]; | ||
export declare const discountTypeCS: readonly ["number", "percent"]; | ||
export declare const orderStatusCS: readonly ["draft", "registered", "processing", "payment-pending", "preparing", "shipping", "delayed", "on-hold", "canceled", "refunded"]; | ||
export declare const orderStatusCS: readonly ["draft", "registered", "processing", "payment_pending", "preparing", "shipping", "delayed", "on_hold", "canceled", "refunded"]; | ||
export interface Product extends AlwatrDocumentObject { | ||
@@ -25,2 +26,12 @@ /** | ||
} | ||
export interface ProductPrice extends AlwatrDocumentObject { | ||
/** | ||
* Product global unique id. | ||
*/ | ||
id: string; | ||
/** | ||
* Product price in this list. | ||
*/ | ||
price: number; | ||
} | ||
export interface Order extends AlwatrDocumentObject { | ||
@@ -42,9 +53,18 @@ /** | ||
*/ | ||
delivery: OrderDelivery; | ||
shippingInfo: Partial<OrderShippingInfo>; | ||
discount: number; | ||
discountType: (typeof discountTypeCS)[number]; | ||
/** | ||
* The total price of this order exclude lading and discounts. | ||
*/ | ||
totalPrice: number; | ||
shippingPrice: number; | ||
finalPrice: number; | ||
/** | ||
* The cost of lading the order. | ||
*/ | ||
ladingPrice: number; | ||
/** | ||
* The final total price of this order include lading and discounts. | ||
*/ | ||
finalTotalPrice: number; | ||
/** | ||
* Customer device uuid. | ||
@@ -58,25 +78,38 @@ */ | ||
} | ||
export interface ProductPrice extends StringifyableRecord { | ||
export interface OrderDraft extends Partial<Order> { | ||
id: 'new'; | ||
status: 'draft'; | ||
} | ||
export interface OrderItem extends StringifyableRecord { | ||
productId: string; | ||
/** | ||
* Displayed price before discount | ||
* The selling price of single product in the market. | ||
*/ | ||
price: number; | ||
/** | ||
* Final price after any discount | ||
* The selling price of a product after any discounts to this buyer. | ||
*/ | ||
finalPrice: number; | ||
} | ||
export interface OrderItem extends StringifyableRecord { | ||
productId: string; | ||
price: ProductPrice; | ||
/** | ||
* Quantity of this item. | ||
*/ | ||
qty: number; | ||
} | ||
export interface OrderDelivery extends StringifyableRecord { | ||
export interface OrderShippingInfo extends StringifyableRecord { | ||
recipientName: string; | ||
recipientNationalCode: string; | ||
address: string; | ||
shipmentType: (typeof shipmentTypeCS)[number]; | ||
description: string; | ||
ladingType: (typeof ladingTypeCS)[number]; | ||
carType: (typeof carTypeCS)[number]; | ||
timePeriod: (typeof timePeriodCS)[number]; | ||
} | ||
export declare const orderLadingSchema: { | ||
recipientName: StringConstructor; | ||
recipientNationalCode: StringConstructor; | ||
address: StringConstructor; | ||
carType: StringConstructor; | ||
ladingType: StringConstructor; | ||
timePeriod: StringConstructor; | ||
}; | ||
//# sourceMappingURL=customer-order-management.d.ts.map |
// -- Const value -- | ||
export const shipmentTypeCS = ['x', 'y']; | ||
export const carTypeCS = ['x', 'y']; | ||
export const timePeriodCS = ['1-2w', '2-3w', '3-4w']; | ||
export const ladingTypeCS = ['hand', 'pallet']; | ||
export const carTypeCS = ['nissan', 'one_wheel', 'ten_wheel', 'trolley']; | ||
export const carTypePriceCS = [110000, 140000, 170000, 200000]; | ||
export const timePeriodCS = ['auto', '1_2w', '2_3w', '3_4w']; | ||
export const discountTypeCS = ['number', 'percent']; | ||
@@ -10,10 +11,19 @@ export const orderStatusCS = [ | ||
'processing', | ||
'payment-pending', | ||
'payment_pending', | ||
'preparing', | ||
'shipping', | ||
'delayed', | ||
'on-hold', | ||
'on_hold', | ||
'canceled', | ||
'refunded', | ||
]; | ||
// -- Schema -- | ||
export const orderLadingSchema = { | ||
recipientName: String, | ||
recipientNationalCode: String, | ||
address: String, | ||
carType: String, | ||
ladingType: String, | ||
timePeriod: String, | ||
}; | ||
//# sourceMappingURL=customer-order-management.js.map |
@@ -1,2 +0,3 @@ | ||
export type ClickSignalType = { | ||
import type { Stringifyable } from './type-helper.js'; | ||
export type ClickSignalType<T extends Stringifyable = Stringifyable> = { | ||
readonly x: number; | ||
@@ -7,3 +8,4 @@ readonly y: number; | ||
readonly metaKey: boolean; | ||
detail: T; | ||
}; | ||
//# sourceMappingURL=event-signal.d.ts.map |
import { AlwatrServiceResponseSuccessWithMeta } from './service-response.js'; | ||
export type LocaleCode = `${Lowercase<string>}-${Uppercase<string>}`; | ||
export type L18eContext = AlwatrServiceResponseSuccessWithMeta<Record<Lowercase<string>, string>, { | ||
export type L18eContext = AlwatrServiceResponseSuccessWithMeta<Record<string, string>, { | ||
code: LocaleCode; | ||
@@ -5,0 +5,0 @@ rev: number; |
@@ -8,2 +8,4 @@ export * from './chat.js'; | ||
export * from './event-signal.js'; | ||
export * from './user.js'; | ||
export * from './photo.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,2 +8,4 @@ export * from './chat.js'; | ||
export * from './event-signal.js'; | ||
export * from './user.js'; | ||
export * from './photo.js'; | ||
Alwatr.registeredList.push({ | ||
@@ -10,0 +12,0 @@ name: '@alwatr/type', |
{ | ||
"name": "@alwatr/type", | ||
"version": "0.29.0", | ||
"version": "0.30.0", | ||
"description": "Alwatr projects common entities types", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "801487f183f8afd8cba25e0fec5d508c0b4fe809" | ||
"gitHead": "36f55780ccdcb1acc07400b0cdb3fe7b0df56cca" | ||
} |
@@ -8,5 +8,7 @@ export type Constructor<T> = new (...args: any[]) => T; | ||
export type Stringifyable = string | number | boolean | null | undefined | { | ||
[x: string]: Stringifyable; | ||
[P: string]: Stringifyable; | ||
} | Array<Stringifyable>; | ||
export type StringifyableRecord = Record<string, Stringifyable>; | ||
export interface StringifyableRecord { | ||
[P: string]: Stringifyable; | ||
} | ||
//# sourceMappingURL=type-helper.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38974
347