Skip to content
Open
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
4 changes: 2 additions & 2 deletions docs/examples/feed-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"vendorId" : 47363942276,
"handle" : "t-shirt",
"lastUpdatedAt" : "2017-08-10T17:15:05.589Z",
"price" : 25.00
"price" : "$25.00"
},
{
"_id" : "donation1",
Expand All @@ -57,7 +57,7 @@
"vendorId" : 47361943276,
"handle" : "donation-1",
"lastUpdatedAt" : "2017-08-10T17:15:05.589Z",
"price" : 25.00
"price" : "Donation"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should say “Donate” not “Donation”

},
{
"_id" : "event2",
Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"vendorId" : 47363942276,
"handle" : "t-shirt",
"lastUpdatedAt" : "2017-08-10T17:15:05.589Z",
"price" : 25.00
"price" : "$25.00"
},
{
"_id" : "donation1",
Expand All @@ -225,7 +225,7 @@
"vendorId" : 47361943276,
"handle" : "donation-1",
"lastUpdatedAt" : "2017-08-10T17:15:05.589Z",
"price" : 25.00
"price" : "Donation"
},
{
"_id" : "event2",
Expand Down Expand Up @@ -264,7 +264,7 @@
"createdAt": "2016-09-10T19:00:00+00:00",
"__v": 0
}
]</code></pre></div></div></div></div></div></div></div></div></div></div></div><div class="panel panel-default"><div class="panel-heading"><h3 id="webhooks_eventbrite" class="panel-title">/webhooks/eventbrite</h3></div><div class="panel-body"><div class="panel-group"><div class="panel panel-white resource-modal"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_webhooks_eventbrite_create"><span class="parent">/webhooks/eventbrite</span>/create</a> <span class="methods"><a href="#webhooks_eventbrite_create_post"><span class="badge badge_post">post</span></a></span></h4></div><div id="panel_webhooks_eventbrite_create" class="panel-collapse collapse"><div class="panel-body"><div class="resource-description"><p>POST an event.created webhook from Eventbrite. <a href="https://www.eventbrite.com/developer/v3/api_overview/webhooks/">Eventbrite docs</a> <a href="https://www.eventbrite.com/myaccount/webhooks/">Configure here</a></p></div><div class="list-group"><div onclick="window.location.href = '#webhooks_eventbrite_create_post'" class="list-group-item"><span class="badge badge_post">post</span><div class="method_description"></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="webhooks_eventbrite_create_post"><div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_post">post</span> <span class="parent">/webhooks/eventbrite</span>/create</h4></div><div class="modal-body"><ul class="nav nav-tabs"><li class="active"><a href="#webhooks_eventbrite_create_post_request" data-toggle="tab">Request</a></li></ul><div class="tab-content"><div class="tab-pane active" id="webhooks_eventbrite_create_post_request"><h3>Body</h3><p><strong>Media type</strong>: application/json</p><p><strong>Type</strong>: object</p><strong>Properties</strong><ul><li><strong>api_url</strong>: <em>required (string)</em><p>URL for the updated resource</p></li><li><strong>config</strong>: <em>required (object)</em><ul><li><strong>action</strong>: <em>required (string)</em><p>Name of the event that occured on Eventbrite</p></li><li><strong>endpoint_url</strong>: <em>required (string)</em><p>The URL to which Eventbrite will POST the hook body</p></li><li><strong>user_id</strong>: <em>required (string)</em></li><li><strong>webhook_id</strong>: <em>required (string)</em></li></ul></li></ul><p><strong>Example</strong>:</p><div class="examples"><pre><code>{
]</code></pre></div></div></div></div></div></div></div></div></div></div></div><div class="panel panel-default"><div class="panel-heading"><h3 id="webhooks_eventbrite" class="panel-title">/webhooks/eventbrite</h3></div><div class="panel-body"><div class="panel-group"><div class="panel panel-white resource-modal"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_webhooks_eventbrite_create"><span class="parent">/webhooks/eventbrite</span>/create</a> <span class="methods"><a href="#webhooks_eventbrite_create_post"><span class="badge badge_post">post</span></a></span></h4></div><div id="panel_webhooks_eventbrite_create" class="panel-collapse collapse"><div class="panel-body"><div class="resource-description"><p>POST an event.created webhook from Eventbrite. <a href="https://www.eventbrite.com/developer/v3/api_overview/webhooks/">Eventbrite docs</a> <a href="https://www.eventbrite.com/myaccount/webhooks/">Configure here</a></p></div><div class="list-group"><div onclick="window.location.href = '#webhooks_eventbrite_create_post'" class="list-group-item"><span class="badge badge_post">post</span><div class="method_description"></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="webhooks_eventbrite_create_post"><div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_post">post</span> <span class="parent">/webhooks/eventbrite</span>/create</h4></div><div class="modal-body"><ul class="nav nav-tabs"><li class="active"><a href="#webhooks_eventbrite_create_post_request" data-toggle="tab">Request</a></li></ul><div class="tab-content"><div class="tab-pane active" id="webhooks_eventbrite_create_post_request"><h3>Body</h3><p><strong>Media type</strong>: application/json</p><p><strong>Type</strong>: object</p><strong>Properties</strong><ul><li><strong>api_url</strong>: <em>required (string)</em><p>URL for the updated resource</p></li><li><strong>config</strong>: <em>required (object)</em><ul><li><strong>action</strong>: <em>required (string)</em><p>Name of the event that occurred on Eventbrite</p></li><li><strong>endpoint_url</strong>: <em>required (string)</em><p>The URL to which Eventbrite will POST the hook body</p></li><li><strong>user_id</strong>: <em>required (string)</em></li><li><strong>webhook_id</strong>: <em>required (string)</em></li></ul></li></ul><p><strong>Example</strong>:</p><div class="examples"><pre><code>{
"api_url": "https://www.eventbriteapi.com/{api-endpoint-to-fetch-object-details}/",
"config": {
"action": "test",
Expand All @@ -273,7 +273,7 @@
"webhook_id": "455763"
}
}
</code></pre></div></div></div></div></div></div></div></div><div class="panel panel-white resource-modal"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_webhooks_eventbrite_update"><span class="parent">/webhooks/eventbrite</span>/update</a> <span class="methods"><a href="#webhooks_eventbrite_update_post"><span class="badge badge_post">post</span></a></span></h4></div><div id="panel_webhooks_eventbrite_update" class="panel-collapse collapse"><div class="panel-body"><div class="resource-description"><p>POST an event.updated webhook from Eventbrite. <a href="https://www.eventbrite.com/developer/v3/api_overview/webhooks/">Eventbrite docs</a> <a href="https://www.eventbrite.com/myaccount/webhooks/">Configure here</a></p></div><div class="list-group"><div onclick="window.location.href = '#webhooks_eventbrite_update_post'" class="list-group-item"><span class="badge badge_post">post</span><div class="method_description"></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="webhooks_eventbrite_update_post"><div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_post">post</span> <span class="parent">/webhooks/eventbrite</span>/update</h4></div><div class="modal-body"><ul class="nav nav-tabs"><li class="active"><a href="#webhooks_eventbrite_update_post_request" data-toggle="tab">Request</a></li></ul><div class="tab-content"><div class="tab-pane active" id="webhooks_eventbrite_update_post_request"><h3>Body</h3><p><strong>Media type</strong>: application/json</p><p><strong>Type</strong>: object</p><strong>Properties</strong><ul><li><strong>api_url</strong>: <em>required (string)</em><p>URL for the updated resource</p></li><li><strong>config</strong>: <em>required (object)</em><ul><li><strong>action</strong>: <em>required (string)</em><p>Name of the event that occured on Eventbrite</p></li><li><strong>endpoint_url</strong>: <em>required (string)</em><p>The URL to which Eventbrite will POST the hook body</p></li><li><strong>user_id</strong>: <em>required (string)</em></li><li><strong>webhook_id</strong>: <em>required (string)</em></li></ul></li></ul><p><strong>Example</strong>:</p><div class="examples"><pre><code>{
</code></pre></div></div></div></div></div></div></div></div><div class="panel panel-white resource-modal"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_webhooks_eventbrite_update"><span class="parent">/webhooks/eventbrite</span>/update</a> <span class="methods"><a href="#webhooks_eventbrite_update_post"><span class="badge badge_post">post</span></a></span></h4></div><div id="panel_webhooks_eventbrite_update" class="panel-collapse collapse"><div class="panel-body"><div class="resource-description"><p>POST an event.updated webhook from Eventbrite. <a href="https://www.eventbrite.com/developer/v3/api_overview/webhooks/">Eventbrite docs</a> <a href="https://www.eventbrite.com/myaccount/webhooks/">Configure here</a></p></div><div class="list-group"><div onclick="window.location.href = '#webhooks_eventbrite_update_post'" class="list-group-item"><span class="badge badge_post">post</span><div class="method_description"></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="webhooks_eventbrite_update_post"><div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_post">post</span> <span class="parent">/webhooks/eventbrite</span>/update</h4></div><div class="modal-body"><ul class="nav nav-tabs"><li class="active"><a href="#webhooks_eventbrite_update_post_request" data-toggle="tab">Request</a></li></ul><div class="tab-content"><div class="tab-pane active" id="webhooks_eventbrite_update_post_request"><h3>Body</h3><p><strong>Media type</strong>: application/json</p><p><strong>Type</strong>: object</p><strong>Properties</strong><ul><li><strong>api_url</strong>: <em>required (string)</em><p>URL for the updated resource</p></li><li><strong>config</strong>: <em>required (object)</em><ul><li><strong>action</strong>: <em>required (string)</em><p>Name of the event that occurred on Eventbrite</p></li><li><strong>endpoint_url</strong>: <em>required (string)</em><p>The URL to which Eventbrite will POST the hook body</p></li><li><strong>user_id</strong>: <em>required (string)</em></li><li><strong>webhook_id</strong>: <em>required (string)</em></li></ul></li></ul><p><strong>Example</strong>:</p><div class="examples"><pre><code>{
"api_url": "https://www.eventbriteapi.com/{api-endpoint-to-fetch-object-details}/",
"config": {
"action": "test",
Expand Down
10 changes: 5 additions & 5 deletions docs/m2l.raml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should always be “Donate”

EventWebhook:
properties:
api_url:
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions server/controllers/donationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be “Donate”

});

DonationController.saveDonation(donation);
Expand All @@ -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);
},
Expand All @@ -67,4 +66,4 @@ var DonationController = {
}
}

exports.DonationController = DonationController;
exports.DonationController = DonationController;
6 changes: 3 additions & 3 deletions server/controllers/listingController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
},
Expand All @@ -67,4 +67,4 @@ var ListingController = {
}
}

exports.ListingController = ListingController;
exports.ListingController = ListingController;
2 changes: 1 addition & 1 deletion server/models/donation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/models/listing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down