Scattering of cubic Dirac equations with a general class of Hartree-type nonlinearity for the critical Sobolev data