get Response from AWS step function after execution of each map iteration - aws-api-gateway

I have an use case, where user is defined a workflow. As user hits the API, step function gets started. A lambda returns a list of steps based on users & start the workflow e.g.:
step1. it process(extracts) the doc,
step2. inserts some data to
DB
step3. .....
step4. .....
here steps are in map, as these steps are returned from lambda.
Is there any way to get response from each map iteration, so that I can show user at which step the process is , & the output of previous step.
here is my step function design:
test-fetch-input-workflow: returns an array: [step1, step2, ....]
workflow step-lambda: calls some lambda based on step name

Assuming that you are using Standard Workflows, you can get this information using the GetExecutionHistory API Action: https://docs.aws.amazon.com/step-functions/latest/apireference/API_GetExecutionHistory.html
You will want to look for events of type MapIterationSucceeded, grab the previousEventId, then look for the output in the HistoryEvent with that Id.
For example, if you had a state machine like this:
{
"StartAt": "Generate Array for Map",
"States": {
"Generate Array for Map": {
"Type": "Pass",
"Next": "Map",
"Result": [
1,
2,
3,
4,
5
]
},
"Map": {
"Type": "Map",
"ItemProcessor": {
"ProcessorConfig": {
"Mode": "INLINE"
},
"StartAt": "Generate Random Number",
"States": {
"Generate Random Number": {
"Type": "Pass",
"End": true,
"Parameters": {
"Random Number.$": "States.MathRandom(1,1000)"
}
}
}
},
"End": true
}
}
}
Your execution history would look like this:
{
"events": [
{
"timestamp": "2022-12-08T16:44:07.651000-08:00",
"type": "ExecutionStarted",
"id": 1,
"previousEventId": 0,
"executionStartedEventDetails": {
"input": "{\n \"Comment\": \"Insert your JSON here\"\n}",
"inputDetails": {
"truncated": false
},
"roleArn": "arn:aws:iam::000000000000:role/service-role/StepFunctions-MapTest-role-613230dd"
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateEntered",
"id": 2,
"previousEventId": 0,
"stateEnteredEventDetails": {
"name": "Generate Array for Map",
"input": "{\n \"Comment\": \"Insert your JSON here\"\n}",
"inputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateExited",
"id": 3,
"previousEventId": 2,
"stateExitedEventDetails": {
"name": "Generate Array for Map",
"output": "[1,2,3,4,5]",
"outputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapStateEntered",
"id": 4,
"previousEventId": 3,
"stateEnteredEventDetails": {
"name": "Map",
"input": "[1,2,3,4,5]",
"inputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapStateStarted",
"id": 5,
"previousEventId": 4,
"mapStateStartedEventDetails": {
"length": 5
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationStarted",
"id": 6,
"previousEventId": 5,
"mapIterationStartedEventDetails": {
"name": "Map",
"index": 0
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationStarted",
"id": 7,
"previousEventId": 5,
"mapIterationStartedEventDetails": {
"name": "Map",
"index": 1
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationStarted",
"id": 8,
"previousEventId": 5,
"mapIterationStartedEventDetails": {
"name": "Map",
"index": 2
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationStarted",
"id": 9,
"previousEventId": 5,
"mapIterationStartedEventDetails": {
"name": "Map",
"index": 3
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationStarted",
"id": 10,
"previousEventId": 5,
"mapIterationStartedEventDetails": {
"name": "Map",
"index": 4
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateEntered",
"id": 11,
"previousEventId": 6,
"stateEnteredEventDetails": {
"name": "Generate Random Number",
"input": "1",
"inputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateExited",
"id": 12,
"previousEventId": 11,
"stateExitedEventDetails": {
"name": "Generate Random Number",
"output": "{\"Random Number\":259}",
"outputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationSucceeded",
"id": 13,
"previousEventId": 12,
"mapIterationSucceededEventDetails": {
"name": "Map",
"index": 0
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateEntered",
"id": 14,
"previousEventId": 7,
"stateEnteredEventDetails": {
"name": "Generate Random Number",
"input": "2",
"inputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateExited",
"id": 15,
"previousEventId": 14,
"stateExitedEventDetails": {
"name": "Generate Random Number",
"output": "{\"Random Number\":776}",
"outputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationSucceeded",
"id": 16,
"previousEventId": 15,
"mapIterationSucceededEventDetails": {
"name": "Map",
"index": 1
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateEntered",
"id": 17,
"previousEventId": 8,
"stateEnteredEventDetails": {
"name": "Generate Random Number",
"input": "3",
"inputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateExited",
"id": 18,
"previousEventId": 17,
"stateExitedEventDetails": {
"name": "Generate Random Number",
"output": "{\"Random Number\":743}",
"outputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationSucceeded",
"id": 19,
"previousEventId": 18,
"mapIterationSucceededEventDetails": {
"name": "Map",
"index": 2
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateEntered",
"id": 20,
"previousEventId": 9,
"stateEnteredEventDetails": {
"name": "Generate Random Number",
"input": "4",
"inputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateExited",
"id": 21,
"previousEventId": 20,
"stateExitedEventDetails": {
"name": "Generate Random Number",
"output": "{\"Random Number\":790}",
"outputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationSucceeded",
"id": 22,
"previousEventId": 21,
"mapIterationSucceededEventDetails": {
"name": "Map",
"index": 3
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateEntered",
"id": 23,
"previousEventId": 10,
"stateEnteredEventDetails": {
"name": "Generate Random Number",
"input": "5",
"inputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "PassStateExited",
"id": 24,
"previousEventId": 23,
"stateExitedEventDetails": {
"name": "Generate Random Number",
"output": "{\"Random Number\":632}",
"outputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapIterationSucceeded",
"id": 25,
"previousEventId": 24,
"mapIterationSucceededEventDetails": {
"name": "Map",
"index": 4
}
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapStateSucceeded",
"id": 26,
"previousEventId": 25
},
{
"timestamp": "2022-12-08T16:44:07.698000-08:00",
"type": "MapStateExited",
"id": 27,
"previousEventId": 25,
"stateExitedEventDetails": {
"name": "Map",
"output": "[{\"Random Number\":259},{\"Random Number\":776},{\"Random Number\":743},{\"Random Number\":790},{\"Random Number\":632}]",
"outputDetails": {
"truncated": false
}
}
},
{
"timestamp": "2022-12-08T16:44:07.745000-08:00",
"type": "ExecutionSucceeded",
"id": 28,
"previousEventId": 27,
"executionSucceededEventDetails": {
"output": "[{\"Random Number\":259},{\"Random Number\":776},{\"Random Number\":743},{\"Random Number\":790},{\"Random Number\":632}]",
"outputDetails": {
"truncated": false
}
}
}
]
}

Related

RangeError (end): Invalid value: Only valid value is 0: 1 when generating model

Getting the error RangeError (end): Invalid value: Only valid value is 0: 1 when generating model when I try to generate model
Expected Behavior
when I use this command get generate model on match_details with assets/models/to_get/match_details.json
it should be creating a model inside the match_details folder with the fields inside the JSON file mentioned.
Current Behavior
When I try to do this I get the error RangeError (end): Invalid value: Only valid value is 0: 1 when generating model** when I try to generate model
Possible Solution
Am sure it is something about parsing the JSON file
More info
here is what the JSON file looks like
{
"success": true,
"details": {
"id": 22,
"date_time": "2022-04-12T20:00:00Z",
"home_team": {
"id": 69,
"home_strip": {
"id": 15,
"image": "/uploads/strip_5_0py3QXM.png"
},
"away_strip": {
"id": 16,
"image": "/uploads/WhatsApp_Image_2022-03-09_at_10.24.56_AM.jpeg"
},
"players": [{
"id": 47,
"is_cap": false,
"average_skill": 3,
"region": {
"id": 13,
"name_ar": "التجمع الخامس",
"name_en": "Fifth Settlement",
"state": {
"id": 8,
"name_ar": "القاهره",
"name_en": "Cairo"
}
},
"first_name": "Ezz El Din",
"last_name": "Karim",
"mobile": "01113481110",
"email": null,
"image": null,
"positions_ar": [{
"مدافع": 3
}],
"positions_en": [{
"CB": 3
}],
"basic_skills_ar": [{
"السرعة": 4
},
{
"تمرير الكرة": 3
},
{
"تسديد": 2
}
],
"basic_skills_en": [{
"speeding": 4
},
{
"Passing": 3
},
{
"shooting": 2
}
]
}],
"cap": {
"id": 46,
"is_cap": true,
"average_skill": 3,
"region": {
"id": 13,
"name_ar": "التجمع الخامس",
"name_en": "Fifth Settlement",
"state": {
"id": 8,
"name_ar": "القاهره",
"name_en": "Cairo"
}
},
"first_name": "Karim",
"last_name": "Garrana",
"mobile": "01113332257",
"email": "karim.garrana#gmail.com",
"image": null,
"positions_ar": [{
"مهاجم": 3
},
{
"مدافع": 4
}
],
"positions_en": [{
"ST": 3
},
{
"CB": 4
}
],
"basic_skills_ar": [{
"السرعة": 3
},
{
"تمرير الكرة": 3
},
{
"تسديد": 3
}
],
"basic_skills_en": [{
"speeding": 3
},
{
"Passing": 3
},
{
"shooting": 3
}
]
},
"average_skill": 3,
"points": 0,
"name": "كوبرا",
"league": 25,
"logo": "/uploads/9_IApeihR.png",
"region_ar": "التجمع الخامس",
"region_en": "Fifth Settlement"
},
"away_team": {
"id": 68,
"home_strip": {
"id": 14,
"image": "/uploads/strip_6.png"
},
"away_strip": {
"id": 13,
"image": "/uploads/strip_5.png"
},
"players": [{
"id": 46,
"is_cap": true,
"average_skill": 3,
"region": {
"id": 13,
"name_ar": "التجمع الخامس",
"name_en": "Fifth Settlement",
"state": {
"id": 8,
"name_ar": "القاهره",
"name_en": "Cairo"
}
},
"first_name": "Karim",
"last_name": "Garrana",
"mobile": "01113332257",
"email": "karim.garrana#gmail.com",
"image": null,
"positions_ar": [{
"مهاجم": 3
},
{
"مدافع": 4
}
],
"positions_en": [{
"ST": 3
},
{
"CB": 4
}
],
"basic_skills_ar": [{
"السرعة": 3
},
{
"تمرير الكرة": 3
},
{
"تسديد": 3
}
],
"basic_skills_en": [{
"speeding": 3
},
{
"Passing": 3
},
{
"shooting": 3
}
]
}],
"cap": {
"id": 45,
"is_cap": false,
"average_skill": 4,
"region": {
"id": 11,
"name_ar": "ميامى",
"name_en": "Miami",
"state": {
"id": 7,
"name_ar": "الإسكندرية",
"name_en": "Alexandria"
}
},
"first_name": "Ahmed",
"last_name": "Wagdi",
"mobile": "01207199086",
"email": "ahmed.w.amin#gmail.com",
"image": "/uploads/90f1e1c9-b430-4f9c-8347-a86be57f58676954964268664537546.jpg",
"positions_ar": [{
"مدافع": 5
}],
"positions_en": [{
"CB": 5
}],
"basic_skills_ar": [{
"تسديد": 5
},
{
"تمرير الكرة": 5
},
{
"السرعة": 5
}
],
"basic_skills_en": [{
"shooting": 5
},
{
"Passing": 5
},
{
"speeding": 5
}
]
},
"average_skill": 4,
"points": 2,
"name": "المنتقمون",
"league": 25,
"logo": "/uploads/6.png",
"region_ar": "التجمع الخامس",
"region_en": "Fifth Settlement"
},
"location": {
"id": 8,
"name_ar": "مدرسة الكابيتال",
"name_en": "Capital School",
"location": "30.014650515430546,31.4582347869873",
"region": 13
}
}
}

AWS API Gateway Model Schema for table display on website

I want to display data from a API call on a Wordpress table. Most table plug-ins accept JSON results from an API call but only if it's formatted as follows
[
{
"stockId": 4,
"description": "Powerbanks",
"costPrice": 42,
"salePrice": 80,
"units": 10,
"purchaseDate": "2019-09-27T00:00:00.000Z",
"image": "power bank.jpg",
"supplierId": 0
},
{
"stockId": 8,
"description": "Chip",
"costPrice": 0.5,
"salePrice": 1.5,
"units": 49,
"purchaseDate": "2019-09-27T00:00:00.000Z",
"image": "Chip.jpg",
"supplierId": 0
},
{
"stockId": 9,
"description": "Honey",
"costPrice": 5.6,
"salePrice": 66,
"units": 33,
"purchaseDate": "2019-09-27T00:00:00.000Z",
"image": "honey.jpg",
"supplierId": 0
}
]
What JSON schema do I need to format the data like this? The JSON output starts/ends with [ ]
My current model schema looks like this at the moment
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Get all stock",
"type": "object",
"properties": {
"rows": {
"type": "array",
"items" : {
"type" : "object",
"properties": {
"stockId": { "type": "number" },
"description": { "type": "string" },
"costPrice": { "type": "number" },
"salePrice": { "type": "number" },
"units": { "type": "number" },
"purchaseDate": { "type": "string" },
"image" : { "type" : "string" },
"supplierId": { "type": "number" }
}
}
}
}
}
This gives the following output:
{
"rows": [
{
"stockId": 4,
"description": "Powerbanks",
"costPrice": 42,
"salePrice": 80,
"units": 10,
"purchaseDate": "2019-09-27T00:00:00.000Z",
"image": "power bank.jpg",
"supplierId": 0
},
{
"stockId": 8,
"description": "Chip",
"costPrice": 0.5,
"salePrice": 1.5,
"units": 49,
"purchaseDate": "2019-09-27T00:00:00.000Z",
"image": "Chip.jpg",
"supplierId": 0
},
{
"stockId": 9,
"description": "Honey",
"costPrice": 5.6,
"salePrice": 66,
"units": 33,
"purchaseDate": "2019-09-27T00:00:00.000Z",
"image": "honey.jpg",
"supplierId": 0
}
]
}
How do I change the model schema to look like the output needed?

Filter for one attribute (array) for one of its value (json)

Having the following record
{
"name": "
 Festões Plástico, 12mt x 17cm - Festas Populares",
"categories": [
"Festas",
"Casamentos",
"Decorações"
],
"hierarchicalCategories": {
"lvl0": "Festas",
"lvl1": "Festas > Casamentos",
"lvl2": "Festas > Casamentos > Decorações"
},
"description": "",
"brand": "Misterius",
"price": 14.94,
"stock": "Disponível",
"prices": [
{
"value": 12,
"type": "specificValue",
"family": "fatos",
"subfamily": "example"
},
{
"value": 13,
"type": "specificValue13",
"family": "fatos13",
"subfamily": "example13"
},
{
"value": 14,
"type": "specificValue14",
"family": "fatos14",
"subfamily": "example14"
},
{
"value": 15,
"type": "specificValue15",
"family": "fatos15",
"subfamily": "example15"
},
{
"value": 16,
"type": "specificValue16",
"family": "fatos16",
"subfamily": "example16"
}
],
"color": [
{
"name": "Amarelo",
"label": "Amarelo,#FFFF00",
"hexa": "#FFFF00"
},
{
"name": "Azul",
"label": "Azul,#0000FF",
"hexa": "#0000FF"
},
{
"name": "Branco",
"label": "Branco,#FFFFFF",
"hexa": "#FFFFFF"
},
{
"name": "Laranja",
"label": "Laranja,#FFA500",
"hexa": "#FFA500"
},
{
"name": "Verde Escuro",
"label": "Verde Escuro,#006400",
"hexa": "#006400"
},
{
"name": "Vermelho",
"label": "Vermelho,#FF0000",
"hexa": "#FF0000"
}
],
"specialcategorie": "",
"reference": "3546",
"rating": 0,
"free_shipping": false,
"popularity": 0,
"objectID": "30"
}
Now by searching for "Festas Populares" will return the record and its attributes, is it possible to also filter for one attribute array as "prices" to only return one json. for example "prices.type"="specificValue14" and "family"="fatos14" and "family"="fatos" and "subfamily"="example"
{
“value”: 14,
“type”: “specificValue14”,
“family”: “fatos14”,
“subfamily”: “example14”
}
the record return would be:
{
"name": "
 Festões Plástico, 12mt x 17cm - Festas Populares",
"categories": [
"Festas",
"Casamentos",
"Decorações"
],
"hierarchicalCategories": {
"lvl0": "Festas",
"lvl1": "Festas > Casamentos",
"lvl2": "Festas > Casamentos > Decorações"
},
"description": "",
"brand": "Misterius",
"price": 14.94,
"stock": "Disponível",
"prices": [
{
"value": 14,
"type": "specificValue14",
"family": "fatos14",
"subfamily": "example14"
}
],
"color": [
{
"name": "Amarelo",
"label": "Amarelo,#FFFF00",
"hexa": "#FFFF00"
},
{
"name": "Azul",
"label": "Azul,#0000FF",
"hexa": "#0000FF"
},
{
"name": "Branco",
"label": "Branco,#FFFFFF",
"hexa": "#FFFFFF"
},
{
"name": "Laranja",
"label": "Laranja,#FFA500",
"hexa": "#FFA500"
},
{
"name": "Verde Escuro",
"label": "Verde Escuro,#006400",
"hexa": "#006400"
},
{
"name": "Vermelho",
"label": "Vermelho,#FF0000",
"hexa": "#FF0000"
}
],
"specialcategorie": "",
"reference": "3546",
"rating": 0,
"free_shipping": false,
"popularity": 0,
"objectID": "30"
}
for some context a product can have multiple prices associated, for a specific user, or one day there is campaign giving discount, etc so for that cases want to filter price associated to the product/record.
No, this is not possible with Algolia. Records are always returned with the attributes specified inside attributesToRetrieve. These attributes are returned in full.

JOLT Spec for supporting the input json

My input JSON looks like below, but i am not sure of how to do internal array related parameter transformation using JOLT. Any help is appreciated as i am new to JOLT
{
"pktId": 7603,
"seq": 1,
"vehicleNumber": "66079",
"rmdLocation": "1",
"rmdTime": "2019-01-07T11:27:05.745Z",
"position": {
"lat": 55.4911232,
"lng": -3.686831
},
"dataSource": 11,
"frames": [
{
"seq": 0,
"card": 8,
"channel": 6,
"value": 117
},
{
"seq": 1,
"card": 8,
"channel": 6,
"value": 120
}
]
}
Below is the spec file i have created but it is not complete
[
{
"operation": "shift",
"spec": {
"frames": {
"*": {
"seq": "parameters[&1].seq",
"card": "parameters[&1].card",
"channel": "parameters[&1].channel",
"value": "parameters[&1].value"
}
},
"rmdTime": "messageTime",
"vehicleNumber": "roadNumber"
}
},
{
"operation": "default",
"spec": {
"appId": "configMsgXX",
"customerId": "ABC",
"messageRev": 1,
"messageType": "customStatistics"
}
}
]
Expected output is as below
{
"appId": "configMsgXX",
"customerId": "ABC",
"deviceId": string1+roadNumber+string2",
"messageRev": 1,
"messageTime": 1543395341000,
"messageType": "customStatistics",
"parameters": [
{
"address": string1+string2,
"name": "EM2000VoltageMainGenerator",
"timestamp": 1543395341000,
"quality": "3",
"datatype": "INTEGER",
"value": 100,
"qualityReason": "Stale Data",
"category": "REAL"
}
],
"roadNumber": 66079
}
I am using this library https://github.com/bazaarvoice/jolt
[
{
"operation": "shift",
"spec": {
"frames": {
"*": {
"seq": "parameters[&1].seq",
"card": "parameters[&1].card",
"channel": "parameters[&1].channel",
"value": "parameters[&1].value",
"#(2,rmdTime)": "parameters[&1].timestamp"
}
},
"rmdTime": "messageTime",
"vehicleNumber": "roadNumber"
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"parameters": {
"*": {
"quality": "3",
"name": "",
"address": "",
"datatype": "INTEGER",
"qualityReason": "Stale Data",
"category": "REAL"
}
}
}
},
{
"operation": "default",
"spec": {
"appId": "configMsgXX",
"customerId": "ABC",
"messageRev": 1,
"messageType": "customStatistics"
}
}
]

Grouping select with partial

Hello i have here this code:
public function getConversations($user, $limit, $page)
{
$offset = ($page - 1) * $limit;
$qb = $this->createQueryBuilder('message');
$qb
->select('message, partial o.{id}, partial userFrom.{id, username, avatar}, partial userTo.{id, username, avatar}, partial availability.{id, timeFrom}')
->leftJoin('message.from', 'userFrom')
->leftJoin('message.to', 'userTo')
->leftJoin('message.order', 'o')
->leftJoin('o.availabilities', 'availability')
->where($qb->expr()->orX(
$qb->expr()->eq('message.from', ':user'),
$qb->expr()->eq('message.to', ':user')
))
->setParameter('user', $user)
->setFirstResult($offset)
->setMaxResults($limit)
->addOrderBy('message.created', Criteria::DESC);
return $qb->getQuery()->getArrayResult();
}
I want to get only last message connected to each order. If i have 2 messages to order it gives me 2 rows but i need only one (the last one). I tried to use GROUP BY but it didn't work well. It wanted me to put all foreign ids to group by and then the result was really bad.
Result for this is:
{
"id": "813fa986-f89b-411d-8324-727e427cbc01",
"isRead": false,
"created": {
"date": "2016-12-12 18:01:00.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"content": "Hello to you too",
"contentType": "text",
"from": {
"id": "3e1806d6-f47e-48b4-afdb-1081d9555a3f",
"avatar": "",
"username": "User two"
},
"to": {
"id": "52ead9fa-b498-400b-967d-b49886ab3118",
"avatar": "",
"username": "User one"
},
"order": {
"id": "8349e718-405a-4e88-8155-3896e9a89fdf",
"availabilities": [
{
"id": "9ddc07e0-be3d-453c-b12f-0ee31bfce444",
"timeFrom": {
"date": "2016-12-03 12:00:00.000000",
"timezone_type": 3,
"timezone": "UTC"
}
}
]
}
},
{
"id": "813fa986-f89b-411d-8324-727e427cbc00",
"isRead": false,
"created": {
"date": "2016-12-12 18:00:00.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"content": "Helllooooooo",
"contentType": "text",
"from": {
"id": "52ead9fa-b498-400b-967d-b49886ab3118",
"avatar": "",
"username": "User one"
},
"to": {
"id": "3e1806d6-f47e-48b4-afdb-1081d9555a3f",
"avatar": "",
"username": "User two"
},
"order": {
"id": "8349e718-405a-4e88-8155-3896e9a89fdf",
"availabilities": [
{
"id": "9ddc07e0-be3d-453c-b12f-0ee31bfce444",
"timeFrom": {
"date": "2016-12-03 12:00:00.000000",
"timezone_type": 3,
"timezone": "UTC"
}
}
]
}
and should be just like this:
{
"id": "813fa986-f89b-411d-8324-727e427cbc01",
"isRead": false,
"created": {
"date": "2016-12-12 18:01:00.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"content": "Hello to you too",
"contentType": "text",
"from": {
"id": "3e1806d6-f47e-48b4-afdb-1081d9555a3f",
"avatar": "",
"username": "User two"
},
"to": {
"id": "52ead9fa-b498-400b-967d-b49886ab3118",
"avatar": "",
"username": "User one"
},
"order": {
"id": "8349e718-405a-4e88-8155-3896e9a89fdf",
"availabilities": [
{
"id": "9ddc07e0-be3d-453c-b12f-0ee31bfce444",
"timeFrom": {
"date": "2016-12-03 12:00:00.000000",
"timezone_type": 3,
"timezone": "UTC"
}
}
]
}
}