dev-launchers / strapiv4

GNU General Public License v3.0
8 stars 2 forks source link

[Platform] [User Notifications][TUS]Subscriptions are created when user performs certain actions #176

Open becevka opened 5 months ago

becevka commented 5 months ago

Summary In order to support User Notifications, we need to subscribe users by default to the Idea of their interest.

Describe the solution you'd like Subscription Collection should consist of the following fields:

When user creates idea, subscription for the new idea is automatically created. When user posts comment to the idea, subscription for that idea is automatically created. For now, we can disable API endpoints to Subscription.

Acceptance Criteria

Generated by Zenhub AI

becevka commented 5 months ago

@tiagopazhs Please start with creating a Subscription collection.

tiagopazhs commented 5 months ago

@tiagopazhs Please start with creating a Subscription collection.

All rigth!

So, how it works?

If I create the collection in my strapi admin. Then push to my branch.

If you pull this, you will see the collection in your strapi admin? Is it imediatly or do you need to run a migration?

becevka commented 5 months ago

@tiagopazhs After you add a collection in Admin locally, strapi will generate new files for you. You can commit those files and create PullRequest. We can review them together in github.

tiagopazhs commented 4 months ago

Why we have a created time instead of subscribed time?

tiagopazhs commented 4 months ago

I didn't understand very weel about this two ones:

tiagopazhs commented 4 months ago

I just created the PR here with the other fields: https://github.com/dev-launchers/strapiv4/pull/181

tiagopazhs commented 4 months ago

So I have another question: If I add a field to Subscription. What will happen with the other records in the database that doesn't have this new field.

becevka commented 4 months ago

Why we have a created time instead of subscribed time?

Could be subscribed time, I just thought it would be more consistent to have similar name in all collections

becevka commented 4 months ago

Also difference between createdDateTime and subscribedDateTime is that user can resubscribe, but that will just set active to true and unsubscribeDateTime to null, but createdDateTime will stay the same. I.e. createdDateTime is a time when record was created, just once, while user might resubscribe, we really not care much (at least for now) when they resubscribe.

becevka commented 4 months ago

entityType will be enum type with the name of the type of the data user subscribe to. For now it will have only one option - IdeaCard. entityId is a numeric Id (not relationship reference) to the entity, user subscribed to. In case of IdeaCard, IdeaCard id.

tiagopazhs commented 4 months ago

entityType will be enum type with the name of the type of the data user subscribe to. For now it will have only one option - IdeaCard. entityId is a numeric Id (not relationship reference) to the entity, user subscribed to. In case of IdeaCard, IdeaCard id.

In this case, should I create a field with normal integer type, right? And before create or update, check if the id exists.

Looks good?

tiagopazhs commented 4 months ago

Why we have a created time instead of subscribed time?

Could be subscribed time, I just thought it would be more consistent to have similar name in all collections

Is there a convetion here in the project for that? Something like: createdAt or createdDateTime or createdTime or TimeCreated wich one can adapt as well to the project?

Last question wich one looks better, camelCase or PascalCase

tiagopazhs commented 3 months ago

Hey @becevka is it still open because we have to test the endpoints and pass all tests before to finalize the entire epic ?