AI-512 : fixed legacyId <-> cuid conversion