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

Update the QuestDocument struct #348

Open
3 tasks
Marchand-Nicolas opened this issue Dec 13, 2024 · 15 comments
Open
3 tasks

Update the QuestDocument struct #348

Marchand-Nicolas opened this issue Dec 13, 2024 · 15 comments
Labels
Good first issue Good for newcomers OD Hack Issue reserved for the OD Hack open for contribution An issue that is available for an Only Dust contribution

Comments

@Marchand-Nicolas
Copy link
Collaborator

Description 📹

Update the QuestDocument struct in src/models.rs to include a new optional banner field. Ensure that the new field is serialized and deserialized correctly, and update src/endpoints/get_quest.rs to return the banner object if it exists. The banner object should have the following structure:

{
   "tag": "Optional",
   "title": "Write a thread on xSTRK",
   "description": "Top 10 threads get $50 each.",
   "cta": "Participate",
   "href": "https://forms.gle/dxcDWjETeYCzRHtG7",
   "image": "/karnot/endurBanner.webp"
}

Proposed Actions 🛠️

Here’s a checklist of actions to follow for resolving this issue:

  1. Fork and Create Branch:
    Fork the repository and create a new branch using the issue number:

    git checkout -b fix-[issue-number]
  2. Implement Changes:
    Update the codebase with the following steps:

    • Modify the QuestDocument struct in src/models.rs to include the new optional banner field:

      pub_struct!(Debug, Serialize, Deserialize; QuestDocument {
          id: u32,
          name: String,
          desc: String,
          additional_desc: Option<String>,
          issuer: String,
          category: String,
          rewards_endpoint: String,
          logo: String,
          rewards_img: String,
          rewards_title: String,
          rewards_description: Option<String>,
          rewards_nfts: Vec<NFTItem>,
          img_card: String,
          title_card: String,
          hidden: Option<bool>,
          disabled: bool,
          expiry: Option<i64>,
          expiry_timestamp: Option<String>,
          mandatory_domain: Option<String>,
          expired: Option<bool>,
          experience: i64,
          start_time: i64,
          banner: Option<Banner>
      });
      
      #[derive(Debug, Serialize, Deserialize)]
      pub struct Banner {
          tag: String,
          title: String,
          description: String,
          cta: String,
          href: String,
          image: String
      }
    • Update the src/endpoints/get_quest.rs file to ensure it properly fetches and returns the new banner field in API responses.

    • If necessary, modify any other related files to ensure compatibility with the new structure.

  3. Run Tests and Commit Changes:
    Make sure your changes don't break existing functionality and commit with a clear message:

    git commit -m "Fix: Add optional banner field to QuestDocument struct"

Required 📋

To keep our workflow smooth, please make sure you follow these guidelines:

  • Assignment: Don't create a pull request if you weren’t assigned to this issue.
  • Timeframe: Complete the task within 3 business days.
  • Closing the Issue: In your PR description, close the issue by writing Close #[issue_id].
  • Review Process:
    • Once you've submitted your PR, change the label to "ready for review".
    • If changes are requested, address them and then update the label back to "ready for review" once done.
  • Testing: Test your PR locally before pushing, and verify that tests and build are working after pushing.

Thank you for your contribution 🙏

⚠️ WARNING: Failure to follow the requirements above may result in being added to the OnlyDust blacklist, affecting your ability to receive future rewards.

@Marchand-Nicolas Marchand-Nicolas added Good first issue Good for newcomers open for contribution An issue that is available for an Only Dust contribution OD Hack Issue reserved for the OD Hack labels Dec 13, 2024
@Benjtalkshow
Copy link
Contributor

I am a Full Stack Developer with a strong background in blockchain and extensive experience in Next.js/React, TypeScript, and Rust. I’ve made over 49 contributions to over 17 projects in the OnlyDust ecosystem, solving complex issues and delivering efficient, scalable solutions.

I can handle this task.
ETA is 2days.

@wheval
Copy link

wheval commented Dec 13, 2024

Hello @Marchand-Nicolas,

Can I contribute to this one?

ETA is 1 day

@Michaelkingsdev
Copy link
Contributor

Let me handle this please. Will make PR in 15hrs.

