@alwatr/type
Advanced tools
Comparing version 0.31.0 to 0.32.0
@@ -6,2 +6,20 @@ # Change Log | ||
# [0.32.0](https://github.com/AliMD/alwatr/compare/v0.31.0...v0.32.0) (2023-05-27) | ||
### Bug Fixes | ||
- **fetch:** userAuth in StringifyableFetchOptions ([f554b57](https://github.com/AliMD/alwatr/commit/f554b575584cb1464d48fbe8a8c4006125365853)) | ||
- **type/com:** orderInfoSchema ([b90d872](https://github.com/AliMD/alwatr/commit/b90d87268429fc802fb9966fd6efd43912bc851a)) | ||
- **type:** `data` type ([0601384](https://github.com/AliMD/alwatr/commit/06013843612fb2400d664a4dd084f70278a5eaa4)) | ||
- **type:** `orderInfoSchema` ([47ca524](https://github.com/AliMD/alwatr/commit/47ca5243f6de3c966c3fb3bd10256134d100e4e9)) | ||
### Features | ||
- **com-pwa:** car count ([d2ea9c1](https://github.com/AliMD/alwatr/commit/d2ea9c12863d214afe5daa7d07997175c19ca859)) | ||
- **type/com:** rewrite ([1829673](https://github.com/AliMD/alwatr/commit/1829673cf63746d4356aaa3673aefc001b042258)) | ||
- **type/user:** add token! ([de23795](https://github.com/AliMD/alwatr/commit/de237957a7a045c1998cf43b585125027fad5d7d)) | ||
- **type:** add `priceListName` to `ComUser` ([b22555e](https://github.com/AliMD/alwatr/commit/b22555ebe508cc0d732e6af0e1bbf99f99eaca16)) | ||
- **type:** user permissions ([e3d7091](https://github.com/AliMD/alwatr/commit/e3d70916fb7e93f8daf51a8c4aaf856f109b01be)) | ||
- **type:** user permissions ([6bb0aac](https://github.com/AliMD/alwatr/commit/6bb0aacb991e11a930a30dc9071a5de0edf77368)) | ||
# [0.31.0](https://github.com/AliMD/alwatr/compare/v0.30.0...v0.31.0) (2023-05-08) | ||
@@ -8,0 +26,0 @@ |
@@ -7,8 +7,13 @@ import type { MultiLangStringObj } from './i18n.js'; | ||
export declare const ladingTypeCS: readonly ["hand", "pallet"]; | ||
export declare const carTypeCS: readonly ["nissan", "one", "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 type LadingType = (typeof ladingTypeCS)[number]; | ||
export declare const carTypeCS: readonly ["trailer_truck", "camion_dual", "camion_solo", "camion_911", "camion_800", "camion_600", "camion_mini", "nissan"]; | ||
export type CarType = (typeof carTypeCS)[number]; | ||
export declare const timePeriodCS: readonly ["auto", "3_4w", "2_3w", "1_2w"]; | ||
export type TimePeriod = (typeof timePeriodCS)[number]; | ||
export declare const discountTypeCS: readonly ["number", "percent"]; | ||
export type DiscountType = (typeof discountTypeCS)[number]; | ||
export declare const orderStatusCS: readonly ["draft", "registered", "processing", "payment_pending", "preparing", "shipping", "delayed", "on_hold", "canceled", "refunded"]; | ||
export declare const tileQtyStep = 3.6; | ||
export type OrderStatus = (typeof orderStatusCS)[number]; | ||
export declare const userPermissionsCS: readonly ["user/patch", "price/patch", "product/patch", "user-list/read"]; | ||
export type UserPermission = (typeof userPermissionsCS)[number]; | ||
export interface Product extends AlwatrDocumentObject { | ||
@@ -46,3 +51,3 @@ /** | ||
*/ | ||
status: (typeof orderStatusCS)[number]; | ||
status: OrderStatus; | ||
/** | ||
@@ -56,17 +61,24 @@ * Order cart list. | ||
shippingInfo: Partial<OrderShippingInfo>; | ||
discount: number; | ||
discountType: (typeof discountTypeCS)[number]; | ||
/** | ||
* The total price of this order exclude lading and discounts. | ||
* The total price of this order exclude shippings. | ||
*/ | ||
totalPrice: number; | ||
subTotalMarket: number; | ||
subTotalAgency: number; | ||
/** | ||
* The cost of lading the order. | ||
*/ | ||
ladingPrice: number; | ||
ladingFee: number; | ||
/** | ||
* The final total price of this order include lading and discounts. | ||
* The cost of pallet. | ||
*/ | ||
finalTotalPrice: number; | ||
palletCost: number; | ||
/** | ||
* The cost of shipping price. | ||
*/ | ||
shippingFee: number; | ||
/** | ||
* Total shipping const. | ||
*/ | ||
totalShippingFee: number; | ||
/** | ||
* Customer device uuid. | ||
@@ -89,7 +101,7 @@ */ | ||
*/ | ||
price: number; | ||
marketPrice: number; | ||
/** | ||
* The selling price of a product after any discounts to this buyer. | ||
*/ | ||
finalPrice: number; | ||
agencyPrice: number; | ||
/** | ||
@@ -105,11 +117,10 @@ * Quantity of this item. | ||
description: string; | ||
ladingType: (typeof ladingTypeCS)[number]; | ||
carType: (typeof carTypeCS)[number]; | ||
timePeriod: (typeof timePeriodCS)[number]; | ||
ladingType: LadingType; | ||
carType: CarType; | ||
timePeriod: TimePeriod; | ||
} | ||
export declare const userPermissionsCS: readonly ["*", "user/patch"]; | ||
export type UserPermission = typeof userPermissionsCS[number]; | ||
export interface ComUser extends User { | ||
permissions?: Array<UserPermission>; | ||
permissions?: Array<UserPermission> | 'root'; | ||
shopName?: string; | ||
priceListName?: string; | ||
} | ||
@@ -121,4 +132,4 @@ export declare const orderInfoSchema: { | ||
productId: StringConstructor; | ||
price: NumberConstructor; | ||
finalPrice: NumberConstructor; | ||
marketPrice: NumberConstructor; | ||
agencyPrice: NumberConstructor; | ||
qty: NumberConstructor; | ||
@@ -134,4 +145,8 @@ }[]; | ||
}; | ||
totalPrice: NumberConstructor; | ||
finalTotalPrice: NumberConstructor; | ||
subTotalMarket: NumberConstructor; | ||
subTotalAgency: NumberConstructor; | ||
ladingFee: NumberConstructor; | ||
palletCost: NumberConstructor; | ||
shippingFee: NumberConstructor; | ||
totalShippingFee: NumberConstructor; | ||
}; | ||
@@ -138,0 +153,0 @@ export declare const orderShippingInfoSchema: { |
// -- Const value -- | ||
export const ladingTypeCS = ['hand', 'pallet']; | ||
export const carTypeCS = ['nissan', 'one', 'ten_wheel', 'trolley']; | ||
export const carTypePriceCS = [110000, 140000, 170000, 200000]; | ||
export const timePeriodCS = ['auto', '1_2w', '2_3w', '3_4w']; | ||
export const carTypeCS = [ | ||
'trailer_truck', | ||
'camion_dual', | ||
'camion_solo', | ||
'camion_911', | ||
'camion_800', | ||
'camion_600', | ||
'camion_mini', | ||
'nissan', | ||
]; | ||
export const timePeriodCS = ['auto', '3_4w', '2_3w', '1_2w']; | ||
export const discountTypeCS = ['number', 'percent']; | ||
@@ -19,4 +27,3 @@ export const orderStatusCS = [ | ||
]; | ||
export const tileQtyStep = 3.6; | ||
export const userPermissionsCS = ['*', 'user/patch']; | ||
export const userPermissionsCS = ['user/patch', 'price/patch', 'product/patch', 'user-list/read']; | ||
// -- Schema -- | ||
@@ -26,8 +33,10 @@ export const orderInfoSchema = { | ||
status: String, | ||
itemList: [{ | ||
itemList: [ | ||
{ | ||
productId: String, | ||
price: Number, | ||
finalPrice: Number, | ||
marketPrice: Number, | ||
agencyPrice: Number, | ||
qty: Number, | ||
}], | ||
}, | ||
], | ||
shippingInfo: { | ||
@@ -40,10 +49,14 @@ recipientName: String, | ||
timePeriod: String, | ||
// description: String, | ||
}, | ||
// discount: Number, | ||
// discountType: String, | ||
totalPrice: Number, | ||
// ladingPrice: Number, | ||
finalTotalPrice: Number, | ||
subTotalMarket: Number, | ||
subTotalAgency: Number, | ||
ladingFee: Number, | ||
palletCost: Number, | ||
shippingFee: Number, | ||
totalShippingFee: Number, | ||
}; | ||
export const orderShippingInfoSchema = orderInfoSchema.shippingInfo; | ||
//# sourceMappingURL=customer-order-management.js.map |
{ | ||
"name": "@alwatr/type", | ||
"version": "0.31.0", | ||
"version": "0.32.0", | ||
"description": "Alwatr projects common entities types", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "896e64b58eed6e9048e870557ecf399d42705612" | ||
"gitHead": "b20d2574ec144e3d10f5ad9645ab30b58d1d2d77" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { StringifyableRecord } from './type-helper.js'; | ||
import { Stringifyable, StringifyableRecord } from './type-helper.js'; | ||
export type Methods = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'TRACE' | 'OPTIONS' | 'PATCH'; | ||
@@ -13,3 +13,3 @@ export type ParamKeyType = 'string' | 'number' | 'boolean'; | ||
} | ||
export interface AlwatrServiceResponseSuccess<TData extends StringifyableRecord = StringifyableRecord> extends StringifyableRecord { | ||
export interface AlwatrServiceResponseSuccess<TData extends Stringifyable = Stringifyable> extends StringifyableRecord { | ||
ok: true; | ||
@@ -21,3 +21,3 @@ statusCode?: number; | ||
} | ||
export interface AlwatrServiceResponseSuccessWithMeta<TData extends StringifyableRecord = StringifyableRecord, TMeta extends StringifyableRecord = StringifyableRecord> extends StringifyableRecord { | ||
export interface AlwatrServiceResponseSuccessWithMeta<TData extends Stringifyable = Stringifyable, TMeta extends StringifyableRecord = StringifyableRecord> extends StringifyableRecord { | ||
ok: true; | ||
@@ -29,3 +29,3 @@ statusCode?: number; | ||
} | ||
export type AlwatrServiceResponse<TData extends StringifyableRecord = StringifyableRecord, TMeta extends StringifyableRecord = StringifyableRecord> = AlwatrServiceResponseSuccess<TData> | AlwatrServiceResponseSuccessWithMeta<TData, TMeta> | AlwatrServiceResponseFailed; | ||
export type AlwatrServiceResponse<TData extends Stringifyable = Stringifyable, TMeta extends StringifyableRecord = StringifyableRecord> = AlwatrServiceResponseSuccess<TData> | AlwatrServiceResponseSuccessWithMeta<TData, TMeta> | AlwatrServiceResponseFailed; | ||
//# sourceMappingURL=service-response.d.ts.map |
@@ -14,5 +14,10 @@ import type { AlwatrDocumentObject } from './storage.js'; | ||
/** | ||
* User token, used for user authorization. | ||
* DANGER: This field should not be save in public storage. | ||
*/ | ||
token?: string; | ||
/** | ||
* User authorization permissions list. | ||
*/ | ||
permissions?: Array<string>; | ||
permissions?: Array<string> | 'root'; | ||
fullName: string; | ||
@@ -44,6 +49,6 @@ phoneNumber: number; | ||
} | ||
export interface UserAuth { | ||
export type UserAuth = { | ||
id: string; | ||
token: string; | ||
} | ||
}; | ||
//# sourceMappingURL=user.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
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
49965
458