Commit Graph

20 Commits

Author SHA1 Message Date
f22bc45a4f Fix booking: use correct BookReservation endpoint + price from selected dates
All checks were successful
Build frontend / build (push) Successful in 38s
- Fixed endpoint: /Reservations/BookReservation/book (was /Reservations/Book)
- bookReservation now takes (propertyId, startDate, endDate) params
- Pricing updates dynamically based on selected date range
- Deposit read from API response instead of hardcoded
- Removed demo fallback that always showed success
2026-03-29 21:23:51 +00:00
86b8fc591b Add availability calendar to property detail page
All checks were successful
Build frontend / build (push) Successful in 42s
- Fetches available date ranges from /Reservations/GetAvailableDates/available/{id}
- Custom month calendar with green (available), amber (selected), gray (unavailable)
- Click start date then end date to select a range
- Validates entire range is available before confirming
- Shows selected dates and day count
- Month navigation with prev/next arrows
2026-03-29 21:16:00 +00:00
ca1d83967e Fix duplicate addRentProperty definition in api.js
All checks were successful
Build frontend / build (push) Successful in 39s
2026-03-29 15:58:54 +00:00
00dab824c3 Fix add property page to match Flutter request body structure
Some checks failed
Build frontend / build (push) Failing after 39s
- Remove 'For sale' offer type (rent only)
- Remove salePrice field and UI
- Fix rentTypeMap: 0=Monthly, 1=Daily (was wrong)
- Fix propertyType: uses RentPropertyCondition (furnished/unfurnished)
- Fix type field: uses RentPropertyType (furnished/unfurnished)
- Fix services: use enum API names in detailsJSON (Electricity, Internet...)
- Fix terms: use enum API names in detailsJSON (NoSmoking, NoAnimals...)
- Fix detailsJSON structure to match Flutter (services array, terms array, room object)
- Replace getCurrencies with static Currency enum dropdown
- Remove duplicate MapClickHandler
- Use all new enums from enums/index.js
2026-03-29 15:48:48 +00:00
16038a80dd Add currency dropdown and deposit field to add property form
All checks were successful
Build frontend / build (push) Successful in 53s
- Added getCurrencies() API function for /Currency/GetAll
- Currency dropdown fetched on mount, populated with available currencies
- Added deposit input field (مبلغ الضمان)
- CurrencyId sent in RentPropertyDto instead of hardcoded 1
2026-03-28 19:40:03 +00:00
d94b32a670 Add property form submits to API as RentPropertyDto
All checks were successful
Build frontend / build (push) Successful in 43s
- Added addRentProperty() API function for POST /RentProperties/AddRentProperty
- handleSubmit builds correct RentPropertyDto with nested PropertyInformation
- Maps UI fields to API enums (BuildingType, RentType, RentPropertyType, PropertyStatus)
- Services/terms stored in DetailsJSON as JSON string
- Console logs the full payload before sending
2026-03-28 18:00:44 +00:00
b6e9f01938 Profile page fetches full data from API via GetByUserId
All checks were successful
Build frontend / build (push) Successful in 39s
- Added getCustomerByUserId and getOwnerByUserId API functions
- Profile page extracts user ID (SID) from JWT, calls appropriate endpoint
- Falls back to JWT/localStorage if API call fails
- Maps API fields (firstName, lastName, whatsAppNumber, phone, etc.) to form
2026-03-28 17:03:40 +00:00
de7636f852 Fix token key mismatch in verify functions
All checks were successful
Build frontend / build (push) Successful in 40s
AuthService stores token as 'auth_token', but verifyEmail/verifyPhone
were reading 'token'. Now uses AuthService.getToken() consistently.
2026-03-28 16:31:27 +00:00
5a4b018c07 Send JWT token with verify email/phone endpoints
All checks were successful
Build frontend / build (push) Successful in 39s
- authFetch now accepts optional token parameter
- verifyEmail/verifyPhone read token from localStorage and send as Bearer header
2026-03-28 16:17:14 +00:00
c99689a995 Add Phone field to FormData in addCustomer and addOwner
All checks were successful
Build frontend / build (push) Successful in 38s
2026-03-28 15:51:25 +00:00
d698305d79 Update registration to match new API schema
All checks were successful
Build frontend / build (push) Successful in 37s
- FullName split into FirstName + LastName in both forms and API
- File fields renamed: FrontIdCarImage -> FrontIdCarImagePath, RearIdCarImage -> RearIdCarImagePath
- Added Language field to form data
- getRentProperty now uses /RentProperties/GetRentPropertyById/{id}
2026-03-28 15:29:06 +00:00
2424da2d45 Fix registration 415: send multipart form data with ID images
All checks were successful
Build frontend / build (push) Successful in 1m10s
- addCustomer/addOwner now use FormData with multipart upload
- Front and back ID images appended as FrontIdCarImage/RearIdCarImage
- Registration pages pass idImages.front and idImages.back to API
- Field names mapped to PascalCase for .NET API (FullName, Email, etc.)
2026-03-28 15:15:09 +00:00
eff0b41b78 Add enums, AuthService, and integrate backend registration endpoints
All checks were successful
Build frontend / build (push) Successful in 57s
- Add separate enum files: BuildingType, PropertyStatus, BookingStatus, CommissionType, IdentityType, UserRole, City, LoginMethod, OwnerType, CustomerType
- Add AuthService (addToken/getToken/deleteToken)
- Update api.js: use AuthService, add Owner/Add and Customer/Add endpoints
- Update login page to use AuthService for token storage
- Rewrite owner register: 3-step flow with OwnerType dropdown, backend integration, OTP verification
- Rewrite tenant register: 2-step flow with CustomerType dropdown, backend integration, OTP verification
- Update homepage and property detail to use enums instead of hardcoded maps
- Update AddPropertyForm to import from enums directly
- Add console logs and status toasts linked to API response messages
2026-03-27 18:03:12 +00:00
2fb55db360 changed the appVersion
All checks were successful
Build frontend / build (push) Successful in 1m6s
2026-03-27 00:06:13 +00:00
b613bde682 Implement login with email/phone + OTP verification flow
All checks were successful
Build frontend / build (push) Successful in 40s
Login page:
- Email/phone tabs with auto-detect from input
- Calls LogInWithEmail or LogInWithPhoneNumber API
- On 206 (Partial Content): shows OTP step, sends OTP, then verifies
- On 200: stores JWT in localStorage, decodes user info
- OTP step with resend button and back navigation
- Console logs throughout all auth flows

