products updates

This commit is contained in:
Jake Kasper
2025-08-21 20:13:20 -04:00
parent e1ac44e4ef
commit 691be0531a
2 changed files with 19 additions and 2 deletions

View File

@@ -9,7 +9,9 @@ INSERT INTO product_categories (name, description) VALUES
('Insecticides', 'Products for insect control'),
('Pre-emergent', 'Products that prevent weeds from germinating'),
('Post-emergent', 'Products that kill existing weeds'),
('Growth Regulators', 'Products that modify plant growth')
('Growth Regulators', 'Products that modify plant growth'),
('Surfactants', 'Products that improve spray coverage and penetration'),
('Adjuvants', 'Products that enhance pesticide performance')
ON CONFLICT (name) DO NOTHING;
-- Get category IDs for reference
@@ -22,6 +24,8 @@ DECLARE
pre_emergent_cat_id INTEGER;
post_emergent_cat_id INTEGER;
growth_reg_cat_id INTEGER;
surfactant_cat_id INTEGER;
adjuvant_cat_id INTEGER;
BEGIN
SELECT id INTO herbicide_cat_id FROM product_categories WHERE name = 'Herbicides';
SELECT id INTO fertilizer_cat_id FROM product_categories WHERE name = 'Fertilizers';
@@ -30,6 +34,8 @@ BEGIN
SELECT id INTO pre_emergent_cat_id FROM product_categories WHERE name = 'Pre-emergent';
SELECT id INTO post_emergent_cat_id FROM product_categories WHERE name = 'Post-emergent';
SELECT id INTO growth_reg_cat_id FROM product_categories WHERE name = 'Growth Regulators';
SELECT id INTO surfactant_cat_id FROM product_categories WHERE name = 'Surfactants';
SELECT id INTO adjuvant_cat_id FROM product_categories WHERE name = 'Adjuvants';
-- Insert herbicides
INSERT INTO products (name, brand, category_id, product_type, active_ingredients, description) VALUES
@@ -80,6 +86,17 @@ BEGIN
('Thiamethoxam 25WG', 'Meridian', insecticide_cat_id, 'granular', 'Thiamethoxam 25%', 'Systemic insecticide for grub prevention and surface insects')
ON CONFLICT (name, brand) DO NOTHING;
-- Insert surfactants and adjuvants
INSERT INTO products (name, brand, category_id, product_type, active_ingredients, description) VALUES
('NIS 90%', 'Various', surfactant_cat_id, 'liquid', 'Nonionic Surfactant 90%', 'Non-ionic surfactant for improved spray coverage and penetration'),
('MSO', 'Various', adjuvant_cat_id, 'liquid', 'Methylated Seed Oil 83%', 'Crop oil concentrate for enhanced herbicide uptake'),
('Silicone Surfactant', 'Silwet L-77', surfactant_cat_id, 'liquid', 'Organosilicone 100%', 'Super spreader for maximum coverage'),
('Penetrant', 'LI-700', adjuvant_cat_id, 'liquid', 'Lecithin + Propionic Acid', 'Penetrating agent for improved systemic activity'),
('COC', 'Various', adjuvant_cat_id, 'liquid', 'Crop Oil Concentrate 83%', 'Oil-based adjuvant for herbicide enhancement'),
('AMS', 'Various', adjuvant_cat_id, 'granular', 'Ammonium Sulfate 21-0-0-24S', 'Water conditioner and spray enhancer'),
('Sticker Spreader', 'Bond', adjuvant_cat_id, 'liquid', 'Pinolene + Surfactants', 'Improves adhesion and spreading of sprays')
ON CONFLICT (name, brand) DO NOTHING;
END $$;
-- Insert application rates for key products

View File

@@ -364,7 +364,7 @@ const CreateProductModal = ({ onSubmit, onCancel, sharedProducts, categories })
}
const submitData = {
productId: formData.productId || null,
productId: formData.productId ? parseInt(formData.productId) : null,
customName: formData.customName || null,
customRateAmount: formData.customRateAmount ? parseFloat(formData.customRateAmount) : null,
customRateUnit: formData.customRateUnit || null,