quantix-mcp 0.3.7 → 0.3.9
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.
- package/.github/agents/copilot-instructions.md +32 -32
- package/.github/copilot-instructions.md +17 -17
- package/.github/workflows/publish.yaml +28 -28
- package/.opencode/command/speckit.analyze.md +184 -184
- package/.opencode/command/speckit.checklist.md +294 -294
- package/.opencode/command/speckit.clarify.md +181 -181
- package/.opencode/command/speckit.constitution.md +84 -84
- package/.opencode/command/speckit.implement.md +135 -135
- package/.opencode/command/speckit.plan.md +89 -89
- package/.opencode/command/speckit.specify.md +258 -258
- package/.opencode/command/speckit.tasks.md +137 -137
- package/.opencode/command/speckit.taskstoissues.md +30 -30
- package/.specify/memory/constitution.md +58 -58
- package/.specify/templates/constitution-template.md +50 -50
- package/.vscode/launch.json +14 -14
- package/CLAUDE.md +64 -64
- package/README.md +176 -176
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/tools/accounts.d.ts.map +1 -1
- package/dist/tools/accounts.js +64 -28
- package/dist/tools/accounts.js.map +1 -1
- package/dist/tools/categories.d.ts.map +1 -1
- package/dist/tools/categories.js +46 -20
- package/dist/tools/categories.js.map +1 -1
- package/dist/tools/credit-cards.d.ts.map +1 -1
- package/dist/tools/credit-cards.js +89 -33
- package/dist/tools/credit-cards.js.map +1 -1
- package/dist/tools/data.d.ts.map +1 -1
- package/dist/tools/data.js +19 -8
- package/dist/tools/data.js.map +1 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +28 -12
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/summary.d.ts.map +1 -1
- package/dist/tools/summary.js +17 -11
- package/dist/tools/summary.js.map +1 -1
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +86 -50
- package/dist/tools/transactions.js.map +1 -1
- package/dist/tools/transfers.d.ts +3 -0
- package/dist/tools/transfers.d.ts.map +1 -0
- package/dist/tools/transfers.js +107 -0
- package/dist/tools/transfers.js.map +1 -0
- package/dist/types/schemas.d.ts +25 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +28 -2
- package/dist/types/schemas.js.map +1 -1
- package/dist/utils/toolHelpers.d.ts +7 -0
- package/dist/utils/toolHelpers.d.ts.map +1 -0
- package/dist/utils/toolHelpers.js +11 -0
- package/dist/utils/toolHelpers.js.map +1 -0
- package/openapi.yaml +2045 -1828
- package/package.json +41 -41
- package/specs/001-mcp-api-integration/checklists/requirements.md +34 -34
- package/specs/001-mcp-api-integration/contracts/openapi.yaml +635 -635
- package/specs/001-mcp-api-integration/data-model.md +106 -106
- package/specs/001-mcp-api-integration/plan.md +73 -73
- package/specs/001-mcp-api-integration/quickstart.md +74 -74
- package/specs/001-mcp-api-integration/research.md +58 -58
- package/specs/001-mcp-api-integration/spec.md +119 -119
- package/specs/001-mcp-api-integration/tasks.md +64 -64
- package/src/config.ts +36 -36
- package/src/index.ts +49 -47
- package/src/services/apiClient.ts +49 -49
- package/src/tools/accounts.ts +140 -111
- package/src/tools/categories.ts +102 -81
- package/src/tools/credit-cards.ts +184 -147
- package/src/tools/data.ts +45 -36
- package/src/tools/settings.ts +64 -51
- package/src/tools/summary.ts +29 -24
- package/src/tools/transactions.ts +157 -128
- package/src/tools/transfers.ts +122 -0
- package/src/types/schemas.ts +260 -235
- package/src/utils/toolHelpers.ts +11 -0
- package/tests/benchmark.test.d.ts +1 -1
- package/tests/benchmark.test.js +32 -32
- package/tests/benchmark.test.ts +38 -38
- package/tests/server.test.d.ts +1 -1
- package/tests/server.test.js +12 -12
- package/tests/server.test.ts +14 -14
- package/tests/setup.d.ts +3 -3
- package/tests/setup.js +16 -16
- package/tests/setup.ts +20 -20
- package/tests/tools/accounts.test.ts +159 -118
- package/tests/tools/categories.test.d.ts +1 -1
- package/tests/tools/categories.test.js +62 -62
- package/tests/tools/categories.test.ts +120 -78
- package/tests/tools/credit-cards.test.d.ts +1 -1
- package/tests/tools/credit-cards.test.js +70 -70
- package/tests/tools/credit-cards.test.ts +131 -89
- package/tests/tools/data.test.ts +100 -0
- package/tests/tools/settings.test.ts +116 -0
- package/tests/tools/summary.test.d.ts +1 -1
- package/tests/tools/summary.test.js +35 -35
- package/tests/tools/summary.test.ts +63 -42
- package/tests/tools/transactions.test.d.ts +1 -1
- package/tests/tools/transactions.test.js +66 -66
- package/tests/tools/transactions.test.ts +133 -82
- package/tests/tools/transfers.test.ts +141 -0
- package/tsconfig.json +52 -52
- package/vitest.config.d.ts +2 -2
- package/vitest.config.js +13 -13
- package/vitest.config.ts +14 -14
|
@@ -1,636 +1,636 @@
|
|
|
1
|
-
openapi: 3.0.0
|
|
2
|
-
info:
|
|
3
|
-
title: Quantix Personal Finance Manager API
|
|
4
|
-
description: API for managing personal finances including transactions, credit cards, categories, and recurring payments
|
|
5
|
-
version: 1.0.0
|
|
6
|
-
contact:
|
|
7
|
-
name: Quantix Support
|
|
8
|
-
email: support@quantix.example.com
|
|
9
|
-
|
|
10
|
-
servers:
|
|
11
|
-
- url: https://api.quantix.example.com
|
|
12
|
-
description: Production server
|
|
13
|
-
- url: https://staging.quantix.example.com
|
|
14
|
-
description: Staging server
|
|
15
|
-
|
|
16
|
-
components:
|
|
17
|
-
securitySchemes:
|
|
18
|
-
ApiKeyAuth:
|
|
19
|
-
type: apiKey
|
|
20
|
-
in: header
|
|
21
|
-
name: API-KEY
|
|
22
|
-
description: API key for authentication, configured via QUANTIX_API_KEY environment variable
|
|
23
|
-
|
|
24
|
-
schemas:
|
|
25
|
-
Category:
|
|
26
|
-
type: object
|
|
27
|
-
required:
|
|
28
|
-
- name
|
|
29
|
-
- type
|
|
30
|
-
properties:
|
|
31
|
-
id:
|
|
32
|
-
type: string
|
|
33
|
-
description: Unique identifier for the category
|
|
34
|
-
example: "cat_123456789"
|
|
35
|
-
name:
|
|
36
|
-
type: string
|
|
37
|
-
description: Name of the category
|
|
38
|
-
example: "Groceries"
|
|
39
|
-
type:
|
|
40
|
-
type: string
|
|
41
|
-
enum: [INCOME, EXPENSE]
|
|
42
|
-
description: Type of the category
|
|
43
|
-
example: "EXPENSE"
|
|
44
|
-
createdAt:
|
|
45
|
-
type: string
|
|
46
|
-
format: date-time
|
|
47
|
-
description: Timestamp when the category was created
|
|
48
|
-
example: "2026-01-30T10:00:00Z"
|
|
49
|
-
|
|
50
|
-
Transaction:
|
|
51
|
-
type: object
|
|
52
|
-
required:
|
|
53
|
-
- type
|
|
54
|
-
- name
|
|
55
|
-
- amount
|
|
56
|
-
- date
|
|
57
|
-
properties:
|
|
58
|
-
id:
|
|
59
|
-
type: string
|
|
60
|
-
description: Unique identifier for the transaction
|
|
61
|
-
example: "txn_123456789"
|
|
62
|
-
type:
|
|
63
|
-
type: string
|
|
64
|
-
enum: [INCOME, EXPENSE]
|
|
65
|
-
description: Type of the transaction
|
|
66
|
-
example: "EXPENSE"
|
|
67
|
-
name:
|
|
68
|
-
type: string
|
|
69
|
-
description: Description of the transaction
|
|
70
|
-
example: "Weekly groceries"
|
|
71
|
-
amount:
|
|
72
|
-
type: number
|
|
73
|
-
format: float
|
|
74
|
-
minimum: 0
|
|
75
|
-
description: Amount of the transaction
|
|
76
|
-
example: 125.75
|
|
77
|
-
date:
|
|
78
|
-
type: string
|
|
79
|
-
format: date
|
|
80
|
-
description: Date of the transaction
|
|
81
|
-
example: "2026-01-30"
|
|
82
|
-
categoryId:
|
|
83
|
-
type: string
|
|
84
|
-
description: ID of the associated category
|
|
85
|
-
example: "cat_123456789"
|
|
86
|
-
paymentMethod:
|
|
87
|
-
type: string
|
|
88
|
-
enum: [CASH, PIX, DEBIT, CREDIT]
|
|
89
|
-
description: Method of payment
|
|
90
|
-
example: "CREDIT"
|
|
91
|
-
creditCardId:
|
|
92
|
-
type: string
|
|
93
|
-
description: ID of the associated credit card (required if paymentMethod is CREDIT)
|
|
94
|
-
example: "cc_123456789"
|
|
95
|
-
installmentGroupId:
|
|
96
|
-
type: string
|
|
97
|
-
description: ID to group installment transactions
|
|
98
|
-
example: "ig_123456789"
|
|
99
|
-
installmentNumber:
|
|
100
|
-
type: integer
|
|
101
|
-
minimum: 1
|
|
102
|
-
description: Current installment number in a series
|
|
103
|
-
example: 2
|
|
104
|
-
installmentTotal:
|
|
105
|
-
type: integer
|
|
106
|
-
minimum: 1
|
|
107
|
-
description: Total number of installments in the series
|
|
108
|
-
example: 5
|
|
109
|
-
recurrenceRuleId:
|
|
110
|
-
type: string
|
|
111
|
-
description: ID of the associated recurrence rule
|
|
112
|
-
example: "rr_123456789"
|
|
113
|
-
paid:
|
|
114
|
-
type: boolean
|
|
115
|
-
default: false
|
|
116
|
-
description: Whether the transaction has been paid/received
|
|
117
|
-
example: true
|
|
118
|
-
createdAt:
|
|
119
|
-
type: string
|
|
120
|
-
format: date-time
|
|
121
|
-
description: Timestamp when the transaction was created
|
|
122
|
-
example: "2026-01-30T10:00:00Z"
|
|
123
|
-
|
|
124
|
-
CreditCard:
|
|
125
|
-
type: object
|
|
126
|
-
required:
|
|
127
|
-
- name
|
|
128
|
-
- limitAmount
|
|
129
|
-
- closingDay
|
|
130
|
-
- dueDay
|
|
131
|
-
properties:
|
|
132
|
-
id:
|
|
133
|
-
type: string
|
|
134
|
-
description: Unique identifier for the credit card
|
|
135
|
-
example: "cc_123456789"
|
|
136
|
-
name:
|
|
137
|
-
type: string
|
|
138
|
-
description: Name of the credit card
|
|
139
|
-
example: "Nubank Platinum"
|
|
140
|
-
brand:
|
|
141
|
-
type: string
|
|
142
|
-
description: Brand of the credit card
|
|
143
|
-
example: "Visa"
|
|
144
|
-
limitAmount:
|
|
145
|
-
type: number
|
|
146
|
-
format: float
|
|
147
|
-
minimum: 0
|
|
148
|
-
description: Credit limit of the card
|
|
149
|
-
example: 5000.00
|
|
150
|
-
closingDay:
|
|
151
|
-
type: integer
|
|
152
|
-
minimum: 1
|
|
153
|
-
maximum: 31
|
|
154
|
-
description: Day of the month when the billing cycle closes
|
|
155
|
-
example: 15
|
|
156
|
-
dueDay:
|
|
157
|
-
type: integer
|
|
158
|
-
minimum: 1
|
|
159
|
-
maximum: 31
|
|
160
|
-
description: Day of the month when the bill is due
|
|
161
|
-
example: 22
|
|
162
|
-
createdAt:
|
|
163
|
-
type: string
|
|
164
|
-
format: date-time
|
|
165
|
-
description: Timestamp when the credit card was added
|
|
166
|
-
example: "2026-01-30T10:00:00Z"
|
|
167
|
-
|
|
168
|
-
RecurrenceRule:
|
|
169
|
-
type: object
|
|
170
|
-
required:
|
|
171
|
-
- frequency
|
|
172
|
-
properties:
|
|
173
|
-
id:
|
|
174
|
-
type: string
|
|
175
|
-
description: Unique identifier for the recurrence rule
|
|
176
|
-
example: "rr_123456789"
|
|
177
|
-
frequency:
|
|
178
|
-
type: string
|
|
179
|
-
enum: [MONTHLY, WEEKLY, YEARLY]
|
|
180
|
-
description: Frequency of recurrence
|
|
181
|
-
example: "MONTHLY"
|
|
182
|
-
interval:
|
|
183
|
-
type: integer
|
|
184
|
-
minimum: 1
|
|
185
|
-
default: 1
|
|
186
|
-
description: Interval multiplier for the frequency
|
|
187
|
-
example: 1
|
|
188
|
-
endDate:
|
|
189
|
-
type: string
|
|
190
|
-
format: date
|
|
191
|
-
description: Date when the recurrence should end
|
|
192
|
-
example: "2026-12-31"
|
|
193
|
-
createdAt:
|
|
194
|
-
type: string
|
|
195
|
-
format: date-time
|
|
196
|
-
description: Timestamp when the recurrence rule was created
|
|
197
|
-
example: "2026-01-30T10:00:00Z"
|
|
198
|
-
|
|
199
|
-
Statement:
|
|
200
|
-
type: object
|
|
201
|
-
properties:
|
|
202
|
-
cardId:
|
|
203
|
-
type: string
|
|
204
|
-
description: ID of the credit card
|
|
205
|
-
example: "cc_123456789"
|
|
206
|
-
periodStart:
|
|
207
|
-
type: string
|
|
208
|
-
format: date
|
|
209
|
-
description: Start date of the billing period
|
|
210
|
-
example: "2026-02-16"
|
|
211
|
-
periodEnd:
|
|
212
|
-
type: string
|
|
213
|
-
format: date
|
|
214
|
-
description: End date of the billing period
|
|
215
|
-
example: "2026-03-15"
|
|
216
|
-
dueDate:
|
|
217
|
-
type: string
|
|
218
|
-
format: date
|
|
219
|
-
description: Due date of the statement
|
|
220
|
-
example: "2026-03-22"
|
|
221
|
-
transactions:
|
|
222
|
-
type: array
|
|
223
|
-
items:
|
|
224
|
-
$ref: '#/components/schemas/Transaction'
|
|
225
|
-
description: List of transactions in the statement period
|
|
226
|
-
total:
|
|
227
|
-
type: number
|
|
228
|
-
format: float
|
|
229
|
-
description: Total amount of the statement
|
|
230
|
-
example: 3450.00
|
|
231
|
-
availableLimit:
|
|
232
|
-
type: number
|
|
233
|
-
format: float
|
|
234
|
-
description: Available credit limit
|
|
235
|
-
example: 1550.00
|
|
236
|
-
|
|
237
|
-
Summary:
|
|
238
|
-
type: object
|
|
239
|
-
properties:
|
|
240
|
-
month:
|
|
241
|
-
type: string
|
|
242
|
-
description: Month for the summary (YYYY-MM format)
|
|
243
|
-
example: "2026-03"
|
|
244
|
-
income:
|
|
245
|
-
type: number
|
|
246
|
-
format: float
|
|
247
|
-
description: Total income for the month
|
|
248
|
-
example: 10000.00
|
|
249
|
-
expenses:
|
|
250
|
-
type: number
|
|
251
|
-
format: float
|
|
252
|
-
description: Total expenses for the month
|
|
253
|
-
example: 4000.00
|
|
254
|
-
creditCardStatements:
|
|
255
|
-
type: array
|
|
256
|
-
items:
|
|
257
|
-
type: object
|
|
258
|
-
properties:
|
|
259
|
-
cardName:
|
|
260
|
-
type: string
|
|
261
|
-
description: Name of the credit card
|
|
262
|
-
example: "Nubank"
|
|
263
|
-
dueDate:
|
|
264
|
-
type: string
|
|
265
|
-
format: date
|
|
266
|
-
description: Due date of the statement
|
|
267
|
-
example: "2026-03-22"
|
|
268
|
-
total:
|
|
269
|
-
type: number
|
|
270
|
-
format: float
|
|
271
|
-
description: Total amount of the statement
|
|
272
|
-
example: 2500.00
|
|
273
|
-
balance:
|
|
274
|
-
type: number
|
|
275
|
-
format: float
|
|
276
|
-
description: Net balance (income - expenses)
|
|
277
|
-
example: 3500.00
|
|
278
|
-
|
|
279
|
-
CreateTransactionRequest:
|
|
280
|
-
type: object
|
|
281
|
-
required:
|
|
282
|
-
- type
|
|
283
|
-
- name
|
|
284
|
-
- amount
|
|
285
|
-
- date
|
|
286
|
-
properties:
|
|
287
|
-
type:
|
|
288
|
-
$ref: '#/components/schemas/Transaction/properties/type'
|
|
289
|
-
name:
|
|
290
|
-
$ref: '#/components/schemas/Transaction/properties/name'
|
|
291
|
-
amount:
|
|
292
|
-
$ref: '#/components/schemas/Transaction/properties/amount'
|
|
293
|
-
date:
|
|
294
|
-
$ref: '#/components/schemas/Transaction/properties/date'
|
|
295
|
-
categoryId:
|
|
296
|
-
$ref: '#/components/schemas/Transaction/properties/categoryId'
|
|
297
|
-
paymentMethod:
|
|
298
|
-
$ref: '#/components/schemas/Transaction/properties/paymentMethod'
|
|
299
|
-
creditCardId:
|
|
300
|
-
$ref: '#/components/schemas/Transaction/properties/creditCardId'
|
|
301
|
-
installments:
|
|
302
|
-
type: integer
|
|
303
|
-
minimum: 1
|
|
304
|
-
description: Number of installments (optional)
|
|
305
|
-
example: 3
|
|
306
|
-
targetDueMonth:
|
|
307
|
-
type: string
|
|
308
|
-
pattern: "^\\d{4}-\\d{2}$"
|
|
309
|
-
description: Target month for due date in YYYY-MM format (optional)
|
|
310
|
-
example: "2026-03"
|
|
311
|
-
recurrence:
|
|
312
|
-
type: object
|
|
313
|
-
properties:
|
|
314
|
-
frequency:
|
|
315
|
-
$ref: '#/components/schemas/RecurrenceRule/properties/frequency'
|
|
316
|
-
interval:
|
|
317
|
-
$ref: '#/components/schemas/RecurrenceRule/properties/interval'
|
|
318
|
-
endDate:
|
|
319
|
-
$ref: '#/components/schemas/RecurrenceRule/properties/endDate'
|
|
320
|
-
|
|
321
|
-
responses:
|
|
322
|
-
UnauthorizedError:
|
|
323
|
-
description: API key is missing or invalid
|
|
324
|
-
content:
|
|
325
|
-
application/json:
|
|
326
|
-
schema:
|
|
327
|
-
type: object
|
|
328
|
-
properties:
|
|
329
|
-
statusCode:
|
|
330
|
-
type: integer
|
|
331
|
-
example: 401
|
|
332
|
-
error:
|
|
333
|
-
type: string
|
|
334
|
-
example: "Unauthorized"
|
|
335
|
-
message:
|
|
336
|
-
type: string
|
|
337
|
-
example: "Invalid API key"
|
|
338
|
-
|
|
339
|
-
security:
|
|
340
|
-
- ApiKeyAuth: []
|
|
341
|
-
|
|
342
|
-
paths:
|
|
343
|
-
/categories:
|
|
344
|
-
post:
|
|
345
|
-
summary: Create a new category
|
|
346
|
-
requestBody:
|
|
347
|
-
required: true
|
|
348
|
-
content:
|
|
349
|
-
application/json:
|
|
350
|
-
schema:
|
|
351
|
-
type: object
|
|
352
|
-
required:
|
|
353
|
-
- name
|
|
354
|
-
- type
|
|
355
|
-
properties:
|
|
356
|
-
name:
|
|
357
|
-
type: string
|
|
358
|
-
example: "Groceries"
|
|
359
|
-
type:
|
|
360
|
-
type: string
|
|
361
|
-
enum: [INCOME, EXPENSE]
|
|
362
|
-
example: "EXPENSE"
|
|
363
|
-
responses:
|
|
364
|
-
'201':
|
|
365
|
-
description: Category created successfully
|
|
366
|
-
content:
|
|
367
|
-
application/json:
|
|
368
|
-
schema:
|
|
369
|
-
$ref: '#/components/schemas/Category'
|
|
370
|
-
'400':
|
|
371
|
-
description: Invalid input
|
|
372
|
-
'401':
|
|
373
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
374
|
-
|
|
375
|
-
get:
|
|
376
|
-
summary: Get all categories
|
|
377
|
-
responses:
|
|
378
|
-
'200':
|
|
379
|
-
description: List of categories
|
|
380
|
-
content:
|
|
381
|
-
application/json:
|
|
382
|
-
schema:
|
|
383
|
-
type: array
|
|
384
|
-
items:
|
|
385
|
-
$ref: '#/components/schemas/Category'
|
|
386
|
-
'401':
|
|
387
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
388
|
-
|
|
389
|
-
/categories/{id}:
|
|
390
|
-
delete:
|
|
391
|
-
summary: Delete a category
|
|
392
|
-
parameters:
|
|
393
|
-
- name: id
|
|
394
|
-
in: path
|
|
395
|
-
required: true
|
|
396
|
-
schema:
|
|
397
|
-
type: string
|
|
398
|
-
description: Category ID
|
|
399
|
-
responses:
|
|
400
|
-
'200':
|
|
401
|
-
description: Category deleted successfully
|
|
402
|
-
'401':
|
|
403
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
404
|
-
'404':
|
|
405
|
-
description: Category not found
|
|
406
|
-
|
|
407
|
-
/credit-cards:
|
|
408
|
-
post:
|
|
409
|
-
summary: Create a new credit card
|
|
410
|
-
requestBody:
|
|
411
|
-
required: true
|
|
412
|
-
content:
|
|
413
|
-
application/json:
|
|
414
|
-
schema:
|
|
415
|
-
type: object
|
|
416
|
-
required:
|
|
417
|
-
- name
|
|
418
|
-
- limitAmount
|
|
419
|
-
- closingDay
|
|
420
|
-
- dueDay
|
|
421
|
-
properties:
|
|
422
|
-
name:
|
|
423
|
-
type: string
|
|
424
|
-
example: "Nubank Platinum"
|
|
425
|
-
brand:
|
|
426
|
-
type: string
|
|
427
|
-
example: "Visa"
|
|
428
|
-
limitAmount:
|
|
429
|
-
type: number
|
|
430
|
-
format: float
|
|
431
|
-
example: 5000.00
|
|
432
|
-
closingDay:
|
|
433
|
-
type: integer
|
|
434
|
-
minimum: 1
|
|
435
|
-
maximum: 31
|
|
436
|
-
example: 15
|
|
437
|
-
dueDay:
|
|
438
|
-
type: integer
|
|
439
|
-
minimum: 1
|
|
440
|
-
maximum: 31
|
|
441
|
-
example: 22
|
|
442
|
-
responses:
|
|
443
|
-
'201':
|
|
444
|
-
description: Credit card created successfully
|
|
445
|
-
content:
|
|
446
|
-
application/json:
|
|
447
|
-
schema:
|
|
448
|
-
$ref: '#/components/schemas/CreditCard'
|
|
449
|
-
'400':
|
|
450
|
-
description: Invalid input
|
|
451
|
-
'401':
|
|
452
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
453
|
-
|
|
454
|
-
get:
|
|
455
|
-
summary: Get all credit cards
|
|
456
|
-
responses:
|
|
457
|
-
'200':
|
|
458
|
-
description: List of credit cards
|
|
459
|
-
content:
|
|
460
|
-
application/json:
|
|
461
|
-
schema:
|
|
462
|
-
type: array
|
|
463
|
-
items:
|
|
464
|
-
$ref: '#/components/schemas/CreditCard'
|
|
465
|
-
'401':
|
|
466
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
467
|
-
|
|
468
|
-
/credit-cards/{id}/statement:
|
|
469
|
-
get:
|
|
470
|
-
summary: Get credit card statement for a specific month
|
|
471
|
-
parameters:
|
|
472
|
-
- name: id
|
|
473
|
-
in: path
|
|
474
|
-
required: true
|
|
475
|
-
schema:
|
|
476
|
-
type: string
|
|
477
|
-
description: Credit card ID
|
|
478
|
-
- name: month
|
|
479
|
-
in: query
|
|
480
|
-
required: true
|
|
481
|
-
schema:
|
|
482
|
-
type: string
|
|
483
|
-
pattern: "^\\d{4}-\\d{2}$"
|
|
484
|
-
description: Month in YYYY-MM format
|
|
485
|
-
example: "2026-03"
|
|
486
|
-
responses:
|
|
487
|
-
'200':
|
|
488
|
-
description: Credit card statement
|
|
489
|
-
content:
|
|
490
|
-
application/json:
|
|
491
|
-
schema:
|
|
492
|
-
$ref: '#/components/schemas/Statement'
|
|
493
|
-
'401':
|
|
494
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
495
|
-
'404':
|
|
496
|
-
description: Credit card not found
|
|
497
|
-
|
|
498
|
-
/credit-cards/{id}/pay-statement:
|
|
499
|
-
post:
|
|
500
|
-
summary: Mark all transactions in a credit card statement as paid
|
|
501
|
-
parameters:
|
|
502
|
-
- name: id
|
|
503
|
-
in: path
|
|
504
|
-
required: true
|
|
505
|
-
schema:
|
|
506
|
-
type: string
|
|
507
|
-
description: Credit card ID
|
|
508
|
-
- name: month
|
|
509
|
-
in: query
|
|
510
|
-
required: true
|
|
511
|
-
schema:
|
|
512
|
-
type: string
|
|
513
|
-
pattern: "^\\d{4}-\\d{2}$"
|
|
514
|
-
description: Month in YYYY-MM format
|
|
515
|
-
example: "2026-03"
|
|
516
|
-
responses:
|
|
517
|
-
'200':
|
|
518
|
-
description: Statement marked as paid
|
|
519
|
-
content:
|
|
520
|
-
application/json:
|
|
521
|
-
schema:
|
|
522
|
-
type: object
|
|
523
|
-
properties:
|
|
524
|
-
message:
|
|
525
|
-
type: string
|
|
526
|
-
example: "Statement for March 2026 marked as paid"
|
|
527
|
-
'401':
|
|
528
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
529
|
-
'404':
|
|
530
|
-
description: Credit card or statement not found
|
|
531
|
-
|
|
532
|
-
/transactions:
|
|
533
|
-
post:
|
|
534
|
-
summary: Create a new transaction
|
|
535
|
-
requestBody:
|
|
536
|
-
required: true
|
|
537
|
-
content:
|
|
538
|
-
application/json:
|
|
539
|
-
schema:
|
|
540
|
-
$ref: '#/components/schemas/CreateTransactionRequest'
|
|
541
|
-
responses:
|
|
542
|
-
'201':
|
|
543
|
-
description: Transaction created successfully
|
|
544
|
-
content:
|
|
545
|
-
application/json:
|
|
546
|
-
schema:
|
|
547
|
-
$ref: '#/components/schemas/Transaction'
|
|
548
|
-
'400':
|
|
549
|
-
description: Invalid input
|
|
550
|
-
'401':
|
|
551
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
552
|
-
|
|
553
|
-
get:
|
|
554
|
-
summary: Get all transactions
|
|
555
|
-
parameters:
|
|
556
|
-
- name: month
|
|
557
|
-
in: query
|
|
558
|
-
required: false
|
|
559
|
-
schema:
|
|
560
|
-
type: string
|
|
561
|
-
pattern: "^\\d{4}-\\d{2}$"
|
|
562
|
-
description: Filter transactions by month (YYYY-MM format)
|
|
563
|
-
example: "2026-03"
|
|
564
|
-
responses:
|
|
565
|
-
'200':
|
|
566
|
-
description: List of transactions
|
|
567
|
-
content:
|
|
568
|
-
application/json:
|
|
569
|
-
schema:
|
|
570
|
-
type: array
|
|
571
|
-
items:
|
|
572
|
-
$ref: '#/components/schemas/Transaction'
|
|
573
|
-
'401':
|
|
574
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
575
|
-
|
|
576
|
-
/transactions/{id}/pay:
|
|
577
|
-
patch:
|
|
578
|
-
summary: Mark a transaction as paid/received
|
|
579
|
-
parameters:
|
|
580
|
-
- name: id
|
|
581
|
-
in: path
|
|
582
|
-
required: true
|
|
583
|
-
schema:
|
|
584
|
-
type: string
|
|
585
|
-
description: Transaction ID
|
|
586
|
-
responses:
|
|
587
|
-
'200':
|
|
588
|
-
description: Transaction marked as paid
|
|
589
|
-
content:
|
|
590
|
-
application/json:
|
|
591
|
-
schema:
|
|
592
|
-
$ref: '#/components/schemas/Transaction'
|
|
593
|
-
'401':
|
|
594
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
595
|
-
'404':
|
|
596
|
-
description: Transaction not found
|
|
597
|
-
|
|
598
|
-
/transactions/{id}:
|
|
599
|
-
delete:
|
|
600
|
-
summary: Delete a transaction
|
|
601
|
-
parameters:
|
|
602
|
-
- name: id
|
|
603
|
-
in: path
|
|
604
|
-
required: true
|
|
605
|
-
schema:
|
|
606
|
-
type: string
|
|
607
|
-
description: Transaction ID
|
|
608
|
-
responses:
|
|
609
|
-
'200':
|
|
610
|
-
description: Transaction deleted successfully
|
|
611
|
-
'401':
|
|
612
|
-
$ref: '#/components/responses/UnauthorizedError'
|
|
613
|
-
'404':
|
|
614
|
-
description: Transaction not found
|
|
615
|
-
|
|
616
|
-
/summary:
|
|
617
|
-
get:
|
|
618
|
-
summary: Get monthly financial summary
|
|
619
|
-
parameters:
|
|
620
|
-
- name: month
|
|
621
|
-
in: query
|
|
622
|
-
required: true
|
|
623
|
-
schema:
|
|
624
|
-
type: string
|
|
625
|
-
pattern: "^\\d{4}-\\d{2}$"
|
|
626
|
-
description: Month in YYYY-MM format
|
|
627
|
-
example: "2026-03"
|
|
628
|
-
responses:
|
|
629
|
-
'200':
|
|
630
|
-
description: Monthly financial summary
|
|
631
|
-
content:
|
|
632
|
-
application/json:
|
|
633
|
-
schema:
|
|
634
|
-
$ref: '#/components/schemas/Summary'
|
|
635
|
-
'401':
|
|
1
|
+
openapi: 3.0.0
|
|
2
|
+
info:
|
|
3
|
+
title: Quantix Personal Finance Manager API
|
|
4
|
+
description: API for managing personal finances including transactions, credit cards, categories, and recurring payments
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
contact:
|
|
7
|
+
name: Quantix Support
|
|
8
|
+
email: support@quantix.example.com
|
|
9
|
+
|
|
10
|
+
servers:
|
|
11
|
+
- url: https://api.quantix.example.com
|
|
12
|
+
description: Production server
|
|
13
|
+
- url: https://staging.quantix.example.com
|
|
14
|
+
description: Staging server
|
|
15
|
+
|
|
16
|
+
components:
|
|
17
|
+
securitySchemes:
|
|
18
|
+
ApiKeyAuth:
|
|
19
|
+
type: apiKey
|
|
20
|
+
in: header
|
|
21
|
+
name: API-KEY
|
|
22
|
+
description: API key for authentication, configured via QUANTIX_API_KEY environment variable
|
|
23
|
+
|
|
24
|
+
schemas:
|
|
25
|
+
Category:
|
|
26
|
+
type: object
|
|
27
|
+
required:
|
|
28
|
+
- name
|
|
29
|
+
- type
|
|
30
|
+
properties:
|
|
31
|
+
id:
|
|
32
|
+
type: string
|
|
33
|
+
description: Unique identifier for the category
|
|
34
|
+
example: "cat_123456789"
|
|
35
|
+
name:
|
|
36
|
+
type: string
|
|
37
|
+
description: Name of the category
|
|
38
|
+
example: "Groceries"
|
|
39
|
+
type:
|
|
40
|
+
type: string
|
|
41
|
+
enum: [INCOME, EXPENSE]
|
|
42
|
+
description: Type of the category
|
|
43
|
+
example: "EXPENSE"
|
|
44
|
+
createdAt:
|
|
45
|
+
type: string
|
|
46
|
+
format: date-time
|
|
47
|
+
description: Timestamp when the category was created
|
|
48
|
+
example: "2026-01-30T10:00:00Z"
|
|
49
|
+
|
|
50
|
+
Transaction:
|
|
51
|
+
type: object
|
|
52
|
+
required:
|
|
53
|
+
- type
|
|
54
|
+
- name
|
|
55
|
+
- amount
|
|
56
|
+
- date
|
|
57
|
+
properties:
|
|
58
|
+
id:
|
|
59
|
+
type: string
|
|
60
|
+
description: Unique identifier for the transaction
|
|
61
|
+
example: "txn_123456789"
|
|
62
|
+
type:
|
|
63
|
+
type: string
|
|
64
|
+
enum: [INCOME, EXPENSE]
|
|
65
|
+
description: Type of the transaction
|
|
66
|
+
example: "EXPENSE"
|
|
67
|
+
name:
|
|
68
|
+
type: string
|
|
69
|
+
description: Description of the transaction
|
|
70
|
+
example: "Weekly groceries"
|
|
71
|
+
amount:
|
|
72
|
+
type: number
|
|
73
|
+
format: float
|
|
74
|
+
minimum: 0
|
|
75
|
+
description: Amount of the transaction
|
|
76
|
+
example: 125.75
|
|
77
|
+
date:
|
|
78
|
+
type: string
|
|
79
|
+
format: date
|
|
80
|
+
description: Date of the transaction
|
|
81
|
+
example: "2026-01-30"
|
|
82
|
+
categoryId:
|
|
83
|
+
type: string
|
|
84
|
+
description: ID of the associated category
|
|
85
|
+
example: "cat_123456789"
|
|
86
|
+
paymentMethod:
|
|
87
|
+
type: string
|
|
88
|
+
enum: [CASH, PIX, DEBIT, CREDIT]
|
|
89
|
+
description: Method of payment
|
|
90
|
+
example: "CREDIT"
|
|
91
|
+
creditCardId:
|
|
92
|
+
type: string
|
|
93
|
+
description: ID of the associated credit card (required if paymentMethod is CREDIT)
|
|
94
|
+
example: "cc_123456789"
|
|
95
|
+
installmentGroupId:
|
|
96
|
+
type: string
|
|
97
|
+
description: ID to group installment transactions
|
|
98
|
+
example: "ig_123456789"
|
|
99
|
+
installmentNumber:
|
|
100
|
+
type: integer
|
|
101
|
+
minimum: 1
|
|
102
|
+
description: Current installment number in a series
|
|
103
|
+
example: 2
|
|
104
|
+
installmentTotal:
|
|
105
|
+
type: integer
|
|
106
|
+
minimum: 1
|
|
107
|
+
description: Total number of installments in the series
|
|
108
|
+
example: 5
|
|
109
|
+
recurrenceRuleId:
|
|
110
|
+
type: string
|
|
111
|
+
description: ID of the associated recurrence rule
|
|
112
|
+
example: "rr_123456789"
|
|
113
|
+
paid:
|
|
114
|
+
type: boolean
|
|
115
|
+
default: false
|
|
116
|
+
description: Whether the transaction has been paid/received
|
|
117
|
+
example: true
|
|
118
|
+
createdAt:
|
|
119
|
+
type: string
|
|
120
|
+
format: date-time
|
|
121
|
+
description: Timestamp when the transaction was created
|
|
122
|
+
example: "2026-01-30T10:00:00Z"
|
|
123
|
+
|
|
124
|
+
CreditCard:
|
|
125
|
+
type: object
|
|
126
|
+
required:
|
|
127
|
+
- name
|
|
128
|
+
- limitAmount
|
|
129
|
+
- closingDay
|
|
130
|
+
- dueDay
|
|
131
|
+
properties:
|
|
132
|
+
id:
|
|
133
|
+
type: string
|
|
134
|
+
description: Unique identifier for the credit card
|
|
135
|
+
example: "cc_123456789"
|
|
136
|
+
name:
|
|
137
|
+
type: string
|
|
138
|
+
description: Name of the credit card
|
|
139
|
+
example: "Nubank Platinum"
|
|
140
|
+
brand:
|
|
141
|
+
type: string
|
|
142
|
+
description: Brand of the credit card
|
|
143
|
+
example: "Visa"
|
|
144
|
+
limitAmount:
|
|
145
|
+
type: number
|
|
146
|
+
format: float
|
|
147
|
+
minimum: 0
|
|
148
|
+
description: Credit limit of the card
|
|
149
|
+
example: 5000.00
|
|
150
|
+
closingDay:
|
|
151
|
+
type: integer
|
|
152
|
+
minimum: 1
|
|
153
|
+
maximum: 31
|
|
154
|
+
description: Day of the month when the billing cycle closes
|
|
155
|
+
example: 15
|
|
156
|
+
dueDay:
|
|
157
|
+
type: integer
|
|
158
|
+
minimum: 1
|
|
159
|
+
maximum: 31
|
|
160
|
+
description: Day of the month when the bill is due
|
|
161
|
+
example: 22
|
|
162
|
+
createdAt:
|
|
163
|
+
type: string
|
|
164
|
+
format: date-time
|
|
165
|
+
description: Timestamp when the credit card was added
|
|
166
|
+
example: "2026-01-30T10:00:00Z"
|
|
167
|
+
|
|
168
|
+
RecurrenceRule:
|
|
169
|
+
type: object
|
|
170
|
+
required:
|
|
171
|
+
- frequency
|
|
172
|
+
properties:
|
|
173
|
+
id:
|
|
174
|
+
type: string
|
|
175
|
+
description: Unique identifier for the recurrence rule
|
|
176
|
+
example: "rr_123456789"
|
|
177
|
+
frequency:
|
|
178
|
+
type: string
|
|
179
|
+
enum: [MONTHLY, WEEKLY, YEARLY]
|
|
180
|
+
description: Frequency of recurrence
|
|
181
|
+
example: "MONTHLY"
|
|
182
|
+
interval:
|
|
183
|
+
type: integer
|
|
184
|
+
minimum: 1
|
|
185
|
+
default: 1
|
|
186
|
+
description: Interval multiplier for the frequency
|
|
187
|
+
example: 1
|
|
188
|
+
endDate:
|
|
189
|
+
type: string
|
|
190
|
+
format: date
|
|
191
|
+
description: Date when the recurrence should end
|
|
192
|
+
example: "2026-12-31"
|
|
193
|
+
createdAt:
|
|
194
|
+
type: string
|
|
195
|
+
format: date-time
|
|
196
|
+
description: Timestamp when the recurrence rule was created
|
|
197
|
+
example: "2026-01-30T10:00:00Z"
|
|
198
|
+
|
|
199
|
+
Statement:
|
|
200
|
+
type: object
|
|
201
|
+
properties:
|
|
202
|
+
cardId:
|
|
203
|
+
type: string
|
|
204
|
+
description: ID of the credit card
|
|
205
|
+
example: "cc_123456789"
|
|
206
|
+
periodStart:
|
|
207
|
+
type: string
|
|
208
|
+
format: date
|
|
209
|
+
description: Start date of the billing period
|
|
210
|
+
example: "2026-02-16"
|
|
211
|
+
periodEnd:
|
|
212
|
+
type: string
|
|
213
|
+
format: date
|
|
214
|
+
description: End date of the billing period
|
|
215
|
+
example: "2026-03-15"
|
|
216
|
+
dueDate:
|
|
217
|
+
type: string
|
|
218
|
+
format: date
|
|
219
|
+
description: Due date of the statement
|
|
220
|
+
example: "2026-03-22"
|
|
221
|
+
transactions:
|
|
222
|
+
type: array
|
|
223
|
+
items:
|
|
224
|
+
$ref: '#/components/schemas/Transaction'
|
|
225
|
+
description: List of transactions in the statement period
|
|
226
|
+
total:
|
|
227
|
+
type: number
|
|
228
|
+
format: float
|
|
229
|
+
description: Total amount of the statement
|
|
230
|
+
example: 3450.00
|
|
231
|
+
availableLimit:
|
|
232
|
+
type: number
|
|
233
|
+
format: float
|
|
234
|
+
description: Available credit limit
|
|
235
|
+
example: 1550.00
|
|
236
|
+
|
|
237
|
+
Summary:
|
|
238
|
+
type: object
|
|
239
|
+
properties:
|
|
240
|
+
month:
|
|
241
|
+
type: string
|
|
242
|
+
description: Month for the summary (YYYY-MM format)
|
|
243
|
+
example: "2026-03"
|
|
244
|
+
income:
|
|
245
|
+
type: number
|
|
246
|
+
format: float
|
|
247
|
+
description: Total income for the month
|
|
248
|
+
example: 10000.00
|
|
249
|
+
expenses:
|
|
250
|
+
type: number
|
|
251
|
+
format: float
|
|
252
|
+
description: Total expenses for the month
|
|
253
|
+
example: 4000.00
|
|
254
|
+
creditCardStatements:
|
|
255
|
+
type: array
|
|
256
|
+
items:
|
|
257
|
+
type: object
|
|
258
|
+
properties:
|
|
259
|
+
cardName:
|
|
260
|
+
type: string
|
|
261
|
+
description: Name of the credit card
|
|
262
|
+
example: "Nubank"
|
|
263
|
+
dueDate:
|
|
264
|
+
type: string
|
|
265
|
+
format: date
|
|
266
|
+
description: Due date of the statement
|
|
267
|
+
example: "2026-03-22"
|
|
268
|
+
total:
|
|
269
|
+
type: number
|
|
270
|
+
format: float
|
|
271
|
+
description: Total amount of the statement
|
|
272
|
+
example: 2500.00
|
|
273
|
+
balance:
|
|
274
|
+
type: number
|
|
275
|
+
format: float
|
|
276
|
+
description: Net balance (income - expenses)
|
|
277
|
+
example: 3500.00
|
|
278
|
+
|
|
279
|
+
CreateTransactionRequest:
|
|
280
|
+
type: object
|
|
281
|
+
required:
|
|
282
|
+
- type
|
|
283
|
+
- name
|
|
284
|
+
- amount
|
|
285
|
+
- date
|
|
286
|
+
properties:
|
|
287
|
+
type:
|
|
288
|
+
$ref: '#/components/schemas/Transaction/properties/type'
|
|
289
|
+
name:
|
|
290
|
+
$ref: '#/components/schemas/Transaction/properties/name'
|
|
291
|
+
amount:
|
|
292
|
+
$ref: '#/components/schemas/Transaction/properties/amount'
|
|
293
|
+
date:
|
|
294
|
+
$ref: '#/components/schemas/Transaction/properties/date'
|
|
295
|
+
categoryId:
|
|
296
|
+
$ref: '#/components/schemas/Transaction/properties/categoryId'
|
|
297
|
+
paymentMethod:
|
|
298
|
+
$ref: '#/components/schemas/Transaction/properties/paymentMethod'
|
|
299
|
+
creditCardId:
|
|
300
|
+
$ref: '#/components/schemas/Transaction/properties/creditCardId'
|
|
301
|
+
installments:
|
|
302
|
+
type: integer
|
|
303
|
+
minimum: 1
|
|
304
|
+
description: Number of installments (optional)
|
|
305
|
+
example: 3
|
|
306
|
+
targetDueMonth:
|
|
307
|
+
type: string
|
|
308
|
+
pattern: "^\\d{4}-\\d{2}$"
|
|
309
|
+
description: Target month for due date in YYYY-MM format (optional)
|
|
310
|
+
example: "2026-03"
|
|
311
|
+
recurrence:
|
|
312
|
+
type: object
|
|
313
|
+
properties:
|
|
314
|
+
frequency:
|
|
315
|
+
$ref: '#/components/schemas/RecurrenceRule/properties/frequency'
|
|
316
|
+
interval:
|
|
317
|
+
$ref: '#/components/schemas/RecurrenceRule/properties/interval'
|
|
318
|
+
endDate:
|
|
319
|
+
$ref: '#/components/schemas/RecurrenceRule/properties/endDate'
|
|
320
|
+
|
|
321
|
+
responses:
|
|
322
|
+
UnauthorizedError:
|
|
323
|
+
description: API key is missing or invalid
|
|
324
|
+
content:
|
|
325
|
+
application/json:
|
|
326
|
+
schema:
|
|
327
|
+
type: object
|
|
328
|
+
properties:
|
|
329
|
+
statusCode:
|
|
330
|
+
type: integer
|
|
331
|
+
example: 401
|
|
332
|
+
error:
|
|
333
|
+
type: string
|
|
334
|
+
example: "Unauthorized"
|
|
335
|
+
message:
|
|
336
|
+
type: string
|
|
337
|
+
example: "Invalid API key"
|
|
338
|
+
|
|
339
|
+
security:
|
|
340
|
+
- ApiKeyAuth: []
|
|
341
|
+
|
|
342
|
+
paths:
|
|
343
|
+
/categories:
|
|
344
|
+
post:
|
|
345
|
+
summary: Create a new category
|
|
346
|
+
requestBody:
|
|
347
|
+
required: true
|
|
348
|
+
content:
|
|
349
|
+
application/json:
|
|
350
|
+
schema:
|
|
351
|
+
type: object
|
|
352
|
+
required:
|
|
353
|
+
- name
|
|
354
|
+
- type
|
|
355
|
+
properties:
|
|
356
|
+
name:
|
|
357
|
+
type: string
|
|
358
|
+
example: "Groceries"
|
|
359
|
+
type:
|
|
360
|
+
type: string
|
|
361
|
+
enum: [INCOME, EXPENSE]
|
|
362
|
+
example: "EXPENSE"
|
|
363
|
+
responses:
|
|
364
|
+
'201':
|
|
365
|
+
description: Category created successfully
|
|
366
|
+
content:
|
|
367
|
+
application/json:
|
|
368
|
+
schema:
|
|
369
|
+
$ref: '#/components/schemas/Category'
|
|
370
|
+
'400':
|
|
371
|
+
description: Invalid input
|
|
372
|
+
'401':
|
|
373
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
374
|
+
|
|
375
|
+
get:
|
|
376
|
+
summary: Get all categories
|
|
377
|
+
responses:
|
|
378
|
+
'200':
|
|
379
|
+
description: List of categories
|
|
380
|
+
content:
|
|
381
|
+
application/json:
|
|
382
|
+
schema:
|
|
383
|
+
type: array
|
|
384
|
+
items:
|
|
385
|
+
$ref: '#/components/schemas/Category'
|
|
386
|
+
'401':
|
|
387
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
388
|
+
|
|
389
|
+
/categories/{id}:
|
|
390
|
+
delete:
|
|
391
|
+
summary: Delete a category
|
|
392
|
+
parameters:
|
|
393
|
+
- name: id
|
|
394
|
+
in: path
|
|
395
|
+
required: true
|
|
396
|
+
schema:
|
|
397
|
+
type: string
|
|
398
|
+
description: Category ID
|
|
399
|
+
responses:
|
|
400
|
+
'200':
|
|
401
|
+
description: Category deleted successfully
|
|
402
|
+
'401':
|
|
403
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
404
|
+
'404':
|
|
405
|
+
description: Category not found
|
|
406
|
+
|
|
407
|
+
/credit-cards:
|
|
408
|
+
post:
|
|
409
|
+
summary: Create a new credit card
|
|
410
|
+
requestBody:
|
|
411
|
+
required: true
|
|
412
|
+
content:
|
|
413
|
+
application/json:
|
|
414
|
+
schema:
|
|
415
|
+
type: object
|
|
416
|
+
required:
|
|
417
|
+
- name
|
|
418
|
+
- limitAmount
|
|
419
|
+
- closingDay
|
|
420
|
+
- dueDay
|
|
421
|
+
properties:
|
|
422
|
+
name:
|
|
423
|
+
type: string
|
|
424
|
+
example: "Nubank Platinum"
|
|
425
|
+
brand:
|
|
426
|
+
type: string
|
|
427
|
+
example: "Visa"
|
|
428
|
+
limitAmount:
|
|
429
|
+
type: number
|
|
430
|
+
format: float
|
|
431
|
+
example: 5000.00
|
|
432
|
+
closingDay:
|
|
433
|
+
type: integer
|
|
434
|
+
minimum: 1
|
|
435
|
+
maximum: 31
|
|
436
|
+
example: 15
|
|
437
|
+
dueDay:
|
|
438
|
+
type: integer
|
|
439
|
+
minimum: 1
|
|
440
|
+
maximum: 31
|
|
441
|
+
example: 22
|
|
442
|
+
responses:
|
|
443
|
+
'201':
|
|
444
|
+
description: Credit card created successfully
|
|
445
|
+
content:
|
|
446
|
+
application/json:
|
|
447
|
+
schema:
|
|
448
|
+
$ref: '#/components/schemas/CreditCard'
|
|
449
|
+
'400':
|
|
450
|
+
description: Invalid input
|
|
451
|
+
'401':
|
|
452
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
453
|
+
|
|
454
|
+
get:
|
|
455
|
+
summary: Get all credit cards
|
|
456
|
+
responses:
|
|
457
|
+
'200':
|
|
458
|
+
description: List of credit cards
|
|
459
|
+
content:
|
|
460
|
+
application/json:
|
|
461
|
+
schema:
|
|
462
|
+
type: array
|
|
463
|
+
items:
|
|
464
|
+
$ref: '#/components/schemas/CreditCard'
|
|
465
|
+
'401':
|
|
466
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
467
|
+
|
|
468
|
+
/credit-cards/{id}/statement:
|
|
469
|
+
get:
|
|
470
|
+
summary: Get credit card statement for a specific month
|
|
471
|
+
parameters:
|
|
472
|
+
- name: id
|
|
473
|
+
in: path
|
|
474
|
+
required: true
|
|
475
|
+
schema:
|
|
476
|
+
type: string
|
|
477
|
+
description: Credit card ID
|
|
478
|
+
- name: month
|
|
479
|
+
in: query
|
|
480
|
+
required: true
|
|
481
|
+
schema:
|
|
482
|
+
type: string
|
|
483
|
+
pattern: "^\\d{4}-\\d{2}$"
|
|
484
|
+
description: Month in YYYY-MM format
|
|
485
|
+
example: "2026-03"
|
|
486
|
+
responses:
|
|
487
|
+
'200':
|
|
488
|
+
description: Credit card statement
|
|
489
|
+
content:
|
|
490
|
+
application/json:
|
|
491
|
+
schema:
|
|
492
|
+
$ref: '#/components/schemas/Statement'
|
|
493
|
+
'401':
|
|
494
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
495
|
+
'404':
|
|
496
|
+
description: Credit card not found
|
|
497
|
+
|
|
498
|
+
/credit-cards/{id}/pay-statement:
|
|
499
|
+
post:
|
|
500
|
+
summary: Mark all transactions in a credit card statement as paid
|
|
501
|
+
parameters:
|
|
502
|
+
- name: id
|
|
503
|
+
in: path
|
|
504
|
+
required: true
|
|
505
|
+
schema:
|
|
506
|
+
type: string
|
|
507
|
+
description: Credit card ID
|
|
508
|
+
- name: month
|
|
509
|
+
in: query
|
|
510
|
+
required: true
|
|
511
|
+
schema:
|
|
512
|
+
type: string
|
|
513
|
+
pattern: "^\\d{4}-\\d{2}$"
|
|
514
|
+
description: Month in YYYY-MM format
|
|
515
|
+
example: "2026-03"
|
|
516
|
+
responses:
|
|
517
|
+
'200':
|
|
518
|
+
description: Statement marked as paid
|
|
519
|
+
content:
|
|
520
|
+
application/json:
|
|
521
|
+
schema:
|
|
522
|
+
type: object
|
|
523
|
+
properties:
|
|
524
|
+
message:
|
|
525
|
+
type: string
|
|
526
|
+
example: "Statement for March 2026 marked as paid"
|
|
527
|
+
'401':
|
|
528
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
529
|
+
'404':
|
|
530
|
+
description: Credit card or statement not found
|
|
531
|
+
|
|
532
|
+
/transactions:
|
|
533
|
+
post:
|
|
534
|
+
summary: Create a new transaction
|
|
535
|
+
requestBody:
|
|
536
|
+
required: true
|
|
537
|
+
content:
|
|
538
|
+
application/json:
|
|
539
|
+
schema:
|
|
540
|
+
$ref: '#/components/schemas/CreateTransactionRequest'
|
|
541
|
+
responses:
|
|
542
|
+
'201':
|
|
543
|
+
description: Transaction created successfully
|
|
544
|
+
content:
|
|
545
|
+
application/json:
|
|
546
|
+
schema:
|
|
547
|
+
$ref: '#/components/schemas/Transaction'
|
|
548
|
+
'400':
|
|
549
|
+
description: Invalid input
|
|
550
|
+
'401':
|
|
551
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
552
|
+
|
|
553
|
+
get:
|
|
554
|
+
summary: Get all transactions
|
|
555
|
+
parameters:
|
|
556
|
+
- name: month
|
|
557
|
+
in: query
|
|
558
|
+
required: false
|
|
559
|
+
schema:
|
|
560
|
+
type: string
|
|
561
|
+
pattern: "^\\d{4}-\\d{2}$"
|
|
562
|
+
description: Filter transactions by month (YYYY-MM format)
|
|
563
|
+
example: "2026-03"
|
|
564
|
+
responses:
|
|
565
|
+
'200':
|
|
566
|
+
description: List of transactions
|
|
567
|
+
content:
|
|
568
|
+
application/json:
|
|
569
|
+
schema:
|
|
570
|
+
type: array
|
|
571
|
+
items:
|
|
572
|
+
$ref: '#/components/schemas/Transaction'
|
|
573
|
+
'401':
|
|
574
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
575
|
+
|
|
576
|
+
/transactions/{id}/pay:
|
|
577
|
+
patch:
|
|
578
|
+
summary: Mark a transaction as paid/received
|
|
579
|
+
parameters:
|
|
580
|
+
- name: id
|
|
581
|
+
in: path
|
|
582
|
+
required: true
|
|
583
|
+
schema:
|
|
584
|
+
type: string
|
|
585
|
+
description: Transaction ID
|
|
586
|
+
responses:
|
|
587
|
+
'200':
|
|
588
|
+
description: Transaction marked as paid
|
|
589
|
+
content:
|
|
590
|
+
application/json:
|
|
591
|
+
schema:
|
|
592
|
+
$ref: '#/components/schemas/Transaction'
|
|
593
|
+
'401':
|
|
594
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
595
|
+
'404':
|
|
596
|
+
description: Transaction not found
|
|
597
|
+
|
|
598
|
+
/transactions/{id}:
|
|
599
|
+
delete:
|
|
600
|
+
summary: Delete a transaction
|
|
601
|
+
parameters:
|
|
602
|
+
- name: id
|
|
603
|
+
in: path
|
|
604
|
+
required: true
|
|
605
|
+
schema:
|
|
606
|
+
type: string
|
|
607
|
+
description: Transaction ID
|
|
608
|
+
responses:
|
|
609
|
+
'200':
|
|
610
|
+
description: Transaction deleted successfully
|
|
611
|
+
'401':
|
|
612
|
+
$ref: '#/components/responses/UnauthorizedError'
|
|
613
|
+
'404':
|
|
614
|
+
description: Transaction not found
|
|
615
|
+
|
|
616
|
+
/summary:
|
|
617
|
+
get:
|
|
618
|
+
summary: Get monthly financial summary
|
|
619
|
+
parameters:
|
|
620
|
+
- name: month
|
|
621
|
+
in: query
|
|
622
|
+
required: true
|
|
623
|
+
schema:
|
|
624
|
+
type: string
|
|
625
|
+
pattern: "^\\d{4}-\\d{2}$"
|
|
626
|
+
description: Month in YYYY-MM format
|
|
627
|
+
example: "2026-03"
|
|
628
|
+
responses:
|
|
629
|
+
'200':
|
|
630
|
+
description: Monthly financial summary
|
|
631
|
+
content:
|
|
632
|
+
application/json:
|
|
633
|
+
schema:
|
|
634
|
+
$ref: '#/components/schemas/Summary'
|
|
635
|
+
'401':
|
|
636
636
|
$ref: '#/components/responses/UnauthorizedError'
|