diff --git a/pet-nutrition-service/db-seed.js b/pet-nutrition-service/db-seed.js index f2f7465d..8d017a37 100644 --- a/pet-nutrition-service/db-seed.js +++ b/pet-nutrition-service/db-seed.js @@ -17,8 +17,12 @@ module.exports = function(){ { pet_type: 'lizard', facts: 'Insects, leafy greens, and calcium supplements', products: 'ScaleStrong Calcium Boost, CricketCrunch Live Supply, ReptileVitality D3 Formula' }, { pet_type: 'snake', facts: 'Whole prey (mice/rats) based on size', products: 'SlitherSnack Frozen Mice, CoilCuisine Feeder Rats, SerpentSupreme Multivitamin' }, { pet_type: 'bird', facts: 'High-quality seeds, pellets, and fresh fruits/veggies', products: 'FeatherFeast Premium Pellets, WingWellness Seed Mix, BeakBoost Cuttlebone Calcium' }, - { pet_type: 'hamster', facts: 'Pellets, grains, fresh vegetables, and occasional fruits', products: 'HamsterHaven Complete Pellets, CheekPouch Gourmet Mix, WhiskerWonder Vitamin Drops' } + { pet_type: 'hamster', facts: 'Pellets, grains, fresh vegetables, and occasional fruits', products: 'HamsterHaven Complete Pellets, CheekPouch Gourmet Mix, WhiskerWonder Vitamin Drops' }, + { pet_type: 'turtle', facts: 'Commercial turtle pellets, leafy greens, and occasional protein sources like fish or insects', products: 'TurtleTreat Aquatic Pellets, ShellShine Calcium Blocks, AquaVeg Turtle Greens' }, + { pet_type: 'rabbit', facts: 'High-fiber hay, fresh vegetables, and limited pellets. Avoid sugary fruits and processed foods', products: 'BunnyBest Timothy Hay, HopHappy Pellets, CarrotCrunch Veggie Mix' }, + { pet_type: 'fish', facts: 'Species-specific flakes or pellets, with occasional frozen or live foods', products: 'AquaChoice Tropical Flakes, FinFeast Goldfish Pellets, BubbleBite Freeze-Dried Bloodworms' }, + { pet_type: 'guinea pig', facts: 'Timothy hay, vitamin C-rich vegetables, and high-quality pellets', products: 'GuineaGold Pellets, PiggyPerfect Hay Cubes, VitaC Veggie Treats' } ]) .then(() => logger.info('collection populated')) .catch(err => logger.error('error populating collection:', err)); -}; +}; \ No newline at end of file diff --git a/pet-nutrition-service/server.js b/pet-nutrition-service/server.js index d53411f1..07e53771 100644 --- a/pet-nutrition-service/server.js +++ b/pet-nutrition-service/server.js @@ -20,7 +20,13 @@ async function main () { const { pet_type } = req.params; const fact = await NutritionFact.findOne({ pet_type }); if (!fact) { - return res.status(404).json({ message: 'nutrition fact not found for the given pet_type' }); + // Return generic nutrition advice instead of 404 + const genericAdvice = { + pet_type: pet_type, + facts: 'Consult with a veterinarian for specific dietary recommendations for your pet. General guidelines include providing fresh water daily, age-appropriate food portions, and avoiding toxic foods.', + products: 'Visit your local pet store or consult your veterinarian for recommended pet food brands suitable for your specific pet type.' + }; + return res.status(200).json(genericAdvice); } res.status(200).json(fact); } catch (error) {