diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index 3b41c6d7b..3fd1d2c7d 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -1607,6 +1607,18 @@ "propertyName": "eventTypes", "functionName": "newSocialTradingGlobalsSignalTypes", "fileName": "SignalTypes.js" + }, + { + "name": "Post Types", + "propertyName": "postTypes", + "functionName": "newSocialTradingGlobalsPostTypes", + "fileName": "PostTypes.js" + }, + { + "name": "Reaction Types", + "propertyName": "reactionTypes", + "functionName": "newSocialTradingGlobalsReactionTypes", + "fileName": "ReactionTypes.js" } ] }, diff --git a/Projects/Social-Trading/SA/Globals/PostTypes.js b/Projects/Social-Trading/SA/Globals/PostTypes.js new file mode 100644 index 000000000..19135688d --- /dev/null +++ b/Projects/Social-Trading/SA/Globals/PostTypes.js @@ -0,0 +1,12 @@ +exports.newSocialTradingGlobalsPostTypes = function () { + + let thisObject = { + /* Post Types */ + NEW_POST: 0, + REPLY_TO_POST: 1, + REPOST_: 2, + QUOTE_REPOST_: 3 + } + + return thisObject +} \ No newline at end of file diff --git a/Projects/Social-Trading/SA/Globals/ReactionTypes.js b/Projects/Social-Trading/SA/Globals/ReactionTypes.js new file mode 100644 index 000000000..44c4b9c03 --- /dev/null +++ b/Projects/Social-Trading/SA/Globals/ReactionTypes.js @@ -0,0 +1,15 @@ +exports.newSocialTradingGlobalsReactionTypes = function () { + + let thisObject = { + /* Reaction Types */ + REACTION_LIKE: 0, + REACTION_LOVE: 1, + REACTION_HAHA: 2, + REACTION_WOW: 3, + REACTION_SAD: 4, + REACTION_ANGRY: 5, + REACTION_CARE: 6 + } + + return thisObject +} \ No newline at end of file diff --git a/Projects/Social-Trading/SA/Modules/Social-Graph/Post.js b/Projects/Social-Trading/SA/Modules/Social-Graph/Post.js index f3678cc62..eac354289 100644 --- a/Projects/Social-Trading/SA/Modules/Social-Graph/Post.js +++ b/Projects/Social-Trading/SA/Modules/Social-Graph/Post.js @@ -1,6 +1,6 @@ exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModulesSocialGraphPost() { /* - Posts represent a collection of multimedia content sorted somewhere else + Posts represent a collection of multimedia content stored somewhere else and identified by that content hash. Posts might belong to: * a User Profile. * a Bot Profile. @@ -34,33 +34,16 @@ exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModule finalize: finalize } - const POST_TYPES = { - NEW_POST: 0, - REPLY_TO_POST: 1, - REPOST_: 2, - QUOTE_REPOST_: 3 - } - - const REACTION_TYPES = { - REACTION_LIKE: 0, - REACTION_LOVE: 1, - REACTION_HAHA: 2, - REACTION_WOW: 3, - REACTION_SAD: 4, - REACTION_ANGRY: 5, - REACTION_CARE: 6 - } - thisObject.replies = new Map() thisObject.reactions = new Map() - thisObject.reactions.set(REACTION_TYPES.REACTION_LIKE, 0) - thisObject.reactions.set(REACTION_TYPES.REACTION_LOVE, 0) - thisObject.reactions.set(REACTION_TYPES.REACTION_HAHA, 0) - thisObject.reactions.set(REACTION_TYPES.REACTION_WOW, 0) - thisObject.reactions.set(REACTION_TYPES.REACTION_SAD, 0) - thisObject.reactions.set(REACTION_TYPES.REACTION_ANGRY, 0) - thisObject.reactions.set(REACTION_TYPES.REACTION_CARE, 0) + thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_LIKE, 0) + thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_LOVE, 0) + thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_HAHA, 0) + thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_WOW, 0) + thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_SAD, 0) + thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_ANGRY, 0) + thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_CARE, 0) return thisObject @@ -92,9 +75,9 @@ exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModule Let's find the Target Post */ if ( - thisObject.postType === POST_TYPES.REPLY_TO_POST || - thisObject.postType === POST_TYPES.REPOST_ || - thisObject.postType === POST_TYPES.QUOTE_REPOST_ + thisObject.postType === SA.projects.socialTrading.globals.postTypes.REPLY_TO_POST || + thisObject.postType === SA.projects.socialTrading.globals.postTypes.REPOST_ || + thisObject.postType === SA.projects.socialTrading.globals.postTypes.QUOTE_REPOST_ ) { /* Validate Target User Profile. @@ -113,7 +96,7 @@ exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModule Let's add this post to the replies of the Target Post */ if ( - thisObject.postType === POST_TYPES.REPLY_TO_POST + thisObject.postType === SA.projects.socialTrading.globals.postTypes.REPLY_TO_POST ) { targetPost.replies.set(thisObject.targetPostHash, thisObject.targetPostHash) }