2#include "Design/Headers/ContactInfo.h"
3#include "Design/Headers/Model.h"
4#include "Base/Headers/String.h"
5#include "Base/Headers/Time.h"
6#include "Base/Headers/JSONParser.h"
42 static constexpr const char*
TypeName() {
return "password"; }
101 static constexpr const char*
TypeName() {
return "customer_device"; }
144 static constexpr const char*
TypeName() {
return "customer_job"; }
195 if (
name.contains(
','))
196 return name.split(
',')[1].trimWhiteSpace();
205 if (
name.contains(
','))
206 return name.split(
',')[0];
216 if (
name.size() > 0 && last_name.
size() > 0)
218 else if (
name.size() > 0)
230 if(
name.size() > 0 && first_name.size() > 0)
232 else if(
name.size() > 0)
303 static constexpr const char*
TypeName() {
return "customer"; }
The equivelent of std::vector but with a bit more control.
CustomerDevice(const Model &model)
Constructs a CustomerDevice model from an existing Model.
void setSerialNumber(const String &serial)
Sets the serial number of the device.
StringView serialNumber() const
Returns the serial number of the device.
void setOSName(const String &os_name)
Sets the operating system name of the device.
static constexpr const char * TypeName()
Returns the type name identifier for this model type.
StringView osName() const
Returns the operating system name of the device.
Buffer< Password > passwords() const
Returns all password entries stored under this device.
Model representing a customer job (e.g.
bool isActive() const
Returns whether this job is currently active.
void setActive(bool active)
Sets the active state of the job.
static constexpr const char * TypeName()
Returns the type name identifier for this model type.
static TranslatedString JobLabel()
Returns the translated display label for jobs.
CustomerJob(const Model &model)
Constructs a CustomerJob model from an existing Model.
Customer(const Model &model)
Constructs a Customer model from an existing Model.
StringView company() const
Returns the customer's company name.
void setCompany(const String &company_name)
Sets the customer's company name.
String getQRCode() const
Generates a vCard QR code string for this customer.
Buffer< PhysicalAddressModel > addresses() const
Returns all physical addresses associated with this customer.
static constexpr const char * TypeName()
Returns the type name identifier for this model type.
void updateSurname(const String &name, const void *lock_ptr=nullptr)
Updates the surname while preserving the first name.
StringView email() const
Returns the customer's email address.
StringView surname() const
Returns the surname portion of the customer name.
Buffer< TelephoneNumber > phoneNumbers() const
Returns all phone numbers associated with this customer.
void setEmail(const String &company_name)
Sets the customer's email address.
StringView firstName() const
Returns the first name portion of the customer name.
void updateFirstName(const String &name, const void *lock_ptr=nullptr)
Updates the first name while preserving the surname.
bool hasActiveJob() const
Checks whether this customer has any active jobs.
Buffer< CustomerJob > jobs() const
Returns all jobs associated with this customer.
constexpr decltype(auto) get(t_property_type property) const
Retrieves a property value from the database, cast to the requested type.
void set(t_property_type property, const t_type &value)
Sets a property value in the database.
constexpr decltype(auto) get() const
Retrieves a property value using a compile-time property constant, cast to the requested type.
bool hasMetaData(const StringView &index) const
Checks whether a metadata entry exists for the given key.
const JSONNode & metaData() const
Retrieves the entire metadata tree for this design object.
void setMetaData(const JSONNode &node)
Replaces the entire metadata tree with the given JSON node.
bool update(t_property_type property, const t_type &value, const void *lock=nullptr)
Updates a property only if the new value differs from the current value.
decltype(auto) getAs() const
Buffer< t_type > getTypeChildren(const StringView &type) const
Returns children of a specific type, cast to the requested derived type.
ModelBuffer getChildrenByType(const StringView &type) const
Returns all direct children whose type matches the given string.
Model()
Default constructor. Creates an uninitialized Model.
String password() const
Returns the stored password string.
void setPassword(const String &address)
Sets the password string.
Password(const Model &model)
Constructs a Password model from an existing Model.
static constexpr const char * TypeName()
Returns the type name identifier for this model type.
The core String View class for the NDEVR API.
constexpr uint04 size() const
Returns the byte size of this string view.
The core String class for the NDEVR API.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
@ type
The type identifier string for this model node.
@ uncompressed_data
Uncompressed binary data storage.
@ name
The display name of the object.
@ icon
Icon identifier for the object.
@ spacial_visible
Whether the object is visible in the 3D spatial view.