+
+ Client::Client(QObject * parent)
+ : Entity(parent, "client")
+ {
+ reference = static_cast<data::StringDecorator*>(
+ addDataItem(new data::StringDecorator(this, "reference", "Client Ref")));
+ name = static_cast<data::StringDecorator*>(
+ addDataItem(new data::StringDecorator(this, "name", "Name")));
+ supplyAddress = static_cast<Address*>(
+ addChild(new Address(this), "supplyAddress"));
+ billingAddress = static_cast<Address*>(
+ addChild(new Address(this), "billingAddress"));
+ appointments = static_cast<data::EntityCollection<Appointment>*>(
+ addChildCollection(new data::EntityCollection<Appointment>(this, "appointments")));
+ contacts = static_cast<data::EntityCollection<Contact>*>(
+ addChildCollection(new data::EntityCollection<Contact>(this, "contacts")));
+ }
+
+ Client::Client(QObject* parent, const QJsonObject& json)
+ : Client(parent)
+ {
+ update(json);
+ }
+
+ QQmlListProperty<Appointment> Client::ui_appointments()
+ {
+ return QQmlListProperty<Appointment>(this, appointments->derivedEntities());
+ }
+
+ QQmlListProperty<Contact> Client::ui_contacts()