seed stuff

This commit is contained in:
Jake Kasper
2025-09-03 10:56:17 -04:00
parent 6dbdba0e38
commit e7cbaf844f
8 changed files with 271 additions and 28 deletions

View File

@@ -20,6 +20,7 @@ const ApplicationExecutionModal = ({ application, propertyDetails, onClose, onCo
const [sections, setSections] = useState([]);
const [mapCenter, setMapCenter] = useState(null);
const [planDetails, setPlanDetails] = useState(null);
const [seedingType, setSeedingType] = useState('overseed');
// Debug: Log the application data to understand structure
useEffect(() => {
@@ -114,6 +115,11 @@ const ApplicationExecutionModal = ({ application, propertyDetails, onClose, onCo
return 3.0; // 3.0 mph default target
}, [application]);
// Determine if this is a seed application based on plan details
const isSeedApplication = useMemo(() => {
return (planDetails?.products || []).some(p => (p.productType || '').toLowerCase() === 'seed');
}, [planDetails?.products]);
const speedStatus = useMemo(() => {
if (!targetSpeed || !currentSpeed) return 'normal';
@@ -301,6 +307,9 @@ const ApplicationExecutionModal = ({ application, propertyDetails, onClose, onCo
notes: `Application completed via mobile tracking. Duration: ${Math.round(duration/60)} minutes, Distance: ${(totalDistance * 3.28084).toFixed(0)} ft, Points: ${gpsTrack.length}`,
products: validProducts
};
if (isSeedApplication) {
logData.seedingType = seedingType;
}
// Debug: log the exact data being sent
console.log('Sending log data:', JSON.stringify(logData, null, 2));
@@ -453,6 +462,23 @@ const ApplicationExecutionModal = ({ application, propertyDetails, onClose, onCo
</div>
</div>
{/* Seeding options for seed products */}
{isSeedApplication && (
<div className="bg-green-50 p-4 rounded-lg mb-6">
<h4 className="font-medium mb-2">Seeding Details</h4>
<div className="flex items-center gap-6 text-sm">
<label className="inline-flex items-center gap-2">
<input type="radio" name="seedingType" value="overseed" checked={seedingType==='overseed'} onChange={()=> setSeedingType('overseed')} />
Overseed
</label>
<label className="inline-flex items-center gap-2">
<input type="radio" name="seedingType" value="new_seed" checked={seedingType==='new_seed'} onChange={()=> setSeedingType('new_seed')} />
New Seed
</label>
</div>
</div>
)}
{/* Tracking Stats */}
{isTracking && (
<div className="bg-blue-50 p-4 rounded-lg mb-6">