-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
136 lines (127 loc) · 4.27 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
org: thaiskotovicz
app: payroll-charts
service: payroll-charts
frameworkVersion: "3"
provider:
name: aws
runtime: nodejs18.x
resources:
Resources:
GatewayResponseDefault4XX:
Type: "AWS::ApiGateway::GatewayResponse"
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: DEFAULT_4XX
RestApiId:
Ref: ApiGatewayRestApi
plugins:
- serverless-offline
- serverless-openapi-documentation
custom:
documentation:
version: '1'
title: 'Payroll Charts'
description: 'API que lista o headcount e turnover por liderados diretos e indiretos'
models:
- name: "PayrollResponse"
description: "Folha de pagamento"
contentType: "application/json"
schema: ${file(src/models/PayrollResponse.json)}
- name: "HeadcountResponse"
description: "Headcount"
contentType: "application/json"
schema: ${file(src/models/HeadcountResponse.json)}
- name: "TurnoverResponse"
description: "Turnover"
contentType: "application/json"
schema: ${file(src/models/TurnoverResponse.json)}
functions:
getPayroll:
handler: src/lambdas/getPayroll.handler
events:
- http:
path: /api/v1/payroll
method: get
cors: true
documentation:
summary: "Folha de pagamento"
description: "Lista a folha de pagamento completa"
methodResponses:
- statusCode: 200
responseBody:
description: "A employees array with its informations and manager email"
responseModels:
application/json: "PayrollResponse"
- statusCode: 500
description: "An error message request fails"
getPayrollByManager:
handler: src/lambdas/getPayrollByManager.handler
events:
- http:
path: /api/v1/payroll/{email}
method: get
cors: true
documentation:
summary: "Folha de pagamento por líder"
description: "Lista a folha de pagamento dos subordinados"
pathParams:
- name: "email"
description: "Email do supervisor"
schema:
type: "string"
methodResponses:
- statusCode: 200
responseBody:
description: "A employees array with its informations and manager email"
responseModels:
application/json: "PayrollResponse"
- statusCode: 500
description: "An error message request fails"
getHeadcount:
handler: src/lambdas/getHeadcount.handler
events:
- http:
path: /api/v1/payroll/headcount/{email}
method: get
cors: true
documentation:
summary: "Headcount por líder"
description: "Calcula o headcount por líder"
pathParams:
- name: "email"
description: "Email do supervisor"
schema:
type: "string"
methodResponses:
- statusCode: 200
responseBody:
description: "A headcount array by month"
responseModels:
application/json: "HeadcountResponse"
- statusCode: 500
description: "An error message request fails"
getTurnover:
handler: src/lambdas/getTurnover.handler
events:
- http:
path: /api/v1/payroll/turnover/{email}
method: get
cors: true
documentation:
summary: "Turnover por líder"
description: "Calcula o turnover por líder"
pathParams:
- name: "email"
description: "Email do supervisor"
schema:
type: "string"
methodResponses:
- statusCode: 200
responseBody:
description: "A turnover array by month"
responseModels:
application/json: "TurnoverResponse"
- statusCode: 500
description: "An error message request fails"