Galaxies in X-ray selected clusters and groups in Dark Energy Survey data – II. Hierarchical Bayesian modelling of the red-sequence galaxy luminosity function. Issue 1 (10th June 2019)