Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
shafi54
5ed889a34f Merge branch 'main' of https://git.technocracy.ovh/shafi/freshyo 2026-03-23 03:23:15 +05:30
shafi54
3ddc939a48 enh 2026-03-23 03:22:20 +05:30
shafi54
24252b717b enh 2026-03-22 21:43:44 +05:30
shafi54
78305e1670 enh 2026-03-22 21:28:32 +05:30
shafi54
1a3fe7826f enh 2026-03-15 22:38:17 +05:30
4 changed files with 16 additions and 8 deletions

View file

@ -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/");
}); });

View file

@ -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"

View file

@ -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,
}, },
}); });

View file

@ -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" }}
/> />