Retrieves a value from raw API data. Prioritises DBAPI data if available
Special method to define behaviour of JSON.stringify() on model instance
StaticcreateRequests an instant valuation estimate and, when trigger_iov_on_create is set,
creates a matching lead in a single call to the Valuations API.
const { valuation, errors } = await InstantValuation.create({
valuation: { postcode: 'BN2 9SQ', paon: '10', property_type: 'terrace', bedrooms: 3 },
lead_params: {
user: { first_name: 'Jane', last_name: 'Smith', email: 'jane@example.com' },
valuation_department: 'Sales valuation',
},
trigger_iov_on_create: true,
});
serializer is a pure function that takes a model instance and returns a plain object that describes how to convert the model to JSON