Skip to content

Commit

Permalink
Added automatic timing field
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Kraemer committed Feb 19, 2017
1 parent 46dc00b commit b3803b3
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
GraphQLInterfaceType,
GraphQLObjectType,
GraphQLString,
GraphQLBoolean,
} from 'graphql';
import t from './types';
import Store from './ObjectStore';
Expand Down Expand Up @@ -64,6 +65,9 @@ export default class OADFStore {
comment: {
type: GraphQLString,
},
automaticTiming: {
type: GraphQLBoolean,
},
}),
resolveType(result) {
if (result.type === t.ATHLETE_RESULT) {
Expand Down Expand Up @@ -241,6 +245,9 @@ export default class OADFStore {
comment: {
type: GraphQLString,
},
automaticTiming: {
type: GraphQLBoolean,
},
}),
interfaces: [resultInterface, athleteResultInterface],
});
Expand Down Expand Up @@ -387,6 +394,9 @@ export default class OADFStore {
comment: {
type: GraphQLString,
},
automaticTiming: {
type: GraphQLBoolean,
},
}),
interfaces: [resultInterface, athleteResultInterface],
});
Expand Down Expand Up @@ -664,6 +674,9 @@ export default class OADFStore {
comment: {
type: GraphQLString,
},
automaticTiming: {
type: GraphQLBoolean,
},
}),
interfaces: [resultInterface],
});
Expand Down Expand Up @@ -747,7 +760,7 @@ export default class OADFStore {
return this.athleteStore.getByProperty('bib', bib);
}

addAthleteResult(athlete, group, performance, exception, wind, position, qualified, weight, comment) {
addAthleteResult(athlete, group, performance, exception, wind, position, qualified, weight, comment, automaticTiming = true) {
const result = {
type: t.ATHLETE_RESULT,
athlete,
Expand All @@ -759,6 +772,7 @@ export default class OADFStore {
qualified,
weight,
comment,
automaticTiming,
};
return this.resultStore.add(result, [athlete, null, group, performance, wind]);
}
Expand Down Expand Up @@ -862,7 +876,7 @@ export default class OADFStore {
this.teamMemberStore.add(teamMember, [result, athlete]);
}

addTeamResult(club, group, performance, exception, position, qualified, comment) {
addTeamResult(club, group, performance, exception, position, qualified, comment, automaticTiming = true) {
const result = {
type: t.TEAM_RESULT,
club,
Expand All @@ -872,6 +886,7 @@ export default class OADFStore {
position,
qualified,
comment,
automaticTiming,
};
return this.resultStore.add(result, [null, club, group, performance, null]);
}
Expand Down Expand Up @@ -921,7 +936,7 @@ export default class OADFStore {
return this.combinedDisciplineStore.getByKey([event, discipline]);
}

addCombinedResult(athlete, group, parentResult, performance, exception, wind, points, position, qualified, weight, comment) {
addCombinedResult(athlete, group, parentResult, performance, exception, wind, points, position, qualified, weight, comment, automaticTiming = true) {
const result = {
type: t.COMBINED_RESULT,
athlete,
Expand All @@ -934,6 +949,7 @@ export default class OADFStore {
qualified,
weight,
comment,
automaticTiming,
parentResult,
};
return this.resultStore.add(result, [athlete, null, group, performance, wind]);
Expand Down

0 comments on commit b3803b3

Please sign in to comment.