Sylius ShopApiPlugin Can't add products to cart - symfony

I'am trying to add a product to my cart using the ShopApiPlugin made for Sylius.
When I try to add a product thru /carts/mytokenoid/items with the json body
{
"productCode": "iphone9",
"quantity": 5
}
I get this response
{
"tokenValue": "mytokenoid",
"channel": "US_WEB",
"currency": "EUR",
"locale": "en_US",
"checkoutState": "cart",
"items": [
{
"quantity": 5,
"total": 4800,
"product": {
"code": "iphone9",
"name": "iPhone 9",
"slug": "iphone-9",
"averageRating": 0,
"taxons": {
"others": []
},
"variants": [
{
"code": "iphone9",
"axis": [],
"nameAxis": [],
"price": {
"current": 2000,
"currency": "EUR"
},
"images": []
}
],
"attributes": [],
"associations": [],
"images": []
}
}
],
"totals": {
"total": 6896,
"items": 4800,
"taxes": 0,
"shipping": 2096,
"promotion": -5200
}, (...)
But when I do /shop-api/carts/mytokenoid to check my cart content, it is empty, nothing was added. Also I checked the database and the cart is there with the correct token but no items.
Does anyone know how can I solve this? I already tried with authorization token and without. Got the same thing

Found the solution.
You just have to uncomment the "- tactician.middleware.doctrine" line in the config/packages/league_tactician.yaml

Related

UgcPosts -> Posts

I've written code which work under unversioned version and it uses ugcPosts api to gets Share/UgcPosts. In response I have thumbnails like below:
UgcPosts - https://api.linkedin.com/v2/ugcPosts/{encoded ugcPostUrn|shareUrn}?viewContext=AUTHOR
{
"author": "urn:li:person:123ABC",
"contentCertificationRecord": "{\"originCountryCode\":\"us\",\"modifiedAt\":1500590592795,\"spamRestriction\":{\"classifications\":[],\"contentQualityClassifications\":[],\"systemName\":\"MACHINE_SYNC\",\"lowQuality\":false,\"contentClassificationTrackingId\":\"B6A8B437D1D5E59D123455F6DCE5B\",\"contentRelevanceClassifications\":[],\"spam\":false}}",
"created": {
"actor": "urn:li:person:123ABC",
"time": 1500590543962
},
"firstPublishedAt": 1500590592702,
"id": "urn:li:ugcPost:123456",
"lastModified": {
"actor": "urn:li:person:123ABC",
"time": 1500590592806
},
"lifecycleState": "PUBLISHED",
"**specificContent**": {
"**com.linkedin.ugc.ShareContent**": {
"**media**": [
{
"media": "urn:li:digitalmediaAsset:123ABDEFHAG",
"status": "READY",
"**thumbnails**": [/**here i can have some thumbnail **]
}
],
"shareCommentary": {
"attributes": [
{
"length": 35,
"start": 66,
"value": {
"com.linkedin.common.CompanyAttributedEntity": {
"company": "urn:li:organization:12345"
}
}
}
],
"text": "Testing a UGC Post!"
},
"shareMediaCategory": "VIDEO"
}
},
"versionTag": "2",
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
But now after "migration" I dont see any option to get thumbnails for retriving posts ...
https://api.linkedin.com/rest/posts/{encoded ugcPostUrn|shareUrn}
and example of respone:
{
"lifecycleState": "PUBLISHED",
"lastModifiedAt": 1634790968774,
"visibility": "PUBLIC",
"publishedAt": 1634790968774,
"author": "urn:li:organization:5515715",
"distribution": {
"feedDistribution": "NONE",
"thirdPartyDistributionChannels": []
},
"content": {
"media": {
"id": "**urn:li:video:C5F10AQGKQg_6y2a4sQ**" - I can see only this, so probably I need to use VideoApi, but if there will be URN:LI:IMAGE ? Then what? How to get thumbnail for URN:LI:Image ?
}
},
"lifecycleStateInfo": {
"isEditedByAuthor": false
},
"isReshareDisabledByAuthor": false,
"createdAt": 1634790968743,
"id": "urn:li:ugcPost:6856810298419044352",
"commentary": "comment on Oct 20",
"adContext": {
"dscStatus": "ACTIVE",
"dscAdType": "VIDEO",
"isDsc": true,
"dscAdAccount": "urn:li:sponsoredAccount:520866471"
}
}
TL:DR :)
How to get thumbnail for urn:li:image ? If I get this in response content from posts, how to get this thumbnail for this type of content. For urn:li:video I guess that I can use VideoApi but for Image ?
I was looking for answer in documentation but without success.

Vega-Lite: Add a layer to a multi view plot based on an if-condition

I'm trying to build a simple text only dashboard with Kibana based on responses like the one below
{
"_index": "jenkins-plasma4-2022.04.08-000001",
"_type": "_doc",
"_id": "nhKIQYABmFVLYNIVp4H3",
"_score": 0,
"_source": {
"branch": "trunk",
"status": "UNSTABLE",
"buildnumber": 5501,
"failedStages": ["System Test"],
"suspectedCommits": []
}
I'm using vconcat right now:
"vconcat": [
{
"mark": {"type": "text", "fontSize": 50},
"encoding": {
"text": {"field": "buildnumber", "type": "nominal",}
}
},
{
"mark": {"type": "text", "fontSize": 50},
"encoding": {
"text": {"field": "status", "type": "nominal",}
}
}
]
In some situations "suspectedCommits" will not be empty, in those cases I'd like to be able to add to a multi view visualization

Cosmos db query to fetch data where array item is not null

I have Collection items in my cosmos db container.My sample data is
{
"objectID": "abc",
"id": "123",
"name": "gfh",
"description": "chock",
"brand": "hcn",
"size": 180,
"sizeUnits": "Grams",
"stores": []
},
{
"objectID": "123c",
"id": "0dfg",
"name": "shaek",
"description": "7ihk",
"brand": "fghcn",
"size": 768,
"sizeUnits": "Grams",
"stores": [ {
"id": 678",
"price": 2.2
},
{
"id": 678",
"price": 2.2}]
}
and so on...
I need to fetch all the details whose stores is empty. How to write query for this.
Please try this SQL:
SELECT * FROM c where ARRAY_LENGTH(c.stores) > 0
Result:
[
{
"objectID": "123c",
"id": "0dfg",
"name": "shaek",
"description": "7ihk",
"brand": "fghcn",
"size": 768,
"sizeUnits": "Grams",
"stores": [
{
"id": 678,
"price": 2.2
},
{
"id": 678,
"price": 2.2
}
]
}
]

how do you do nested objects in graphql - i'm using appsync and dynamodb

I have the following object and I want to create a schema for it that handles nested objects - what's the best way using graphql:
{
"type": "product",
"id": "411e2a2b-37e8-421e-adb8-2e038751d263",
"name": "Hazel",
"slug": "hazel",
"sku": "ENGINEERED3",
"manage_stock": false,
"description": "Abstract, sculptural, refined and edgy with a modern twist. Its symmetrical, spoked structure generates a clever geometric presence, which works well in a contemporary environment..",
"price": [
{
"amount": 11200,
"currency": "AUD",
"includes_tax": true
}
],
"status": "live",
"commodity_type": "physical",
"meta": {
"timestamps": {
"created_at": "2019-05-09T13:30:10+00:00",
"updated_at": "2019-05-09T13:45:11+00:00"
},
"display_price": {
"with_tax": {
"amount": 11200,
"currency": "AUD",
"formatted": "$112.00"
},
"without_tax": {
"amount": 11200,
"currency": "AUD",
"formatted": "$112.00"
}
},
"stock": {
"level": 0,
"availability": "out-stock"
}
}
}
It seems as though graphql wants a separate type per nested object - is that true?

Open graph fitness.runs returning no data

I have a bunch of Nike+ run data which i'm assuming (based on the below article) is published to the open graph. It certainly looks that way in my timeline.
https://developers.facebook.com/blog/post/2012/08/29/early-success-stories--fitness-and-open-graph/
Frustratingly while my music.listens request works fine and returns all of my Spotify listens, my request for fitness.runs returns no data. Is this simply because Nike haven't integrated correctly with the Open Graph. Or perhaps I need to request extended permissions in my Auth token?
https://developers.facebook.com/docs/reference/opengraph/action-type/fitness.runs
Any ideas?
As with all actions you need the correct permissions, in this case
user_actions.fitness
So the data returned from /me/fitness.runs for Nike will look like
{
"data": [
{
"id": "10101118696330517",
"from": {
"name": "Philippe Harewood",
"id": "13608786"
},
"start_time": "2013-03-22T23:15:56+0000",
"end_time": "2013-03-22T23:26:36+0000",
"publish_time": "2013-03-24T15:50:00+0000",
"application": {
"name": "Nike",
"namespace": "nikeapp",
"id": "84697719333"
},
"data": {
"course": {
"id": "476811255725972",
"url": "http://nikeplus.nike.com/plus/activity/running/detail/2118587303?external_share_id=CE32E1C4-93D8-48A7-A08F-6D5B4C13EE6A&is_new_meta=true",
"type": "fitness.course",
"title": "1.12 miles"
}
},
"type": "fitness.runs",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
},
{
"id": "10101118696155867",
"from": {
"name": "Philippe Harewood",
"id": "13608786"
},
"start_time": "2013-03-19T22:03:32+0000",
"end_time": "2013-03-19T22:18:37+0000",
"publish_time": "2013-03-24T15:49:46+0000",
"application": {
"name": "Nike",
"namespace": "nikeapp",
"id": "84697719333"
},
"data": {
"course": {
"id": "502469216483599",
"url": "http://nikeplus.nike.com/plus/activity/running/detail/2118587302?external_share_id=EBF6BC1D-BDEA-4EE5-B18D-FBC576610F13&is_new_meta=true",
"type": "fitness.course",
"title": "1.49 miles"
}
},
"type": "fitness.runs",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
}
],
"paging": {
"next": "https://graph.facebook.com/13608786/fitness.runs?limit=25&offset=25&__after_id=10101118696155867"
}
}

Resources