Conversation
Collaborator
Author
|
@nut1414 pls help review |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds an end‐to‐end test scenario for the User Billing page while updating both backend and frontend components for billing and subscription functionality. Key changes include:
- Adding endpoints to trigger overdue and expired subscription actions in the backend and corresponding API client methods.
- Updating the data models, test fixtures, and E2E tests to support the new billing page scenario.
- Enhancing UI components with new data-testid attributes for more robust test automation.
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/pages/user/init.py | Updated exported page classes to include UserBillingPage. |
| test/e2e/pages/instance/instance_list_page.py | Added new element and method for instance list assertions. |
| test/e2e/data/models.py | Introduced TransactionData model for transaction-related fixtures. |
| test/e2e/data/constant.py | Added new enums for TransactionType and TransactionStatus. |
| test/e2e/conftest.py | Extended fixture configuration with new user marker support. |
| test/e2e/api/client.py | Introduced billing-related API methods. |
| frontend/src/pages/User/UserBillingPage.tsx | Added data-testid for the billing page container. |
| frontend/src/pages/Instance/InstanceListPage.tsx | Added data-testid for the instance list component. |
| frontend/src/hooks/User/useUserBilling.ts | Adjusted filtering to exclude scheduled transactions from response. |
| frontend/src/constant/CurrencyConstant.ts | Revised currency formatting for numbers to include decimals. |
| frontend/src/components/User/Billing/TopUpMenu.tsx | Added data-testid attributes for key interactive elements. |
| frontend/src/components/User/Billing/OverviewMenu.tsx | Added data-testid attributes for billing overview display items. |
| frontend/src/components/User/Billing/HistoryMenu.tsx | Added data-testid attribute to the history menu component. |
| frontend/src/components/Common/Table.tsx | Updated table markup with conditional data-testid for testing. |
| backend/src/core/startup.py | Adjusted billing worker startup to be conditional on test environment. |
| backend/src/core/sql/operations/subscription.py | Added utility to query subscription by instance identifier/name. |
| backend/src/core/sql/operations/billing.py | Modified upcoming payment computation to include overdue statuses. |
| backend/src/core/service/subscription.py | Changed subscription creation logic for setting payment dates. |
| backend/src/core/service/billing.py | Integrated test environment guard into billing trigger endpoints. |
| backend/src/core/routers/billing.py | Exposed new billing trigger endpoints via the API router. |
Comments suppressed due to low confidence (1)
backend/src/core/service/subscription.py:29
- Changing next_payment_date to the current time instead of adding PAYMENT_INTERVAL (as in the previous behavior) may result in subscriptions being due immediately. Verify that this intended logic is correct or consider reinstating the interval addition to ensure future-dated payments.
next_payment_date = DateTimeUtils.now_dt()
nut1414
requested changes
Apr 24, 2025
Owner
nut1414
left a comment
There was a problem hiding this comment.
This has been on my mind for awhile now: should we keep only one terminal/console? The current implementation have root terminal and console to login which I think will definitely raise some question to why have both.
nut1414
approved these changes
Apr 24, 2025
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
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.
Summary
Backend:
/billing/trigger/overdue/{instance_name},/billing/trigger/expired/{instance_name})OVERDUEtransactionTesting