Serialises this DTO to JSON. Subclasses tag the output with a type discriminator field so fromJson can route to the right factory.
type
Map<String, dynamic> toJson();