We consider an insurance risk model with extended flexibility, under which claims arrive according to a point process with an order statistics (OS) property, their amounts may have any joint distribution and the premium income is accumulated following any nondecreasing, possibly discontinuous real valued function. We generalize the definition of an OS point process, assuming it is generated by an arbitrary cdf allowing jump discontinuities, which corresponds to an arbitrary (possibly discontinuous) claim arrival cumulative intensity function. The latter feature is appealing for insurance applications since it allows to consider clusters of claims arriving instantaneously. Under these general assumptions, a closed form expression for the joint distribution of the time to ruin and the deficit at ruin is derived, which remarkably involves classical Appell polynomials. Corollaries of our main result generalize previous non-ruin formulas e.g., those obtained by Ignatov and Kaishev