CentralBackend/models/Tax.js
2025-12-06 11:14:55 +01:00

20 lines
627 B
JavaScript

const VAT_FIELDS = ['standard_rate', 'reduced_rate', 'super_reduced_rate', 'parking_rate'];
class VatRate {
constructor(row = {}) {
VAT_FIELDS.forEach((k) => { this[k] = row[k] != null ? Number(row[k]) : null; });
this.id = row.id;
this.country_id = row.country_id;
this.effective_from = row.effective_from;
this.effective_to = row.effective_to;
this.created_by = row.created_by;
this.updated_by = row.updated_by;
this.created_at = row.created_at;
this.updated_at = row.updated_at;
}
}
class VatRateHistory extends VatRate {}
module.exports = { VAT_FIELDS, VatRate, VatRateHistory };