Skip to content

feat: add distribution backend#183

Open
tusharshah21 wants to merge 3 commits intomainfrom
feat/distribution-backend-131
Open

feat: add distribution backend#183
tusharshah21 wants to merge 3 commits intomainfrom
feat/distribution-backend-131

Conversation

@tusharshah21
Copy link
Collaborator

Summary

Implements backend support for distributions in the existing Rust backend by adding persistence and a batch registration endpoint.

Changes

  • Added migration backend/migrations/008_create_distributions_table.sql with required fields:
    • address
    • badge_name (maps from badgeName)
    • distribution_id (maps from distributionId)
  • Added protected endpoint POST /distributions to register distributions from a list payload.
  • Added minimal distribution domain/application/infrastructure wiring:
    • distribution repository trait + postgres implementation
    • request DTOs for list input
    • command to persist batch records
    • API/handler integration
  • Added integration test for successful list registration and DB persistence.

Scope

  • This PR intentionally avoids refactors, cleanups, and unrelated changes.
  • Changes are limited strictly to issue Add backend for distributions #131 requirements for distribution backend support.

@joelamouche
Copy link
Contributor

Thanks for contributing 🙏

Scope
This PR intentionally avoids refactors, cleanups, and unrelated changes.
Changes are limited strictly to issue #131 requirements for distribution backend support.

This is llm redundant text that is not needed here.

Added protected endpoint POST /distributions to register distributions from a list payload.

This is admin only endpoint right?

So in general, everytime yoju add an endpoint to the backend, pls add it to the readme and add testing instructions for integration test. That means a script (like we already have for other endpoints) that will perform a full testing sequence using curl: get nonce, generate signature, post endpoint, list endpoint.

Thanks in advance :)

@tusharshah21
Copy link
Collaborator Author

okays taking a look

@tusharshah21
Copy link
Collaborator Author

Earlier it was not for admin only, now updated it to admin only

  1. Moved distributions to admin-only routes:
    • POST /admin/distributions
  2. Updated backend README with the new endpoint docs.
  3. Added a curl integration script that runs full flow:
    nonce -> signature -> post endpoint -> list endpoint
    (scripts/test_admin_distributions.sh)

Please take another look when you get a chance. FOR LLM PR would make sure about it in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants