Skip to content

Commit fe22079

Browse files
committed
Add snooze and unsnooze case API endpoints.
1 parent 3410108 commit fe22079

File tree

2 files changed

+80
-2
lines changed

2 files changed

+80
-2
lines changed

packages/marble-api/openapis/marblecore-api/cases.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
- $ref: 'components.yml#/parameters/offset_id'
4444
- $ref: 'components.yml#/parameters/limit'
4545
- $ref: 'components.yml#/parameters/order'
46+
- name: include_snoozed
47+
description: Include cases that are currently snoozed
48+
in: query
49+
required: false
50+
schema:
51+
type: boolean
52+
default: false
4653
responses:
4754
'200':
4855
description: List of corresponding cases
@@ -212,6 +219,71 @@
212219
$ref: 'components.yml#/responses/403'
213220
'404':
214221
$ref: 'components.yml#/responses/404'
222+
/cases/{caseId}/snooze:
223+
post:
224+
tags:
225+
- Cases
226+
summary: Snooze a case
227+
operationId: snoozeCase
228+
security:
229+
- bearerAuth: []
230+
parameters:
231+
- name: caseId
232+
description: ID of the case that needs to be snoozed
233+
in: path
234+
required: true
235+
schema:
236+
type: string
237+
format: uuid
238+
requestBody:
239+
description: 'Decision ids to add to case'
240+
content:
241+
application/json:
242+
schema:
243+
type: object
244+
required:
245+
- until
246+
properties:
247+
until:
248+
type: date-time
249+
required: true
250+
responses:
251+
'204':
252+
description: The case was snoozed
253+
'400':
254+
$ref: 'components.yml#/responses/400'
255+
'401':
256+
$ref: 'components.yml#/responses/401'
257+
'403':
258+
$ref: 'components.yml#/responses/403'
259+
'404':
260+
$ref: 'components.yml#/responses/404'
261+
delete:
262+
tags:
263+
- Cases
264+
summary: Snooze a case
265+
operationId: unsnoozeCase
266+
security:
267+
- bearerAuth: []
268+
parameters:
269+
- name: caseId
270+
description: ID of the case that needs to be unsnoozed
271+
in: path
272+
required: true
273+
schema:
274+
type: string
275+
format: uuid
276+
responses:
277+
'204':
278+
description: The case was unsnoozed
279+
'400':
280+
$ref: 'components.yml#/responses/400'
281+
'401':
282+
$ref: 'components.yml#/responses/401'
283+
'403':
284+
$ref: 'components.yml#/responses/403'
285+
'404':
286+
$ref: 'components.yml#/responses/404'
215287
/cases/{caseId}/comments:
216288
post:
217289
tags:
@@ -430,6 +502,9 @@ components:
430502
type: array
431503
items:
432504
$ref: '#/components/schemas/CaseTagDto'
505+
snoozed_until:
506+
type: string
507+
format: date-time
433508
CaseDetailDto:
434509
allOf:
435510
- $ref: '#/components/schemas/CaseDto'

packages/marble-api/src/generated/marblecore-api.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export type CaseDto = {
6363
inbox_id: string;
6464
contributors: CaseContributorDto[];
6565
tags: CaseTagDto[];
66+
snoozed_until?: string;
6667
};
6768
export type Error = {
6869
code: number;
@@ -945,7 +946,7 @@ export function createDecision(createDecisionBody: CreateDecisionBody, opts?: Oa
945946
/**
946947
* List cases
947948
*/
948-
export function listCases({ status, inboxId, startDate, endDate, sorting, name, offsetId, limit, order }: {
949+
export function listCases({ status, inboxId, startDate, endDate, sorting, name, offsetId, limit, order, includeSnoozed }: {
949950
status?: CaseStatusDto[];
950951
inboxId?: string[];
951952
startDate?: string;
@@ -955,6 +956,7 @@ export function listCases({ status, inboxId, startDate, endDate, sorting, name,
955956
offsetId?: string;
956957
limit?: number;
957958
order?: "ASC" | "DESC";
959+
includeSnoozed?: boolean;
958960
} = {}, opts?: Oazapfts.RequestOpts) {
959961
return oazapfts.ok(oazapfts.fetchJson<{
960962
status: 200;
@@ -976,7 +978,8 @@ export function listCases({ status, inboxId, startDate, endDate, sorting, name,
976978
name,
977979
offset_id: offsetId,
978980
limit,
979-
order
981+
order,
982+
include_snoozed: includeSnoozed
980983
}))}`, {
981984
...opts
982985
}));

0 commit comments

Comments
 (0)