Skip to content

Create an enum for Message status - #7380

Merged
TorstenDittmann merged 1 commit into
1.5.xfrom
feat-message-status
Jan 4, 2024
Merged

TorstenDittmann merged 1 commit into
1.5.xfrom
feat-message-status

Conversation

@stnguyen90

Copy link
Copy Markdown
Contributor

What does this PR do?

Create an enum for Message status since there's a set of possible values for the status.

Test Plan

None

Related PRs and Issues

None

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@stnguyen90
stnguyen90 marked this pull request as ready for review January 2, 2024 22:43

namespace Appwrite\Enum;

enum MessageStatus: string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we have more enums for Message or other entities? Maybe the structure should be Appwrite\Enum[Entity][Type] or Appwrite\Enum\Message\Type?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need a namespace for enums, because it will be typed in its usage.

@TorstenDittmann TorstenDittmann Jan 3, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to have it under the namespace where it actually follows the story.

We already have Appwrite\Messaging for that imo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we have more enums for Message or other entities? Maybe the structure should be Appwrite\Enum[Entity][Type] or Appwrite\Enum\Message\Type?

@eldadfux, yes, we can have more. For example, providerType can be email, sms, or push.

I think it makes more sense to have it under the namespace where it actually follows the story.

We already have Appwrite\Messaging for that imo

@TorstenDittmann, that path is for Realtime, though 😅. It's probably most related to Appwrite\Utopia\Response\Model\Message.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am kinda against having a separate namespace for enums, it's always nice if stuff like that is relative to its consuming classes (if there are).

However, we don't have enough enums implemented to know how it will look like.

@stnguyen90
stnguyen90 requested a review from eldadfux January 3, 2024 15:53
@TorstenDittmann
TorstenDittmann merged commit 10dfadb into 1.5.x Jan 4, 2024
@TorstenDittmann
TorstenDittmann deleted the feat-message-status branch January 4, 2024 18:06
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.

3 participants