Skip to content

Enhance documentation and refactor user management functions - #31

Merged
prinako merged 12 commits into
mainfrom
dev
Aug 2, 2026
Merged

prinako merged 12 commits into
mainfrom
dev

Conversation

@prinako

@prinako prinako commented Aug 2, 2026

Copy link
Copy Markdown
Owner

This pull request primarily improves documentation, code readability, and maintainability across the project. The most significant changes include clarifying and expanding the README.md for environment variables and deployment, adding JSDoc comments for better code understanding in backend repositories and services, and refactoring imports and utility usage in the Telegram bot source code.

Documentation improvements:

  • Expanded and clarified the environment variable descriptions in README.md, added security notes, and explained Compose/deployment nuances. Also documented new and legacy bot commands, clarified schema application, and improved local and production setup instructions. [1] [2] [3] [4] [5]

Backend code maintainability:

  • Added JSDoc comments to all major functions in backend/src/repositories/agenda.repository.js and backend/src/services/agenda.service.js for improved developer understanding and editor support. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
  • Fixed a bug in telegramDisplayName in users.repository.js to avoid concatenating undefined values and ensure a fallback to first name.

Telegram bot code refactoring:

  • Refactored imports in agenda_payment.js, paid.js, and someone_paid.js to use ES module syntax and improved utility usage (e.g., replaced getAgendaMemberDisplayName with getMemberName). [1] [2] [3] [4] [5]
  • Added missing logging and improved keyboard label generation in agenda_payment.js and someone_paid.js. [1] [2]

Code organization:

  • Moved utility imports to the top and removed commented-out legacy code in several bot files for clarity. [1] [2] [3]
  • Added a JSDoc comment to the registrationKey function in server.js for better documentation.

These changes collectively make the codebase easier to understand, maintain, and deploy.

prinako added 12 commits August 2, 2026 19:50
…tation

This commit enhances the agenda.repository.js file by adding JSDoc comments to various functions, providing clear descriptions of parameters and return values. This improves code readability and maintainability, facilitating better understanding for future developers working on the repository.
This commit refactors the telegramDisplayName function in users.repository.js by removing redundant checks for user display names. The function now directly constructs the display name from first and last names, improving clarity and efficiency in user data handling.
This commit enhances the agenda.service.js file by adding JSDoc comments to the createAgendaPayment, getAllAgendaPayments, getAgendaPaymentsByUser, getAgendaPayment, updateAgenda, and deleteAgenda functions. The comments provide clear descriptions of parameters and return values, improving code readability and maintainability for future developers.
…am user management

This commit introduces functionality to track Telegram user registrations and their memberships within the bot. It adds a new `trackTelegramUserAndMembership` function and a helper function `registrationKey` to generate unique keys for registration messages. Additionally, JSDoc comments are added to enhance code documentation, improving clarity and maintainability for future developers.
… imports

This commit refactors the AgendaPayment class by replacing the getAgendaMemberDisplayName function with getMemberName for improved clarity. Additionally, it consolidates and organizes import statements for better maintainability, enhancing the overall structure of the agenda_payment.js file.
This commit refactors the paid.js file by removing duplicate import statements and consolidating them into a single section. This enhances code clarity and maintainability by ensuring a cleaner structure for the import declarations.
This commit refactors the someone_paid.js file by replacing the getAgendaMemberDisplayName function with getMemberName for improved clarity. It also consolidates import statements, enhancing code organization and maintainability.
…etMemberName and add JSDoc comments

This commit refactors the agenda_formatter.js file by replacing the getAgendaMemberDisplayName function with getMemberName for improved clarity. It also adds JSDoc comments to the memberPaid function, enhancing code documentation and maintainability.
…names with fallback options

This commit introduces the getMemberName function, which consolidates various methods of retrieving a member's name from different properties. It includes a cleanText utility function to sanitize input values and ensures that the function returns the most appropriate name or identifier. JSDoc comments are added for improved documentation and maintainability.
…terTelegramUserAndMembership function

This commit enhances the registerTelegramUserAndMembership.js file by adding JSDoc comments to the registerTelegramUserAndMembership function. The comments provide clear descriptions of the function's parameters and return values, improving code readability and maintainability for future developers.
…ment class

This commit adds a missing line to generate the payment summary message in the AgendaPayment class. The change ensures that the summary is properly formatted and sent to the user, enhancing the functionality of the payment process.
…ployment instructions

This commit revises the README.md file to clarify the descriptions of environment variables, including `POSTGRES_PASSWORD`, `BACKEND_URL`, `ALLOWED_USERS`, and `ADMIN_USERS`. It also updates the deployment instructions to specify Node.js version requirements and improve clarity on the use of Docker and PostgreSQL. Additionally, a new bot command `/ia` is introduced, and the schema application process is detailed for better understanding.
@prinako prinako self-assigned this Aug 2, 2026
@prinako
prinako merged commit 77fcc37 into main Aug 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant