This commit is contained in:
VictoriaPresnyakova 2023-05-01 15:29:55 +04:00
parent 75cfa2156f
commit e4b3e01c37
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,31 @@
export default class Favor {
constructor(data) {
this._id = data?.id;
this._price = data?.price;
this._componentIds = data?.componentIds;
this._orderIds = data?.orderIds;
}
get id() {
return this._id;
}
get price() {
return this._price;
}
set price(value) {
if (typeof value !== 'string' || value === null || value.length == 0) {
throw 'New price value ' + value + ' is not a string or empty';
}
this._price = value;
}
get componentIds() {
return this._componentIds;
}
get orderIds() {
return this._orderIds;
}
}

View File

@ -0,0 +1,26 @@
export default class Cabinet {
constructor(data) {
this._id = data?.id;
this._date = data?.date;
this._favorIds = data?.favorIds;
}
get id() {
return this._id;
}
get date() {
return this._date;
}
set date(value) {
if (typeof value !== 'string' || value === null || value.length == 0) {
throw 'New date value ' + value + ' is not a string or empty';
}
this._date = value;
}
get favorIds() {
return this._favorIds;
}
}