Let's say I must have this data structure:
├── Operations (struct) │ ├── date_begining (uint) │ └── date_end (uint) │ └── responsible (address) │ └── type **(?)** │ ├── Observation (struct) │ | └── Production units (string) │ | └── Parcel (string) | OR │ ├── ObservationPrague (struct) │ | └── Fon state (bool) │ | └── Trapped (string) | OR │ ├── ObservationDesiese (struct) │ | └── Other var (bool) │ | └── Some Other var (uint) | OR │ ├── Logistics (struct) │ | └── Other var1 (bool) │ | └── Some Other var1 (uint)
So As you can see, I need a struct of operations that always have 4 keys:
type. That ok until now. But now, my type should have one of the 4 following choices:
Logistics, that consequently have their own key/values too. So, what is the best way for me struct my "type". Is there a way I can say, "it's one of those four structs" in solidity lang? I thought of the enums, but concluded it couldn't be because then I wouldn't be able to have key/value pairs under the enum. Appreciate any help.