Skip to content

Instantly share code, notes, and snippets.

@joelso
Created April 15, 2019 13:42
Show Gist options
  • Save joelso/469e77f0839cf38c329752f6d4459dd1 to your computer and use it in GitHub Desktop.
Save joelso/469e77f0839cf38c329752f6d4459dd1 to your computer and use it in GitHub Desktop.
schema-test
{
"additionalProperties": false,
"description": "Get order by id response",
"id": "GetOrderByIdResponse",
"properties": {
"address": {
"additionalProperties": false,
"properties": {
"city": {
"description": "city",
"type": "string"
},
"streetAddress": {
"description": "Address of the street",
"type": "string"
},
"zipCode": {
"description": "Zip code",
"type": "string"
}
},
"type": "object"
},
"applications": {
"description": "Accepted applications for customers/admins, Own application for consultant",
"items": {
"additionalProperties": false,
"properties": {
"consultant": {
"additionalProperties": false,
"description": "Consultant account object",
"id": "ConsultantAccount",
"properties": {
"active": {
"description": "Active status of the user",
"type": "boolean"
},
"addressOne": {
"description": "Address one of the consultant",
"type": "string"
},
"addressTwo": {
"description": "address two of the consultant",
"type": "string"
},
"bank": {
"description": "Bank of the consultant",
"type": "string"
},
"city": {
"description": "City of the consultant",
"type": "string"
},
"criminalRecordsReportExpireDate": {
"description": "Expire date of criminal record",
"pattern": "^\\d{4}\\-(0?[1-9]|1[012])\\-(0?[1-9]|[12][0-9]|3[01])$",
"type": [
"null",
"string"
]
},
"dateOfEmployment": {
"description": "Date of employment of the consultant",
"pattern": "^\\d{4}\\-(0?[1-9]|1[012])\\-(0?[1-9]|[12][0-9]|3[01])$",
"type": "string"
},
"employeeNumber": {
"description": "Employee number of the consultant",
"type": "integer"
},
"employer": {
"description": "Employer of the consultant",
"type": "string"
},
"employmentType": {
"description": "Employment type of the consultant",
"type": "string"
},
"expertise": {
"items": {
"additionalProperties": false,
"properties": {
"competence": {
"description": "Competence of the consultant",
"type": "string"
},
"industry": {
"description": "Industry of the consultant",
"type": "string"
},
"service": {
"description": "Service of the consultant",
"type": "string"
}
},
"required": [
"industry",
"service"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"firstName": {
"description": "First name of the user",
"faker": "name.firstName",
"type": "string"
},
"hasDriverLicense": {
"description": "If consultant has a driver license",
"type": "boolean"
},
"hasTeacherLicense": {
"description": "If consultant has a teacher license",
"type": "boolean"
},
"holidayPayPercentage": {
"description": "Additional hourly pay percentage of the consultant",
"maximum": 100,
"minimum": 0,
"type": "number"
},
"hourlyPay": {
"description": "Hourly pay pay of the consultant",
"type": "number"
},
"id": {
"description": "Read-only unique id",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
},
"internalPresentation": {
"description": "Internal presentation the consultant",
"type": "string"
},
"isInvited": {
"description": "is consultant invited",
"type": "boolean"
},
"lastName": {
"description": "Last name of the user",
"faker": "name.lastName",
"type": "string"
},
"phoneNumber": {
"description": "Phone number of the consultant",
"pattern": "^[0-9/-]*.{9,11}$",
"type": "string"
},
"photo": {
"description": "Photo the consultant",
"faker": "internet.url",
"format": "uri",
"type": "string"
},
"presentation": {
"description": "Presentation the consultant",
"type": "string"
},
"region": {
"description": "Region of the consultant",
"type": "string"
},
"socialSecurityNumber": {
"description": "socialSecurityNumber number of the consultant",
"pattern": "^\\d{6,8}[-|(\\s)]{0,1}\\d{4}$",
"type": "string"
},
"type": {
"description": "Consultant type",
"enum": [
"consultant"
],
"type": "string"
},
"zipCode": {
"description": "Zip Code (5-digit)",
"pattern": "^\\d{5}$",
"type": "string"
}
},
"required": [
"expertise",
"firstName",
"id",
"lastName"
],
"type": "object"
},
"id": {
"description": "Id of order application",
"type": "string"
},
"status": {
"description": "Status of the order application",
"enum": [
"ACCEPTED",
"CANCELLED",
"DECLINED",
"PENDING_ANSWER"
],
"type": "string"
}
},
"required": [
"id",
"status"
],
"type": "object"
},
"type": "array"
},
"competence": {
"description": "Competence(s) for order",
"type": "array"
},
"contactPersonEmail": {
"description": "email of the contact person of the order",
"type": "string"
},
"contactPersonId": {
"description": "id of contact person",
"faker": "random.uuid",
"format": "uuid",
"type": [
"null",
"string"
]
},
"contactPersonName": {
"description": "name of the contact person of the order",
"type": "string"
},
"contactPersonPhoneNumber": {
"description": "phone no of the contact person of the order",
"type": "string"
},
"contract": {
"anyOf": [
{
"additionalProperties": false,
"description": "Contract for order",
"properties": {
"id": {
"description": "Contract id",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
},
"price": {
"description": "Price for the expertise",
"type": "number"
},
"version": {
"description": "Contract version for the order",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
}
},
"required": [
"id",
"price",
"version"
],
"type": "object"
},
{
"active": {
"description": "Active status of the user",
"type": "boolean"
},
"description": {
"description": "Description of contract",
"type": [
"null",
"string"
]
},
"id": {
"description": "Readonly unique id, is set during creation",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
},
"metadata": {
"additionalProperties": false,
"properties": {
"created": {
"description": "The contract created time",
"format": "date-time",
"type": [
"null",
"string"
]
},
"createdBy": {
"description": "Readonly unique id, is set during creation",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
},
"updated": {
"description": "The contract last updated time",
"format": "date-time",
"type": [
"null",
"string"
]
},
"updatedBy": {
"description": "Readonly unique id, is set during creation",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
}
},
"required": [
"created",
"createdBy"
],
"type": "object"
},
"name": {
"description": "Name of contract",
"type": "string"
},
"versions": {
"items": {
"additionalProperties": false,
"description": "The contract version object",
"id": "ContractVersion",
"properties": {
"id": {
"description": "Readonly unique id, is set during creation",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
},
"metadata": {
"additionalProperties": false,
"properties": {
"created": {
"description": "The contract created time",
"format": "date-time",
"type": [
"null",
"string"
]
},
"createdBy": {
"description": "Readonly unique id, is set during creation",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
}
},
"required": [
"created",
"createdBy"
],
"type": "object"
},
"prices": {
"description": "The price per hour for employee",
"items": {
"additionalProperties": false,
"properties": {
"industry": {
"description": "Industry of the price",
"type": "string"
},
"price": {
"description": "Hourly payment",
"type": "number"
},
"service": {
"description": "Service of the price",
"type": "string"
}
},
"required": [
"industry",
"price",
"service"
],
"type": "object"
},
"type": "array"
},
"terms": {
"description": "Terms of contract",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
}
]
},
"created": {
"description": "Order created time",
"format": "date-time",
"type": "string"
},
"createdBy": {
"description": "id of user that created the order",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
},
"customer": {
"additionalProperties": false,
"description": "Customer object",
"id": "Customer",
"properties": {
"company": {
"additionalProperties": false,
"description": "Company details",
"properties": {
"name": {
"description": "Name of customer",
"type": "string"
},
"telephone": {
"description": "Telephone number",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"contact": {
"additionalProperties": false,
"description": "User object",
"id": "User",
"properties": {
"firstName": {
"description": "First name of the user",
"faker": "name.firstName",
"type": "string"
},
"id": {
"description": "Read-only unique id",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
},
"lastName": {
"description": "Last name of the user",
"faker": "name.lastName",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
},
"customerId": {
"description": "Customer number",
"type": "number"
},
"customerTo": {
"default": "Pedagogpoolen",
"description": "Company that customer belongs to",
"type": "string"
},
"description": {
"description": "General practical details about customer, is visible for consultants",
"type": "string"
},
"id": {
"description": "Customer id",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
},
"invoice": {
"description": "Invoice address and details, refer to customer service for full details",
"type": "object"
},
"region": {
"description": "Region of the customer",
"type": "string"
},
"visitingAddress": {
"additionalProperties": false,
"description": "Visiting address details",
"properties": {
"city": {
"description": "city for visiting address",
"type": "string"
},
"streetAddress": {
"description": "Street address",
"type": "string"
},
"zipCode": {
"description": "zip code for visiting address",
"type": "string"
}
},
"required": [
"city",
"streetAddress",
"zipCode"
],
"type": "object"
}
},
"required": [
"id"
],
"type": "object"
},
"deniedReason": {
"description": "Reason why order was denied",
"type": "string"
},
"description": {
"description": "description of the order",
"type": "string"
},
"endDate": {
"oneOf": [
{
"description": "Start date of the order",
"format": "date",
"type": "string"
},
{
"description": "Start date of the order",
"format": "date-time",
"type": "string"
}
]
},
"expertise": {
"items": {
"additionalProperties": false,
"properties": {
"competence": {
"description": "Competence of the order",
"type": "string"
},
"industry": {
"description": "Industry of the order",
"type": "string"
},
"service": {
"description": "Service of the order",
"type": "string"
}
},
"required": [
"industry",
"service"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"finished": {
"description": "is this a finished order or not",
"type": "boolean"
},
"id": {
"description": "Read only unique id, is set during creation",
"type": "integer"
},
"industry": {
"description": "The industry value of the order.",
"type": "string"
},
"isDenied": {
"description": "Keep whether the order is denied or not",
"type": "boolean"
},
"isExpress": {
"description": "is this an express order or not",
"type": "boolean"
},
"isLongTermAssignment": {
"description": "Is the order is a long term assignment",
"type": "boolean"
},
"isPlanningExist": {
"description": "is planning for the order exist",
"type": "boolean"
},
"nameOfOrdinaryTeacher": {
"description": "name of teacher this consultant will be substitute for or name of department",
"type": "string"
},
"numberOfConsultants": {
"default": 1,
"description": "Number of consultants wanted for order",
"maximum": 100,
"minimum": 0,
"type": "integer"
},
"numberOfHours": {
"description": "Number of hours for order",
"type": "number"
},
"purchaseOrderNo": {
"description": "Optional reference number entered by customer (Swedish: Inköpsordernummer)",
"type": "string"
},
"region": {
"description": "region of order, usually same region as customer",
"type": "string"
},
"service": {
"description": "The service value of the order. (service should common for all expertise)",
"type": "string"
},
"shifts": {
"items": {
"additionalProperties": false,
"description": "OrderShift object",
"id": "OrderShift",
"properties": {
"break": {
"description": "Break in minutes if shift duration is more then five hours, calculated by backend",
"minimum": 0,
"type": "integer"
},
"date": {
"description": "Date of shift (YYYYMMDD)",
"maximum": 29991231,
"minimum": 20180101,
"type": "integer"
},
"duration": {
"description": "Duration in hours of shift, calculated by backend",
"minimum": 0,
"type": "number"
},
"end": {
"description": "End date-time of shift",
"maximum": 2359,
"minimum": 0,
"type": "integer"
},
"id": {
"description": "Id of shift",
"type": "string"
},
"start": {
"description": "Start date-time of shift",
"maximum": 2359,
"minimum": 0,
"type": "integer"
},
"weekday": {
"description": "Weekday of shift date",
"type": "string"
}
},
"required": [
"date",
"end",
"id",
"start"
],
"type": "object"
},
"type": "array"
},
"startDate": {
"oneOf": [
{
"description": "Start date of the order",
"format": "date",
"type": "string"
},
{
"description": "Start date of the order",
"format": "date-time",
"type": "string"
}
]
},
"status": {
"description": "Status of the order",
"enum": [
"ACCEPTED",
"ACTIVE",
"BOOKED",
"BOOKED_BY_OTHER",
"CANCELLED",
"DECLINED",
"DELETED",
"NOT_BOOKED",
"PENDING_ANSWER"
],
"type": "string"
},
"updated": {
"description": "Order update time",
"format": "date-time",
"type": "string"
},
"updatedBy": {
"description": "id of user that updated the order",
"faker": "random.uuid",
"format": "uuid",
"type": "string"
}
},
"required": [
"address",
"contactPersonEmail",
"contactPersonName",
"contactPersonPhoneNumber",
"contract",
"createdBy",
"customer",
"description",
"endDate",
"expertise",
"finished",
"id",
"isLongTermAssignment",
"isPlanningExist",
"numberOfConsultants",
"region",
"startDate"
],
"type": "object"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment