diff --git a/src/db/ClimbTypes.ts b/src/db/ClimbTypes.ts index e27c6923..4d0acf1b 100644 --- a/src/db/ClimbTypes.ts +++ b/src/db/ClimbTypes.ts @@ -38,7 +38,7 @@ export interface IPitch { parentId: MUUID pitchNumber: number grades?: Partial> - type?: DisciplineType + disciplines?: DisciplineType length?: number boltsCount?: number description?: string @@ -169,8 +169,8 @@ export interface PitchChangeInputType { id?: string parentId?: string pitchNumber?: number + disciplines?: DisciplineType grades?: Partial> - type?: DisciplineType length?: number boltsCount?: number description?: string @@ -180,7 +180,7 @@ export interface ClimbChangeInputType { id?: string name?: string disciplines?: DisciplineType - grade?: string // actual grade value (e.g. "7a", "5+") + grade?: string // single, atomic grade value (e.g. "7a", "5+") leftRightIndex?: number description?: string location?: string diff --git a/src/graphql/schema/Climb.gql b/src/graphql/schema/Climb.gql index 3463e937..5e73b516 100644 --- a/src/graphql/schema/Climb.gql +++ b/src/graphql/schema/Climb.gql @@ -205,4 +205,4 @@ type Pitch { length: Int boltsCount: Int description: String -} +} \ No newline at end of file diff --git a/src/graphql/schema/ClimbEdit.gql b/src/graphql/schema/ClimbEdit.gql index 8ec92446..e1f36b80 100644 --- a/src/graphql/schema/ClimbEdit.gql +++ b/src/graphql/schema/ClimbEdit.gql @@ -42,32 +42,45 @@ input SingleClimbChangeInput { fa: String "Length in meters" length: Int + "Number of fixed anchors" + boltsCount: Int + "List of Pitch objects representing individual pitches of a multi-pitch climb" + pitches: [PitchInput] experimentalAuthor: ExperimentalAuthorType } +input GradeTypeInput { + vscale: String + yds: String + ewbank: String + french: String + brazilianCrux: String + font: String + uiaa: String +} + +input PitchInput { + id: ID! + parentId: ID! + pitchNumber: Int! + grades: GradeTypeInput + disciplines: DisciplineType +} + input DisciplineType { - "https://en.wikipedia.org/wiki/Traditional_climbing" trad: Boolean - "https://en.wikipedia.org/wiki/Sport_climbing" sport: Boolean - "https://en.wikipedia.org/wiki/Bouldering" bouldering: Boolean - "https://en.wikipedia.org/wiki/Deep-water_soloing" deepwatersolo: Boolean - "https://en.wikipedia.org/wiki/Alpine_climbing" alpine: Boolean - "https://en.wikipedia.org/wiki/Ice_climbing" snow: Boolean - "https://en.wikipedia.org/wiki/Ice_climbing" ice: Boolean mixed: Boolean - "https://en.wikipedia.org/wiki/Aid_climbing" aid: Boolean - "https://en.wikipedia.org/wiki/Top_rope_climbing" tr: Boolean } input ExperimentalAuthorType { displayName: String! url: String! -} +} \ No newline at end of file diff --git a/src/model/__tests__/MutableClimbDataSource.ts b/src/model/__tests__/MutableClimbDataSource.ts index 911ab721..58c73ff1 100644 --- a/src/model/__tests__/MutableClimbDataSource.ts +++ b/src/model/__tests__/MutableClimbDataSource.ts @@ -123,7 +123,7 @@ describe('Climb CRUD', () => { { pitchNumber: 1, grades: { uiaa: '7' }, - type: { sport: true }, + disciplines: { sport: true }, length: 30, boltsCount: 5, description: 'First pitch description' @@ -131,7 +131,7 @@ describe('Climb CRUD', () => { { pitchNumber: 2, grades: { uiaa: '6+' }, - type: { sport: true }, + disciplines: { sport: true }, length: 40, boltsCount: 6, description: 'Second pitch description' @@ -653,7 +653,7 @@ describe('Climb CRUD', () => { parentId: originalPitch1ParentID, pitchNumber: 1, grades: { ewbank: '19' }, - type: { sport: false, alpine: true }, + disciplines: { sport: false, alpine: true }, length: 20, boltsCount: 6, description: 'Updated first pitch description' @@ -664,7 +664,7 @@ describe('Climb CRUD', () => { parentId: originalPitch2ParentID, pitchNumber: 2, grades: { ewbank: '18' }, - type: { sport: false, alpine: true }, + disciplines: { sport: false, alpine: true }, length: 25, boltsCount: 5, description: 'Updated second pitch description'