Skip to content

Commit d6cfa87

Browse files
committed
chore: simplify pairing session form by removing candidate type
Remove the full-time/apprentice candidate type field from the request pairing session modal and downstream messaging — teammates will know this context when they need it. Also update the candidate name placeholder to use fun Office character names (e.g. "Dwight S, Pam B, or Kevin") to reflect that identifiers are informal, not formal first/last names.
1 parent d6f476a commit d6cfa87

14 files changed

Lines changed: 15 additions & 106 deletions

src/bot/__tests__/acceptPairingSlot.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { pairingSessionsRepo } from '@repos/pairingSessionsRepo';
33
import { userRepo } from '@repos/userRepo';
44
import { buildMockApp, buildMockActionParam } from '@utils/slackMocks';
55
import { PairingSession } from '@models/PairingSession';
6-
import { CandidateType, InterviewFormat, InterviewType } from '@bot/enums';
6+
import { InterviewFormat, InterviewType } from '@bot/enums';
77
import * as PairingRequestService from '@/services/PairingRequestService';
88
import * as PairingSessionCloserModule from '@/services/PairingSessionCloser';
99
import { App } from '@slack/bolt';
@@ -16,7 +16,6 @@ function makeInterview(overrides: Partial<PairingSession> = {}): PairingSession
1616
candidateName: 'Dana',
1717
languages: ['Python'],
1818
format: InterviewFormat.REMOTE,
19-
candidateType: CandidateType.FULL_TIME,
2019
requestedAt: new Date(),
2120
teammatesNeededCount: 2,
2221
slots: [

src/bot/__tests__/requestPairingSession.test.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from '@utils/slackMocks';
77
import { languageRepo } from '@repos/languageRepo';
88
import { pairingSessionsRepo } from '@repos/pairingSessionsRepo';
9-
import { ActionId, CandidateType, InterviewFormat } from '@bot/enums';
9+
import { ActionId, InterviewFormat } from '@bot/enums';
1010
import * as PairingQueueService from '@/services/PairingQueueService';
1111
import * as PairingRequestService from '@/services/PairingRequestService';
1212
import { chatService } from '@/services/ChatService';
@@ -63,11 +63,6 @@ describe('requestPairingSession', () => {
6363
state: {
6464
values: {
6565
'candidate-name': { 'candidate-name': { value: 'Dana' } },
66-
'candidate-type': {
67-
'candidate-type': {
68-
selected_option: { value: 'full-time', text: { text: 'Full-time' } },
69-
},
70-
},
7166
'language-selections': {
7267
'language-selections': { selected_options: [{ value: 'Python' }] },
7368
},
@@ -111,11 +106,6 @@ describe('requestPairingSession', () => {
111106

112107
const stateValues: Record<string, any> = {
113108
'candidate-name': { 'candidate-name': { value: 'Dana' } },
114-
'candidate-type': {
115-
'candidate-type': {
116-
selected_option: { value: 'full-time', text: { text: 'Full-time' } },
117-
},
118-
},
119109
'language-selections': { 'language-selections': { selected_options: [] } },
120110
'interview-format-selection': {
121111
'interview-format-selection': {
@@ -172,11 +162,6 @@ describe('requestPairingSession', () => {
172162
state: {
173163
values: {
174164
'candidate-name': { 'candidate-name': { value: 'Dana' } },
175-
'candidate-type': {
176-
'candidate-type': {
177-
selected_option: { value: 'full-time', text: { text: 'Full-time' } },
178-
},
179-
},
180165
'language-selections': {
181166
'language-selections': { selected_options: [{ value: 'Python' }] },
182167
},
@@ -247,7 +232,6 @@ describe('requestPairingSession', () => {
247232
'interview-format-selection': { selected_option: { value: 'remote' } },
248233
},
249234
'candidate-name': { 'candidate-name': { value: 'Dana Smith' } },
250-
'candidate-type': { 'candidate-type': { selected_option: { value: 'full-time' } } },
251235
'number-of-reviewers': { 'number-of-reviewers': { value: '2' } },
252236
'pairing-slot-1-date': { 'pairing-slot-1-date': { selected_date: '2026-03-31' } },
253237
'pairing-slot-1-start': { 'pairing-slot-1-start': { selected_time: '13:00' } },
@@ -269,7 +253,6 @@ describe('requestPairingSession', () => {
269253
candidateName: 'Dana Smith',
270254
languages: ['Python'],
271255
format: InterviewFormat.REMOTE,
272-
candidateType: CandidateType.FULL_TIME,
273256
slots: expect.arrayContaining([
274257
expect.objectContaining({ date: '2026-03-31', startTime: '13:00', endTime: '15:00' }),
275258
expect.objectContaining({ date: '2026-04-01', startTime: '09:00', endTime: '11:00' }),
@@ -296,7 +279,6 @@ describe('requestPairingSession', () => {
296279
'interview-format-selection': { selected_option: { value: 'remote' } },
297280
},
298281
'candidate-name': { 'candidate-name': { value: 'Test' } },
299-
'candidate-type': { 'candidate-type': { selected_option: { value: 'full-time' } } },
300282
'number-of-reviewers': { 'number-of-reviewers': { value: '2' } },
301283
'pairing-slot-1-date': { 'pairing-slot-1-date': { selected_date: null } },
302284
'pairing-slot-1-start': { 'pairing-slot-1-start': { selected_time: null } },
@@ -332,7 +314,6 @@ describe('requestPairingSession', () => {
332314
'interview-format-selection': { selected_option: { value: 'remote' } },
333315
},
334316
'candidate-name': { 'candidate-name': { value: 'Test' } },
335-
'candidate-type': { 'candidate-type': { selected_option: { value: 'full-time' } } },
336317
'number-of-reviewers': { 'number-of-reviewers': { value: '2' } },
337318
'pairing-slot-1-date': { 'pairing-slot-1-date': { selected_date: '2026-03-31' } },
338319
'pairing-slot-1-start': { 'pairing-slot-1-start': { selected_time: '09:00' } },

src/bot/acceptPairingSlot.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ActionParam } from '@/slackTypes';
22
import { App } from '@slack/bolt';
33
import log from '@utils/log';
4-
import { ActionId, BlockId, CandidateTypeLabel, InterviewFormatLabel } from './enums';
4+
import { ActionId, BlockId, InterviewFormatLabel } from './enums';
55
import { userRepo } from '@repos/userRepo';
66
import { pairingSessionsRepo } from '@repos/pairingSessionsRepo';
77
import { pairingRequestService } from '@/services/PairingRequestService';
@@ -76,9 +76,7 @@ export const acceptPairingSlot = {
7676
compose(
7777
`*Thanks for your availability!* Here's what you submitted:`,
7878
compose(
79-
bold(
80-
`Candidate: ${interview.candidateName} (${CandidateTypeLabel.get(interview.candidateType) ?? interview.candidateType})`,
81-
),
79+
bold(`Candidate: ${interview.candidateName}`),
8280
bold(`Languages: ${interview.languages.join(', ')}`),
8381
bold(`Format: ${InterviewFormatLabel.get(interview.format) ?? interview.format}`),
8482
),

src/bot/requestPairingSession.ts

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@ import { Block, KnownBlock, Option, PlainTextOption, View } from '@slack/types';
66
import { blockUtils } from '@utils/blocks';
77
import log from '@utils/log';
88
import { codeBlock, compose, mention } from '@utils/text';
9-
import {
10-
ActionId,
11-
CandidateType,
12-
CandidateTypeLabel,
13-
InterviewFormat,
14-
InterviewFormatLabel,
15-
Interaction,
16-
} from './enums';
9+
import { ActionId, InterviewFormat, InterviewFormatLabel, Interaction } from './enums';
1710
import { chatService } from '@/services/ChatService';
1811
import { getInitialUsersForPairingSession } from '@/services/PairingQueueService';
1912
import { pairingRequestService } from '@/services/PairingRequestService';
@@ -35,7 +28,6 @@ interface SlotState {
3528

3629
interface ModalState {
3730
candidateName?: string;
38-
candidateType?: string;
3931
selectedLanguageOptions?: Option[];
4032
formatOption?: { value: string; text: { type: 'plain_text'; text: string } };
4133
slots: SlotState[];
@@ -45,7 +37,6 @@ function readStateFromBody(body: any, slotCount: number): ModalState {
4537
const v = body.view.state.values;
4638
return {
4739
candidateName: v['candidate-name']?.['candidate-name']?.value,
48-
candidateType: v['candidate-type']?.['candidate-type']?.selected_option?.value,
4940
selectedLanguageOptions: v['language-selections']?.['language-selections']?.selected_options,
5041
formatOption: (() => {
5142
const opt = v['interview-format-selection']?.['interview-format-selection']?.selected_option;
@@ -84,36 +75,10 @@ export const requestPairingSession = {
8475
element: {
8576
type: 'plain_text_input',
8677
action_id: ActionId.CANDIDATE_NAME,
87-
placeholder: { type: 'plain_text', text: 'e.g. Dana Smith' },
78+
placeholder: { type: 'plain_text', text: 'e.g. Dwight S, Pam B, or Kevin' },
8879
...(currentState?.candidateName ? { initial_value: currentState.candidateName } : {}),
8980
},
9081
},
91-
{
92-
type: 'input',
93-
block_id: ActionId.CANDIDATE_TYPE,
94-
label: { text: 'Candidate type', type: 'plain_text' },
95-
element: {
96-
type: 'static_select',
97-
action_id: ActionId.CANDIDATE_TYPE,
98-
options: [CandidateType.FULL_TIME, CandidateType.APPRENTICE].map<PlainTextOption>(t => ({
99-
text: { type: 'plain_text', text: CandidateTypeLabel.get(t) ?? t },
100-
value: t,
101-
})),
102-
...(currentState?.candidateType
103-
? {
104-
initial_option: {
105-
text: {
106-
type: 'plain_text' as const,
107-
text:
108-
CandidateTypeLabel.get(currentState.candidateType as CandidateType) ??
109-
currentState.candidateType,
110-
},
111-
value: currentState.candidateType,
112-
},
113-
}
114-
: {}),
115-
},
116-
},
11782
{
11883
type: 'input',
11984
block_id: ActionId.LANGUAGE_SELECTIONS,
@@ -240,8 +205,6 @@ export const requestPairingSession = {
240205
const languages = blockUtils.getLanguageFromBody(body);
241206
const format = blockUtils.getBlockValue(body, ActionId.INTERVIEW_FORMAT_SELECTION)
242207
.selected_option.value as InterviewFormat;
243-
const candidateType = blockUtils.getBlockValue(body, ActionId.CANDIDATE_TYPE).selected_option
244-
.value as CandidateType;
245208
const slots = parseSlots(body, meta.slotCount);
246209
const teammatesNeededCount = Number(
247210
blockUtils.getBlockValue(body, ActionId.NUMBER_OF_REVIEWERS).value,
@@ -265,7 +228,6 @@ export const requestPairingSession = {
265228
compose(
266229
`${mention(user)} has requested a pairing session for *${candidateName}*.`,
267230
`*Languages:* ${languages.join(', ')} | *Format:* ${InterviewFormatLabel.get(format) ?? format}`,
268-
`*Candidate type:* ${CandidateTypeLabel.get(candidateType) ?? candidateType}`,
269231
),
270232
);
271233

@@ -284,7 +246,6 @@ export const requestPairingSession = {
284246
candidateName,
285247
languages,
286248
format,
287-
candidateType,
288249
requestedAt: new Date(),
289250
teammatesNeededCount,
290251
slots,

src/cron/__tests__/expirePairingRequests.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { pairingSessionsRepo } from '@repos/pairingSessionsRepo';
22
import { pairingRequestService } from '@/services/PairingRequestService';
33
import { PairingSession, PendingPairingTeammate } from '@models/PairingSession';
4-
import { CandidateType, InterviewFormat } from '@bot/enums';
4+
import { InterviewFormat } from '@bot/enums';
55
import { App } from '@slack/bolt';
66
import { expirePairingRequests } from '../expirePairingRequests';
77

@@ -16,7 +16,6 @@ function makeInterview(pendingTeammates: PendingPairingTeammate[]): PairingSessi
1616
candidateName: 'Dana',
1717
languages: ['Java'],
1818
format: InterviewFormat.REMOTE,
19-
candidateType: CandidateType.FULL_TIME,
2019
requestedAt: new Date(),
2120
teammatesNeededCount: 2,
2221
slots: [],

src/database/models/PairingSession.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { CandidateType, InterviewFormat } from '@bot/enums';
1+
import { InterviewFormat } from '@bot/enums';
22

33
export interface PairingSession {
44
threadId: string;
55
requestorId: string;
66
candidateName: string;
77
languages: string[];
88
format: InterviewFormat;
9-
candidateType: CandidateType;
109
slots: PairingSlot[];
1110
requestedAt: Date;
1211
teammatesNeededCount: number;

src/database/repos/__tests__/pairingSessionsRepo.test.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { pairingSessionsRepo, mapRowToPairingSession } from '@repos/pairingSessionsRepo';
22
import { PairingSession } from '@models/PairingSession';
3-
import { CandidateType, InterviewFormat } from '@bot/enums';
3+
import { InterviewFormat } from '@bot/enums';
44

55
jest.mock('@database');
66

@@ -22,7 +22,6 @@ function buildPairingSession(overrides: Partial<PairingSession> = {}): PairingSe
2222
candidateName: 'Dana Smith',
2323
languages: ['Python'],
2424
format: InterviewFormat.REMOTE,
25-
candidateType: CandidateType.FULL_TIME,
2625
requestedAt: new Date(1000000000000),
2726
teammatesNeededCount: 2,
2827
slots: [
@@ -50,7 +49,6 @@ describe('pairingSessionsRepo', () => {
5049
candidateName: interview.candidateName,
5150
languages: 'Python',
5251
format: 'remote',
53-
candidateType: 'full-time',
5452
requestedAt: interview.requestedAt.getTime(),
5553
teammatesNeededCount: interview.teammatesNeededCount,
5654
slots: JSON.stringify(interview.slots),
@@ -70,7 +68,6 @@ describe('pairingSessionsRepo', () => {
7068
candidateName: 'Test',
7169
languages: 'Python,JavaScript',
7270
format: 'remote',
73-
candidateType: 'full-time',
7471
requestedAt: 1000,
7572
slots: '[]',
7673
pendingTeammates: '[]',
@@ -92,7 +89,6 @@ describe('pairingSessionsRepo', () => {
9289
candidateName: interview.candidateName,
9390
languages: 'Python',
9491
format: 'remote',
95-
candidateType: 'full-time',
9692
requestedAt: interview.requestedAt.getTime(),
9793
teammatesNeededCount: interview.teammatesNeededCount,
9894
slots: JSON.stringify(interview.slots),
@@ -124,7 +120,6 @@ describe('pairingSessionsRepo', () => {
124120
candidateName: interview.candidateName,
125121
languages: 'Python',
126122
format: 'remote',
127-
candidateType: 'full-time',
128123
requestedAt: interview.requestedAt.getTime(),
129124
slots: JSON.stringify(interview.slots),
130125
pendingTeammates: '[]',
@@ -159,7 +154,6 @@ describe('pairingSessionsRepo', () => {
159154
candidateName: interview.candidateName,
160155
languages: 'Python',
161156
format: 'remote',
162-
candidateType: 'full-time',
163157
requestedAt: interview.requestedAt.getTime(),
164158
slots: JSON.stringify(interview.slots),
165159
pendingTeammates: '[]',

src/database/repos/pairingSessionsRepo.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { database } from '@database';
33
import { PairingSession } from '@models/PairingSession';
4-
import { InterviewFormat, CandidateType } from '@bot/enums';
4+
import { InterviewFormat } from '@bot/enums';
55
import { GoogleSpreadsheetRow, GoogleSpreadsheetWorksheet } from 'google-spreadsheet';
66
import log from '@utils/log';
77

@@ -11,7 +11,6 @@ enum Column {
1111
CANDIDATE_NAME = 'candidateName',
1212
LANGUAGES = 'languages',
1313
FORMAT = 'format',
14-
CANDIDATE_TYPE = 'candidateType',
1514
REQUESTED_AT = 'requestedAt',
1615
TEAMMATES_NEEDED_COUNT = 'teammatesNeededCount',
1716
SLOTS = 'slots',
@@ -26,7 +25,6 @@ export function mapRowToPairingSession(row: GoogleSpreadsheetRow): PairingSessio
2625
candidateName: row.get(Column.CANDIDATE_NAME),
2726
languages: row.get(Column.LANGUAGES).split(','),
2827
format: row.get(Column.FORMAT) as InterviewFormat,
29-
candidateType: row.get(Column.CANDIDATE_TYPE) as CandidateType,
3028
requestedAt: new Date(Number(row.get(Column.REQUESTED_AT))),
3129
teammatesNeededCount: Number(row.get(Column.TEAMMATES_NEEDED_COUNT)),
3230
slots: JSON.parse(row.get(Column.SLOTS)),
@@ -42,7 +40,6 @@ function mapPairingSessionToRow(interview: PairingSession): Record<string, any>
4240
[Column.CANDIDATE_NAME]: interview.candidateName,
4341
[Column.LANGUAGES]: interview.languages.join(','),
4442
[Column.FORMAT]: interview.format,
45-
[Column.CANDIDATE_TYPE]: interview.candidateType,
4643
[Column.REQUESTED_AT]: interview.requestedAt.getTime(),
4744
[Column.TEAMMATES_NEEDED_COUNT]: interview.teammatesNeededCount,
4845
[Column.SLOTS]: JSON.stringify(interview.slots),

src/services/PairingRequestService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ export const pairingRequestService = {
9898
interview.candidateName,
9999
interview.languages,
100100
interview.format,
101-
interview.candidateType,
102101
interview.slots,
103102
interview.threadId,
104103
);

src/services/__tests__/PairingQueueService.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
import { userRepo } from '@repos/userRepo';
99
import { pairingSessionsRepo } from '@repos/pairingSessionsRepo';
1010
import { PairingSession } from '@models/PairingSession';
11-
import { CandidateType } from '@bot/enums';
1211

1312
function makeUser(overrides: Partial<User> = {}): User {
1413
return {
@@ -30,7 +29,6 @@ function makePairingSession(overrides: Partial<PairingSession> = {}): PairingSes
3029
candidateName: 'Dana',
3130
languages: ['Python'],
3231
format: InterviewFormat.REMOTE,
33-
candidateType: CandidateType.FULL_TIME,
3432
requestedAt: new Date(),
3533
teammatesNeededCount: 2,
3634
slots: [],

0 commit comments

Comments
 (0)