A model for a production–repair system under a time-varying demand process