How to find the time when an order was fulfilled? - shopify

When getting the order information form the api we get the fulfilment status but not the exact time when the order was fulfilled. The fulfilment information from the api is missing.
The fulfilment object in an order has the following properties.
fulfillments: [
{
id: NUMBER,
admin_graphql_api_id: 'gid://shopify/Fulfillment/NUMBER',
created_at: '2022-01-04T11:07:59-05:00',
location_id: NUMBER,
name: 'STRING',
order_id: NUMBER,
receipt: {},
service: 'manual',
shipment_status: null,
status: 'success',
tracking_company: 'ACME',
tracking_number: 'NUMBER',
tracking_numbers: [Array],
tracking_url: 'https://acme.com/TrackConfirmAction?qtc_tLabels1=NUMBER',
tracking_urls: [Array],
updated_at: '2022-01-04T11:08:00-05:00',
line_items: [Array]
}
],
created_at has the information when the fulfilment was created and updated at could have the information when it was even shipped/delivered. How do I get this time, pointers to documentation would be really appreciated.

Related

Getstream Chat Documentation for Attachments & Actions / How to make clickable predefined answers?

I am not able to find Stream Chat React-Native documentation for Actions or I am not using what I found correct :-)
I am able to find a message example like:
{
'text': 'Wonderful! Thanks for asking.',
'attachments': [
{
'type': 'form',
'title': 'Select your account',
'actions': [
{
'name': 'account',
'text': 'Checking',
'style': 'primary',
'type': 'button',
'value': 'checking'
},
{
'name': 'account',
'text': 'Saving',
'style': 'default',
'type': 'button',
'value': 'saving'
},
{
'name': 'account',
'text': 'Cancel',
'style': 'default',
'type': 'button',
'value': 'cancel'
}
]
}
]
}
Pushing this message result in a OK rendering in the client.
Image: Message in chat client
However, the React-Native client throws an error when clicking any of the 3 buttons.
The error I get is:
WARN Possible Unhandled Promise Rejection (id: 0):
Error: StreamChat error code 4: RunMessageAction failed with error: "invalid or disabled command ``"
I have found some references to documentation like this:
Actions in combination with attachments can be used to build commands.
But the link does not end up describing anything about Commands.
Anyone have any tip. E.g. like a link to some documentation describing how to make clickable predefined answers work? :-D

How to nest a JSON payload under a named parameter in open api 3.0 [duplicate]

