CentralBackend/models/Pool.js

21 lines
931 B
JavaScript

class Pool {
constructor({ id = null, pool_name, description = null, price = 0.00, subscription_coffee_id = null, subscription_title = null, pool_type = 'other', is_active = true, created_by = null, updated_by = null, created_at = null, updated_at = null, members_count = 0 }) {
this.id = id;
this.pool_name = pool_name;
this.description = description;
this.price = price;
this.price_net = Number(price || 0);
this.price_per_capsule_net = Number(price || 0);
this.subscription_coffee_id = subscription_coffee_id == null ? null : Number(subscription_coffee_id);
this.subscription_title = subscription_title || null;
this.pool_type = pool_type;
this.is_active = is_active;
this.created_by = created_by;
this.updated_by = updated_by;
this.created_at = created_at;
this.updated_at = updated_at;
this.members_count = Number(members_count || 0);
}
}
module.exports = Pool;