Conversation
Added new ETH Mainnet API URL
* Add Cause and CauseProject entities with relationships to User and Project - Introduced Cause entity with fields for title, description, funding details, and status. - Added CauseProject entity to manage relationships between Cause and Project. - Updated Project entity to include a reference to Cause. * Create migration files for Cause and CauseProject tables, and add causeId to Project table - Created Cause table with relevant fields and status enum. - Created CauseProject table to manage relationships between Cause and Project. - Updated Project table to include a foreign key reference to Cause. * Add cause and causeProject entities to the netities object * Enhance Cause entity with new status and listing status enums - Added CauseStatus enum with new values: REJECTED, PENDING, CLARIFICATION, VERIFICATION, DEACTIVE, CANCELLED, DRAFTED. - Introduced ListingStatus enum to manage cause listing states. - Registered enums for GraphQL usage and updated Cause entity to include listingStatus field with default value set to NotReviewed. * Refactor Cause and Project entities to support many-to-many relationships - Updated Cause entity to replace OneToMany relationship with Project to ManyToMany, adding activeProjectsCount field. - Modified Project entity to establish ManyToMany relationship with Cause, introducing activeCausesCount field. - Enhanced User entity to include ownedCauses and related counts for better tracking of user-owned causes. * Update cause status mapping and enhance User entity with totalCausesDonated field - Added a query to map expanded cause status values to original ones, consolidating various statuses into 'active' and 'deactivated'. - Enhanced User entity by introducing totalCausesDonated field to track the number of causes donated by the user.
Update scan api endpoints
Fixing API key
fix: adjust the estimated matching calculation to include Stellar donations
* Add CauseResolver and error messages for cause management - Integrated CauseResolver into the resolvers list to handle cause-related queries. - Added new error messages for cause management, including validations for existing causes and input errors. - Updated English and Spanish locale files to include new error messages for better user feedback. - Introduced a GraphQL mutation for creating causes, detailing required fields and expected response structure. * Add cause repository and test cases - Implemented causeRepository with functions to find, create, activate, and deactivate causes, including handling relationships with users and projects. - Added comprehensive test cases for all repository functions to ensure correct behavior and data integrity. - Included setup for test data and validation of expected outcomes in various scenarios. * Enhance CauseResolver and add new test scripts - Updated CauseResolver to improve input validation and error handling, including user authorization checks and logging. - Removed the ownerId argument from the createCause mutation and adjusted related logic accordingly. - Added new test scripts for causeResolver and causeRepository to ensure comprehensive coverage of the new functionality. - Enhanced GraphQL mutation to include owner and project details in the response. * Add validation for cause title and transaction verification * Enhance cause title validation and testing * Add findAllCauses and get cause by id functionality and related tests * Enhance cause creation process with transaction verification and update the tests * Add deposit transaction fields to Cause entity and implement validation - Introduced new fields `depositTxHash` and `depositTxChainId` to the Cause entity. - Added unique and not-null constraints for the new fields in the database migration. - Implemented validation for transaction hashes to prevent duplicates in the cause creation process. - Updated CauseResolver to include transaction hash validation during cause creation. - Enhanced tests to cover scenarios for duplicate transaction hashes. * Add expected cause creation fee amount validation and error messages - Introduced a new error message for when the expected cause creation fee amount is not set in environment variables. - Implemented validation in the transaction verification process to ensure the expected amount is provided. - Updated English and Spanish locale files to include the new error message for better user feedback. * Enhance causeRepository tests with deposit transaction validation * Refactor cause creation process to support multiple token contract addresses - Introduced a function to retrieve token contract addresses based on chain ID. - Updated the CauseResolver to utilize the new function for transaction verification. - Removed the hardcoded environment variable check for token contract address in favor of a more flexible approach. - Adjusted related tests to reflect the changes in the cause creation validation process. * Refactor createCause function to use transactional entity manager for improved reliability - Updated the cause creation process to utilize a transaction, ensuring atomicity and consistency. - Enhanced error handling by throwing a specific error if the created cause cannot be retrieved. - Modified error messages for cause not found scenarios to utilize internationalization support. * Refactor transaction verification to use BigNumber for expected amount comparison - Updated the expected amount retrieval to convert the environment variable to a BigNumber for accurate comparisons. - Simplified the amount comparison logic to use the `gte` method for better readability and reliability. - Removed the hardcoded environment variable for cause creation fee token contract address from the test setup. * Add cause creation fee configuration and validation - Introduced new environment variables for cause creation fee token contract address, expected fee amount, and receiver address. - Updated error messages to handle cases where the receiver address is not configured. - Enhanced transaction verification logic to check for both expected amount and receiver address in transfer events. - Updated English and Spanish locale files to include new error messages for improved user feedback.
- Removed table truncation in test setup to improve test isolation. - Added cleanup logic in afterEach hooks to ensure test data is properly removed after each test. - Introduced new utility function `deleteProjectDirectlyFromDb` for project cleanup. - Updated test cases to handle dynamic project and cause titles for better uniqueness. - Enhanced error handling and validation in test cases for cause creation and title checks.
- Modified test cases to generate unique titles and transaction hashes using timestamps, ensuring better isolation and preventing conflicts. - Updated cleanup logic in afterEach hooks to use LIKE queries for broader matching of test data, enhancing data removal accuracy. - Improved overall test reliability by ensuring that dynamically generated data is consistently handled across various test scenarios.
- Replaced dynamic project and update ID calculations with static values (9999999) in test cases for better consistency and isolation. - Ensured that tests for adding, editing, deleting project updates, and deleting draft projects are not dependent on the current state of the database.
- Updated the function to dynamically retrieve token contract addresses based on network IDs, enhancing flexibility for different environments. - Added support for staging and production environments by conditionally setting the Optimism network ID. - Improved code readability and maintainability by utilizing a result object for address mapping.
* Add new fields and sorting functionality for Cause entity - Introduced `givPower` and `givBack` fields to the Cause entity for enhanced donation tracking. - Updated the cause repository to support sorting by new fields and added filtering options for chain ID, search term, and listing status. - Modified the CauseResolver to accommodate new arguments for sorting and filtering in the `findAllCauses` query, improving data retrieval capabilities. * Enhance cause repository and resolver tests with new filtering and sorting capabilities - Added tests for filtering causes by chain ID, search term, and listing status in both cause repository and resolver tests. - Implemented sorting functionality for causes based on total raised, givPower, givBack, and project count. - Updated GraphQL queries to support new filtering and sorting parameters, improving data retrieval and usability. - Ensured comprehensive test coverage for new features, enhancing overall reliability and accuracy of cause-related functionalities. * fix issues in repository tests * Fix cause resolver tests * resolve comments by coderabbit
Fetch cause data by slug
…ts (#2016) * migrate cause as child of project, fix resolvers,repositories and tests * add distribution service to cause * filter causes from projects query fetch
Fix total distributed amount updates
…vice (#2080) - Updated the `generateWallet` method to return a more structured response, including success status and error messages. - Introduced `WalletGenerationResponse` and `WalletGenerationData` interfaces for better type safety and clarity. - Enhanced error handling to throw meaningful messages based on the response from the API.
* Implement updateCompleteDistribution mutation for bulk project updates - Added `updateCompleteDistribution` mutation to handle bulk updates of cause project distributions and update the total distributed amount for the associated cause. - Introduced new input types for fee breakdown and complete distribution updates. - Updated tests to verify the functionality of the new mutation and ensure correct updates to the cause's total distributed amount. * Remove redundant test for cause totalDistributed update in causeProjectRepository tests. Enhance DistributionServicePayload to include causeOwnerAddress and update causeDistributionJob to fetch adminUser's wallet address.
Fix admin user data on causeProjects
… to 200 seconds for improved API call reliability.
* add conditions for proyects to evaluation * add feeedback for minimum values and use correct provider
Adding causes to sitemap json file
* Adding ownerTotalEarned and ownerTotalEarnedUsdValue to cause * fix counting * Remove outdated migration for updating owner earnings in projects and refactor cause owner's total earnings update logic in the resolver. * Refactor cause project total distribution update to use atomic database-level calculations, preventing race conditions. Update logic for owner total earnings in a single database call. * Update causeProjectResolver to fetch adminUser instead of user for cause relations --------- Co-authored-by: ali <aliebrahimi2079@gmail.com>
* Adding ownerTotalEarned and ownerTotalEarnedUsdValue to cause * fix counting * Add causesTotalEarned to user table * jsut commint * update tests * Remove outdated migration for updating owner earnings in projects and refactor cause owner's total earnings update logic in the resolver. * Remove outdated migration for populating user earnings and update cause owner's total earnings logic in the resolver to directly modify user records. * Refactor cause project total distribution update to use atomic database-level calculations, preventing race conditions. Update logic for owner total earnings in a single database call. * Update causeProjectResolver to fetch adminUser instead of user for cause relations * Refactor user earnings update in causeProjectResolver to use atomic database updates for totalCausesDistributed and causesTotalEarned, enhancing performance and preventing race conditions. --------- Co-authored-by: ali <aliebrahimi2079@gmail.com>
- Introduced CAUSE_PROJECT_IP_WHITELIST environment variable to configure allowed IPs. - Implemented IP checking in the CauseProjectResolver for update mutations. - Added utility functions for IP whitelisting and middleware for request validation. - Updated ApolloContext to include the Express request object for IP checks. - Modified configuration files to include the new whitelist variable.
Fixing editing project/cause title saving
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.
No description provided.