API client:
- Added authFetch() for raw status code handling (200/206)
- Added loginWithEmail, loginWithPhone, sendEmailOTP, sendPhoneOTP,
  verifyEmail, verifyPhone, isEmail, isPhoneNumber
- apiFetch now accepts 206 as non-error
2026-03-26 23:56:18 +00:00
211ac42ad9 Clean up API client - use nested propertyInformation directly
All checks were successful
Build frontend / build (push) Successful in 42s
- Removed manual enrichment calls (Properties/Get fallback no longer needed)
- Removed unused hasNestedInfo variables
- API now returns propertyInformation nested in RentProperties/SaleProperties
2026-03-26 23:27:28 +00:00
fd3dcf4cc3 Update mappers for flat API response + enrich with property info
All checks were successful
Build frontend / build (push) Successful in 38s
- api.js: getRentProperties/getSaleProperties now fetch PropertyInformation
  for each property's propInfoId (when Properties/Get endpoint is fixed)
- Updated all 3 mapApiProperty functions to handle flat response format
  (no nested propertyInformation) - uses defaults for missing fields
- Status/type mapping checks both flat and nested fields
2026-03-26 22:59:08 +00:00
bdcb98a047 Fix API endpoint paths to match controller routing
All checks were successful
Build frontend / build (push) Successful in 43s
- Endpoints now use /Controller/Action format (e.g. /RentProperties/GetRentProperties)
- Unwrap API response envelope ({ data, isSuccess, ... } -> data)
- Use query params for single-property fetch (?id=N)
- Marked locations endpoint as unconfirmed (not yet deployed)
2026-03-26 22:46:57 +00:00
cfb9c0058b Add API client and wire up live data fetching
All checks were successful
Build frontend / build (push) Successful in 43s
- Created app/utils/api.js with functions for all OpenAPI endpoints
- Updated main page to fetch RentProperties + SaleProperties from API
- Updated properties listing page with API integration
- Updated property detail page to fetch by ID from API
- Added mapApiProperty() adapter to transform API responses to UI format
- All pages gracefully fall back to dummy data if API is unavailable
2026-03-26 22:20:33 +00:00
6d81ff56a8 Edit admin page
Edit home image
Added properties page
2026-02-15 01:53:37 +03:00