[Add] Improve code and convert test cases of sale and purchase module in new api.