-
Notifications
You must be signed in to change notification settings - Fork 1
Update prod #488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Update prod #488
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* feat(noti): added loop sender worker * fix tests * added numbers declension * fix lint * added examples for decl * Update workers/loop/src/provider.ts Co-authored-by: e11sy <130844513+e11sy@users.noreply.github.com> * Update workers/loop/src/provider.ts Co-authored-by: e11sy <130844513+e11sy@users.noreply.github.com> * fix tests --------- Co-authored-by: e11sy <130844513+e11sy@users.noreply.github.com>
* fix(js): use babel parser plugins based on type extension * fix(): comments * fix(): duplicated variable
* Localize block workspace email templates to Russian Translated block workspace email subject, text, and layout components from English to Russian to improve localization for Russian-speaking users. Updated button label and system name references accordingly. * Update block workspace email wording Rephrased notification messages in both HTML and text email templates for blocked workspaces to improve clarity and conciseness. * Update workers/email/src/templates/emails/block-workspace/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update block workspace email templates wording Revised subject and body text in block workspace email templates for clarity and consistency. The new wording emphasizes that the workspace no longer receives events and that users are not tracking new errors due to plan limits or expiration. * Update button label based on tariff plan The button label in the block workspace email template now changes to 'Увеличить лимит от 99₽' if the workspace's tariffPlanId matches a specific value, otherwise it remains 'Открыть настройки'. * Fix spacing in button label currency symbol Added a space between the amount and the ₽ currency symbol in the button label for improved readability in the block workspace email template. * Fix punctuation in block workspace email template Added a missing period and line break to improve readability and clarity in the block workspace notification email template. * Improve block workspace email template formatting Replaces line breaks with paragraph tags for better readability and updates Twig syntax for tariff plan comparison in the button label. --------- Co-authored-by: Peter <specc.dev@gmail.com>
* Add blocked workspace reminder email template Introduces a new email template for reminding users about blocked workspaces due to expired or depleted plans. Adds pluralization utility for Russian, updates template names, and includes logic to calculate days since the last payment. * Send reminder emails to blocked workspace admins Added logic to send reminder emails to admins of blocked workspaces at specific intervals after payday. Introduced the sendBlockedWorkspaceReminders method and updated tests to cover this new behavior. * Fix workspace retrieval and header in EmailTestServer Corrects the Content-Type header to include charset in sendHTML and fixes the getWorkspace method to properly return the workspace document. Also removes a redundant line in calculateDaysAfterPayday. * Add comments and eslint disables for magic numbers Added explanatory comments and disabled the @typescript-eslint/no-magic-numbers rule for specific lines in emailOverview.ts and paymaster/src/index.ts where magic numbers are used for date calculations and reminder scheduling. * Update index.test.ts * Update test to use expect.any(Number) for daysAfterPayday Replaces the hardcoded value for daysAfterPayday with expect.any(Number) in the blocked-workspace-reminder test payload to allow for dynamic number matching. * Move pluralize_ru macro from Twig to TypeScript extension Removed the utils.twig file and its pluralize_ru macro, replacing it with a TypeScript implementation registered as a Twig function in extensions.ts. Updated all template usages to call pluralize_ru directly, simplifying imports and improving maintainability. * Refactor blocked workspace reminder days to constant Introduced DAYS_AFTER_PAYDAY_TO_REMIND constant to define the days after payday when admins are reminded about blocked workspaces. Updated the logic to use this constant for better maintainability and clarity. * Fix test dates and assertions in PaymasterWorker tests Updated test dates and moved the blocked-workspace-reminder assertion to the correct test case in index.test.ts. This ensures the tests accurately reflect the intended scenarios and improve test reliability. * Add test for blocked workspace reminder after payday Introduces a test to verify that admins are reminded for blocked workspaces with active subscriptions when 3 days have passed since payday. Ensures the reminder includes the correct number of days after payday. * Rename daysBlocked to daysAfterPayday in reminder method Updated the sendBlockedWorkspaceReminders method to use 'daysAfterPayday' instead of 'daysBlocked' for clarity and consistency in parameter naming and payload structure. * Add eslint-disable for magic numbers in pluralize_ru Added eslint-disable-next-line comments to suppress magic number warnings in the pluralize_ru Twig function. This helps maintain code clarity while adhering to linting rules. * Update extensions.ts * Add blocked workspace reminder notification support Introduces handling for 'blocked-workspace-reminder' tasks in SenderWorker, including new types and template variables. Renames files for consistency and updates type exports to support the new notification event. * Update provider.ts * Add documentation to calculateDaysAfterPayday method Added JSDoc comments to the calculateDaysAfterPayday method in EmailTestServer to clarify its purpose and usage. This improves code readability and maintainability. * Simplify pluralization logic in blocked workspace emails Removed redundant ternary check for daysAfterPayday in pluralize_ru calls across HTML, subject, and text templates for blocked workspace reminder emails. This streamlines the template code and ensures consistent pluralization. * Update workers/email/scripts/emailOverview.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update workers/paymaster/tests/index.test.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update workers/paymaster/src/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update workers/paymaster/src/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update workers/email/src/templates/emails/blocked-workspace-reminder/subject.twig Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update workers/email/src/templates/emails/blocked-workspace-reminder/text.twig Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update workers/email/src/templates/emails/blocked-workspace-reminder/html.twig Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update workers/sender/types/sender-task/blocked-workspace-reminder.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update workers/sender/types/sender-task/blocked-workspace-reminder.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add lastChargeDate fallback to calculateDaysAfterPayday in email overview (#485) * Initial plan * Add fallback logic for lastChargeDate in calculateDaysAfterPayday Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Remove accidentally committed build artifacts Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Remove env-test.js build artifact Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Fix setMonth mutation issue in calculateDaysAfterPayday Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Clean up build artifacts Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Move MILLISECONDS_IN_DAY to module level Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Stop tracking build artifacts and update gitignore Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Fix grammar in MILLISECONDS_IN_DAY comment Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Expand test coverage for blocked workspace reminder days (#486) * Initial plan * Add comprehensive test coverage for blocked workspace reminder days Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com> * Update blocked workspace reminder email text Revised subject and body to emphasize required action and clarify that error monitoring is not working. The new wording provides clearer instructions for users to renew their subscription. * Group blocked workspace reminder tests Refactored blocked workspace reminder tests into a dedicated describe block for better organization and readability. * Refactor blocked workspace reminder tests Consolidated repetitive test logic for blocked workspace reminders into a reusable helper function. This improves maintainability and readability of the test suite by reducing code duplication. * Fix extra closing bracket in test suite Removed an unnecessary closing bracket in the PaymasterWorker test suite to correct the test structure. * Refactor payday calculation logic to shared utility Moved daysBeforePayday and daysAfterPayday functions to a new shared utility file (lib/utils/payday.ts) and updated emailOverview and paymaster worker to use these functions. This reduces code duplication and centralizes payday-related calculations. * Update workers/sender/src/index.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix spacing in blocked workspace email templates Added missing space after '{{' in variable references in subject and text templates for blocked workspace reminder emails to improve readability and consistency. * Update index.ts * Move updateLastNoticationDate call outside conditionals Refactored the code to call updateLastNoticationDate after processing notifications, regardless of whether the conditional block is entered. This ensures the last notification date is always updated for each workspace and event type. * Move updateLastNoticationDate call outside Promise.all Refactored the updateLastNoticationDate invocation to occur after Promise.all resolves, ensuring it is called once per method execution rather than for each iteration. * Fix typo in updateLastNotificationDate method name Renamed updateLastNoticationDate to updateLastNotificationDate for consistency and correctness across all usages in SenderWorker. * Update blocked-workspace-reminder.ts --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: talyguryn <15259299+talyguryn@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Auto-generated prod update suggestion