This question already has answers here:
Swagger: How to have a property reference a model in OpenAPI 2.0 (i.e. nest the models)?
(2 answers)
Closed 2 years ago.
I'm trying to describe an API endpoint that receives a PUT request with the following JSON payload:
{
"product": {
"name: "foo",
"brand": "bar"
}
}
Here is a sample of the definition:
components:
schemas:
Product:
type: object
required:
- name
- brand
properties:
name:
type: string
brand:
type: string
paths:
/products/{id}:
parameters:
- name: id
in: path
schema:
type: integer
required: true
put:
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
However, this produces the following JSON payload (it's missing the "product" key):
{
"name: "foo",
"brand": "bar"
}
I tried this:
parameters:
- name: product
in: body
schema:
type: object
properties:
product:
type: object
schema:
$ref: '#/components/schemas/Product'
But that doesn't work. Any ideas?
Your second example is almost correct, just change this part
schema:
type: object
properties:
product:
type: object
schema:
$ref: '#/components/schemas/Product'
to
schema:
type: object
properties:
product:
$ref: '#/components/schemas/Product'
Note the $ref is used directly under the property name.

How to store complex data in Redis?

I want to store data in the following style in Redis database:
{ _id: 5b3a60cdccbdf81bcc5343e6,
id: 5b3a60cdccbdf81bcc5343e5,
position: 'Web dveloper',
type: 'Contract',
Skills: 'html, bootstrap,php',
location: 'Boston',
job_id: 1,
Experience: '0-6 months',
Description: 'Developer for websites and web apps',
__v: 0 },
{ _id: 5b3a6151ccbdf81bcc5343e8,
id: 5b3a6151ccbdf81bcc5343e7,
position: 'Data analyst',
type: 'contract',
Skills: 'big data, hadoop,python',
location: 'boston',
job_id: 2,
Experience: '1yr',
Description: 'for analysing incoming data',
__v: 0 },
{ _id: 5b3a6207ccbdf81bcc5343ea,
id: 5b3a6207ccbdf81bcc5343e9,
position: 'Content Writer',
type: 'Permanent',
Skills: 'Technical wirtting,Custmer engagement',
location: 'new jersey',
job_id: 3,
Experience: '0-6 months',
Description: 'for writting website content',
__v: 0 },
{ _id: 5b3a62c4ccbdf81bcc5343ec,
id: 5b3a62c4ccbdf81bcc5343eb,
position: 'node js specialist',
type: 'Permanent',
Skills: 'node js ,express js , mean stack',
location: 'boston',
job_id: 4,
Experience: '1yr',
Description: 'for the web apps',
__v: 0 },
{ _id: 5b3a6362ccbdf81bcc5343ee,
id: 5b3a6362ccbdf81bcc5343ed,
position: 'database expert',
type: 'temporary',
Skills: 'sql , no sql, mysql,sql server,mongo db',
location: 'boston',
job_id: 5,
Experience: '2 yrs',
Description: 'for desinging and maintaing databases',
__v: 0 },
{ _id: 5b3a8639c8323b2cfc179969,
id: 5b3a8639c8323b2cfc179968,
position: 'Social media manager',
type: 'Permanent',
Skills: 'Social media marketing,Digital marketing',
location: 'Boston',
job_id: 4,
Experience: '1yr',
Description: 'For managing company socail media accounts',
__v: 0 }
I have gone through Redis official documentation but I have found nothing. Can anybody guide what structure I can use to store and how I can retrieve these data in table?
One of the alternatives you could use to store your data is the Redis Hash data structure. Using the Redis Hash structure, you could store your entities using the id as the key, then map the remaining fields into a Redis Hash using the HMSET command.
The recommended client for Node.js is the npm Redis package. This will provide all of the functionality you need to interact with Redis.
Ultimately, your query patterns are going to determine the optimal structure for your data. Using a hash is a very basic entity mapping approach to the problem, but it might not be the best way to structure the data. There may be more efficient ways to structure the data depending on how you plan to use it.
Redis doesn't offer that much structure directly, but there are layered libraries that do. I am trying to use Walrus, a Python library, that offers that capability atop Redis.

Adjusting User Context with TreeStoreBuilder

I've been able to create a grid and basic filtering to narrow down iterations etc. Ideally I would like to run this via html/confluence so ideally I need to have the filtering set so that I can filter on parent as well as project. Testing this in the Rally dashboard, the way I have it still only working within project I'm sitting in. How do I make my filtering work so that where I'm at project wise in Rally doesn't matter or if I use my api key.
Thanks!
Mark
Ext.create('Rally.data.wsapi.TreeStoreBuilder').build({
models: ['userstory'],
autoLoad: true,
enableHierarchy: true,
filters: [{property: 'Iteration.Name',
operator : '=',
value : 'March'},
{property: 'Project.Parent.Name',
operator : '=',
value : 'Synergy'},
{property: 'Project.Name',
operator : '=',
value : 'Condor'}
]
}).then({
success: function(store) {
Ext.create('Ext.Container', {
items: [{
xtype: 'rallytreegrid',
columnCfgs: [
'DisplayColor',
'Name',
'ScheduleState',
'Blocked',
'TaskEstimateTotal',
'TaskRemainingTotal',
'Owner',
'Notes'
],
store: store
}],
renderTo: Ext.getBody()
});
}
});
You just need to pass a context to your store:
https://help.rallydev.com/apps/2.0/doc/#!/guide/data_stores-section-scoping
All projects:
{ project: null, workspace: '/workspace/12345'}
Specific project:
{ project: '/project/12345', projectScopeDown: false, projectScopeUp: false }
Project hierarchy:
{ project: '/project/12345', projectScopeDown: true, projectScopeUp: false }
Or if you are trying to get data from multiple projects not in a tree you can always create a filter in the store on Project like you're doing above. Note that you'll need to make sure all those projects are actually in scope based on your context to get any results.

Waterline unique validation not detected until the next sailsjs server reset

I am using sails#beta.
I am trying to create several Room models (see definition) below, the problem is that I can successfully create Room models with the same attribute 'name', although attribute 'name' has a unique validation.
The validation isn't detected until the next restart of 'sails' server, then I get this output:
C:\eMali_dev\server>sails lift
info: Starting app...
Express midleware for passport
Waterline encountered a fatal error when trying to perform the `alter` auto-migration strategy.
In a couple of seconds, the data (cached in memory) will be logged to stdout.
(a failsafe put in place to preserve development data)
In the mean time, here's the error:
Error (E_UNKNOWN) :: Encountered an unexpected error:
MongoError: E11000 duplicate key error index: eMali_beta_dev.room.$name_1 dup key: { : "e1" }
Details:
{ error: 'E_UNKNOWN',
summary: 'Encountered an unexpected error',
status: 500,
raw: 'MongoError: E11000 duplicate key error index: eMali_beta_dev.room.$name_1 dup key: { : "e1" }' }
================================
Data backup:
================================
[ { name: 'e1',
center: '53471e2318b931dc1b69f3a8',
min_age: 1,
max_age: 6,
createdAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
updatedAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
_id: { _bsontype: 'ObjectID', id: 'SG\u001e#\u001811Ü\u001bióc' } },
{ name: 'e2',
center: '53471e2318b931dc1b69f3a8',
min_age: 1,
max_age: 7,
createdAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
updatedAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
_id: { _bsontype: 'ObjectID', id: 'SG\u001e#\u001811Ü\u001bióª' } },
{ name: 'e1',
center: '53471e2318b931dc1b69f3a8',
min_age: 1,
max_age: 6,
createdAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
updatedAt: Fri Apr 11 2014 00:41:39 GMT+0200 (W. Europe Summer Time),
_id: { _bsontype: 'ObjectID', id: 'SG\u001e#\u001811Ü\u001bió«' } } ]
error: A hook (`orm`) failed to load!
Room model:
module.exports = {
schema: true,
attributes: {
name: {
type: 'string',
required: true,
unique: true,
minLength: 3
},
center: {
model: 'center'
},
min_age: {
type: 'integer',
required: true
},
max_age: {
type: 'integer',
required: true
}
}
}
This was a bug in sails and it was fixed. Thanks everybody
You need to change the database from default Disk database to a database of your choice.
I was facing a similar problem and changing database from "Disk" to "MongoDB" fixed my issue.
It seems the default database is unable to enforce unique constraint.
I hope it solves your issue.