Service - Import Data: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 22: | Line 22: | ||
}, | }, | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== ImportBatchMain == | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
importBatchId: "xx", // random uuid | |||
userId: "xx", // submitted by userId | |||
startTime: currentTime.getTime(), | |||
batchConfig: {}, // same as request | |||
} | |||
</syntaxhighlight> | |||
* partition key: importBatchId | |||
* sort key: {none} | |||
== RawRecord == | |||
Is a raw copy, split out into fields, of one submitted record. One record may have multiple objects in it's fields. | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
importBatchId: "xx", | |||
rawRecordId: "xx", // random uuid | |||
fields: {}, // key is the name of the field | |||
recordNumber: ##, // eg the line number of the record | |||
} | |||
</syntaxhighlight> | |||
* partition key: importBatchId | |||
* sort key: rawRecordId | |||
== PendingObjectMain == | |||
One item per object that needs to be created. | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
importBatchId: "xx", | |||
objectId: "xx", // importBatchId_random uuid | |||
objectType: "xx", // eg variant|product|sellOffer|sellOfferPrice|sellOfferPlan|... | |||
fields: {}, // key is the name of the field | |||
rawRecordId: "xx", | |||
status: "xx", | |||
} | |||
</syntaxhighlight> | |||
* partition key: importBatchId | |||
* sort key: objectId | |||
== PendingObjectReference == | |||
Creates a link between submitted referenceId and saved object, so can find when other objects reference it. | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
importBatchId: "xx", | |||
referenceId: "xx", // objectType_{feed supplied referenceId} | |||
objectId: "xx", // eg variant|product|sellOffer|sellOfferPrice|sellOfferPlan|... | |||
} | |||
</syntaxhighlight> | |||
* partition key: importBatchId | |||
* sort key: referenceId | |||
* when creating maybe throw error if item exists with different objectId | |||
= Object hierarchy and field schema = | = Object hierarchy and field schema = | ||
Line 33: | Line 97: | ||
== where to store/set schema == | == where to store/set schema == | ||
Considering external service delivers this to ImportData in Initial Setup, as seed data. | Considering external service delivers this to ImportData in Initial Setup, as seed data injected directly into Import Data Config Dynamo table. | ||
= Working documents = | = Working documents = |
Revision as of 12:02, 29 October 2022
Overview
Orchestrates importing of objects/data into project.
Repository
https://bitbucket.org/izara-core-import-export-data/izara-core-import-data-import-data/src/master/
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configKey: "objectType",
configTag: "xx" // {eg: sellOffer/Product/VariantProduct etc..}
configValue: {
createObectServiceName: "xx" // {service name service that handles this type}
}
},
ImportBatchMain
{
importBatchId: "xx", // random uuid
userId: "xx", // submitted by userId
startTime: currentTime.getTime(),
batchConfig: {}, // same as request
}
- partition key: importBatchId
- sort key: {none}
RawRecord
Is a raw copy, split out into fields, of one submitted record. One record may have multiple objects in it's fields.
{
importBatchId: "xx",
rawRecordId: "xx", // random uuid
fields: {}, // key is the name of the field
recordNumber: ##, // eg the line number of the record
}
- partition key: importBatchId
- sort key: rawRecordId
PendingObjectMain
One item per object that needs to be created.
{
importBatchId: "xx",
objectId: "xx", // importBatchId_random uuid
objectType: "xx", // eg variant|product|sellOffer|sellOfferPrice|sellOfferPlan|...
fields: {}, // key is the name of the field
rawRecordId: "xx",
status: "xx",
}
- partition key: importBatchId
- sort key: objectId
PendingObjectReference
Creates a link between submitted referenceId and saved object, so can find when other objects reference it.
{
importBatchId: "xx",
referenceId: "xx", // objectType_{feed supplied referenceId}
objectId: "xx", // eg variant|product|sellOffer|sellOfferPrice|sellOfferPlan|...
}
- partition key: importBatchId
- sort key: referenceId
- when creating maybe throw error if item exists with different objectId
Object hierarchy and field schema
- Some fields will be required, some optional
- some fields possibly have system defaults
- perhaps user can setup default templates (do later if has value)
- schema will need to state identifier fields for each object, if set in feed Import Data knows is pointing to existing child/parent object, if empty needs to create new
- perhaps each objectType states it's child objects, as more likely to be aware of these than parent objects
where to store/set schema
Considering external service delivers this to ImportData in Initial Setup, as seed data injected directly into Import Data Config Dynamo table.