Skip to content
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

[PLA-2114] Revert packs for release #117

Merged
merged 1 commit into from
Dec 10, 2024
Merged

[PLA-2114] Revert packs for release #117

merged 1 commit into from
Dec 10, 2024

Conversation

leonardocustodio
Copy link
Contributor

@leonardocustodio leonardocustodio commented Dec 9, 2024

PR Type

Enhancement, Tests


Description

  • Removed BeamPack functionality across multiple services, models, and GraphQL mutations.
  • Simplified BeamService logic by removing packs handling and related methods.
  • Updated GraphQL mutations (CreateBeam, AddTokens, RemoveTokens, etc.) to reflect the removal of BeamPack.
  • Enhanced validation rules for tokens input in GraphQL mutations.
  • Refactored tests to align with the updated logic and removed BeamPack-related test cases.
  • Improved error handling and logging in jobs and services.
  • Simplified rules and validation logic for token count and supply.

Changes walkthrough 📝

Relevant files
Enhancement
12 files
BeamService.php
Refactor BeamService to remove BeamPack support and simplify logic.

src/Services/BeamService.php

  • Removed support for BeamPack functionality, including related methods
    and attributes.
  • Simplified create, updateByCode, addTokens, and removeTokens methods
    by removing packs handling.
  • Updated logic for single-use codes and claims to streamline
    operations.
  • Refactored methods to improve clarity and remove redundant code.
  • +62/-221
    ClaimBeam.php
    Simplify ClaimBeam job by removing BeamPack logic.             

    src/Jobs/ClaimBeam.php

  • Removed BeamPack-related logic in the claim handling process.
  • Simplified claim assignment and logging.
  • Updated error handling and logging for failed claims.
  • +14/-35 
    AddTokensMutation.php
    Refactor AddTokensMutation to remove BeamPack support.     

    src/GraphQL/Mutations/AddTokensMutation.php

  • Removed packs argument and related logic.
  • Updated validation rules for tokens to ensure stricter checks.
  • Simplified mutation resolution logic.
  • +69/-19 
    CreateBeamMutation.php
    Refactor CreateBeamMutation to remove BeamPack support.   

    src/GraphQL/Mutations/CreateBeamMutation.php

  • Removed packs argument and related logic.
  • Enhanced validation rules for tokens input.
  • Simplified mutation resolution logic.
  • +67/-13 
    UpdateBeamMutation.php
    Refactor UpdateBeamMutation to remove BeamPack support.   

    src/GraphQL/Mutations/UpdateBeamMutation.php

  • Removed packs argument and related logic.
  • Enhanced validation rules for tokens input.
  • Simplified mutation resolution logic.
  • +67/-11 
    BeamClaim.php
    Refactor BeamClaim model to remove BeamPack dependency.   

    src/Models/Laravel/BeamClaim.php

  • Removed BeamPack relationship and attributes.
  • Added new scopes for single-use code handling.
  • Simplified model logic for claims.
  • +24/-4   
    MaxTokenCount.php
    Simplify MaxTokenCount rule logic.                                             

    src/Rules/MaxTokenCount.php

  • Removed redundant logic for input token validation.
  • Simplified token count validation logic.
  • +2/-11   
    MaxTokenSupply.php
    Simplify MaxTokenSupply rule logic.                                           

    src/Rules/MaxTokenSupply.php

  • Removed redundant logic for input token validation.
  • Simplified token supply validation logic.
  • +1/-10   
    GetSingleUseCodesQuery.php
    Simplify GetSingleUseCodesQuery by removing BeamPack logic.

    src/GraphQL/Queries/GetSingleUseCodesQuery.php

  • Removed BeamPack-related logic.
  • Simplified query to only handle BeamClaim entities.
  • +2/-8     
    SingleUseCodeExist.php
    Simplify SingleUseCodeExist rule by removing BeamPack logic.

    src/Rules/SingleUseCodeExist.php

  • Removed BeamPack-related logic.
  • Simplified validation for single-use codes.
  • +6/-10   
    RemoveTokensMutation.php
    Refactor RemoveTokensMutation to remove BeamPack support.

    src/GraphQL/Mutations/RemoveTokensMutation.php

  • Removed packs argument and related logic.
  • Simplified mutation resolution and validation rules.
  • +2/-64   
    CreateBeam.graphql
    Update CreateBeam GraphQL schema to remove packs input.   

    tests/Feature/GraphQL/Resources/CreateBeam.graphql

  • Removed packs input from the mutation.
  • Updated schema to reflect changes in CreateBeam mutation.
  • +1/-3     
    Tests
    3 files
    CreateBeamTest.php
    Update CreateBeamTest to reflect removal of BeamPack functionality.

    tests/Feature/GraphQL/Mutations/CreateBeamTest.php

  • Removed tests related to BeamPack functionality.
  • Updated tests to align with the simplified BeamService logic.
  • Added assertions for new validation rules and error handling.
  • +21/-194
    UpdateBeamTest.php
    Update UpdateBeamTest to align with BeamPack removal.       

    tests/Feature/GraphQL/Mutations/UpdateBeamTest.php

  • Removed BeamPack-related tests.
  • Adjusted test cases to align with updated BeamService logic.
  • Simplified test data generation and validation.
  • +42/-120
    RemoveTokensTest.php
    Update RemoveTokensTest to align with BeamPack removal.   

    tests/Feature/GraphQL/Mutations/RemoveTokensTest.php

  • Removed BeamPack-related tests.
  • Updated tests to reflect changes in removeTokens logic.
  • Simplified test cases and assertions.
  • +3/-66   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    github-actions bot commented Dec 9, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Refactoring
    The create method in BeamService has been refactored to remove the handling of BeamPack and related logic. Ensure that the new implementation aligns with the intended business logic and that all necessary functionalities are preserved or appropriately handled.

    Cache Handling
    The caching strategy in the create method has been adjusted. Review the new cache handling logic to ensure it meets the requirements and correctly manages beam data.

    Error Handling
    The error handling in the create method has been simplified. Verify that all potential error states are adequately addressed and that the system can gracefully handle unexpected situations.

    Method Removal
    Several methods related to BeamPack have been removed, such as createPackClaims. Ensure that all references to these methods are removed from the codebase or appropriately redirected to their new implementations.

    Claim Logic
    The claim handling logic has been modified to no longer differentiate between packs and individual claims. This change could impact how claims are processed and validated.

    Copy link

    github-actions bot commented Dec 9, 2024

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @leonardocustodio leonardocustodio merged commit f8c6d4e into master Dec 10, 2024
    3 of 7 checks passed
    @leonardocustodio leonardocustodio deleted the PLA-2114 branch December 10, 2024 13:20
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Development

    Successfully merging this pull request may close these issues.

    2 participants