Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(soffit-order): reported issues #1113

Merged
merged 6 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cloud/classic/lib/* filter=crypt diff=crypt merge=crypt
*.env filter=crypt diff=crypt merge=crypt
uniquely/com-api/demo-user.http filter=crypt diff=crypt merge=crypt
6 changes: 3 additions & 3 deletions core/type/src/customer-order-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export interface ComUser extends User {

export const orderInfoSchema = {
id: String,
// status: String,
status: String,
itemList: [{
productId: String,
price: Number,
Expand All @@ -168,9 +168,9 @@ export const orderInfoSchema = {
},
// discount: Number,
// discountType: String,
// totalPrice: Number,
totalPrice: Number,
// ladingPrice: Number,
// finalTotalPrice: Number,
finalTotalPrice: Number,
};

export const orderShippingInfoSchema = orderInfoSchema.shippingInfo;
Expand Down
5 changes: 2 additions & 3 deletions core/validator/src/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ export function validator<T extends StringifyableRecord>(
}
// else
const schema = itemSchema[0];
for (const index in itemValue) {
if (!Object.prototype.hasOwnProperty.call(itemSchema, index)) continue;
for (let index = itemValue.length - 1; index >= 0; index--) {
const item = itemValue[index];
targetObject[index] = validator<StringifyableRecord>(
itemValue[index] = validator<StringifyableRecord>(
schema,
item as StringifyableRecord, // @FIXME: DeMastmalize
additionalProperties,
Expand Down
15 changes: 13 additions & 2 deletions ui/pwa-helper/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {getLocalStorageItem} from '@alwatr/util';

import type {Stringifyable, StringifyableRecord} from '@alwatr/type';

declare global {
Expand All @@ -7,9 +9,18 @@ declare global {

// TODO: config-context with dynamic import like l18e

const debugConfig = localStorage.getItem('DEBUG_CONFIG');
/**
* Debug app config.
*
* Example:
*
* ```ts
* localStorage.setItem('DEBUG_CONFIG', JSON.stringify(globalThis.appConfig))
* ```
*/
const debugConfig = getLocalStorageItem('DEBUG_CONFIG', null);
if (debugConfig != null) {
globalThis.appConfig = JSON.parse(debugConfig);
globalThis.appConfig = debugConfig;
}

