-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
services/static-webserver/client/source/class/osparc/data/model/PricingPlan.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* ************************************************************************ | ||
osparc - the simcore frontend | ||
https://osparc.io | ||
Copyright: | ||
2024 IT'IS Foundation, https://itis.swiss | ||
License: | ||
MIT: https://opensource.org/licenses/MIT | ||
Authors: | ||
* Odei Maiz (odeimaiz) | ||
************************************************************************ */ | ||
|
||
/** | ||
* Class that stores PricingPlan data. | ||
*/ | ||
|
||
qx.Class.define("osparc.data.model.PricingPlan", { | ||
extend: qx.core.Object, | ||
|
||
/** | ||
* @param pricingPlanData {Object} Object containing the serialized PricingPlan Data | ||
*/ | ||
construct: function(pricingPlanData) { | ||
this.base(arguments); | ||
|
||
this.set({ | ||
pricingPlanId: pricingPlanData.pricingPlanId, | ||
pricingPlanKey: pricingPlanData.pricingPlanKey, | ||
pricingUnits: pricingPlanData.pricingUnits, | ||
classification: pricingPlanData.classification, | ||
name: pricingPlanData.displayName, | ||
description: pricingPlanData.description, | ||
isActive: pricingPlanData.isActive, | ||
}); | ||
}, | ||
|
||
properties: { | ||
pricingPlanId: { | ||
check: "Number", | ||
nullable: false, | ||
init: null, | ||
event: "changePricingPlanId" | ||
}, | ||
|
||
pricingPlanKey: { | ||
check: "String", | ||
nullable: true, | ||
init: null, | ||
event: "changePricingPlanKey" | ||
}, | ||
|
||
pricingUnits: { | ||
check: "Array", | ||
nullable: true, | ||
init: null, | ||
event: "changePricingunits" | ||
}, | ||
|
||
classification: { | ||
check: "TIER, ", | ||
nullable: false, | ||
init: null, | ||
event: "changeClassification" | ||
}, | ||
|
||
name: { | ||
check: "String", | ||
nullable: false, | ||
init: null, | ||
event: "changeName" | ||
}, | ||
|
||
description: { | ||
check: "String", | ||
nullable: true, | ||
init: null, | ||
event: "changeDescription" | ||
}, | ||
|
||
isActive: { | ||
check: "Boolean", | ||
nullable: false, | ||
init: false, | ||
event: "changeIsActive" | ||
}, | ||
}, | ||
}); |
76 changes: 76 additions & 0 deletions
76
services/static-webserver/client/source/class/osparc/data/model/PricingUnit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* ************************************************************************ | ||
osparc - the simcore frontend | ||
https://osparc.io | ||
Copyright: | ||
2024 IT'IS Foundation, https://itis.swiss | ||
License: | ||
MIT: https://opensource.org/licenses/MIT | ||
Authors: | ||
* Odei Maiz (odeimaiz) | ||
************************************************************************ */ | ||
|
||
/** | ||
* Class that stores PricingUnit data. | ||
*/ | ||
|
||
qx.Class.define("osparc.data.model.PricingUnit", { | ||
extend: qx.core.Object, | ||
|
||
/** | ||
* @param pricingUnitData {Object} Object containing the serialized PricingUnit Data | ||
*/ | ||
construct: function(pricingUnitData) { | ||
this.base(arguments); | ||
|
||
this.set({ | ||
pricingUnitId: pricingUnitData.pricingUnitId, | ||
name: pricingUnitData.unitName, | ||
cost: pricingUnitData.currentCostPerUnit, | ||
isDefault: pricingUnitData.default, | ||
extraInfo: pricingUnitData.unitExtraInfo, | ||
}); | ||
}, | ||
|
||
properties: { | ||
pricingUnitId: { | ||
check: "Number", | ||
nullable: true, | ||
init: null, | ||
event: "changePricingUnitId" | ||
}, | ||
|
||
name: { | ||
check: "String", | ||
nullable: false, | ||
init: null, | ||
event: "changeName" | ||
}, | ||
|
||
cost: { | ||
check: "Number", | ||
nullable: false, | ||
init: null, | ||
event: "changeCost" | ||
}, | ||
|
||
isDefault: { | ||
check: "Boolean", | ||
nullable: false, | ||
init: false, | ||
event: "changeIsDefault", | ||
}, | ||
|
||
extraInfo: { | ||
check: "Object", | ||
nullable: false, | ||
init: null, | ||
event: "changeExtraInfo" | ||
}, | ||
}, | ||
}); |