add payment for SaleProprite ,add commsion,fixed error handling fiexd final things
All checks were successful
Build frontend / build (push) Successful in 1m46s

This commit is contained in:
hamzaobed7
2026-08-18 01:24:18 +03:00
parent 5592d9fbd2
commit 3472dc1175
10 changed files with 793 additions and 1070 deletions

View File

@ -383,7 +383,7 @@ export default function OwnerBookingsPage() {
const fetchData = async () => {
try {
const [response, rentProps] = await Promise.all([getOwnerReservationsByStatuses([0, 1, 2, 3, 4]), getRentProperties().catch(() => [])]);
const [response, rentProps] = await Promise.all([getOwnerReservationsByStatuses([0, 1, 2, 3, 4, 5]), getRentProperties().catch(() => [])]);
let rawData = response;
@ -419,8 +419,6 @@ export default function OwnerBookingsPage() {
propMap[rp.propertyInformation?.id] = propertyData;
});
console.log("PROP MAP:", propMap);
// ربط الـ reservation بالعقار عن طريق propertyId
const enriched = list.map((item) => {
if (item.propertyId && propMap[item.propertyId]) {
@ -430,8 +428,6 @@ export default function OwnerBookingsPage() {
return item;
});
console.log("ENRICHED BOOKINGS:", enriched);
const mappedBookings = enriched.map((item) => {
const property = item._prop || {};
@ -450,7 +446,8 @@ export default function OwnerBookingsPage() {
1: "pending",
2: "confirmed",
3: "completed",
4: "cancelled",
4: "منتهية",
5: "cancelled",
};
const statusKey = statusMap[item?.status] || "pending";