When an object version is made dark, if there is a user version for that object version, any preceding user versions should be marked permanently withdrawn. When permanently withdrawn, a user version cannot be withdrawn or restored.
For this ticket:
Change the modeling of user version model so there is a "state" enum field, the values of which can be "available", "withdrawn", or "permanently_withdrawn" (default "available") and migrate the existing data.
When closing an object version, mark user versions as permanently withdrawn as described above.
When an object version is made dark, if there is a user version for that object version, any preceding user versions should be marked permanently withdrawn. When permanently withdrawn, a user version cannot be withdrawn or restored.
For this ticket:
restorable?
andwithdrawable?
when a user version is permanently deleted. (https://github.com/sul-dlss/dor-services-app/blob/main/app/models/user_version.rb#L38-L44)