export function getConfKey<T extends Stringifyable>(key: string): T {
Expand Down
207 changes: 207 additions & 0 deletions uniquely/com-api/demo-user.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
U2FsdGVkX18gnhn2EnKFIj00BkruQMzo9XfSKruEZX8Bnc4t9+PPOTgMl5+79IhW
IvZDATITei2vMkorIMGc8+8WsLfwXMhfslMeC/svQYMhQHmMHcb+85vIcRg+sOcb
yK+QOE7SnG6r2d0KkmA5v73Wm2nP/OcHd5f08zS+5XOyBQBQaYO2YfNiqip+bZmE
HyYiAuiMAjj2zJKTUY6vkvnvVYPoozgdbVaqgPavM+njKE3jO+gCm8BBeSOiaWRr
wZm0Cc8HF7lp4oPeFfYnK4O9st8NW1rxtRqRQGbTHmPd/S944XvSPrBg39bSbq0S
55h+eJ41K7fnvzjXtLcPsAjPrRE+Nt7gxegingTaDC67mocO6325cx58q9+zcY0c
R/0ua+zm5k3aovTtbxVrYpVyzHPH5OULPmiEAqum2ASde/BoBK2ljdo6G5X1x1Ce
L9aO8J42LEFAd8hojyPSLL1IU9nMq+FTVdCOLaB4VNrxqi5xlEAbWeFL1JwpSdeo
w+FToGPQ5GuITUF70BIy5kGKoUizltz2T/f7GZPw1yaGNrQ/L2Ry6GqCuPwgJbLU
o5vtigetZ0/9DkcmjDJhtsHXNe9KpDtO+JBcL4pSDh07qxdnSrEHE7NlefrUo7vI
XuBGLVGz3STKX3TC7jdQBvTryguka2m9NT9nCUm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RhbtqfVVczbXAVM08MgHS1gS
PFNXzBqa+7lG4RxSPEnbTuoESAlw9hvqvawydc/wu1P7Se/GQm0eegA/WwcxSoM7
u5NLUZOD0NyVtciTOYA/FmrOKP7emZ1CUWywkO2MXx44mIlMC0LPFJ5osYwe/zUW
UzDYQ4xeusQOv1ba3HTb96kdjlxx+cx6HGipKZPDqveA9eespEAEnTA8PRHJPfq8
7oNJIbXIArm/hUIwT/MsJt1OJbOvvQpwdYVGhJrhXkNalPV5q6sWleC6HydNATSt
lXrZPXyowVsbFvPkZlaEWL9VFNW4/yBy7gW4XG34oV9QjK9FbTRpfuovvXcVH9Ca
uZm6/NSXf6yeaSO8UHlxe3e+oUpX3EZIQZgxVkO+9a2IGxfbonx4KKwPGRnU0Tej
+Vh6A5NGQhAFoqiFT/kL/yh67IcGtcrHwyNVev4D1gpoOlehrkKc/qUeL/Q1ybln
XgMNE+kL1OO3loZ2GOEyZ9HBxne2we4IfTg5BBtG1o7OHmJzjN0uVfa6w5EotVdB
vE3eZ1iyth9N3yt42a+KjG4an4AWkbVd64zTZeeut/Fr5KFmewlfikqp7k5X5qaE
DFNkDuWxYl3QnrsnvevzADSfIclybkq4oP1n2jljtKevlb7B5LVommMzWO4uD4Ia
nFk586Mh6xO+LSHei6zGUS31UAUSrY5IVtEZHuSroOh7oaN/i+DOX0eB26ZVwit4
w+P8qjnicmmlSlOVVh6l9fiK0RSP/iq7ztlD9XkSiFMOjL6XBwMafULPziJJfALA
5rNPzOiHaoEQdWZgGZ0LhCItEmAkJvl24novf21fHtyGhs8iy+eTKcbE0D2iEm/8
vq/meWo1sxjbym4EEJVi4463pimzZqnLvCpE0HtpJT4=
5 changes: 3 additions & 2 deletions uniquely/com-pwa/res/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
window.appConfig = {
domain: '$DOMAIN',
// old version compatibility.
api: '/api/v0',
cdn: '/cdn',
productStorageList: ['tile'],
token: 'old-version',
productStorageList: [],
};
1 change: 0 additions & 1 deletion uniquely/com-pwa/res/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
<body>
<alwatr-pwa unresolved>درحال بارگذاری...</alwatr-pwa>

<script type="module" src="config.js"></script>
<script type="module" src="alwatr-pwa.js"></script>

<noscript>
Expand Down
17 changes: 12 additions & 5 deletions uniquely/com-pwa/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import {FetchOptions} from '@alwatr/fetch';
import {getConfKey} from '@alwatr/pwa-helper/config.js';
import {getLocalStorageItem} from '@alwatr/util';

/**
* Debug API.
*
* ```ts
* localStorage.setItem('DEBUG_API', '"https://canary.order.soffit.co"');
* ```
*/
const apiPrefix = getLocalStorageItem('DEBUG_API', '');
export const config = {
api: getConfKey<string>('api'),
cdn: getConfKey<string>('cdn'),
productStorageList: getConfKey<Array<string>>('productStorageList'),
api: apiPrefix + '/api/v0',
cdn: apiPrefix + '/cdn',
priceListName: '${productStorage}-market-ir',
finalPriceListName: '${productStorage}-agency-ir',
fetchContextOptions: <Partial<FetchOptions>> {
fetchContextOptions: <Partial<FetchOptions>>{
method: 'GET',
removeDuplicate: 'auto',
retry: 2,
Expand Down
8 changes: 4 additions & 4 deletions uniquely/com-pwa/src/manager/controller/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ finiteStateMachineProvider.defineActions<OrderFsm>('order_fsm', {
const order = fsmInstance.getContext().newOrder;
if (!order.itemList?.length) throw new Error('invalid_type');
// else
fsmInstance.getContext().newOrder = validator(orderInfoSchema, order, true);
fsmInstance.setContext({
newOrder: validator<OrderDraft>(orderInfoSchema, order),
});
return true;
}
catch (err) {
Expand All @@ -267,9 +269,7 @@ finiteStateMachineProvider.defineActions<OrderFsm>('order_fsm', {

validate_shipping_info: (fsmInstance): boolean => {
try {
const order = fsmInstance.getContext().newOrder;
// else
fsmInstance.getContext().newOrder.shippingInfo = validator(orderShippingInfoSchema, order.shippingInfo, true);
validator(orderShippingInfoSchema, fsmInstance.getContext().newOrder.shippingInfo);
return true;
}
catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions uniquely/com-pwa/src/ui/stuff/order-status-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class AlwatrOrderStatusBox extends LocalizeMixin(SignalMixin(AlwatrBaseEl
this.content.status === 'draft'
? message('order_status_box_headline_new')
: message('order_status_box_headline')
.replace('${orderId}', replaceNumber(this.content.id.padStart(2, '0') ?? ''));
.replace('${orderId}', replaceNumber(this.content.id.padStart(2, '0')));

const iconBoxContent: IconBoxContent = {
headline,
Expand All @@ -88,7 +88,7 @@ export class AlwatrOrderStatusBox extends LocalizeMixin(SignalMixin(AlwatrBaseEl
return html`
<alwatr-icon-box .content=${iconBoxContent}>
${message('order_status_box_status') + ': ' + message('order_status_' + this.content.status)} <br />
${message('order_status_box_created') + ': ' + date(this.content.meta?.created ?? 0)}
${message('order_status_box_created') + ': ' + date(this.content.meta?.created ?? Date.now())}
</alwatr-icon-box>
`;
}
Expand Down