Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Extract markup metadata #58

Merged
merged 1 commit into from
May 3, 2021
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ const supportedMetadata = {
defaultValue: 0,
description: 'DR points'
},
57: {
method: metadataExtractor.extractMarkup,
defaultValue: 0,
description: 'Markup'
},
35: {
method: metadataExtractor.extractSpecReviewCost,
defaultValue: null,
Expand Down
10 changes: 10 additions & 0 deletions src/utils/metadataExtractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ function extractBillingProject (challenge, defaultValue) {
return _.get(challenge, 'billingAccountId', _.get(challenge, 'billing.billingAccountId', _.toString(defaultValue)))
}

/**
* Extract markup
* @param {Object} challenge the challenge object
* @param {Any} defaultValue the default value
*/
function extractMarkup (challenge, defaultValue) {
return _.toString(_.get(challenge, 'billing.markup', defaultValue))
}

/**
* Extract submission limit
* @param {Object} challenge the challenge object
Expand Down Expand Up @@ -182,6 +191,7 @@ function extractEstimateEffortOnsite (challenge, defaultValue) {
}

module.exports = {
extractMarkup,
extractBillingProject,
extractSubmissionLimit,
extractSpecReviewCost,
Expand Down