Peace be upon you,
1. If the traveler prayed fully while knowing the ruling, their prayer is invalid, and they must repeat it or make up for it.
2. If they were unaware of the ruling regarding shortening prayers for travelers, their prayer is valid, and they do not need to repeat it.
3. If they knew the general ruling but were unaware of specific conditions that necessitate shortening, such as the distance traveled or that a sinner can shorten their prayer upon returning to obedience, it is recommended to repeat the prayer if they realized this during the prayer time. If they learned of it after the time had passed, they do not need to make it up.
4. If they were unaware of the situation, such as not knowing that their destination was a distance, and they completed their prayer, they should repeat it if they remember during the prayer time. If they remember after the time has passed, they do not need to make it up.
5. If they completed their prayer out of forgetfulness while knowing the ruling, they must repeat it during the prayer time, and it is recommended to make it up if they remember after the time has passed.
Source: [Islamic Jurisprudence, Volume 1, Issue 945](
https://www.sistani.com/arabic/book/23720/4693/)
May you be successful in all good.