diff --git a/src/models/Strategy.js b/src/models/Strategy.js index e0932ec67..e8116b208 100644 --- a/src/models/Strategy.js +++ b/src/models/Strategy.js @@ -9,7 +9,7 @@ const strategySchema = new Schema( dropDups: true, }, subStrategies: [{ - actif: { + active: { type: Boolean, required: true, default: true, diff --git a/src/schema/types/Strategy.js b/src/schema/types/Strategy.js index 8c9633146..034d8bcd7 100644 --- a/src/schema/types/Strategy.js +++ b/src/schema/types/Strategy.js @@ -16,11 +16,11 @@ const Type = new GraphQLObjectType({ id: { type: GraphQLID }, fbSlug: { type: GraphQLString }, subStrategies: { - args: { actifOnly: { type: GraphQLBoolean } }, + args: { activeOnly: { type: GraphQLBoolean } }, type: new GraphQLList(SubStrategyType), - resolve(parent, { actifOnly }) { - if (actifOnly) { - return parent.subStrategies.filter(subStrategy => subStrategy.actif); + resolve(parent, { activeOnly }) { + if (activeOnly) { + return parent.subStrategies.filter(subStrategy => subStrategy.active); } return parent.subStrategies; }, diff --git a/src/schema/types/SubStrategy.js b/src/schema/types/SubStrategy.js index 69b7ff20c..7facc4dc4 100644 --- a/src/schema/types/SubStrategy.js +++ b/src/schema/types/SubStrategy.js @@ -17,7 +17,7 @@ const Type = new GraphQLObjectType({ name: 'SubStrategy', description: 'SubStrategy composing a strategy', fields: () => ({ - actif: { type: GraphQLBoolean }, + active: { type: GraphQLBoolean }, name: { type: GraphQLString }, entryPoint: { type: EntryPointType, diff --git a/src/schema/types/input/SubStrategy.js b/src/schema/types/input/SubStrategy.js index 737aa532b..08a56e37b 100644 --- a/src/schema/types/input/SubStrategy.js +++ b/src/schema/types/input/SubStrategy.js @@ -17,7 +17,7 @@ const Type = new GraphQLInputObjectType({ name: 'SubStrategyInput', description: 'Payload for subStrategy input', fields: () => ({ - actif: { type: GraphQLBoolean }, + active: { type: GraphQLBoolean }, name: { type: GraphQLString }, entryPoint: { type: EntryPointInputType }, exitPoint: { type: ExitPointInputType }, diff --git a/src/templates/strategyTemplate.js b/src/templates/strategyTemplate.js index 7af2abcde..5f1031b8a 100644 --- a/src/templates/strategyTemplate.js +++ b/src/templates/strategyTemplate.js @@ -2,7 +2,7 @@ const strategy = { subStrategies: [ { - actif: true, + active: true, name: 'Trend Following', entryPoint: { situations: [ @@ -181,7 +181,7 @@ const strategy = { }, }, { - actif: true, + active: true, name: 'Range Trading', entryPoint: { situations: [ @@ -255,7 +255,7 @@ const strategy = { }, }, { - actif: true, + active: true, name: 'LRC Strategy', entryPoint: { situations: [