diff --git a/prompt b/prompt index e69de29..5682053 100644 --- a/prompt +++ b/prompt @@ -0,0 +1,5 @@ +django server code : /home/vignesh/github/seller_central_backend +Don't push code without my command +beta site : https://betasuppliers.tipro.in/ +in betasite only you need test with playwright +Read this repo and understand this project , once you ready let me know i will provide you instruction \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 706e0f7..d9f0f7c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -68,6 +68,13 @@ export default function App() { const [aadharS3Key, setAadharS3Key] = useState(null) const [panS3Key, setPanS3Key] = useState(null) + // New onboarding customization states + const [businessType, setBusinessType] = useState<'registered_company' | 'self_help_group' | 'individual_maker'>('registered_company') + const [storeSlug, setStoreSlug] = useState('') + const [supportEmail, setSupportEmail] = useState('') + const [supportPhone, setSupportPhone] = useState('') + const [selectedCategories, setSelectedCategories] = useState([]) + // Step 3: Store and Location details const [storeName, setStoreName] = useState('My Artisan Handloom') const [storeLogo, setStoreLogo] = useState(null) @@ -158,6 +165,13 @@ export default function App() { setPanFile(profile.pan_file || null); setAadharS3Key(profile.aadhar_s3_key || null); setPanS3Key(profile.pan_s3_key || null); + + setBusinessType(profile.business_type || 'registered_company'); + setStoreSlug(profile.store_slug || ''); + setSupportEmail(profile.support_email || ''); + setSupportPhone(profile.support_phone || ''); + setSelectedCategories(profile.categories || []); + setStoreName(profile.store_name || 'My Artisan Handloom'); setStoreLogo(profile.store_logo || null); setLogoS3Key(profile.logo_s3_key || null); @@ -173,7 +187,7 @@ export default function App() { } const step = profile.onboarding_step; - if (step >= 4) { + if (step >= 7) { setIsProfileComplete(true); setCurrentPage('dashboard'); } else { @@ -529,6 +543,11 @@ export default function App() { email_verified: emailVerified, gstin: gstin, is_gstin_verified: isGstinVerified, + business_type: businessType, + store_slug: storeSlug, + support_email: supportEmail, + support_phone: supportPhone, + categories: selectedCategories, aadhar_file: aadharFile, pan_file: panFile, aadhar_s3_key: aadharS3Key || 'suppliers/default/aadhar.pdf', @@ -557,14 +576,13 @@ export default function App() { if (profileStep === 2) { setIsGstinVerified(true) } - const isLastStep = profileStep === 3; + const isLastStep = profileStep === 6; saveProfileBackend(isLastStep) .then(() => { if (!isLastStep) { setProfileStep(prev => prev + 1) } else { - setIsProfileComplete(true) - navigateTo('welcome-tour', true) + setProfileStep(7); } }) .catch(err => { @@ -1256,13 +1274,17 @@ export default function App() { {currentPage === 'profile-completion' && (
- Step {profileStep} of 3: { - profileStep === 1 ? 'Contact Verification' : - profileStep === 2 ? 'Tax & Identity Verification' : - 'Store & Pickup Location' + Step {profileStep} of 7: { + profileStep === 1 ? 'Welcome' : + profileStep === 2 ? 'Business Details' : + profileStep === 3 ? 'Identity Verification' : + profileStep === 4 ? 'Contact Verification' : + profileStep === 5 ? 'Choose Categories' : + profileStep === 6 ? 'Store Setup' : + 'Verification' }
-
+
@@ -1270,8 +1292,177 @@ export default function App() {
{profileStep === 1 && ( +
+
👋
+

Welcome to Tradhox Onboarding

+

+ We bridge the gap between traditional Indian artistry and a global marketplace. + Let's set up your supplier profile in a few simple steps. +

+ +
+ )} + + {profileStep === 2 && (
-

Step 1: Verify Contacts

+

Step 2: Business Details

+
+ +
+ + + +
+
+
+ +
+ setGstin(e.target.value)} + required + /> + +
+ {isGstinVerified && ( +

+ ✓ GSTIN verification will be completed within the next 24 hrs +

+ )} +
+
+ + +
+
+ )} + + {profileStep === 3 && ( +
+

Step 3: Identity Verification

+ + {/* Aadhaar Upload */} +
+ +
+ { + if (e.target.files?.[0]) { + const file = e.target.files[0]; + setAadharFile(file.name); + alert(`Aadhaar card selected: ${file.name}. Uploading...`); + const s3Key = await uploadDocument(file, 'aadhar'); + setAadharS3Key(s3Key); + alert(`Aadhaar card uploaded successfully!`); + } + }} + style={{ display: 'none' }} + /> + + + {aadharFile ? `Selected: ${aadharFile}` : 'No file uploaded yet'} + +
+
+ + {/* PAN Upload */} +
+ +
+ { + if (e.target.files?.[0]) { + const file = e.target.files[0]; + setPanFile(file.name); + alert(`PAN card selected: ${file.name}. Uploading...`); + const s3Key = await uploadDocument(file, 'pan'); + setPanS3Key(s3Key); + alert(`PAN card uploaded successfully!`); + } + }} + style={{ display: 'none' }} + /> + + + {panFile ? `Selected: ${panFile}` : 'No file uploaded yet'} + +
+
+ +
+ + +
+
+ )} + + {profileStep === 4 && ( +
+

Step 4: Verify Contacts

{/* Phone/WhatsApp Verification */}
@@ -1417,169 +1608,151 @@ export default function App() { )}
- -
- )} - - {profileStep === 2 && ( -
-

Step 2: GSTIN, PAN & Aadhaar

- - {/* GSTIN verification */} -
- -
- setGstin(e.target.value)} - required - /> - -
- {isGstinVerified && ( -

- verification will be completed within next 24 hrs -

- )} -
- - {/* Aadhaar Upload */} -
- -
- { - if (e.target.files?.[0]) { - const file = e.target.files[0]; - setAadharFile(file.name); - alert(`Aadhaar card selected: ${file.name}. Uploading...`); - const s3Key = await uploadDocument(file, 'aadhar'); - setAadharS3Key(s3Key); - alert(`Aadhaar card uploaded successfully!`); - } - }} - style={{ display: 'none' }} - /> - - - {aadharFile ? `Selected: ${aadharFile}` : 'No file uploaded yet'} - -
-
- - {/* PAN Upload */} -
- -
- { - if (e.target.files?.[0]) { - const file = e.target.files[0]; - setPanFile(file.name); - alert(`PAN card selected: ${file.name}. Uploading...`); - const s3Key = await uploadDocument(file, 'pan'); - setPanS3Key(s3Key); - alert(`PAN card uploaded successfully!`); - } - }} - style={{ display: 'none' }} - /> - - - {panFile ? `Selected: ${panFile}` : 'No file uploaded yet'} - -
-
-
-
)} - {profileStep === 3 && ( + {profileStep === 5 && (
-

Step 3: Store Details & Location Map

+

Step 5: Choose Product Categories

+

+ Select the categories that apply to your artisanal goods. +

+
+ {['Sustainable Products', 'Home Decor', 'Eco-Friendly', 'OPOD Products', 'GI Tagged', 'Textiles & Apparel'].map(cat => { + const isSelected = selectedCategories.includes(cat); + return ( +
{ + if (isSelected) { + setSelectedCategories(selectedCategories.filter(c => c !== cat)); + } else { + setSelectedCategories([...selectedCategories, cat]); + } + }} + style={{ + padding: '1rem', + border: isSelected ? '2px solid var(--primary)' : '1px solid var(--border)', + backgroundColor: isSelected ? 'rgba(107, 26, 44, 0.05)' : 'transparent', + borderRadius: '8px', + cursor: 'pointer', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + fontWeight: isSelected ? '600' : 'normal', + transition: 'all 0.2s ease', + textAlign: 'center' + }} + > + {cat} +
+ ); + })} +
+ +
+ + +
+
+ )} + + {profileStep === 6 && ( +
+

Step 6: Store Details & Pickup Location

-
- - setStoreName(e.target.value)} - required - /> +
+
+ + setStoreName(e.target.value)} + required + /> +
+
+ + setStoreSlug(e.target.value.toLowerCase().replace(/[^a-z0-9\-]/g, ''))} + required + /> +
+
+ +
+
+ + setSupportEmail(e.target.value)} + required + /> +
+
+ + setSupportPhone(e.target.value)} + required + /> +
- +
- {/* Interactive Location Map Picker */}
- {/* Map Marker Pin */}
📍
-
- Coordinates: Lat {mapCoordinates.lat}, Lng {mapCoordinates.lng} (Click map to change pin) -
- Click anywhere on the map grid to pin location + Click map to pin location
- + setAddress({ ...address, street: e.target.value })} required />
-
+
+
+ + setAddress({ ...address, state: e.target.value })} + required + /> +
setAddress({ ...address, pincode: e.target.value })} required @@ -1676,79 +1842,45 @@ export default function App() {
-
)} + + {profileStep === 7 && ( +
+
🎉
+

Setup Complete!

+

+ Your supplier profile has been successfully submitted and is under review. You can now access your preview dashboard. +

+ +
+ )}
)} - {/* ONBOARDING CONFIRMATION / REVIEW STATUS VIEW (Step 3 of 3) */} - {currentPage === 'confirmation' && ( -
-
- Step 3 of 3: Verification -
-
-
-
- -
🎉
-

Welcome to {CONFIG.companyName}!

- -

- Your registration is under review. We will verify your GSTIN credentials and activate your dashboard access within 24-48 hours. -

- -
-
-
-
-
-
-
-
-
Total Sales
-
$0.00
-
-
-
Active Orders
-
0
-
-
-
Balance
-
$0.00
-
-
-
-
-
-
-
-
-
-
- - -
- )} - {/* WELCOME PAGE & SETUP TOUR FOR NEW SELLERS */} {currentPage === 'welcome-tour' && ( navigateTo('dashboard')} /> @@ -2494,17 +2626,35 @@ export default function App() {

Store Configurations

-
{ e.preventDefault(); alert('Store configurations updated successfully!'); }}> -
- - setStoreName(e.target.value)} - required - /> + { + e.preventDefault(); + saveProfileBackend(true) + .then(() => alert('Store configurations updated successfully!')) + .catch(err => alert(err.message)); + }}> +
+
+ + setStoreName(e.target.value)} + required + /> +
+
+ + setStoreSlug(e.target.value.toLowerCase().replace(/[^a-z0-9\-]/g, ''))} + required + /> +
@@ -2526,6 +2676,31 @@ export default function App() {
+
+
+ + setSupportEmail(e.target.value)} + required + /> +
+
+ + setSupportPhone(e.target.value)} + required + /> +
+
+
+
+ +
+ {['Sustainable Products', 'Home Decor', 'Eco-Friendly', 'OPOD Products', 'GI Tagged', 'Textiles & Apparel'].map(cat => { + const isSelected = selectedCategories.includes(cat); + return ( + + ); + })} +
+
+
@@ -2577,17 +2777,27 @@ export default function App() {
-
- - setGstin(e.target.value)} - disabled - /> -

GSTIN cannot be modified after verification.

+
+
+ + +
+
+ + +