// ----------------------------------------------------------------------------- // Enum Typedefs // ----------------------------------------------------------------------------- /** * The level of dedication of the segment to cycling * @typedef {"shared" | "dedicatedLane" | "bikePath"} PathType */ /** * The surface type of a segment (road type) * @typedef {"gravel" | "asphalt" | "dirt"} SurfaceType */ /** * The type of user (user or admin) * @typedef {"user" | "admin"} UserRole */ // ----------------------------------------------------------------------------- // Model Typedefs // ----------------------------------------------------------------------------- /** * A routable path on a map - not necessarily a segment * @typedef {Object} MapRoute * @property {string} polyline * @property {number} distance */ /** * A longitudinal or latitudinal coordatine * @typedef {Object} Point * @property {number} lat * @property {number} lng */ /** * A segment of road which will be rated and tagged * @typedef {Object} Segment * @property {string} id * @property {string} [name] * @property {string} [description] * @property {string} polyline * @property {string} created_by The user who created the segment * @property {boolean} hidden Whether a segment is user visible or not */ /** * Form the client uses to create a segment * @typedef {Object} SegmentCreateForm * @property {string} [name] * @property {string} [description] * @property {string[]} polylines * @property {number} surfaceRating * @property {number} trafficRating * @property {SurfaceType} surfaceType * @property {PathType} pathType */ /** * A rating that is supplied with the segment * @typedef {Object} SegmentRating * @property {string} id * @property {string} segmentId * @property {string} userId * @property {number} trafficRating * @property {number} surfaceRating * @property {SurfaceType} surfaceType * @property {PathType} pathType * @property {string} createdAt * @property {string} updatedAt * @property {string} [deletedAt] */ /** * Form to modify an existing segment * @typedef {Object} SegmentUpdateForm * @property {string} [name] * @property {string} [description] * @property {number} [surfaceRating] * @property {number} [trafficRating] * @property {SurfaceType} [surfaceType] * @property {PathType} [pathType] */ /** * A user of the service * @typedef {Object} User * @property {string} id * @property {string} firstName * @property {string} lastName * @property {string} email * @property {string} [city] * @property {string} [province] * @property {string} [country] * @property {string} [birthdate] * @property {string} [sex] * @property {UserRole} role * @property {string} stravaToken Strava API token * @property {string} createdAt * @property {string} updatedAt * @property {string} [deletedAt] */ /** * A form to update attributes about a user * @typedef {Object} UserUpdateForm * @property {string} [birthdate] * @property {string} [sex] */ /** * @typedef {Object} VersionInfo * @property {string} name Name of this service * @property {string} version Version of this service * @property {string} scalaVersion Version of Scala used to build this service * @property {string} sbtVersion Version of SBT used to build this service */ // ----------------------------------------------------------------------------- // Union Typedefs // -----------------------------------------------------------------------------