If your thinking leaf read the following
https://www.mynissanleaf.com/viewtopic.php?t=26662
Most brands don’t guarantee battery capacity outside the 3/36, Nissan was sued into expanding it to 5/60 (I think)
California cars are warranted against battery failure 10/150k
Non-carb are warrantied against failure 8/100k
Battery degradation is not legally required to be covered so making a claim on that issue can be very tough.