Body
Media type: application/json
Type: object
PropertiesExample:
{
"api_url": "https://www.eventbriteapi.com/{api-endpoint-to-fetch-object-details}/",
"config": {
"action": "test",
diff --git a/docs/m2l.raml b/docs/m2l.raml
index 9f4e9eb..0710d1f 100644
--- a/docs/m2l.raml
+++ b/docs/m2l.raml
@@ -89,8 +89,8 @@ types:
type: string
description: The date the item was last updated on the vendor's system
price:
- type: number
- description: The price of the item
+ type: string
+ description: The price of the item for labelling purposes
Donation:
type: FeedItem
properties:
@@ -104,8 +104,8 @@ types:
type: string
description: The date the item was last updated on the vendor's system
price:
- type: number
- description: The price of the item
+ type: string
+ description: The 'price' of the item for labelling purposes (always has value "Donation")
EventWebhook:
properties:
api_url:
@@ -116,7 +116,7 @@ types:
properties:
action:
type: string
- description: Name of the event that occured on Eventbrite
+ description: Name of the event that occurred on Eventbrite
endpoint_url:
type: string
description: The URL to which Eventbrite will POST the hook body
diff --git a/server/controllers/donationController.js b/server/controllers/donationController.js
index 3513ed1..4a0d5fe 100644
--- a/server/controllers/donationController.js
+++ b/server/controllers/donationController.js
@@ -30,7 +30,7 @@ var DonationController = {
handle: item.handle,
feedImageUrl: item.images[0].src,
lastUpdatedAt: item.updated_at,
- price: item.variants[0].price
+ price: 'Donation'
});
DonationController.saveDonation(donation);
@@ -43,7 +43,6 @@ var DonationController = {
donation.feedImageUrl = item.images[0].src;
donation.handle = item.handle;
donation.lastUpdatedAt = item.updated_at;
- donation.price = item.variants[0].price;
DonationController.saveDonation(donation);
},
@@ -67,4 +66,4 @@ var DonationController = {
}
}
-exports.DonationController = DonationController;
\ No newline at end of file
+exports.DonationController = DonationController;
diff --git a/server/controllers/listingController.js b/server/controllers/listingController.js
index ea14c87..7f559f0 100644
--- a/server/controllers/listingController.js
+++ b/server/controllers/listingController.js
@@ -30,7 +30,7 @@ var ListingController = {
handle: item.handle,
feedImageUrl: item.images[0].src,
lastUpdatedAt: item.updated_at,
- price: item.variants[0].price
+ price: '$'+item.variants[0].price.toFixed(2);
});
ListingController.saveListing(listing);
@@ -43,7 +43,7 @@ var ListingController = {
listing.feedImageUrl = item.images[0].src;
listing.handle = item.handle;
listing.lastUpdatedAt = item.updated_at;
- listing.price = item.variants[0].price;
+ listing.price = '$'+item.variants[0].price.toFixed(2);
ListingController.saveListing(listing);
},
@@ -67,4 +67,4 @@ var ListingController = {
}
}
-exports.ListingController = ListingController;
\ No newline at end of file
+exports.ListingController = ListingController;
diff --git a/server/models/donation.js b/server/models/donation.js
index 75ae03e..9d8eeef 100644
--- a/server/models/donation.js
+++ b/server/models/donation.js
@@ -7,7 +7,7 @@ var donationSchema = new mongoose.Schema({
vendorId: Number,
handle: String,
lastUpdatedAt: String,
- price: Number
+ price: String
});
// discriminator used for document inheritance within the same collection
diff --git a/server/models/listing.js b/server/models/listing.js
index 200e675..34d6f16 100644
--- a/server/models/listing.js
+++ b/server/models/listing.js
@@ -7,7 +7,7 @@ var listingSchema = new mongoose.Schema({
vendorId: Number,
handle: String,
lastUpdatedAt: String,
- price: Number
+ price: String
});
// discriminator used for document inheritance within the same collection