Compare commits
5 commits
sqlite_mig
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ed889a34f | ||
|
|
3ddc939a48 | ||
|
|
24252b717b | ||
|
|
78305e1670 | ||
|
|
1a3fe7826f |
4 changed files with 16 additions and 8 deletions
|
|
@ -180,6 +180,6 @@ app.use((err: any, req: express.Request, res: express.Response, next: express.Ne
|
||||||
res.status(status).json({ message });
|
res.status(status).json({ message });
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(4000, () => {
|
app.listen(4000, '::', () => {
|
||||||
console.log("Server is running on http://localhost:4000/api/mobile/");
|
console.log("Server is running on http://localhost:4000/api/mobile/");
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@
|
||||||
"multer": "^2.0.2",
|
"multer": "^2.0.2",
|
||||||
"node-cron": "^4.2.1",
|
"node-cron": "^4.2.1",
|
||||||
"pg": "^8.16.3",
|
"pg": "^8.16.3",
|
||||||
"pg-sdk-node": "https://phonepe.mycloudrepo.io/public/repositories/phonepe-pg-sdk-node/releases/v2/phonepe-pg-sdk-node.tgz",
|
|
||||||
"razorpay": "^2.9.6",
|
"razorpay": "^2.9.6",
|
||||||
"redis": "^5.9.0",
|
"redis": "^5.9.0",
|
||||||
"zod": "^4.1.12"
|
"zod": "^4.1.12"
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,10 @@ const formatOrderMessageWithFullData = (ordersData: any[]): string => {
|
||||||
|
|
||||||
message += '📦 <b>Items:</b>\n';
|
message += '📦 <b>Items:</b>\n';
|
||||||
order.orderItems?.forEach((item: any) => {
|
order.orderItems?.forEach((item: any) => {
|
||||||
message += ` • ${item.product?.name || 'Unknown'} x${item.quantity}\n`;
|
const productQuantity = item.product?.productQuantity ?? 1
|
||||||
|
const unitNotation = item.product?.unit?.shortNotation || ''
|
||||||
|
const quantityWithUnit = unitNotation ? `${productQuantity}${unitNotation}` : `${productQuantity}`
|
||||||
|
message += ` • ${item.product?.name || 'Unknown'} ${quantityWithUnit} x${item.quantity}\n`;
|
||||||
});
|
});
|
||||||
|
|
||||||
message += `\n💰 <b>Total:</b> ₹${order.totalAmount}\n`;
|
message += `\n💰 <b>Total:</b> ₹${order.totalAmount}\n`;
|
||||||
|
|
@ -72,7 +75,12 @@ const formatCancellationMessage = (orderData: any, cancellationData: Cancellatio
|
||||||
📞 <b>Phone:</b> ${orderData.address?.phone || 'N/A'}
|
📞 <b>Phone:</b> ${orderData.address?.phone || 'N/A'}
|
||||||
|
|
||||||
📦 <b>Items:</b>
|
📦 <b>Items:</b>
|
||||||
${orderData.orderItems?.map((item: any) => ` • ${item.product?.name || 'Unknown'} x${item.quantity}`).join('\n') || ' N/A'}
|
${orderData.orderItems?.map((item: any) => {
|
||||||
|
const productQuantity = item.product?.productQuantity ?? 1
|
||||||
|
const unitNotation = item.product?.unit?.shortNotation || ''
|
||||||
|
const quantityWithUnit = unitNotation ? `${productQuantity}${unitNotation}` : `${productQuantity}`
|
||||||
|
return ` • ${item.product?.name || 'Unknown'} ${quantityWithUnit} x${item.quantity}`
|
||||||
|
}).join('\n') || ' N/A'}
|
||||||
|
|
||||||
💰 <b>Total:</b> ₹${orderData.totalAmount}
|
💰 <b>Total:</b> ₹${orderData.totalAmount}
|
||||||
💳 <b>Refund:</b> ${orderData.refundStatus === 'na' ? 'N/A (COD)' : orderData.refundStatus || 'Pending'}
|
💳 <b>Refund:</b> ${orderData.refundStatus === 'na' ? 'N/A (COD)' : orderData.refundStatus || 'Pending'}
|
||||||
|
|
@ -102,7 +110,7 @@ export const startOrderHandler = async (): Promise<void> => {
|
||||||
where: inArray(orders.id, orderIds),
|
where: inArray(orders.id, orderIds),
|
||||||
with: {
|
with: {
|
||||||
address: true,
|
address: true,
|
||||||
orderItems: { with: { product: true } },
|
orderItems: { with: { product: { with: { unit: true } } } },
|
||||||
slot: true,
|
slot: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -147,7 +155,7 @@ export const startCancellationHandler = async (): Promise<void> => {
|
||||||
where: eq(orders.id, cancellationData.orderId),
|
where: eq(orders.id, cancellationData.orderId),
|
||||||
with: {
|
with: {
|
||||||
address: true,
|
address: true,
|
||||||
orderItems: { with: { product: true } },
|
orderItems: { with: { product: { with: { unit: true } } } },
|
||||||
refunds: true,
|
refunds: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import {
|
||||||
import { useProductSlotIdentifier } from '@/hooks/useProductSlotIdentifier';
|
import { useProductSlotIdentifier } from '@/hooks/useProductSlotIdentifier';
|
||||||
import { useCartStore } from '@/src/store/cartStore';
|
import { useCartStore } from '@/src/store/cartStore';
|
||||||
import { trpc } from '@/src/trpc-client';
|
import { trpc } from '@/src/trpc-client';
|
||||||
|
import { Image as RnImage } from 'react-native'
|
||||||
|
|
||||||
|
|
||||||
interface ProductCardProps {
|
interface ProductCardProps {
|
||||||
|
|
@ -129,7 +130,7 @@ const ProductCard: React.FC<ProductCardProps> = ({
|
||||||
activeOpacity={0.9}
|
activeOpacity={0.9}
|
||||||
>
|
>
|
||||||
<View style={tw`relative`}>
|
<View style={tw`relative`}>
|
||||||
<Image
|
<RnImage
|
||||||
source={{ uri: item.images?.[0] }}
|
source={{ uri: item.images?.[0] }}
|
||||||
style={{ width: "100%", height: itemWidth, resizeMode: "cover" }}
|
style={{ width: "100%", height: itemWidth, resizeMode: "cover" }}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue