/var/www/qr4y.kz/server/delivery/api/responseModels/company
Edit: /var/www/qr4y.kz/server/delivery/api/responseModels/company/companyList.model.js (1105B)
let { BranchModel } = {}
module.exports = class CompanyListModel {
constructor({ companies, count, page, time }) {
BranchModel = require('../branch/branch.model')
this.count = count || 0
this.list = companies
? companies.map((company) => {
var companyImages = company.companyImages
? company.companyImages.map((i) => {
const {
uid,
enabled,
active,
image,
icon,
imageSmall,
imageLarge,
isDefault
} = i
return {
uid,
enabled,
active,
image,
icon,
imageSmall,
imageLarge,
isDefault
}
})
: []
let { id, uid, name, tag, description, enabled, active, rating, branches, image } = company
if (branches) {
branches = branches.map((branch) => {
return new BranchModel(branch)
})
}
return { id, uid, name, image, tag, description, enabled, active, rating, companyImages, branches }
})
: []
this.page = page ? page : 1
this.time = time ? time : 0
}
}