enh
This commit is contained in:
parent
9ac19b0a87
commit
dabdbb74ea
4 changed files with 15 additions and 28 deletions
|
|
@ -15,6 +15,7 @@ const formatDateTime = (dateStr: string | null | undefined): string => {
|
|||
return new Date(dateStr).toLocaleString('en-IN', {
|
||||
dateStyle: 'medium',
|
||||
timeStyle: 'short',
|
||||
timeZone: 'Asia/Kolkata',
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -19,29 +19,14 @@ export const initializeAllStores = async (): Promise<void> => {
|
|||
try {
|
||||
console.log('Starting application stores initialization...');
|
||||
|
||||
// Initialize role manager
|
||||
await roleManager.fetchRoles();
|
||||
console.log('Role manager initialized successfully');
|
||||
|
||||
// Compute and store constants in Redis
|
||||
await computeConstants();
|
||||
console.log('Const store initialized successfully');
|
||||
|
||||
// Initialize product store in Redis
|
||||
await initializeProducts();
|
||||
console.log('Product store initialized successfully');
|
||||
|
||||
// Initialize product tag store in Redis
|
||||
await initializeProductTagStore();
|
||||
console.log('Product tag store initialized successfully');
|
||||
|
||||
// Initialize slot store in Redis
|
||||
await initializeSlotStore();
|
||||
console.log('Slot store initialized successfully');
|
||||
|
||||
// Initialize banner store in Redis
|
||||
await initializeBannerStore();
|
||||
console.log('Banner store initialized successfully');
|
||||
await Promise.all([
|
||||
roleManager.fetchRoles(),
|
||||
computeConstants(),
|
||||
initializeProducts(),
|
||||
initializeProductTagStore(),
|
||||
initializeSlotStore(),
|
||||
initializeBannerStore(),
|
||||
]);
|
||||
|
||||
console.log('All application stores initialized successfully');
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ const placeOrderUtil = async (params: {
|
|||
let isFirstOrder = true;
|
||||
|
||||
for (const [slotId, items] of ordersBySlot) {
|
||||
const orderTotal = items.reduce(
|
||||
const subOrderTotal = items.reduce(
|
||||
(sum, item) => {
|
||||
const itemPrice = params.isFlash
|
||||
? parseFloat((item.product.flashPrice || item.product.price).toString())
|
||||
|
|
@ -219,9 +219,10 @@ const placeOrderUtil = async (params: {
|
|||
},
|
||||
0
|
||||
);
|
||||
const subOrderTotalWithDelivery = subOrderTotal + expectedDeliveryCharge;
|
||||
|
||||
const orderGroupProportion = orderTotal / totalAmount;
|
||||
const orderTotalAmount = isFirstOrder ? totalWithDelivery : totalAmount;
|
||||
const orderGroupProportion = subOrderTotal / totalAmount;
|
||||
const orderTotalAmount = isFirstOrder ? subOrderTotalWithDelivery : subOrderTotal;
|
||||
|
||||
const { finalOrderTotal: finalOrderAmount } = applyDiscountToOrder(
|
||||
orderTotalAmount,
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ const isDevMode = Constants.executionEnvironment !== "standalone";
|
|||
// const BASE_API_URL = API_URL;
|
||||
// const BASE_API_URL = 'http://10.0.2.2:4000';
|
||||
// const BASE_API_URL = 'http://192.168.100.101:4000';
|
||||
// const BASE_API_URL = 'http://192.168.1.3:4000';
|
||||
let BASE_API_URL = "https://mf.freshyo.in";
|
||||
const BASE_API_URL = 'http://192.168.1.3:4000';
|
||||
// let BASE_API_URL = "https://mf.freshyo.in";
|
||||
// let BASE_API_URL = 'http://192.168.100.104:4000';
|
||||
// let BASE_API_URL = 'http://192.168.29.176:4000';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue