Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bundle price cast #73

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/entities/Bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ import BaseEntity from './BaseEntity';
* Bundle name.
* @property string name
*
* Price for the bundle. If >0, it must always be accompanied by the currency specification.
* @property double price
*
* Specifies currency for the bundle price. Check data types to discover which currencies are
* supported.
* @property string currency
*
* Arbitrary additional user properties of string type may be associated with each bundle. The name of user property
* must not be equal to any of the fixed property names listed above and must be none of id, deleted.
*
Expand All @@ -36,6 +43,8 @@ export default class Bundle extends BaseEntity {
number: 'string',
active: 'boolean',
name: 'string',
price: 'double',
currency: 'string',
},
});
}
Expand Down Expand Up @@ -72,6 +81,22 @@ export default class Bundle extends BaseEntity {
return this.getProperty('description', def);
}

setPrice(price) {
return this.setProperty('price', price);
}

getPrice(def) {
return this.getProperty('price', def);
}

setCurrency(currency) {
return this.setProperty('currency', currency);
}

getCurrency(def) {
return this.getProperty('currency', def);
}

setLicenseTemplateNumbers(licenseTemplateNumbers) {
const numbers = (Array.isArray(licenseTemplateNumbers))
? licenseTemplateNumbers.join(',')
Expand Down
Loading