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

BO21 - Create a DAL function to add a Sponsor #186

Open
gregoriopalama opened this issue Apr 17, 2024 · 4 comments
Open

BO21 - Create a DAL function to add a Sponsor #186

gregoriopalama opened this issue Apr 17, 2024 · 4 comments
Labels
help wanted Extra attention is needed task This is a Task. Contributors can work on this

Comments

@gregoriopalama
Copy link
Member

gregoriopalama commented Apr 17, 2024

Add a DAL function in the Sponsorship API.

The function accept contain the informations about the sponsor:

  • sponsorshipID. This is required;
  • name. This is required;
  • link. This is required;
  • position: this will be checked. If there is an other sponsor with the same position, the other one will be updated and moved to the next position, and the same will be done for any other level with a colliding position. This field is optional. If not provided, the position will be set to the actual number of sponsors in the db (index must start from 0).

The response will be an error if something goes wrong. Otherwise, the function will provide the inserted sponsor object in the response's body, including the ID of the document in the DB.

Depends on #182

@gregoriopalama gregoriopalama converted this from a draft issue Apr 17, 2024
@gregoriopalama gregoriopalama moved this from Backlog to Ready in Hedwig Apr 17, 2024
@gregoriopalama gregoriopalama added help wanted Extra attention is needed task This is a Task. Contributors can work on this labels Apr 17, 2024
@giacomoRanieri
Copy link

I'll try resolving this issue.
I need just a small clarification.

I recon that the "Also" part may require a multipart form data to be able to also upload the image.
Does this mean that:

  • the body is always a multipart?
  • the json part of the body has key "body" ?
  • the file part of the body has key "image" ?

@gregoriopalama
Copy link
Member Author

Thanks for asking @giacomoRanieri .
First of all, I've updated the issue's description to reflect the fact that this depends on #182 : we need the endpoint on the sponsorships levels, before we can work on this.

@camillobucciarelli I think we should discuss Giacomo's doubts asap and provide a proper answer

@gregoriopalama
Copy link
Member Author

@giacomoRanieri again, thanks for your questions.
We've discussed this internally and updated the issue accordingly: the image will be handled solely with the appropriate endpoint, keeping this one very simple. The PUT action on the image endpoint, making it idempotent, will reflect the meaning of it: the image will be "overwritten" everytime, by deleting the old one from the storage, uploading the new one and updating the image url in the firestore document

@giacomoRanieri
Copy link

I'll wait for #182 to be completed to work on this :)

@gregoriopalama gregoriopalama changed the title BO21 - Create an endpoint to add a Sponsor BO21 - Create a DAL function to add a Sponsor Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed task This is a Task. Contributors can work on this
Projects
Status: Ready
Development

No branches or pull requests

2 participants