diff --git a/Pricing All Services.txt b/Pricing All Services.txt deleted file mode 100644 index 0024dff..0000000 --- a/Pricing All Services.txt +++ /dev/null @@ -1,1303 +0,0 @@ -Pre-Purchase -Pre-Purchase Inspection Pricing -Base Inspection -Building-only inspection -* Up to 2 combined bedrooms & bathrooms - -* One level (apartments are considered one level) - -Price: $400 -Additional Charges - - -Item - Price - Each additional bedroom - $50 - Each additional bathroom - $50 - Each additional level - $100 - Basement - $150 - Granny flat - $350 - - - - -Optional Add-Ons - - -Add-On - Price - Pest inspection - $150 - Drug residue testing - $150 - Thermal imaging & moisture meter - $150 - Roof inspection using drone - $250 - 1–2 minute walk-through video - $50 - Same-day inspection (subject to availability) - $180 - Saturday inspection (subject to availability) - $150 - Sunday inspection (subject to availability) - $300 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Booking questions (skipping the questions we ask on quote ) - - - 1. Contact person 1 (first name / lastname / email /mobile) - 2. Contact person 2 (first name / lastname / email /mobile) - 3. Property address (Including Lot number) - 4. Agent details (first name / lastname / email /mobile) - 5. ATTACH engineer drawing (if available) - 6. ATTACH floor plans (if available) - 7. ATTACH roof truss layout (if available) - 8. Control joint layout (if available) - 9. ATTACH proof of payment - 10. Who will provide access? (Agent / vendor / tenant) - 11. Tentative Time - 12. Any comment or special needs -Pre-Sales -Pre-Sales Inspection Pricing -Base Inspection -Building-only inspection - * Up to 2 combined bedrooms & bathrooms - - * One level (apartments are considered one level) - -Price: $400 -Additional Charges - - -Item - Price - Each additional bedroom - $50 - Each additional bathroom - $50 - Each additional level - $100 - Basement - $150 - Granny flat - $350 - - - - -Optional Add-Ons - - -Add-On - Price - Pest inspection - $150 - Drug residue testing - $150 - Thermal imaging & moisture meter - $150 - Roof inspection using drone - $250 - 1–2 minute walk-through video - $50 - Same-day inspection (subject to availability) - $180 - Saturday inspection (subject to availability) - $150 - Sunday inspection (subject to availability) - $300 - - -Apartment Pre-Settlement -Apartment Pre-settlement Inspection Pricing -Base Inspection -Building-only inspection - * Up to 2 combined bedrooms & bathrooms - - * One level (apartments are considered one level) - -Price: $400 -Additional Charges - - -Item - Price - Each additional bedroom - $50 - Each additional bathroom - $50 - - - - -Optional Add-Ons - - -Add-On - Price - Pest inspection - $150 - Thermal imaging & moisture meter - $150 - Roof inspection using drone - $250 - 1–2 minute walk-through video - $50 - Same-day inspection (subject to availability) - $180 - Saturday inspection (subject to availability) - $150 - Sunday inspection (subject to availability) - $300 - - - - - - - - -https://forms.monday.com/forms/06952a0406c7c96d7eff4d15f8019a66?r=use1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Booking questions - - - 1. Contact person 1 (first name / lastname / email /mobile) - 2. Contact person 2 (first name / lastname / email /mobile) - 3. Property address (Including Lot number) - 4. Agent details (first name / lastname / email /mobile) - 5. ATTACH engineer drawing (if available) - 6. ATTACH floor plans (if available) - 7. ATTACH roof truss layout (if available) - 8. Control joint layout (if available) - 9. ATTACH proof of payment - 10. Who will provide access? (Agent / vendor / tenant) - 11. Tentative Time - 12. Any comment or special needs -Pre-Handover inspection -Pre-Handover Inspection -pre hand over if apartment > apartment pre settlement -if house > construction PCI - - - - - - -https://forms.monday.com/forms/d5ea6163a6459424c4b62c00b57e7b24?r=use1 - - - - -important note -The rate sheet engine calculates a base price, but we add pricing based on location, property value and area value https://docs.google.com/spreadsheets/d/14LKewVfaGeIrhE4wCqESCOS89xSONS3z32JVWwfVL0s/edit?gid=0#gid=0 - We have given each property a mark from 1 to 10 And for each mark we add some %% to the price Ratesheet engine should use this sheet or we add it to dashboard We need to talk to Hossein Nazari about it -Dilapidation -Pre-Purchase Inspection Pricing -Base Inspection -Building-only inspection - * Up to 2 combined bedrooms & bathrooms - - * One level (apartments are considered one level) - -Price: $400 - - -Item - Price - Each additional bedroom - $50 - Each additional bathroom - $50 - Each additional level - $100 - Basement - $150 - Granny flat - $350 - Swimming pool - $100 - - -Optional Add-Ons (Per Property) - - -Add-On - Price - Owner Inspections arranging access to neighbouring properties - $50 - Roof inspection using drone - $250 - 1–2 minute walk-through video - $50 - Same-day inspection (subject to availability) - $180 - Saturday inspection (subject to availability) - $150 - Sunday inspection (subject to availability) - $300 - - - - - - - - - - -https://forms.monday.com/forms/0989e5030dc2bb690877d39a28dd2b85?r=use1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Booking questions (skipping the questions we ask on quote ) - - - 1. Client 2 name (if available) - 2. Client 2 last name (if available) - 3. Client 2 mobile number (if available) - 4. Client 2 email (if available) - 5. Property 1 address (Including Lot number) - 6. State - 7. How many storeys? - 8. Number of bedrooms and bathrooms - 9. Building size Inc. Garage (sq) - 10. Property 2(Neighbour) address (Including Lot number) (if Requested) - 11. How many storeys? - 12. Building size Inc. Garage (sq) - 13. Number of bedrooms and bathrooms - 14. Choose your package discount - 15. If they request OI to arrange everything with the neighbours: - 16. Neighbour Name - 17. Neighbour Number - 18. Neighbour Email - 19. What type of construction or works are taking place? -☐ Excavation -☐ Demolition -☐ New Building/Extension -☐ Roadworks / Infrastructure -☐ Other - 20. Where are the works located in relation to the property? -☐ Adjoining property -☐ Same property (before works start) -☐ Council/utility works nearby -☐ Other - 21. What is the report required for? -☐ Baseline record before construction starts -☐ Post-construction comparison -☐ Council/authority requirement -☐ Dispute resolution -☐ Other - 22. 23. ATTACH engineer drawing (if available) - 24. ATTACH floor plans (if available) - 25. ATTACH roof truss layout (if available) - 26. Control joint layout (if available) - 27. Any comment or special needs: - 28. Column for accepting the quote - 29. ATTACH proof of payment - 30. Tentative Time -drug resistance -Pre-Purchase Inspection Pricing -Base Inspection -Building-only inspection - * Up to 2 combined bedrooms & bathrooms - -Price: $400 -Additional Charges - - -Item - Price - Each additional bedroom - $50 - - - - - - - - -New Construction stages -New Construction Stages Inspection Pricing -Base Property Type -Single-storey dwelling - * Up to 25 squares - - * Prices below are per inspection stage -Inspection Stages & Pricing - - -Inspection Stage - Price - Bored Piers / Screw Piles - $490 - Slab Pre-Pour - $490 - Frame Inspection - $490 - Lock-Up (Pre-Plaster) - $490 - Fixing (including Waterproofing) - $490 - Completion (PCI / Pre-Handover) - $590 - Maintenance Stage - $590 - - -Additional Charges (Per Stage) - - - - -Condition - Additional Cost - Each additional level - * $50 - Every extra 0–5 squares - * $50 - Properties larger than 70 squares - Custom quote required - Granny flat - * $300 - - -Optional Add-Ons - - - - -Add-On - Price - Availability - Thermal imaging & moisture meter - $150 - PCI stage only - Roof inspection using drone - $250 - PCI stage only - 2–3 minute walk-through video - $50 - Any stage - Same-day inspection - $180 - Subject to availability - Saturday inspection - $150 - Subject to availability - Sunday inspection - $300 - Subject to availability - - -Offers: N/A -All stages with full payment in advanced: - * 150 $ off - * $50 reinspection credit per stage -Free 1-2 min video on per stage -FREE Thermal Camera at PCI -50 % off Drone at PCI -All stages with $500 deposit (credited to final inspection) - * - FREE 1-minute video each stage -Online booking within 1 hour: $50 off - - -Refund policy: -Non Refundable - - - - - - - - - - -https://forms.monday.com/forms/f36ab6c89a7db39ced2c71c8739fb047?r=use1 - - - - - - - - -Booking questions (skipping the questions we ask on quote ) - - - 1. Client 2 name (if available) - 2. Client 2 last name (if available) - 3. Client 2 mobile number (if available) - 4. Client 2 email (if available) - 5. Property address (Including Lot number) - 6. State - 7. How many storeys? - 8. Building size Inc. Garage (sq) - 9. Stage Inspection: - * Bored Piers (If Applicable) - * Slab Pre-Pour - * Fixing (and Waterproofing) - * Frame - * Lock-up (Before Plaster) - * Completion (PCI) - * Maintenance - 10. Choose your package discount - 11. Site Supervisor name (If known) - 12. Site Supervisor Number - 13. Site Supervisor Email - 14. Builder admin name - 15. Builder admin number - 16. Builder admin email - 17. ATTACH engineer drawing (if available) - 18. ATTACH floor plans (if available) - 19. ATTACH roof truss layout (if available) - 20. Control joint layout (if available) - 21. Construction tentatively commences within: - 22. Any comment or special needs: - 23. Column for accepting the quote - 24. ATTACH proof of payment -maintenance -New Construction Stages Inspection Pricing -Base Property Type -Single-storey dwelling - * Up to 25 squares - -Price: $590 -Additional Charges (Per Stage) - - - - -Condition - Additional Cost - Each additional level - * $50 - Every extra 0–5 squares - * $50 - Properties larger than 70 squares - Custom quote required - Granny flat - * $300 - - -Optional Add-Ons - - - - -Add-On - Price - Availability - Thermal imaging & moisture meter - $150 - PCI stage only - Roof inspection using drone - $250 - PCI stage only - 2–3 minute walk-through video - $50 - Any stage - Same-day inspection - $180 - Subject to availability - Saturday inspection - $150 - Subject to availability - Sunday inspection - $300 - Subject to availability - - -Offers: N/A -All stages with full payment in advanced: - * 150 $ off - * $50 reinspection credit per stage -Free 1-2 min video on per stage -FREE Thermal Camera at PCI -50 % off Drone at PCI -All stages with $500 deposit (credited to final inspection) - * - FREE 1-minute video each stage -Online booking within 1 hour: $50 off - - -Refund policy: -Non Refundable - - - - - - - - - - -https://forms.monday.com/forms/f36ab6c89a7db39ced2c71c8739fb047?r=use1 - - - - - - - - -Booking questions (skipping the questions we ask on quote ) - - - 1. Client 2 name (if available) - 2. Client 2 last name (if available) - 3. Client 2 mobile number (if available) - 4. Client 2 email (if available) - 5. Property address (Including Lot number) - 6. State - 7. How many storeys? - 8. Building size Inc. Garage (sq) - 9. Stage Inspection: - * Bored Piers (If Applicable) - * Slab Pre-Pour - * Fixing (and Waterproofing) - * Frame - * Lock-up (Before Plaster) - * Completion (PCI) - * Maintenance - 10. Choose your package discount - 11. Site Supervisor name (If known) - 12. Site Supervisor Number - 13. Site Supervisor Email - 14. Builder admin name - 15. Builder admin number - 16. Builder admin email - 17. ATTACH engineer drawing (if available) - 18. ATTACH floor plans (if available) - 19. ATTACH roof truss layout (if available) - 20. Control joint layout (if available) - 21. Construction tentatively commences within: - 22. Any comment or special needs: - 23. Column for accepting the quote - 24. ATTACH proof of payment - - -Insurance Report -InsuranceInspection Pricing - - - - -Stage - Item - Price - - - 1 - Document review & site inspection - $1,500 - Fixed price - 2 - Detailed report preparation - $1,500 - + $1,000 Each additional $100,000 of loss - 3 - Cost estimate preparation - $1,500 - + $1,000 Each additional $100,000 of loss - - - - -Optional Add-Ons - - -Add-On - Price - Thermal imaging & moisture meter - $150 - Roof inspection using drone - $250 - Same-day inspection - $180 (subject to availability) - Saturday inspection - $150 (subject to availability) - Sunday inspection - $300 (subject to availability) - - - - - - - - - - - - - - - - - - - - - - - - - - - - -https://forms.monday.com/forms/cbe78bb1c2735c19f63f4a92f203b933?r=use1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Booking questions (skipping the questions we ask on quote ) - - - 1. Property Address - 2. Is it house/apartment/ townhouse/ commercial - 3. Policy holder/tenant/builder/insurance company representative - 4. Approx. age of property - 5. Is the property occupied or vacant - 6. Name of insurance company - 7. Claim number (if available) - 8. Type of insurance claim: - * Storm - * Hail - * flood/water damage - * Fire - * Structural defect - * subsidence/movement - - - 9. Has the claim already been lodged? - 10. Has the insurer already sent an assessor/builder? - 11. Are there specific issues the insurer has asked to be investigated? - 12. Main Issue - 13. Areas of damage (roof/ceiling/walls/floors/windows or doors/external areas/others) - 14. Photos/videos (if available) - 15. Has any other professional (builder/plumber/engineer/assessor) provided a report? - 16. If yes, provide copies -Defects Investigation Report -Defect Investigation Inspection Pricing - - - - -Stage - Item - Price - 1 - Document review & site inspection - $1,500 - 2 - Detailed report preparation - $1,500 - - - - -Optional Add-Ons - - -Add-On - Price - Thermal imaging & moisture meter - $150 - Roof inspection using drone - $250 - Same-day inspection - $180 (subject to availability) - Saturday inspection - $150 (subject to availability) - Sunday inspection - $300 (subject to availability) - - - - - - -Defect investigation has 2 stages -If only stage umber is added in request payload add it to the quote_price - - - - - - - - - - - - - -https://forms.monday.com/forms/045ab4c86451914e6aac905e91b5e489?r=use1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Booking questions (skipping the questions we ask on quote ) - - - 1. Property owner / tenant / builder / strata or body corporate / solicitor - 2. Property Address - 3. Is it house / apartment / townhouse / commercial - 4. Approx. age of the property - 5. Is the property occupied or vacant - 6. Brief declaration of main issue - 7. Affected Areas (roof / ceiling / walls / floors / windows or doors / external areas / plumbing / electrical / others) - 8. Photos / videos (if available) - 9. The Problem/concern (cracking, leaks, movement, water ingress, uneven floors) -Expert Witness Report -Expert Witness Inspection Pricing - - - - -Stage - Item - Price - - - 1 - Document review & site inspection - $2450 - up to 7 hours - 2 - Detailed report preparation - $350 - For each extra hours (min 7 hours) - 3 - Cost estimate preparation (scott schedule) - $350 - For each extra hours (min 7 hours) - - - - -Optional Add-Ons - - -Add-On - Price - Thermal imaging & moisture meter - $150 - Roof inspection using drone - $250 - Same-day inspection - $180 (subject to availability) - Saturday inspection - $150 (subject to availability) - Sunday inspection - $300 (subject to availability) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Booking questions (skipping the questions we ask on quote ) - - - 1. Property Address - 2. Is it house/apartment/ townhouse/ commercial - 3. Property owner/tenant/builder/solicitor - 4. Are you currently represented by a solicitor? - 5. If yes: - * Solicitor name - * Solicitor number - * Solicitor email address - 6. Age of the property - 7. Is the property occupied or vacant - 8. The Main issue (brief description) - 9. Who is the dispute with? (builder, contractor, developer, strata, insurer) - 10. Is this matter currently in: - * NCAT/VCAT/QCAT/Other Tribunal - * Court - * Mediation/Pre-trial - * Not yet lodged - 11. Is there a deadline for submission of the report - 12. Has anyone previously inspected or reported on this matter? - 13. If yes: provide details - * Builder report - * Engineer’s report - * Insurer’s assessment - - - 14. What do you require from the Expert Witness Report? - * Independent expert opinion on defects - * Assessment of builder’s workmanship against standards - * Cost-to-rectify estimate - * Response to another party’s report - * Other - 15. Photos/videos (if available) - 16. Report purpose: - * Builder/contractor dispute - * Insurance/strata claim - * Legal purposes -Condition report - - -Renovation / Alteration - - -strata building bond - - -137B - - -brain storming -Future inspections -Rental Property Condition Report (Entry / Exit) -condition report -addin pre sales inspection -what is building inspection -handover inspecton -asbestos report -mintnance report -home renovation -https://www.consumer.vic.gov.au/housing/buying-and-selling-property/buying-property/inspect-properties-before-you-buy -what do u think of https://inspectioncentral.com.au/ - 1. submit the quote (i need consultant before buying) - 2. needs quote - • 3. pays online - - -User Flow - - -Service & Sales Model -1. Service Classification -A. By Sales Method - * Type X – Instant Price (Self-Serve) - * Price is calculated automatically - * Customer can accept quote and pay online - * Type Y – Sales-Assisted - * Requires consultation (phone or online meeting) - * Price may be discussed or negotiated with sales - * No instant payment before consultation -________________ - - -B. By Staging - * Non-Staged Services - * Single delivery - * Staged Services - * Multiple stages (e.g. construction stages) - * Customer may: - * Buy one stage - * Buy multiple stages at once - * Buy one stage now and return later for additional stages -Each stage must be independently quotable, invoiceable, and payable. -________________ - - -End-to-End Customer & System Flow -________________ - - -STEP 1 — Lead Capture & Quote Creation -Customer Flow -Customer fills the form and submits: -Form Fields - * First name - * Last name - * Email - * Phone - * Property address - * Service type -Customer is redirected to a Thank You page. -________________ - - -Backend Automation (Triggered on Submit) - 1. Property Intelligence - * Call OpenAI API to extract: - * Property type - * Bedrooms / bathrooms / levels - * Special attributes (basement, granny flat, pool, etc.) - 2. Pricing - * Send structured property + service data to Rate Sheet Engine - * Calculate base price + addons + stages (if applicable) - 3. CRM Objects Created - * Contact (customer) - * Property - * Job (primary container) - * Quote (linked to job) - 4. Associations - * Contact ↔ Property ↔ Job ↔ Quote -________________ - - -Customer Communication Logic -If Service = Type X (Instant Price) - * Email sent: - * Quote summary - * “View Quote” button - * “Accept Quote & Pay” CTA -If Service = Type Y (Sales-Assisted) - * Email sent: - * Thank-you message - * One or more Calendly booking links - * No payment CTA at this stage -________________ - - -Website Access Logic - * Customer can: - * Open quote via email or - * View quote on website - * Phone verification is mandatory before showing quote details -________________ - - -STEP 1.1 — Sales Intervention (Optional) -Used for Type Y or renegotiated Type X services. -Sales Capabilities - * Modify quote price - * Add / remove addons - * Add or remove stages - * Generate Quote Revision (q1, q2, …) - * Email updated quote to customer -Only the latest active quote can be accepted. -________________ - - -STEP 2 — Quote Acceptance → Invoice Creation -Customer Action - * Clicks “Accept Quote & Pay Now” -System Actions - 1. Lock the accepted quote (read-only) - 2. Generate an Invoice: - * Same structure as quote - * Unique invoice number - * Linked to job & quote - 3. Show invoice to customer - 4. Display “Pay Now” button -________________ - - -STEP 3 — Payment Processing (Stripe) -Payment Flow - 1. Customer clicks Pay Now - 2. Redirect to Stripe Checkout - 3. Stripe returns payment status via webhook -________________ - - -Payment Handling Logic - * Record payment in system: - * Amount - * Method - * Stripe payment ID - * Detect payment type: - * Full payment - * Partial payment - * Update invoice status: - * Paid - * Partially Paid -________________ - - -Customer View - * Payment receipt displayed - * Payment history visible in dashboard -________________ - - -STEP 4 — Booking After Payment -Customer Action - * From receipt page: - * Click “Book Now” - * Redirected to booking form/page -________________ - - -Booking Form Collects - * Preferred inspection date/time - * Access details - * Additional contacts - * Notes / special instructions -________________ - - -System Actions - 1. Attach booking data to job - 2. Set job status → Booked - 3. Show confirmation message: -“Your booking is received and pending confirmation.” -________________ - - -Internal Sales / Ops Action - * Review booking - * Confirm availability - * Update job status → Booking Confirmed - * Send booking confirmation email to customer -________________ - - -Job & Financial Status Model (Recommended) -Job Status - * New Lead - * Quoted - * Quote Revised - * Quote Accepted - * Invoiced - * Paid / Partially Paid - * Booked - * Booking Confirmed - * Completed -________________ - - -Quote Status - * Draft - * Sent - * Revised - * Accepted - * Expired -________________ - - -Invoice Status - * Draft - * Issued - * Partially Paid - * Paid -________________ - - -Key Design Principles (Why This Works) - * Single Job is the source of truth - * Quotes and invoices are versioned, not overwritten - * Supports: - * Staged services - * Partial payments - * Sales renegotiation - * Returning customers buying more stages later - * Same flow for frontend & email - * Clean separation between Quote → Invoice → Payment → Booking \ No newline at end of file diff --git a/Product-Fields-Mapping.md b/Product-Fields-Mapping.md deleted file mode 100644 index f2b0d4d..0000000 --- a/Product-Fields-Mapping.md +++ /dev/null @@ -1,154 +0,0 @@ -# 📋 مقایسه فیلدها - سیستم محصولات - -## 🔵 فیلدهای محصول (Product Fields) - -| فرم ما | API Field | نوع | توضیح | -| ---------------------- | ---------------------- | ---------- | ------------------------ | -| ✅ `name` | ✅ `name` | `string` | نام محصول | -| ✅ `description` | ✅ `description` | `string` | توضیحات محصول | -| ✅ `design_style` | ✅ `design_style` | `string` | استایل طراحی | -| ✅ `enabled` | ✅ `enabled` | `boolean` | فعال/غیرفعال | -| ✅ `category_ids` | ✅ `category_ids` | `number[]` | آرایه شناسه دسته‌بندی‌ها | -| ✅ `product_option_id` | ✅ `product_option_id` | `number` | شناسه گزینه محصول | -| ✅ `total_sold` | ✅ `total_sold` | `number` | تعداد فروخته شده | -| ✅ `type` | ✅ `type` | `number` | نوع محصول (0,1,2,3) | -| ✅ `attributes` | ✅ `attributes` | `object` | ویژگی‌های سفارشی | -| ✅ `variants` | ✅ `variants` | `array` | آرایه variants | - -## 🔧 فیلدهای Variant - -| فرم ما | API Field | نوع | توضیح | -| ---------------------- | ---------------------- | --------- | -------------------------- | -| ✅ `enabled` | ✅ `enabled` | `boolean` | فعال/غیرفعال variant | -| ✅ `fee_percentage` | ✅ `fee_percentage` | `number` | درصد کارمزد | -| ✅ `profit_percentage` | ✅ `profit_percentage` | `number` | درصد سود | -| ✅ `stock_limit` | ✅ `stock_limit` | `number` | حد کمینه موجودی | -| ✅ `stock_managed` | ✅ `stock_managed` | `boolean` | مدیریت موجودی فعال/غیرفعال | -| ✅ `stock_number` | ✅ `stock_number` | `number` | تعداد موجودی | -| ✅ `weight` | ✅ `weight` | `number` | وزن (گرم) | -| ✅ `attributes` | ✅ `attributes` | `object` | ویژگی‌های variant | -| ✅ `meta` | ✅ `meta` | `object` | Meta data | - -## 📊 فیلدهای اضافی در فرم - -| فرم ما | API | دلیل | -| --------------- | ------- | ------------------------------ | -| 🆕 `images` | ❌ نیست | برای آپلود و مدیریت تصاویر | -| 🆕 `id` | ❌ نیست | برای ویرایش (از response میاد) | -| 🆕 `created_at` | ❌ نیست | از response میاد | -| 🆕 `updated_at` | ❌ نیست | از response میاد | - -## 🎯 مثال API Request کامل - -```json -{ - "name": "تیشرت مردانه", - "description": "تیشرت با کیفیت بالا", - "design_style": "مدرن", - "enabled": true, - "category_ids": [1, 3], - "product_option_id": 2, - "total_sold": 25, - "type": 1, - "attributes": { - "material": "پنبه", - "season": "تابستان" - }, - "variants": [ - { - "enabled": true, - "fee_percentage": 5.5, - "profit_percentage": 25, - "stock_managed": true, - "stock_number": 10, - "stock_limit": 2, - "weight": 200, - "attributes": { - "color": "قرمز", - "size": "بزرگ" - }, - "meta": { - "supplier": "تامین‌کننده A", - "priority": "high" - } - } - ] -} -``` - -## 🚀 نوع محصولات (Product Types) - -| مقدار | نام | توضیح | -| ----- | ----------- | ----------------------- | -| `0` | محصول ساده | محصول بدون variant | -| `1` | محصول متغیر | محصول با variants مختلف | -| `2` | محصول گروهی | مجموعه محصولات | -| `3` | محصول خارجی | لینک به سایت خارجی | - -## 🎨 فیلدهای UI (غیر API) - -### فیلدهای مدیریت تصاویر: - -- **`images`** - آرایه تصاویر محصول -- **`images.id`** - شناسه فایل آپلود شده -- **`images.url`** - آدرس تصویر -- **`images.alt`** - متن جایگزین -- **`images.order`** - ترتیب نمایش - -### فیلدهای مدیریت داخلی: - -- **`id`** - شناسه محصول (برای ویرایش) -- **`created_at`** - تاریخ ایجاد -- **`updated_at`** - تاریخ آخرین ویرایش - -## ✨ خلاصه مطابقت - -### ✅ کاملاً مطابق: - -- **100% فیلدهای API پیاده‌سازی شده** -- **ساختار دقیقاً مشابه** -- **نوع داده‌ها صحیح** -- **Validation مناسب** - -### 🎯 ویژگی‌های اضافی: - -- **مدیریت تصاویر** با آپلود و پیش‌نمایش -- **UI/UX بهتر** با validation و error handling -- **Preview زنده** تغییرات -- **Responsive design** برای موبایل - -## 📝 نتیجه‌گیری - -**✅ تمام فیلدهای API شما دقیقاً پیاده‌سازی شده است** - -**🎨 قابلیت‌های اضافی UI/UX برای تجربه بهتر کاربر اضافه شده** - -**🚀 سیستم آماده برای استفاده در production** - ---- - -## 📋 فیلدهای حذف شده (که در API نبودند) - -### ❌ فیلدهایی که حذف کردیم: - -- **`price`** - نه در محصول و نه در variant -- **`sku`** - نه در محصول و نه در variant -- **`status`** - در API نبود -- **`name`** برای variant - در API نبود - -### 🔄 تغییرات انجام شده: - -1. **Models** به‌روزرسانی شد طبق API دقیق -2. **Product Form** فیلدهای اضافی حذف شد -3. **Variant Manager** ساده‌سازی شد طبق API -4. **Validation** تنظیم شد برای فیلدهای جدید - -## 🛠️ فایلهای تغییر یافته: - -- `src/pages/products/core/_models.ts` -- `src/pages/products/product-form/ProductFormPage.tsx` -- `src/components/ui/VariantManager.tsx` - -## 🎉 نتیجه نهایی: - -**سیستم کاملاً آماده و مطابق با API شماست! 🚀** diff --git a/dashboard-api-requirements.md b/dashboard-api-requirements.md deleted file mode 100644 index 5a87cf3..0000000 --- a/dashboard-api-requirements.md +++ /dev/null @@ -1,429 +0,0 @@ -# درخواست API‌های داشبورد - -سلام تیم بک‌اند 👋 - -برای تکمیل صفحه داشبورد نیاز به API‌های زیر داریم. لطفاً این API‌ها را پیاده‌سازی کنید: - ---- - -## 1. API آمار کلی داشبورد (Dashboard Overview Stats) - -**Endpoint:** `GET /api/v1/admin/dashboard/stats` - -**Description:** دریافت آمار کلی سیستم شامل سفارشات، درآمد، کاربران و محصولات - -**Response:** - -```json -{ - "orders": { - "total": 1250, - "pending": 45, - "completed": 1100, - "cancelled": 105, - "today_count": 23, - "today_amount": 45000000 - }, - "revenue": { - "total": 2500000000, - "today": 45000000, - "this_month": 350000000, - "last_month": 320000000, - "growth_percentage": 9.4 - }, - "users": { - "total": 8500, - "active": 7200, - "new_today": 15, - "new_this_month": 450 - }, - "products": { - "total": 1250, - "active": 1100, - "low_stock": 25, - "out_of_stock": 8 - } -} -``` - ---- - -## 2. API فروش ماهانه (Monthly Sales Chart) - -**Endpoint:** `GET /api/v1/admin/dashboard/monthly-sales` - -**Description:** دریافت آمار فروش به صورت ماهانه برای نمایش در چارت - -**Query Parameters:** - -- `months` (optional, default: 6) - تعداد ماه‌های گذشته که باید برگردانده شود - -**Response:** - -```json -{ - "data": [ - { - "month": "فروردین", - "month_number": 1, - "year": 1403, - "total_amount": 350000000, - "order_count": 450 - }, - { - "month": "اردیبهشت", - "month_number": 2, - "year": 1403, - "total_amount": 420000000, - "order_count": 520 - } - // ... برای تعداد ماه‌های درخواستی - ] -} -``` - -**Note:** داده‌ها باید به ترتیب زمانی (از قدیمی‌ترین به جدیدترین) مرتب باشند. - ---- - -## 3. API روند رشد (Growth Trend) - -**Endpoint:** `GET /api/v1/admin/dashboard/growth-trend` - -**Description:** دریافت روند رشد سیستم در بازه‌های زمانی مختلف - -**Query Parameters:** - -- `period` (optional, default: "monthly") - نوع بازه زمانی: `"daily"`, `"weekly"`, `"monthly"` -- `days` (optional, default: 30) - تعداد روزها برای `period=daily` -- `weeks` (optional, default: 12) - تعداد هفته‌ها برای `period=weekly` -- `months` (optional, default: 12) - تعداد ماه‌ها برای `period=monthly` - -**Response:** - -```json -{ - "period": "monthly", - "data": [ - { - "date": "1403/01", - "revenue": 350000000, - "orders": 450, - "users": 120 - }, - { - "date": "1403/02", - "revenue": 420000000, - "orders": 520, - "users": 135 - } - // ... - ], - "growth_rate": 9.4 -} -``` - ---- - -## 4. API کاربران اخیر (Recent Users) - -**Endpoint:** `GET /api/v1/admin/dashboard/recent-users` - -**Description:** دریافت لیست کاربران جدید که اخیراً ثبت‌نام کرده‌اند - -**Query Parameters:** - -- `limit` (optional, default: 10) - تعداد کاربران - -**Response:** - -```json -{ - "users": [ - { - "id": 1, - "first_name": "علی", - "last_name": "احمدی", - "username": "ali_ahmadi", - "email": "ali@example.com", - "phone": "09123456789", - "status": "active", - "created_at": "2024-01-15T10:30:00Z" - }, - { - "id": 2, - "first_name": "فاطمه", - "last_name": "حسینی", - "username": "fateme_hosseini", - "email": "fateme@example.com", - "phone": "09123456790", - "status": "active", - "created_at": "2024-01-14T15:20:00Z" - } - // ... - ], - "total": 10 -} -``` - -**Note:** کاربران باید به ترتیب تاریخ ثبت‌نام (جدیدترین اول) مرتب باشند. - ---- - -## 5. API توزیع دستگاه‌های کاربری (Device Distribution) - -**Endpoint:** `GET /api/v1/admin/dashboard/device-distribution` - -**Description:** دریافت آمار توزیع دستگاه‌های کاربری (دسکتاپ، موبایل، تبلت) - -**Response:** - -```json -{ - "data": [ - { - "device_type": "desktop", - "label": "دسکتاپ", - "count": 4500, - "percentage": 45.5 - }, - { - "device_type": "mobile", - "label": "موبایل", - "count": 3500, - "percentage": 35.2 - }, - { - "device_type": "tablet", - "label": "تبلت", - "count": 2000, - "percentage": 19.3 - } - ], - "total": 10000 -} -``` - -**Note:** درصدها باید به صورت عدد صحیح (بدون اعشار) برگردانده شوند. - ---- - -## 6. API سفارش‌های اخیر (Recent Orders) - -**Endpoint:** `GET /api/v1/admin/dashboard/recent-orders` - -**Description:** دریافت لیست آخرین سفارش‌های ثبت شده - -**Query Parameters:** - -- `limit` (optional, default: 10) - تعداد سفارش‌ها - -**Response:** - -```json -{ - "orders": [ - { - "id": 1234, - "order_number": "ORD-2024-001234", - "customer_name": "علی احمدی", - "customer_id": 45, - "total_amount": 2500000, - "status": "pending", - "payment_status": "paid", - "created_at": "2024-01-15T14:30:00Z" - }, - { - "id": 1233, - "order_number": "ORD-2024-001233", - "customer_name": "فاطمه حسینی", - "customer_id": 46, - "total_amount": 1800000, - "status": "completed", - "payment_status": "paid", - "created_at": "2024-01-15T13:20:00Z" - } - // ... - ], - "total": 10 -} -``` - -**Note:** سفارش‌ها باید به ترتیب تاریخ ایجاد (جدیدترین اول) مرتب باشند. - ---- - -## 7. API محصولات پرفروش (Top Selling Products) - -**Endpoint:** `GET /api/v1/admin/dashboard/top-products` - -**Description:** دریافت لیست محصولات پرفروش - -**Query Parameters:** - -- `limit` (optional, default: 5) - تعداد محصولات -- `period` (optional, default: "month") - بازه زمانی: `"day"`, `"week"`, `"month"` - -**Response:** - -```json -{ - "products": [ - { - "id": 45, - "name": "محصول نمونه", - "sku": "PRD-001", - "sold_count": 250, - "revenue": 125000000, - "image_url": "https://example.com/images/product-45.jpg" - }, - { - "id": 78, - "name": "محصول دیگر", - "sku": "PRD-002", - "sold_count": 180, - "revenue": 90000000, - "image_url": "https://example.com/images/product-78.jpg" - } - // ... - ] -} -``` - -**Note:** محصولات باید به ترتیب تعداد فروش (بیشترین اول) مرتب باشند. - ---- - -## 8. API آمار مقایسه‌ای (Comparison Stats) - -**Endpoint:** `GET /api/v1/admin/dashboard/comparison` - -**Description:** دریافت آمار مقایسه‌ای بین دوره فعلی و دوره قبلی - -**Query Parameters:** - -- `compare_with` (optional, default: "last_period") - نوع مقایسه: `"last_period"`, `"last_year"` -- `period` (optional, default: "month") - نوع دوره: `"day"`, `"week"`, `"month"` - -**Response:** - -```json -{ - "current": { - "revenue": 350000000, - "orders": 450, - "users": 120 - }, - "previous": { - "revenue": 320000000, - "orders": 410, - "users": 105 - }, - "changes": { - "revenue": { - "amount": 30000000, - "percentage": 9.4, - "trend": "up" - }, - "orders": { - "amount": 40, - "percentage": 9.8, - "trend": "up" - }, - "users": { - "amount": 15, - "percentage": 14.3, - "trend": "up" - } - } -} -``` - -**Note:** - -- `trend` می‌تواند `"up"`, `"down"` یا `"stable"` باشد -- درصدها می‌توانند اعشار داشته باشند - ---- - -## نکات مهم و الزامات: - -1. **احراز هویت:** همه API‌ها باید نیاز به احراز هویت داشته باشند (Bearer Token) - -2. **فیلتر تاریخ:** در صورت امکان، همه API‌ها باید قابلیت فیلتر بر اساس بازه زمانی را داشته باشند: - - - `from_date` (optional) - تاریخ شروع - - `to_date` (optional) - تاریخ پایان - -3. **فرمت تاریخ:** - - - تاریخ‌ها در Response باید به فرمت ISO 8601 برگردانده شوند: `"2024-01-15T14:30:00Z"` - - تاریخ‌های ورودی می‌توانند به فرمت ISO 8601 یا timestamp باشند - -4. **فرمت مبالغ:** - - - همه مبالغ به تومان هستند - - مبالغ باید به صورت عدد (integer) برگردانده شوند - -5. **ترتیب داده‌ها:** - - - داده‌های زمانی باید به ترتیب زمانی (از قدیمی‌ترین به جدیدترین) مرتب باشند - - داده‌های مرتب‌سازی شده (مثل پرفروش‌ترین) باید به ترتیب مناسب مرتب باشند - -6. **مقدار پیش‌فرض:** - - - در صورت نبود داده، آرایه خالی `[]` یا `null` برگردانده شود - - مقادیر عددی در صورت نبود داده باید `0` باشند - -7. **خطاها:** - - - در صورت خطا، کد HTTP مناسب برگردانده شود - - پیام خطا به فارسی و واضح باشد - -8. **Performance:** - - برای بهینه‌سازی، می‌توان از کش استفاده کرد - - Query‌ها باید بهینه باشند تا زمان پاسخگویی کم باشد - ---- - -## اولویت پیاده‌سازی: - -1. **اولویت بالا:** - - - API آمار کلی داشبورد (#1) - - API فروش ماهانه (#2) - - API کاربران اخیر (#4) - - API سفارش‌های اخیر (#6) - -2. **اولویت متوسط:** - - - API روند رشد (#3) - - API محصولات پرفروش (#7) - - API آمار مقایسه‌ای (#8) - -3. **اولویت پایین:** - - API توزیع دستگاه‌های کاربری (#5) - در صورت وجود داده - ---- - -## مثال استفاده: - -```bash -# دریافت آمار کلی -curl -X GET "https://api.example.com/api/v1/admin/dashboard/stats" \ - -H "Authorization: Bearer YOUR_TOKEN" - -# دریافت فروش 6 ماه گذشته -curl -X GET "https://api.example.com/api/v1/admin/dashboard/monthly-sales?months=6" \ - -H "Authorization: Bearer YOUR_TOKEN" - -# دریافت کاربران اخیر -curl -X GET "https://api.example.com/api/v1/admin/dashboard/recent-users?limit=10" \ - -H "Authorization: Bearer YOUR_TOKEN" -``` - ---- - -**ممنون می‌شوم اگر این API‌ها را در اسرع وقت پیاده‌سازی کنید تا بتوانیم داشبورد را کامل کنیم.** 🙏 - -**در صورت نیاز به توضیحات بیشتر یا تغییرات، لطفاً اطلاع دهید.** diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index 43e44f8..24b76a5 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -1,8 +1,27 @@ -import { useState } from 'react'; +import { Suspense, useState } from 'react'; import { Outlet } from 'react-router-dom'; import { Sidebar } from './Sidebar'; import { Header } from './Header'; +const ContentSkeleton = () => ( +
+
+
+ {[...Array(3)].map((_, index) => ( +
+
+
+ ))} +
+
+
+
+
+); + export const Layout = () => { const [sidebarOpen, setSidebarOpen] = useState(false); @@ -18,7 +37,9 @@ export const Layout = () => {
- + }> + +