-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ivory Coast] Additional tables/fields/relations to sync #819
Comments
@andreievg @wlthomson @Chris-Petty To create a requisition by program we need:
Questions
.... or we just store |
In hindsight I think we should have just done a store table in mobile. Next iteration of mobile we can address 😀. So without doing a store table, saving them into settings is probably best/only way. Unless tags were on
The above as I understand will come in as an object and be saved as such in the masterList record, so not much other than tweaking that into
Confused, shouldn't all this be happening server side and just syncing (i.e. already decided by desktop implementation)?
String we should probably avoid. As mentioned earlier it'll come in as JSON and be parsed to a JS object which is way more useful and I don't see much difficulty in it.
get orderTypes() {
if (!this.isProgram) return [];
const storeTags = Object.entries(this.programSettings.storeTags);
const orderTypes = storeTags.reduce(
// Use JS Sets to get distinct values
(types, currentTag) => Array.from(new Set([...types, ...currentTag.orderTypes])),
[],
);
return orderTypes;
} |
From my understanding all types must resolve to some scalar with realm and there is no ability to use an 'object' type. As program settings has many nested objects we need to resolve the way in which it is saved. I could be totally wrong? But even if realm has introduced this recently, we're still using an old realm version as far as I know (Also, it's probably behind a paywall, right?)
Obviously my ramblings weren't very clear, sorry! What I mean is, if we use |
@Chris-Petty I am pretty sure that we can't store JSON in realm. I am fine with storing it as string. As for extracting program info from master list program settings, seem pretty simple to me For each store tag, see if key exists in programSettings, return programSettings.storeTag[tag] (first matching) |
Wasn't suggesting to store JSON in Realm sorry, meant that we should pass the JSON and actually store it as JS object in Realm... which you can't do either. Realm just no objects, sadness. Gee I guess store it as a string but you'll have to parse it every time you want something like Where's mah JSONB 😢 |
One of the very first issues on realm-js haha realm/realm-js#8 They basically suggest doing a string too. |
yeah.. you could potentially make a 'generic object' type. Possibly worth investing time into, but probably not. Just string it for now. |
Sweet. So that eliminates all the PK stuff; updates from central server will just send a whole new string for whatever changes were made? For any getters what not, just parsing it and writing code using the object should be fine. Will only ever be a few programs so hopefully won't be much overhead. |
@wlthomson @Chris-Petty @andreievg So to summarize, after me wasting everyone's time: Stores will be sent to mobile: If the store ID matches the mobiles ID, store the tags in settings. Throw everything else out Tables to add:
Fields to add:
Relations
Question ? : |
Epic: sussol/org-issues#18
Related: sussol/msupply#2544 - sussol/msupply#2523 - sussol/org-issues#6
UPDATE: Summary comment here
Description:
We need to add additional tables/fields/relations for the new features being adding in sussol/org-issues#18
Requirements
Tables to add:
Period/Schedule
[ Still up in the air currently - issue: sussol/msupply#2523Reason
- added in this issue: sussol/msupply#2544Fields to add:
masterList.programSettings
sussol/org-issues#6masterList.isProgram
sussol/org-issues#6Relations
Requisition.programId
->masterlist.ID
requisition.periodId
->period.ID
[ see above, may need to wait on this? ]stocktake.programId
->masterlist.ID
Comments:
I think these all amount to relatively small changes, not needing to be broken down further? Once someone is assigned that can evaluate if it needs to be.
The text was updated successfully, but these errors were encountered: