Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# yqni13 | $\texttt{\color{cornflowerblue}{SUPPORT}}$
### $\textsf{\color{brown}{v1.6.1}}$
### $\textsf{\color{brown}{v1.6.2}}$

#### Support hub - handling feedback/ratings (`/feedback`) and bug/support requests (`/tickets`) including file attachments across multiple applications via REST API. Built with NodeJS (Typescript), Express & PostgreSQL in Docker container using API-Key authentication and rate-limiting. Created following Test-Driven Development (450+ tests) and hosting env:prod via Render, Neon and Cloudflare.

Expand Down Expand Up @@ -215,8 +215,8 @@ Preventing an unwanted merge with unfinished/failed test run, the project is set
[see changelog for all updates](/docs/CHANGELOG.md)


$\textsf{[v1.6.0\ =>\ {\textbf{\color{brown}v1.6.1}]}}$ app<br>
- $\textsf{\color{orange}Patch:}$ Updated interfaces to remove "I" prefix and remove usages of "any" type.
$\textsf{[v1.6.1\ =>\ {\textbf{\color{brown}v1.6.2}]}}$ app<br>
- $\textsf{\color{orange}Patch:}$ Updated 'tickets' routes to prepare for HTTP method .query() to use for path '/search' (not available on current version of Express.js).

<br>

Expand Down
1,141 changes: 482 additions & 659 deletions backend/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "support_backend",
"version": "1.6.1",
"version": "1.6.2",
"appMeta": {
"db_version": "1.6.0",
"docker_image": "yqni13/support",
Expand Down Expand Up @@ -28,7 +28,7 @@
"body-parser": "^2.2.0",
"cors": "^2.8.5",
"dotenv": "^16.5.0",
"express": "^4.21.2",
"express": "^5.2.1",
"express-validator": "^7.2.1",
"glob": "^13.0.0",
"multer": "^2.0.2",
Expand All @@ -41,7 +41,7 @@
"@jest/globals": "^30.2.0",
"@testcontainers/postgresql": "^11.7.0",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.3",
"@types/express": "^5.0.6",
"@types/jest": "^30.0.0",
"@types/multer": "^2.0.0",
"@types/node": "^24.10.1",
Expand Down
1 change: 0 additions & 1 deletion backend/src/loaders/express.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export class ExpressLoader {

app.use(bodyParser.json());
app.use(cors());
app.options("*", cors());

return app;
}
Expand Down
7 changes: 6 additions & 1 deletion backend/src/loaders/middleware.loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import { errorMiddleware } from '../middleware/error.middleware';

export class MiddlewareLoader {
static init(app: Application) {
app.all('*', (req: Request, res: Response, next: NextFunction) => {
/**
* Express.js v5.x has change on internal regex
* Wildcard via '*' is invalid and needs /*splat or /{*splat} for root paths
* https://expressjs.com/en/guide/migrating-5/#path-syntax
*/
app.all('/*splat', (req: Request, res: Response, next: NextFunction) => {
res.send('SERVER: YQNI13_SUPPORT.\nSTATUS: ACTIVE.');
});

Expand Down
4 changes: 4 additions & 0 deletions backend/src/routes/tickets.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ router.post(
factory(ticketsController.postTicketsSearch)
);

// TODO(yqni13): implement as soon as official version contains new http method
// Definition to find in: node_modules/@types/express-serve-static-core/index.d.ts => IRouter
// router.query('/search', authAdmin(), searchSchema, factory(ticketsController.postTicketsSearch));

// create
router.post(
'/create',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,22 @@ describe('Integration-tests (repository), priority: entity Tickets', () => {
expect(testResponse.body).toMatchObject(testResult);
})

// Testing new HTTP method .query()
// test('Repository process fn findByFilter(), params: <client_id> result: null', async () => {
// const testParam_dto: TicketsFilterDTO = {
// client_id: mockId.clients.invalid[0] as ClientsId
// };
// const testResult: TicketsResponseDTO[] | null = null;

// await dbTestSetup.addTestData();
// const testResponse = await request(app)
// .query(`${apiUrl}/search`)
// .send(testParam_dto);

// expect(testResponse.statusCode).toBe(200);
// expect(testResponse.body).toBe(testResult);
// })

test('Repository process fn findByFilter(), params: <client_id> result: null', async () => {
const testParam_dto: TicketsFilterDTO = {
client_id: mockId.clients.invalid[0] as ClientsId
Expand Down
1 change: 0 additions & 1 deletion backend/tests/test-app.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export function createTestApp(middleware: any[], router: any, route: string) {

app.use(bodyParser.json());
app.use(cors());
app.options("*", cors());

if(middleware.length > 0) {
app.use(middleware);
Expand Down
9 changes: 8 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
## 📜 $\textsf{\color{salmon}{List\ of\ updates}}$

### $\textsf{\color{skyblue}2026/07/04}$

$\textsf{[v1.6.1\ =>\ {\textbf{\color{brown}v1.6.2}]}}$ app<br>
- $\textsf{\color{orange}Patch:}$ Updated 'tickets' routes to prepare for HTTP method .query() to use for path '/search' (not available on current version of Express.js).

<br>

### $\textsf{\color{skyblue}2026/05/08}$

$\textsf{[v1.6.0\ =>\ {\textbf{\color{brown}v1.6.1}]}}$ app<br>
$\textsf{[v1.6.0\ =>\ v1.6.1]}$ app<br>
- $\textsf{\color{orange}Patch:}$ Updated interfaces to remove "I" prefix and remove usages of "any" type.

<br>
Expand Down
Loading