Skip to content

TSDK-417 Adding Event Reminders to Event Object#399

Merged
mrashed-dev merged 5 commits intomainfrom
TSDK-417
Oct 14, 2022
Merged

TSDK-417 Adding Event Reminders to Event Object#399
mrashed-dev merged 5 commits intomainfrom
TSDK-417

Conversation

@kraju3
Copy link
Copy Markdown
Contributor

@kraju3 kraju3 commented Oct 12, 2022

Description

Adding Event Reminder method to the Event object. Just creating a PR to see if I am on the right track here. I can see that our Object Schema from our API and the response we get back differ. There is some duplication that needed to be done to get this working. However, in this.validate() I am adding some validations to make sure the request passes through.

Questions And Concerns

So I am making sure no reminders are set on PUT calls using the id field
I still need to add some tests to test out read and write for this property
Also when you get the response back we get a reminders object :( So Mapping is different, so I had to duplicate some value with how our fromJson and toJson behave. But the weird thing is reminder_minutes is a string in the post request but it is an integer in the response

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 12, 2022

Codecov Report

Merging #399 (357e6db) into main (f255756) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
+ Coverage   91.42%   91.51%   +0.08%     
==========================================
  Files          60       61       +1     
  Lines        2554     2568      +14     
  Branches      460      462       +2     
==========================================
+ Hits         2335     2350      +15     
+ Misses        218      217       -1     
  Partials        1        1              
Impacted Files Coverage Δ
src/models/event-reminder-method.ts 100.00% <100.00%> (ø)
src/models/event.ts 91.20% <100.00%> (+0.07%) ⬆️
src/models/attributes.ts 95.65% <0.00%> (+0.48%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kraju3 kraju3 changed the title Tsdk 417 TSDK-417 Adding Event Reminders to Event Object Oct 12, 2022
@kraju3 kraju3 requested a review from mrashed-dev October 12, 2022 21:33
Removing one validation

Removing one validation and fixing prettier

Added some tests

Revert "Added some tests"

This reverts commit 596d496.

Reverted a commit and used prettier

Adding test and coverage for Event reminders

Added test coverage
@abdullahtariq1171
Copy link
Copy Markdown

Thank you kraju3 for raising the PR.

Comment thread src/models/event.ts Outdated
if (
this.id &&
((this.reminders &&
(this.reminders.reminderMethod || this.reminders.reminderMinutes)) ||
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.

Why do we throw an error if the event has a reminders object set? In this case the user can never update an event that was created with a reminder as ID will be set and this.reminders will be set.

Comment thread src/models/event.ts
Co-authored-by: Mostafa Rashed <17770919+mrashed-dev@users.noreply.github.com>
Comment thread src/models/event.ts Outdated
Co-authored-by: Mostafa Rashed <17770919+mrashed-dev@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@mrashed-dev mrashed-dev left a comment

Choose a reason for hiding this comment

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

Looks good to me! Will add additional test coverage.

@mrashed-dev mrashed-dev merged commit c31c4f6 into main Oct 14, 2022
@mrashed-dev mrashed-dev deleted the TSDK-417 branch October 14, 2022 18:19
@mrashed-dev mrashed-dev mentioned this pull request Oct 14, 2022
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