Collaborative optimization of maintenance and spare ordering of continuously degrading systems