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

AC-1080: Appointment Scheduling Integration #1000

Merged
merged 23 commits into from
Jun 29, 2023

Conversation

shubhamsgit
Copy link
Member

@shubhamsgit shubhamsgit commented Jun 17, 2023

Description of what I changed

  • This is the start of Appointment Scheduling functionality in the SDK
  • New models and entities for the Appointment endpoint
  • Added convertors for online to offline
  • Added overloaded functions for easy use of SDK functions

Issue I worked on

JIRA Issue: https://issues.openmrs.org/browse/AC-1080

Checklist: I completed these to help reviewers :)

  • My pull request only contains ONE single commit
    (the number above, next to the 'Commits' tab is 1).
  • I have added tests to cover my changes. (If you refactored
    existing code that was well tested you do not have to add tests)
  • All new and existing tests passed.
  • My pull request is based on the latest changes of the master branch.

@shubhamsgit shubhamsgit marked this pull request as draft June 17, 2023 22:33
@shubhamsgit shubhamsgit added the SDK Changes for the SDK label Jun 17, 2023
@shubhamsgit shubhamsgit marked this pull request as ready for review June 26, 2023 05:09
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Undo changes that are not relevant


class TimeSlot(

@Expose var appointmentBlock: AppointmentBlock? = null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@Expose var appointmentBlock: AppointmentBlock? = null,
@Expose
var appointmentBlock: AppointmentBlock? = null,

@@ -0,0 +1,30 @@
package com.openmrs.android_sdk.library.models
Copy link
Collaborator

Choose a reason for hiding this comment

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

copywright


class Appointment(

@Expose var timeSlot: TimeSlot? = null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@Expose var timeSlot: TimeSlot? = null,
@Expose
var timeSlot: TimeSlot? = null,

Comment on lines 17 to 20




Copy link
Collaborator

Choose a reason for hiding this comment

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

just one is enough

import javax.inject.Singleton

@Singleton
class AppointmentRepository @Inject constructor() : BaseRepository(){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
class AppointmentRepository @Inject constructor() : BaseRepository(){
class AppointmentRepository @Inject constructor() : BaseRepository() {

Comment on lines 60 to 61
}
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}
)
})

*
* @return the TimeSlot object
*/
fun createTimeSlot(timeSlot: TimeSlot): Observable<TimeSlot>{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add spacing in all remaining functions

Comment on lines 82 to 83
}
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}
)
}
)
Suggested change
}
)
})

Add this change in all remaining functions

Comment on lines 104 to 109
if (response.isSuccessful && response != null) {
return@Callable response.body()!!
} else {
logger.e("Error creating Time Slot: " + response.message())
throw Exception(response.message())
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can create a function instead of repeating the same lines

Copy link
Member Author

@shubhamsgit shubhamsgit Jun 28, 2023

Choose a reason for hiding this comment

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

Indeed! Updated the PR by creating a function using Generics

Copy link
Member Author

@shubhamsgit shubhamsgit Jun 28, 2023

Choose a reason for hiding this comment

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

Reverted the irrelevant changes

@shubhamsgit
Copy link
Member Author

Pushed the requested changes. Please have a look now :)

@rishabh-997 rishabh-997 merged commit 89622d9 into master Jun 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Changes for the SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants