refactor(backend): add status constants and update code to use them
- Create constants/statuses.js with MATCH_STATUS, SUGGESTION_STATUS - Update routes/dashboard.js to use MATCH_STATUS - Update routes/matches.js to use MATCH_STATUS - Update routes/events.js to use SUGGESTION_STATUS - Update services/matching.js to use SUGGESTION_STATUS - Update tests to use constants
This commit is contained in:
6
backend/src/constants/index.js
Normal file
6
backend/src/constants/index.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const { MATCH_STATUS, SUGGESTION_STATUS } = require('./statuses');
|
||||
|
||||
module.exports = {
|
||||
MATCH_STATUS,
|
||||
SUGGESTION_STATUS,
|
||||
};
|
||||
24
backend/src/constants/statuses.js
Normal file
24
backend/src/constants/statuses.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Match status constants
|
||||
*/
|
||||
const MATCH_STATUS = {
|
||||
PENDING: 'pending',
|
||||
ACCEPTED: 'accepted',
|
||||
REJECTED: 'rejected',
|
||||
COMPLETED: 'completed',
|
||||
};
|
||||
|
||||
/**
|
||||
* Suggestion status constants (for auto-matching)
|
||||
*/
|
||||
const SUGGESTION_STATUS = {
|
||||
PENDING: 'pending',
|
||||
ACCEPTED: 'accepted',
|
||||
REJECTED: 'rejected',
|
||||
NOT_FOUND: 'not_found',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
MATCH_STATUS,
|
||||
SUGGESTION_STATUS,
|
||||
};
|
||||
Reference in New Issue
Block a user