Set up data models #11

Open
opened 2025-01-29 13:12:15 -05:00 by cswimr · 8 comments
Owner

@MYHM What should these look like? Is this just for bans? General moderations?

@MYHM What should these look like? Is this just for bans? General moderations?
cswimr added the
Kind
Feature
Priority
High
Size
M
labels 2025-01-29 13:12:15 -05:00
cswimr self-assigned this 2025-01-29 13:12:15 -05:00
MYHM was assigned by cswimr 2025-01-29 13:12:15 -05:00
cswimr added a new dependency 2025-01-29 13:25:05 -05:00
Collaborator

So everything is going to be structured exactly the same, which will include the user ID, the ban/warn reason, proof, and the reason key.

So everything is going to be structured exactly the same, which will include the user ID, the ban/warn reason, proof, and the reason key.
Author
Owner

@MYHM wrote in https://www.coastalcommits.com/cswimr/myhm-commission/issues/11#issuecomment-2317:

and the reason key.

So, C# is kinda weird when it comes to enums / records. Would you want this to be documented in Swagger, or would just linking to the enum / record in the src be fine?
Edit: I'm assuming by reason key you mean a preset list of items, where only those items would be accepted in API requests. For example, given the following (pseudocode) enum:

public stringEnum Reasons:
{
  Advertising
  Inappropriate Behavior
}

Providing a value of "Warning" would not be accepted, but "Advertising" would be. Is this correct?

@MYHM wrote in https://www.coastalcommits.com/cswimr/myhm-commission/issues/11#issuecomment-2317: > and the reason key. So, C# is kinda weird when it comes to enums / records. Would you want this to be documented in Swagger, or would just linking to the enum / record in the src be fine? Edit: I'm assuming by `reason key` you mean a preset list of items, where only those items would be accepted in API requests. For example, given the following (pseudocode) enum: ```csharp public stringEnum Reasons: { Advertising Inappropriate Behavior } ``` Providing a value of `"Warning"` would not be accepted, but `"Advertising"` would be. Is this correct?
Collaborator

Oh I have a list of this, send them to you as soon as you get a chance, way easier than this, one of them is DM_AD, another would be DM_SPAM

Oh I have a list of this, send them to you as soon as you get a chance, way easier than this, one of them is DM_AD, another would be DM_SPAM
Author
Owner

But, DM_SPMA should raise a validation error in the API, right? Basically, should this list be validated or can it just be a string?

But, `DM_SPMA` should raise a validation error in the API, right? Basically, should this list be validated or can it just be a string?
cswimr added spent time 2025-01-29 15:10:32 -05:00
20 minutes
cswimr started working 2025-01-29 15:10:43 -05:00
Author
Owner

Oh my god i love this, finally a way to use enums as string values without wanting to tear my hair out

Oh my god i love [this](https://github.com/Brondahl/EnumStringValues), finally a way to use enums as string values without wanting to tear my hair out
cswimr stopped working 2025-01-29 16:05:11 -05:00
54 minutes 28 seconds
Collaborator

List of different reason keys:

Advertising
Bot
Harassment
Impersonation
Phishing
Raiding
TOS
NSFW
Alt/Ban Evasion

also I almost forgot, I'd need a PUT method to actually upload data, but I think you figured that part out already.

List of different reason keys: ``` Advertising Bot Harassment Impersonation Phishing Raiding TOS NSFW Alt/Ban Evasion ``` also I almost forgot, I'd need a PUT method to actually upload data, but I think you figured that part out already.
Author
Owner
public enum ModerationReasons
{
    Advertising,
    Bot,
    Harassment,
    Impersonation,
    Phishing,
    Raiding,

    [StringValue("TOS")]
    Tos,

    [StringValue("NSFW")]
    Nsfw,

    [StringValue("Alt/Ban Evasion")]
    BanEvasion,
}
```csharp public enum ModerationReasons { Advertising, Bot, Harassment, Impersonation, Phishing, Raiding, [StringValue("TOS")] Tos, [StringValue("NSFW")] Nsfw, [StringValue("Alt/Ban Evasion")] BanEvasion, } ```
cswimr started working 2025-01-30 06:57:46 -05:00
cswimr stopped working 2025-01-30 07:06:44 -05:00
8 minutes 58 seconds
Collaborator

OH can you add Scamming to the list

OH can you add Scamming to the list
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Total time spent: 1 hour 23 minutes
cswimr
1 hour 23 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#2 API Base}
cswimr/LookingGlass
Reference: cswimr/LookingGlass#11
No description provided.