Add lock files for package management and update architecture documentation
- Introduced bun.lock and package-lock.json to manage dependencies for the project. - Enhanced backend API architecture documentation with additional security and documentation guidelines. - Made minor formatting adjustments across various files for consistency and clarity.
This commit is contained in:
@@ -42,9 +42,9 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
withStats: {
|
||||
type: 'string',
|
||||
enum: ['true', 'false'],
|
||||
description: 'Include statistics for each category',
|
||||
},
|
||||
},
|
||||
description: 'Include statistics for each category'
|
||||
}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
200: {
|
||||
@@ -61,14 +61,14 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
description: {type: 'string', nullable: true},
|
||||
color: {type: 'string', nullable: true},
|
||||
createdAt: {type: 'string'},
|
||||
updatedAt: {type: 'string'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
updatedAt: {type: 'string'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
categoryController.getAll.bind(categoryController)
|
||||
);
|
||||
@@ -86,8 +86,8 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
params: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {type: 'string'},
|
||||
},
|
||||
id: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
200: {
|
||||
@@ -102,13 +102,13 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
description: {type: 'string', nullable: true},
|
||||
color: {type: 'string', nullable: true},
|
||||
createdAt: {type: 'string'},
|
||||
updatedAt: {type: 'string'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
updatedAt: {type: 'string'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
categoryController.getOne.bind(categoryController)
|
||||
);
|
||||
@@ -129,19 +129,19 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
properties: {
|
||||
name: {type: 'string', minLength: 1, maxLength: 255},
|
||||
description: {type: 'string'},
|
||||
color: {type: 'string', pattern: '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'},
|
||||
},
|
||||
color: {type: 'string', pattern: '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
201: {
|
||||
description: 'Debt category created successfully',
|
||||
type: 'object',
|
||||
properties: {
|
||||
category: {type: 'object'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
category: {type: 'object'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
categoryController.create.bind(categoryController)
|
||||
);
|
||||
@@ -159,27 +159,27 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
params: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {type: 'string'},
|
||||
},
|
||||
id: {type: 'string'}
|
||||
}
|
||||
},
|
||||
body: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: {type: 'string', minLength: 1, maxLength: 255},
|
||||
description: {type: 'string'},
|
||||
color: {type: 'string', pattern: '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'},
|
||||
},
|
||||
color: {type: 'string', pattern: '^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
200: {
|
||||
description: 'Debt category updated successfully',
|
||||
type: 'object',
|
||||
properties: {
|
||||
category: {type: 'object'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
category: {type: 'object'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
categoryController.update.bind(categoryController)
|
||||
);
|
||||
@@ -197,16 +197,16 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
params: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {type: 'string'},
|
||||
},
|
||||
id: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
204: {
|
||||
description: 'Debt category deleted successfully',
|
||||
type: 'null',
|
||||
},
|
||||
},
|
||||
},
|
||||
type: 'null'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
categoryController.delete.bind(categoryController)
|
||||
);
|
||||
@@ -227,19 +227,19 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
type: 'object',
|
||||
properties: {
|
||||
withStats: {type: 'string', enum: ['true', 'false']},
|
||||
categoryId: {type: 'string', description: 'Filter by category ID'},
|
||||
},
|
||||
categoryId: {type: 'string', description: 'Filter by category ID'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
200: {
|
||||
description: 'List of debt accounts',
|
||||
type: 'object',
|
||||
properties: {
|
||||
accounts: {type: 'array', items: {type: 'object'}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
accounts: {type: 'array', items: {type: 'object'}}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
accountController.getAll.bind(accountController)
|
||||
);
|
||||
@@ -259,11 +259,11 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
description: 'Total debt',
|
||||
type: 'object',
|
||||
properties: {
|
||||
totalDebt: {type: 'number'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
totalDebt: {type: 'number'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
accountController.getTotalDebt.bind(accountController)
|
||||
);
|
||||
@@ -281,19 +281,19 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
params: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {type: 'string'},
|
||||
},
|
||||
id: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
200: {
|
||||
description: 'Debt account details',
|
||||
type: 'object',
|
||||
properties: {
|
||||
account: {type: 'object'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
account: {type: 'object'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
accountController.getOne.bind(accountController)
|
||||
);
|
||||
@@ -321,19 +321,19 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
interestRate: {type: 'number', minimum: 0, maximum: 100},
|
||||
minimumPayment: {type: 'number', minimum: 0},
|
||||
dueDate: {type: 'string', format: 'date-time'},
|
||||
notes: {type: 'string'},
|
||||
},
|
||||
notes: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
201: {
|
||||
description: 'Debt account created successfully',
|
||||
type: 'object',
|
||||
properties: {
|
||||
account: {type: 'object'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
account: {type: 'object'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
accountController.create.bind(accountController)
|
||||
);
|
||||
@@ -351,8 +351,8 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
params: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {type: 'string'},
|
||||
},
|
||||
id: {type: 'string'}
|
||||
}
|
||||
},
|
||||
body: {
|
||||
type: 'object',
|
||||
@@ -364,19 +364,19 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
interestRate: {type: 'number', minimum: 0, maximum: 100},
|
||||
minimumPayment: {type: 'number', minimum: 0},
|
||||
dueDate: {type: 'string', format: 'date-time'},
|
||||
notes: {type: 'string'},
|
||||
},
|
||||
notes: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
200: {
|
||||
description: 'Debt account updated successfully',
|
||||
type: 'object',
|
||||
properties: {
|
||||
account: {type: 'object'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
account: {type: 'object'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
accountController.update.bind(accountController)
|
||||
);
|
||||
@@ -394,16 +394,16 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
params: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {type: 'string'},
|
||||
},
|
||||
id: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
204: {
|
||||
description: 'Debt account deleted successfully',
|
||||
type: 'null',
|
||||
},
|
||||
},
|
||||
},
|
||||
type: 'null'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
accountController.delete.bind(accountController)
|
||||
);
|
||||
@@ -425,19 +425,19 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
properties: {
|
||||
accountId: {type: 'string', description: 'Filter by account ID'},
|
||||
startDate: {type: 'string', format: 'date-time'},
|
||||
endDate: {type: 'string', format: 'date-time'},
|
||||
},
|
||||
endDate: {type: 'string', format: 'date-time'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
200: {
|
||||
description: 'List of debt payments',
|
||||
type: 'object',
|
||||
properties: {
|
||||
payments: {type: 'array', items: {type: 'object'}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
payments: {type: 'array', items: {type: 'object'}}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
paymentController.getAll.bind(paymentController)
|
||||
);
|
||||
@@ -457,11 +457,11 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
description: 'Total payments',
|
||||
type: 'object',
|
||||
properties: {
|
||||
totalPayments: {type: 'number'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
totalPayments: {type: 'number'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
paymentController.getTotalPayments.bind(paymentController)
|
||||
);
|
||||
@@ -479,19 +479,19 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
params: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {type: 'string'},
|
||||
},
|
||||
id: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
200: {
|
||||
description: 'Debt payment details',
|
||||
type: 'object',
|
||||
properties: {
|
||||
payment: {type: 'object'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
payment: {type: 'object'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
paymentController.getOne.bind(paymentController)
|
||||
);
|
||||
@@ -513,19 +513,19 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
accountId: {type: 'string', format: 'uuid'},
|
||||
amount: {type: 'number', minimum: 0.01},
|
||||
paymentDate: {type: 'string', format: 'date-time'},
|
||||
notes: {type: 'string'},
|
||||
},
|
||||
notes: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
201: {
|
||||
description: 'Debt payment created successfully',
|
||||
type: 'object',
|
||||
properties: {
|
||||
payment: {type: 'object'},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
payment: {type: 'object'}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
paymentController.create.bind(paymentController)
|
||||
);
|
||||
@@ -543,16 +543,16 @@ export async function debtRoutes(fastify: FastifyInstance) {
|
||||
params: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {type: 'string'},
|
||||
},
|
||||
id: {type: 'string'}
|
||||
}
|
||||
},
|
||||
response: {
|
||||
204: {
|
||||
description: 'Debt payment deleted successfully',
|
||||
type: 'null',
|
||||
},
|
||||
},
|
||||
},
|
||||
type: 'null'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
paymentController.delete.bind(paymentController)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user