Skip to content

Commit

Permalink
Change case of PublishType, Season, Orientation and WallAngle enums k…
Browse files Browse the repository at this point in the history
…eys and values to all lowercase.
  • Loading branch information
salamca committed Sep 13, 2024
1 parent 152b842 commit 5464446
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 46 deletions.
10 changes: 5 additions & 5 deletions src/activities/entities/activity-route.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export const firstTrTickAscentTypes = new Set([
]);

export enum PublishType {
PUBLIC = 'public',
CLUB = 'club',
LOG = 'log',
PRIVATE = 'private',
public = 'public',
club = 'club',
log = 'log',
private = 'private',
}
registerEnumType(PublishType, {
name: 'PublishType',
Expand Down Expand Up @@ -123,7 +123,7 @@ export class ActivityRoute extends BaseEntity {
@Column({
type: 'enum',
enum: PublishType,
default: PublishType.PRIVATE,
default: PublishType.private,
})
@Field((type) => PublishType)
publish: PublishType;
Expand Down
32 changes: 16 additions & 16 deletions src/crags/entities/crag.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,34 @@ export enum CragType {
}

export enum Orientation {
NORTH = 'north',
NORTHEAST = 'northeast',
EAST = 'east',
SOUTHEAST = 'southeast',
SOUTH = 'south',
SOUTHWEST = 'southwest',
WEST = 'west',
NORTHWEST = 'northwest',
north = 'north',
northeast = 'northeast',
east = 'east',
southeast = 'southeast',
south = 'south',
southwest = 'southwest',
west = 'west',
northwest = 'northwest',
}
registerEnumType(Orientation, {
name: 'Orientation',
});

export enum WallAngle {
SLAB = 'slab',
VERTICAL = 'vertical',
OVERHANG = 'overhang',
ROOF = 'roof',
slab = 'slab',
vertical = 'vertical',
overhang = 'overhang',
roof = 'roof',
}
registerEnumType(WallAngle, {
name: 'WallAngle',
});

export enum Season {
SPRING = 'spring',
SUMMER = 'summer',
AUTUMN = 'autumn',
WINTER = 'winter',
spring = 'spring',
summer = 'summer',
autumn = 'autumn',
winter = 'winter',
}
registerEnumType(Season, {
name: 'Season',
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/activity.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe('Activity', () => {
response.body.data.activities.items.filter(
(a) =>
a.routes.filter(
(ar) => ![PublishType.PUBLIC].includes(ar.publish.toLowerCase()),
(ar) => ![PublishType.public].includes(ar.publish.toLowerCase()),
).length > 0,
).length;
expect(numOfNonPublicActivityRoutes).toEqual(0);
Expand All @@ -317,7 +317,7 @@ describe('Activity', () => {
response.body.data.activities.items.filter(
(a) =>
!a.routes.some((ar) =>
[PublishType.PUBLIC].includes(ar.publish.toLowerCase()),
[PublishType.public].includes(ar.publish.toLowerCase()),
),
).length;
expect(numOfActivitiesWithNoPublicActivityRoutes).toEqual(0);
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/activityMutations.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('ActivityMutations', () => {
routes: [
{
ascentType: "${AscentType.onsight}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockData.crags.publishedCrag.sectors.publishedSector.routes.publishedRoute.id}"
}
Expand Down
28 changes: 14 additions & 14 deletions test/e2e/activityRoutes.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,85 +61,85 @@ describe('Activity', () => {
routes: [
{
ascentType: "${AscentType.onsight}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[0].id}"
},
{
ascentType: "${AscentType.flash}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[1].id}"
},
{
ascentType: "${AscentType.redpoint}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[2].id}"
},
{
ascentType: "${AscentType.repeat}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[2].id}"
}
{
ascentType: "${AscentType.allfree}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[3].id}"
},
{
ascentType: "${AscentType.aid}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[4].id}"
},
{
ascentType: "${AscentType.attempt}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[5].id}"
},
{
ascentType: "${AscentType.t_onsight}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[6].id}"
},
{
ascentType: "${AscentType.t_flash}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[7].id}"
},
{
ascentType: "${AscentType.t_redpoint}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[8].id}"
},
{
ascentType: "${AscentType.t_repeat}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[8].id}"
},
{
ascentType: "${AscentType.t_allfree}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[9].id}"
},
{
ascentType: "${AscentType.t_aid}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[10].id}"
}
{
ascentType: "${AscentType.t_attempt}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[11].id}"
}
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/routeMigration.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ describe('RouteMigration', () => {
routes: [
{
ascentType: "${AscentType.onsight}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[0].id}"
}
Expand Down Expand Up @@ -316,7 +316,7 @@ describe('RouteMigration', () => {
routes: [
{
ascentType: "${AscentType.redpoint}",
publish: "${PublishType.PUBLIC}",
publish: "${PublishType.public}",
date: "2017-03-07",
routeId: "${mockRoutes[1].id}"
}
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/user-delete.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ describe('UserDelete', () => {
{
route: mockData.crags.simpleCrag.sectors.simpleSector1.routes[0],
ascentType: AscentType.redpoint,
publishType: PublishType.PRIVATE,
publishType: PublishType.private,
votedDifficulty: 1100,
votedStarRating: 2,
},
{
route: mockData.crags.simpleCrag.sectors.simpleSector1.routes[1],
ascentType: AscentType.onsight,
publishType: PublishType.PUBLIC,
publishType: PublishType.public,
},
],
);
Expand All @@ -82,7 +82,7 @@ describe('UserDelete', () => {
{
route: mockData.crags.simpleCrag.sectors.simpleSector1.routes[0],
ascentType: AscentType.redpoint,
publishType: PublishType.PRIVATE,
publishType: PublishType.private,
votedDifficulty: 1200,
votedStarRating: 2,
},
Expand All @@ -91,7 +91,7 @@ describe('UserDelete', () => {
{
route: mockData.crags.simpleCrag.sectors.simpleSector1.routes[0],
ascentType: AscentType.redpoint,
publishType: PublishType.PRIVATE,
publishType: PublishType.private,
votedDifficulty: 1300,
votedStarRating: 2,
},
Expand All @@ -103,15 +103,15 @@ describe('UserDelete', () => {
{
route: mockData.crags.simpleCrag.sectors.simpleSector1.routes[0],
ascentType: AscentType.redpoint,
publishType: PublishType.PRIVATE,
publishType: PublishType.private,
votedStarRating: 2,
},
]);
await logRoutes(app, mockData.users.basicUser5, mockData.crags.simpleCrag, [
{
route: mockData.crags.simpleCrag.sectors.simpleSector1.routes[0],
ascentType: AscentType.redpoint,
publishType: PublishType.PRIVATE,
publishType: PublishType.private,
votedStarRating: 2,
},
]);
Expand Down

0 comments on commit 5464446

Please sign in to comment.