@in-human-resources/backend-proto 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,156 @@
1
+ syntax = "proto3";
2
+
3
+ package hiring.v1;
4
+
5
+ option go_package = "github.com/InHuman-Resources/Backend/Go/proto/gen/hiring/v1;hiringv1";
6
+
7
+ // Pipeline capability aligns with business hiring automation areas.
8
+ enum PipelineCapability {
9
+ PIPELINE_CAPABILITY_UNSPECIFIED = 0;
10
+ PIPELINE_CAPABILITY_SCREENING = 1;
11
+ PIPELINE_CAPABILITY_RECRUITER_REVIEW = 2;
12
+ PIPELINE_CAPABILITY_ASSESSMENT = 3;
13
+ PIPELINE_CAPABILITY_INTERVIEW = 4;
14
+ PIPELINE_CAPABILITY_OFFER = 5;
15
+ PIPELINE_CAPABILITY_COMMUNICATION = 6;
16
+ }
17
+
18
+ enum PipelineStepType {
19
+ PIPELINE_STEP_TYPE_UNSPECIFIED = 0;
20
+ PIPELINE_STEP_TYPE_AUTOMATED = 1;
21
+ PIPELINE_STEP_TYPE_HUMAN_GATE = 2;
22
+ PIPELINE_STEP_TYPE_ASSESSMENT = 3;
23
+ PIPELINE_STEP_TYPE_INTERVIEW = 4;
24
+ PIPELINE_STEP_TYPE_OFFER = 5;
25
+ }
26
+
27
+ message BlockSLA {
28
+ int32 reminder_after_days = 1;
29
+ int32 escalate_after_days = 2;
30
+ int32 auto_reject_after_days = 3;
31
+ }
32
+
33
+ message ManualFieldSpec {
34
+ string id = 1;
35
+ string label = 2;
36
+ string type = 3;
37
+ bool required = 4;
38
+ }
39
+
40
+ message ManualFieldsConfig {
41
+ repeated ManualFieldSpec fields = 1;
42
+ }
43
+
44
+ message PipelineBlock {
45
+ string block_id = 1;
46
+ int32 sort_order = 2;
47
+ PipelineCapability capability = 3;
48
+ bool enabled = 4;
49
+ string display_name = 5;
50
+ string candidate_status_label = 6;
51
+ PipelineStepType step_type = 7;
52
+ BlockSLA sla = 8;
53
+ ManualFieldsConfig manual_fields = 9;
54
+ string config_json = 10;
55
+ }
56
+
57
+ message PipelineDefinition {
58
+ string definition_id = 1;
59
+ string company_id = 2;
60
+ string name = 3;
61
+ string description = 4;
62
+ string slug = 5;
63
+ int32 version = 6;
64
+ string status = 7;
65
+ bool is_platform = 8;
66
+ string source_template_id = 9;
67
+ int32 schema_version = 10;
68
+ repeated PipelineBlock blocks = 11;
69
+ }
70
+
71
+ message ExecutionStep {
72
+ string stage_id = 1;
73
+ PipelineStepType step_type = 2;
74
+ string block_id = 3;
75
+ PipelineCapability capability = 4;
76
+ BlockSLA sla = 5;
77
+ string config_json = 6;
78
+ string manual_fields_json = 7;
79
+ }
80
+
81
+ message PipelineSnapshot {
82
+ string definition_id = 1;
83
+ int32 definition_version = 2;
84
+ int32 schema_version = 3;
85
+ string definition_name = 4;
86
+ repeated ExecutionStep steps = 5;
87
+ }
88
+
89
+ message ListPlatformPipelineTemplatesRequest {}
90
+
91
+ message ListPlatformPipelineTemplatesResponse {
92
+ repeated PipelineDefinition templates = 1;
93
+ }
94
+
95
+ message GetPipelineDefinitionRequest {
96
+ string definition_id = 1;
97
+ }
98
+
99
+ message ListPipelineDefinitionsRequest {}
100
+
101
+ message ListPipelineDefinitionsResponse {
102
+ repeated PipelineDefinition definitions = 1;
103
+ }
104
+
105
+ message CreatePipelineDefinitionRequest {
106
+ string name = 1;
107
+ string description = 2;
108
+ repeated PipelineBlock blocks = 3;
109
+ }
110
+
111
+ message CreatePipelineDefinitionResponse {
112
+ string definition_id = 1;
113
+ }
114
+
115
+ message UpdatePipelineDefinitionRequest {
116
+ string definition_id = 1;
117
+ string name = 2;
118
+ string description = 3;
119
+ repeated PipelineBlock blocks = 4;
120
+ }
121
+
122
+ message PublishPipelineDefinitionRequest {
123
+ string definition_id = 1;
124
+ }
125
+
126
+ message PublishPipelineDefinitionResponse {
127
+ int32 version = 1;
128
+ }
129
+
130
+ message ClonePipelineFromTemplateRequest {
131
+ string template_id = 1;
132
+ string name = 2;
133
+ }
134
+
135
+ message ClonePipelineFromTemplateResponse {
136
+ string definition_id = 1;
137
+ }
138
+
139
+ message SetCompanyDefaultPipelineRequest {
140
+ string definition_id = 1;
141
+ }
142
+
143
+ message SetCompanyDefaultPipelineResponse {}
144
+
145
+ message SetJobPipelineDefinitionRequest {
146
+ string job_id = 1;
147
+ string definition_id = 2;
148
+ }
149
+
150
+ message GetApplicationPipelineSnapshotRequest {
151
+ string application_id = 1;
152
+ }
153
+
154
+ message GetApplicationPipelineSnapshotResponse {
155
+ PipelineSnapshot snapshot = 1;
156
+ }
@@ -0,0 +1,310 @@
1
+ syntax = "proto3";
2
+
3
+ package hiring.v1;
4
+
5
+ option go_package = "github.com/InHuman-Resources/Backend/Go/proto/gen/hiring/v1;hiringv1";
6
+
7
+ import "hiring/v1/pipeline.proto";
8
+
9
+ // HiringService is the private hiring API for the API gateway and approved internal callers
10
+ // (e.g. workflow in M2). Product clients must use api.v1.HiringService on the gateway.
11
+ service HiringService {
12
+ rpc CreateJob(CreateJobRequest) returns (CreateJobResponse);
13
+ rpc PublishJob(PublishJobRequest) returns (PublishJobResponse);
14
+ rpc ApplyToJob(ApplyToJobRequest) returns (ApplyToJobResponse);
15
+ rpc GetJob(GetJobRequest) returns (GetJobResponse);
16
+ rpc GetApplication(GetApplicationRequest) returns (GetApplicationResponse);
17
+
18
+ rpc ListJobs(ListJobsRequest) returns (ListJobsResponse);
19
+ rpc SearchJobs(SearchJobsRequest) returns (SearchJobsResponse);
20
+ rpc UpdateJob(UpdateJobRequest) returns (UpdateJobResponse);
21
+ rpc CloseJob(CloseJobRequest) returns (CloseJobResponse);
22
+
23
+ rpc ListApplications(ListApplicationsRequest) returns (ListApplicationsResponse);
24
+ rpc ListApplicationsForJob(ListApplicationsForJobRequest) returns (ListApplicationsForJobResponse);
25
+ rpc ListApplicationsForCandidate(ListApplicationsForCandidateRequest) returns (ListApplicationsForCandidateResponse);
26
+
27
+ rpc TransitionApplicationStage(TransitionApplicationStageRequest) returns (TransitionApplicationStageResponse);
28
+ rpc RecordRecruiterDecision(RecordRecruiterDecisionRequest) returns (RecordRecruiterDecisionResponse);
29
+ rpc RecordScreeningResult(RecordScreeningResultRequest) returns (RecordScreeningResultResponse);
30
+ rpc RecordInterview(RecordInterviewRequest) returns (RecordInterviewResponse);
31
+ rpc LinkAssessment(LinkAssessmentRequest) returns (LinkAssessmentResponse);
32
+ rpc RecordOffer(RecordOfferRequest) returns (RecordOfferResponse);
33
+ rpc ListApplicationEvents(ListApplicationEventsRequest) returns (ListApplicationEventsResponse);
34
+
35
+ // Pipeline configuration (M2.5)
36
+ rpc ListPlatformPipelineTemplates(ListPlatformPipelineTemplatesRequest) returns (ListPlatformPipelineTemplatesResponse);
37
+ rpc GetPipelineDefinition(GetPipelineDefinitionRequest) returns (PipelineDefinition);
38
+ rpc ListPipelineDefinitions(ListPipelineDefinitionsRequest) returns (ListPipelineDefinitionsResponse);
39
+ rpc CreatePipelineDefinition(CreatePipelineDefinitionRequest) returns (CreatePipelineDefinitionResponse);
40
+ rpc UpdatePipelineDefinition(UpdatePipelineDefinitionRequest) returns (PipelineDefinition);
41
+ rpc PublishPipelineDefinition(PublishPipelineDefinitionRequest) returns (PublishPipelineDefinitionResponse);
42
+ rpc ClonePipelineFromTemplate(ClonePipelineFromTemplateRequest) returns (ClonePipelineFromTemplateResponse);
43
+ rpc SetCompanyDefaultPipeline(SetCompanyDefaultPipelineRequest) returns (SetCompanyDefaultPipelineResponse);
44
+ rpc SetJobPipelineDefinition(SetJobPipelineDefinitionRequest) returns (Job);
45
+ rpc GetApplicationPipelineSnapshot(GetApplicationPipelineSnapshotRequest) returns (GetApplicationPipelineSnapshotResponse);
46
+ }
47
+
48
+ // --- Pagination ---
49
+
50
+ message PageRequest {
51
+ int32 page_size = 1; // default 20, max 100
52
+ string page_token = 2; // opaque; empty for first page
53
+ }
54
+
55
+ message PageResponse {
56
+ string next_page_token = 1;
57
+ }
58
+
59
+ // --- Jobs ---
60
+
61
+ message CreateJobRequest {
62
+ string title = 1;
63
+ string description = 2;
64
+ string public_slug = 3;
65
+ string pipeline_definition_id = 4;
66
+ }
67
+
68
+ message CreateJobResponse {
69
+ string job_id = 1;
70
+ }
71
+
72
+ message PublishJobRequest {
73
+ string job_id = 1;
74
+ }
75
+
76
+ message PublishJobResponse {
77
+ string status = 1;
78
+ }
79
+
80
+ message GetJobRequest {
81
+ string job_id = 1;
82
+ }
83
+
84
+ message Job {
85
+ string job_id = 1;
86
+ string company_id = 2;
87
+ string title = 3;
88
+ string description = 4;
89
+ string status = 5;
90
+ string public_slug = 6;
91
+ string requirements = 7;
92
+ string team_metadata_json = 8;
93
+ string created_at = 9;
94
+ string updated_at = 10;
95
+ string pipeline_definition_id = 11;
96
+ }
97
+
98
+ message GetJobResponse {
99
+ string job_id = 1;
100
+ string company_id = 2;
101
+ string title = 3;
102
+ string description = 4;
103
+ string status = 5;
104
+ string public_slug = 6;
105
+ string requirements = 7;
106
+ string team_metadata_json = 8;
107
+ string created_at = 9;
108
+ string updated_at = 10;
109
+ string pipeline_definition_id = 11;
110
+ }
111
+
112
+ message ListJobsRequest {
113
+ string status_filter = 1; // empty = all for company
114
+ PageRequest page = 2;
115
+ }
116
+
117
+ message ListJobsResponse {
118
+ repeated Job jobs = 1;
119
+ PageResponse page = 2;
120
+ }
121
+
122
+ message SearchJobsRequest {
123
+ string query = 1;
124
+ PageRequest page = 2;
125
+ }
126
+
127
+ message SearchJobsResponse {
128
+ repeated Job jobs = 1;
129
+ PageResponse page = 2;
130
+ }
131
+
132
+ message UpdateJobRequest {
133
+ string job_id = 1;
134
+ string title = 2;
135
+ string description = 3;
136
+ string public_slug = 4;
137
+ string requirements = 5;
138
+ string team_metadata_json = 6;
139
+ string pipeline_definition_id = 7;
140
+ }
141
+
142
+ message UpdateJobResponse {
143
+ Job job = 1;
144
+ }
145
+
146
+ message CloseJobRequest {
147
+ string job_id = 1;
148
+ }
149
+
150
+ message CloseJobResponse {
151
+ string status = 1;
152
+ }
153
+
154
+ // --- Applications ---
155
+
156
+ message ApplyToJobRequest {
157
+ string job_id = 1;
158
+ }
159
+
160
+ message ApplyToJobResponse {
161
+ string application_id = 1;
162
+ }
163
+
164
+ message Application {
165
+ string application_id = 1;
166
+ string job_id = 2;
167
+ string candidate_user_id = 3;
168
+ string current_stage = 4;
169
+ string applied_at = 5;
170
+ string job_title = 6;
171
+ string company_id = 7;
172
+ }
173
+
174
+ message GetApplicationRequest {
175
+ string application_id = 1;
176
+ }
177
+
178
+ message GetApplicationResponse {
179
+ string application_id = 1;
180
+ string job_id = 2;
181
+ string candidate_user_id = 3;
182
+ string current_stage = 4;
183
+ string applied_at = 5;
184
+ string requirements = 6;
185
+ string team_metadata_json = 7;
186
+ }
187
+
188
+ message ListApplicationsRequest {
189
+ string status_filter = 1; // filter by job status or application stage — optional stage substring
190
+ string stage_filter = 2;
191
+ PageRequest page = 3;
192
+ }
193
+
194
+ message ListApplicationsResponse {
195
+ repeated Application applications = 1;
196
+ PageResponse page = 2;
197
+ }
198
+
199
+ message ListApplicationsForJobRequest {
200
+ string job_id = 1;
201
+ PageRequest page = 2;
202
+ }
203
+
204
+ message ListApplicationsForJobResponse {
205
+ repeated Application applications = 1;
206
+ PageResponse page = 2;
207
+ }
208
+
209
+ message ListApplicationsForCandidateRequest {
210
+ // If empty, hiring uses candidate user id from verified token (recommended for gateway).
211
+ string candidate_user_id = 1;
212
+ PageRequest page = 2;
213
+ }
214
+
215
+ message ListApplicationsForCandidateResponse {
216
+ repeated Application applications = 1;
217
+ PageResponse page = 2;
218
+ }
219
+
220
+ // --- Pipeline ---
221
+
222
+ message TransitionApplicationStageRequest {
223
+ string application_id = 1;
224
+ string target_stage = 2;
225
+ string reason = 3;
226
+ }
227
+
228
+ message TransitionApplicationStageResponse {
229
+ string current_stage = 1;
230
+ }
231
+
232
+ message RecordRecruiterDecisionRequest {
233
+ string application_id = 1;
234
+ string stage_context = 2;
235
+ string outcome = 3;
236
+ string reasoning = 4;
237
+ map<string, string> manual_inputs = 5;
238
+ }
239
+
240
+ message RecordRecruiterDecisionResponse {
241
+ string decision_id = 1;
242
+ }
243
+
244
+ message RecordScreeningResultRequest {
245
+ string application_id = 1;
246
+ double score = 2;
247
+ string explanation = 3;
248
+ string skill_extractions_json = 4;
249
+ string source_model_id = 5;
250
+ string raw_output_ref = 6;
251
+ }
252
+
253
+ message RecordScreeningResultResponse {
254
+ string screening_result_id = 1;
255
+ }
256
+
257
+ message RecordInterviewRequest {
258
+ string application_id = 1;
259
+ string scheduled_at = 2; // RFC3339 or empty
260
+ string actual_at = 3;
261
+ string notes = 4;
262
+ string transcript_ref = 5;
263
+ string structured_scores_json = 6;
264
+ }
265
+
266
+ message RecordInterviewResponse {
267
+ string interview_record_id = 1;
268
+ }
269
+
270
+ message LinkAssessmentRequest {
271
+ string application_id = 1;
272
+ string external_assessment_id = 2;
273
+ string status = 3;
274
+ string score_summary = 4;
275
+ }
276
+
277
+ message LinkAssessmentResponse {
278
+ string assessment_link_id = 1;
279
+ }
280
+
281
+ message RecordOfferRequest {
282
+ string application_id = 1;
283
+ string terms = 2;
284
+ string status = 3;
285
+ }
286
+
287
+ message RecordOfferResponse {
288
+ string offer_id = 1;
289
+ }
290
+
291
+ message ApplicationEvent {
292
+ string event_id = 1;
293
+ string application_id = 2;
294
+ string from_stage = 3;
295
+ string to_stage = 4;
296
+ string actor_type = 5;
297
+ string actor_user_id = 6;
298
+ string metadata_json = 7;
299
+ string created_at = 8;
300
+ }
301
+
302
+ message ListApplicationEventsRequest {
303
+ string application_id = 1;
304
+ PageRequest page = 2;
305
+ }
306
+
307
+ message ListApplicationEventsResponse {
308
+ repeated ApplicationEvent events = 1;
309
+ PageResponse page = 2;
310
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@in-human-resources/backend-proto",
3
- "version": "0.1.3",
4
- "description": "Protobuf-ES and Connect-ES generated clients for api.v1, auth.v1, and common.v1",
3
+ "version": "0.1.5",
4
+ "description": "Protobuf-ES and Connect-ES generated clients for api.v1, auth.v1, hiring.v1, workflow.v1, and common.v1",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -9,6 +9,8 @@
9
9
  "gen/ts",
10
10
  "api",
11
11
  "auth",
12
+ "hiring",
13
+ "workflow",
12
14
  "common",
13
15
  "buf.yaml",
14
16
  "buf.gen.yaml"
@@ -0,0 +1,87 @@
1
+ syntax = "proto3";
2
+
3
+ package workflow.v1;
4
+
5
+ option go_package = "github.com/InHuman-Resources/Backend/Go/proto/gen/workflow/v1;workflowv1";
6
+
7
+ // WorkflowService is private: API gateway and approved internal callers only.
8
+ // Drives Temporal application lifecycle; product clients use api.v1.HiringService.
9
+ service WorkflowService {
10
+ // StartApplicationLifecycle starts (or idempotently re-attaches to) the root workflow for one application.
11
+ rpc StartApplicationLifecycle(StartApplicationLifecycleRequest) returns (StartApplicationLifecycleResponse);
12
+
13
+ rpc CancelWorkflow(CancelWorkflowRequest) returns (CancelWorkflowResponse);
14
+
15
+ // Human / domain signals (Temporal signal names match RPC suffixes where applicable).
16
+ rpc SignalRecruiterDecision(SignalRecruiterDecisionRequest) returns (SignalRecruiterDecisionResponse);
17
+ rpc SignalAssessmentCompleted(SignalAssessmentCompletedRequest) returns (SignalAssessmentCompletedResponse);
18
+ rpc SignalInterviewBooked(SignalInterviewBookedRequest) returns (SignalInterviewBookedResponse);
19
+ rpc SignalOfferDecision(SignalOfferDecisionRequest) returns (SignalOfferDecisionResponse);
20
+
21
+ rpc GetWorkflowStatus(GetWorkflowStatusRequest) returns (GetWorkflowStatusResponse);
22
+ }
23
+
24
+ message StartApplicationLifecycleRequest {
25
+ string application_id = 1;
26
+ string job_id = 2;
27
+ string candidate_user_id = 3;
28
+ string company_id = 4;
29
+ // JSON-encoded hiring PipelineSnapshot; when set, workflow interprets steps from snapshot.
30
+ string pipeline_snapshot_json = 5;
31
+ }
32
+
33
+ message StartApplicationLifecycleResponse {
34
+ string workflow_id = 1;
35
+ string run_id = 2;
36
+ }
37
+
38
+ message CancelWorkflowRequest {
39
+ string application_id = 1;
40
+ }
41
+
42
+ message CancelWorkflowResponse {}
43
+
44
+ message SignalRecruiterDecisionRequest {
45
+ string application_id = 1;
46
+ // approve advances pipeline; reject moves to rejected.
47
+ bool approve = 2;
48
+ string reason = 3;
49
+ map<string, string> manual_inputs = 4;
50
+ }
51
+
52
+ message SignalRecruiterDecisionResponse {}
53
+
54
+ message SignalAssessmentCompletedRequest {
55
+ string application_id = 1;
56
+ string external_assessment_id = 2;
57
+ }
58
+
59
+ message SignalAssessmentCompletedResponse {}
60
+
61
+ message SignalInterviewBookedRequest {
62
+ string application_id = 1;
63
+ string scheduled_at_rfc3339 = 2;
64
+ }
65
+
66
+ message SignalInterviewBookedResponse {}
67
+
68
+ message SignalOfferDecisionRequest {
69
+ string application_id = 1;
70
+ bool accepted = 2;
71
+ string reason = 3;
72
+ }
73
+
74
+ message SignalOfferDecisionResponse {}
75
+
76
+ message GetWorkflowStatusRequest {
77
+ string application_id = 1;
78
+ }
79
+
80
+ message GetWorkflowStatusResponse {
81
+ string workflow_id = 1;
82
+ string run_id = 2;
83
+ // Temporal workflow status name, e.g. RUNNING, COMPLETED.
84
+ string status = 3;
85
+ // Best-effort last known stage from workflow (may be empty if not yet started).
86
+ string last_known_stage = 4;
87
+ }