When the status of the parent changes, only the subitems that have a value in the "quantity" column will remain, and the rest will be deleted

Hey,
I have a simple board that contains order numbers (items). Each order has several products (subitems) with a quantity column. I would like to create a situation when the status of the order (item) changes to done, so that of all the subitems under it, only those that have values ​​in the quantity column will remain, and the rest will be deleted.
I haven’t found a way to do this.
If anyone knows a way, or another idea to do this either by subitems or not, I would appreciate the help.

Another option.
Allow text-subitems to be selected from a list. I didn’t see that there was such an option. It only allows to write free text.