I'm working on a status changing implementation for records. For example, when a record is created, it commences in a 'pending' state until a administrator changes its state to either 'active', 'rejected' or 'revoked'.
The thing is, if a status has been changed from pending to active, the status cannot be changed back to pending or rejected. A rejected status can be changed back to active.
A revoked status cannot changed to active, pending or rejected. At the moment I have a series of if/else statements to detect this but I wondered if there was a more logical and standard approach.