2022-10-29 Example Import Data feed and config

From Izara Wiki
Revision as of 02:31, 31 October 2022 by Mint (talk | contribs)
Jump to navigation Jump to search

Service - Import Data

Sample for importing a DeliveryMethod, with RateTable (including versioned data).

  • ? if createRateTable needs to know deliveryMethodId when creating, then must adjust to system where deliveryMethod gets created first (which would include in request to dependant object the id of the first created object, eg deliveryMethodId gets added to the request to createRateTable)

example Config table items

{
	configKey: "objectType",
	configTag: "deliveryMethodStandard"
	configValue: {
		createObjectServiceName: "DeliveryMethodStandard",
		createLinkServiceNames: {
			"rateTable": "DeliveryMethodStandard",
		},
		parentObjectTypes:[
			"deliveryMethodLink",
		]
	}
},
{
	configKey: "objectType",
	configTag: "deliveryMethodRateTable"
	configValue: {
		createObjectServiceName: "DeliveryMethodStandard",//?
		createLinkServiceNames: {
		},
		parentObjectTypes:[
			"deliveryMethodStandard",
			"deliveryMethodOther",
		]
	}
},

example

PendingObjectMain

{
	importBatchId: "xx",
	objectId: "aa",
	objectType: "deliveryMethodStandard",
	fields: {
		deliveryMethodName: [
			"en": "Post Office",
			"th": "Braisanee",
		]
		fromLocationNodeId: "xxx",
	},
	reference: "smurf"
	recordNumber: 1,
	status: "processing",
	errorsFound: {},
},
{
	importBatchId: "xx",
	objectId: "bb",
	objectType: "deliveryMethodRateTable"
	fields: {
		rates: [
			//..
		]
	},
	recordNumber: 1,
	status: "processing",
	errorsFound: {},
},

PendingObjectReference

{
	importBatchId: "xx",
	referenceId: "aa",
	objectId: "bb",
},

PendingLink

{
	importBatchId: "xx",
	pendingLinkId: "bb_aa",
},

also

  • PendingObjectAwaitingProcess
  • PendingLinkAwaitingProcess