@Emmanex01
Copy link

I'd love to give this a go.

@KeneePatel
Copy link

Hello Nico,

I am a returning contributor to OnlyDust. I have previously completed several issues on a wide range of projects. The notable ones being kakarot and starknet.js. I will review and follow the community and contributing guidelines making sure the requirements are met properly.

ETA: 1d
Telegram: @patelkenee

@Supa-mega
Copy link
Contributor

Hi, May I take care of this?

@Jagadeeshftw
Copy link

Can I attempt this issue?

@PedroCo3lho
Copy link

Would love to tackle this!

@Agbeleshe
Copy link

Could I take over this issue? I will approach this issue by ensuring the data pipeline and UI are synchronized with the updated backend. First, after the backend team implements the new banner field in the QuestDocument struct and updates the API endpoint, I will fetch the updated API schema and test its response to ensure the banner field is properly serialized. Next, I will update the front-end data models or TypeScript types to include the optional banner field. I will then adapt the UI components to conditionally render the banner if it exists, ensuring a fallback display for cases where the field is null. Finally, I will write or update tests to verify both the API integration and UI behavior, ensuring the banner displays correctly without breaking the existing functionality. The changes will be committed, pushed to a feature branch, and reviewed before merging.

@GideonBature
Copy link
Contributor

Let me try this one!

My name is Gideon Bature, a Software Engineer with experience working with Rust and some of it's framework like Axum, Actix-web etc. I will love to complete this task, and if assigned will send my first PR within 48 hrs.

Thank you!

@ryzen-xp
Copy link
Contributor

Hi, I am proficient Blockchain developer expert in Cairo , Rust and Solidity and also in web development.
please /assign this issue .
Thank You

@Nityam573
Copy link

Can I tackle this one?

@psychemist
Copy link

Hello, StarknetQuest project maintainers!
Hi. I am a fullstack web developer and a recent alumni of Web3Bridge, the largest and most sought after blockchain developer community in Africa. I have extensive experience building backend systems, implementing user authentication, and serving web resources over a fully fleshed-out and documented API. I am a new contributor to OnlyDust and would love to take on this task to increase my knowledge base and contribute to open source projects.

Over my years of experience, I have worked with tools like:

Web3: Solidity and Rust
Backend: Express.js, Nest.js, Django, FastAPI, and Flask
Frontend: HTML/CSS, JavaScript/TypeScript, , React.js, Next.js, TailwindCSS, and shadcn/ui

Here is how I would solve this task:

  • Update the QuestDocument struct in src/models.rs by adding an optional banner field using Rust's Optiontype and defining the banner struct.
  • Next, I will modify the src/endpoints/get_quest.rs file by updating the endpoint to fetch and return the banner object in the API response if it exists.
  • Afterward, I shall write tests to check for proper serialization and deserialization of the banner field, covering cases where it is present and absent.
  • Then, I will review and adjust any related code to support the updated QuestDocument structure and adhere to the codebase conventions.

I aim to complete this task within 48 hours being assigned and setting up my development environment, with my first pull request submitted before 24 hours have elapsed. I have an incredible work ethic and can deliver on this task.

Thank you for the opportunity and I look forward to working with you. LET'S BUILD! 🚀

@helios492
Copy link

Hello! @Marchand-Nicolas
As an experienced fullstack and blockchain developer, I am sure that I can satisfy you with this issue.
I have strong background in problem solving skills.
I can handle this project within 3 business day and you will get what you want.
Thank you for considering my opportunity and will look forward to your contact.
Best Regards.

@omsant02
Copy link
Contributor

I would like to work on this issue

1-In models.rs, I'll add a new Banner struct and include it as an optional field in QuestDocument:
-Create the Banner struct with all required fields (tag, title, description, etc.)
-Update QuestDocument to include banner: Option
-Add the same field to QuestInsertDocument for consistency

2-In get_quest.rs, since the MongoDB pipeline is already set up correctly to fetch quest documents, the banner field will automatically be included in the response once we add it to the model.

ETA : 1 day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Good for newcomers OD Hack Issue reserved for the OD Hack open for contribution An issue that is available for an Only Dust contribution
Projects
None yet
Development

No branches or pull requests