Passed
Push — development ( d4af34...aa4abf )
by Peter
22:33 queued 09:48
created

backend/src/constants/HTTP_responses.ts

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 27
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 22
dl 0
loc 27
ccs 2
cts 2
cp 1
c 0
b 0
f 0
wmc 0
mnd 0
bc 0
fnc 0
bpm 0
cpm 0
noi 0
1 7
export const HTTP_STATUS = {
2
  OK: 200,
3
  BAD_REQUEST: 400,
4
  UNAUTHORIZED: 401,
5
  FORBIDDEN: 403,
6
  NOT_FOUND: 404,
7
} as const;
8
9 7
export const API_RESPONSES = {
10
  AUTH_REQUIRED: {
11
    status: HTTP_STATUS.UNAUTHORIZED,
12
    description: 'Unauthorized. Authentication required',
13
  },
14
  ADMIN_REQUIRED: {
15
    status: HTTP_STATUS.FORBIDDEN,
16
    description: 'Forbidden. Admin access required',
17
  },
18
  NOT_FOUND: {
19
    status: HTTP_STATUS.NOT_FOUND,
20
    description: 'Resource not found',
21
  },
22
  BAD_REQUEST: {
23
    status: HTTP_STATUS.BAD_REQUEST,
24
    description: 'Invalid input with error message',
25
  },
26
} as const;
27