-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Add 25Mar2020 Virtual Session fields for non-offline sessions #2
base: feature/configurable-sessionseries-dates
Are you sure you want to change the base?
feat: Add 25Mar2020 Virtual Session fields for non-offline sessions #2
Conversation
@@ -119,7 +124,7 @@ function generateOffer(age, baseUrl, modified, golden, free) { | |||
|
|||
function generateImages(golden) { | |||
var out = []; | |||
var imageCount = faker.random.number(golden ? {min: 4, max: 6} : 6); | |||
var imageCount = faker.random.number(golden ? {min: 4, max: 6} : { max: 6 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My error checker gets confused when function call signatures are mixed with a single call (i.e. number(max: number)
vs number({ max: number, min: number })
).
So I've updated it to both use the same signature (with the min
/max
object)
var startDate = moment.tz(startDateString, tzid); | ||
var endDate = startDate.clone().add(moment.duration(duration)); | ||
/** | ||
* @param {Date} startDate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not a string - it was a Date
/** | ||
* @param {string} orgBaseUrl | ||
* @param {boolean} golden | ||
*/ | ||
function generatePlace(orgBaseUrl, golden) { | ||
var siteName = faker.address.streetName() + " " + faker.random.arrayElement(["Sports Village", "Leisure Centre", "Centre"]); | ||
var postcodeObj = postcodes[faker.random.number(postcodes.length - 1)]; | ||
return { | ||
"type": "Place", | ||
"url": orgBaseUrl + "/" + faker.random.arrayElement(["sites", "centres", "locations"]) + "/" + faker.helpers.slugify(siteName.toLowerCase()), | ||
"name": siteName, | ||
"description": faker.lorem.paragraphs(golden ? 4 : faker.random.number(4)), | ||
"identifier": faker.finance.bic(), | ||
"address": { | ||
"type": "PostalAddress", | ||
"streetAddress": faker.address.streetAddress(), | ||
"addressLocality": "Oxford", | ||
"addressRegion": "Oxfordshire", | ||
"postalCode": postcodeObj.postcode, | ||
"addressCountry": "GB" | ||
}, | ||
"telephone": faker.phone.phoneNumber(), | ||
"geo": { | ||
"type": "GeoCoordinates", | ||
"latitude": postcodeObj.latitude, | ||
"longitude": postcodeObj.longitude | ||
}, | ||
"image": generateImages(), | ||
"amenityFeature": generateAmenityFeature(golden), | ||
"openingHoursSpecification": [ | ||
{ | ||
"type": "OpeningHoursSpecification", | ||
"dayOfWeek": "https://schema.org/Sunday", | ||
"opens": "09:00", | ||
"closes": "17:30" | ||
}, | ||
{ | ||
"type": "OpeningHoursSpecification", | ||
"dayOfWeek": "https://schema.org/Monday", | ||
"opens": "06:30", | ||
"closes": "21:30" | ||
}, | ||
{ | ||
"type": "OpeningHoursSpecification", | ||
"dayOfWeek": "https://schema.org/Tuesday", | ||
"opens": "06:30", | ||
"closes": "21:30" | ||
}, | ||
{ | ||
"type": "OpeningHoursSpecification", | ||
"dayOfWeek": "https://schema.org/Wednesday", | ||
"opens": "06:30", | ||
"closes": "21:30" | ||
}, | ||
{ | ||
"type": "OpeningHoursSpecification", | ||
"dayOfWeek": "https://schema.org/Thursday", | ||
"opens": "06:30", | ||
"closes": "21:30" | ||
}, | ||
{ | ||
"type": "OpeningHoursSpecification", | ||
"dayOfWeek": "https://schema.org/Friday", | ||
"opens": "06:30", | ||
"closes": "20:30" | ||
}, | ||
{ | ||
"type": "OpeningHoursSpecification", | ||
"dayOfWeek": "https://schema.org/Saturday", | ||
"opens": "07:15", | ||
"closes": "17:30" | ||
} | ||
] | ||
}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an exact copy of the Place
object that was created in generateSessionSeriesItemData
. I have made no updates to it other than moving it into its own function
a471fb9
to
94277ef
Compare
…rable-sessionseries-dates feat: Configure timestamp and schedule generation for SessionSeries feed
94277ef
to
b530461
Compare
QA
Example of a golden session:
Online sessions have no
location
:Example of an affiliated location: