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

Feature request: Add ClanLogo colour data to Clan Data #326

Open
BillTheBeast opened this issue Nov 4, 2024 · 4 comments
Open

Feature request: Add ClanLogo colour data to Clan Data #326

BillTheBeast opened this issue Nov 4, 2024 · 4 comments
Assignees
Labels
feature New feature to add

Comments

@BillTheBeast
Copy link

What do you want to see in the API?

Add afield to clan that contains all of the data related to the clan logo (which logo is used and which colours are used.)

How do you think this should work?

The logo type can be determined through some sort of Enum or string that tells the client what logo to use. (Currently only heart is available.)
The colour data should be as a list of hexadecimal values. The current heart logo has 50 pieces that can have different colours, but later logos can have varying number of pieces.

Any additional info?

clanLogo: {
logoType: "Heart",
pieceColours: {
FF7744,
FFFFFF,
00AB39,
...
}
}

@MikhailDeriabin
Copy link
Member

@BillTheBeast

Is the pieceColours field array, there the index of the color corresponds to the piece in the logo?
Otherwise I am not sure how to convert it in TS, since there are no list data structure

@BillTheBeast
Copy link
Author

In my head it would be a dynamic size array, since one logo could have 50 pieces and another could have say 37. How this is done in TS, I can't really help you.

If you have to store it as a massive block of string, then that is what needs to be done regardless of how regrettable (and ugly or annoying) that is.

@MikhailDeriabin
Copy link
Member

ok, yes, the array can be dynamic no problem with that

@MikhailDeriabin MikhailDeriabin moved this from Backlog to Next to do in Altzone-Server Nov 14, 2024
@MikhailDeriabin
Copy link
Member

@Shahtaa
Have a look at the feature request above and add the requested functionality for the /clan endpoint. You can find the code for the /clan endpoint in the src/clan folder.

  • Create enum for the logoType field
  • Add the clan logo data object to the clan schema. I suggest to create a separate class or type for it
  • Add the clan logo data object to all DTOs, do not forget about validation:
    • mark the field itself as optional
    • the logoType must be enum
    • for pieceColours enough to check that it is an array of strings
  • Check that everything works fine in postman (CRU functionality)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature to add
Projects
Status: Next to do
Development

No branches or pull requests

3 participants