├── .idea ├── .name ├── .gitignore ├── dictionaries │ └── Ribas.xml ├── compiler.xml ├── vcs.xml ├── deploymentTargetDropDown.xml └── gradle.xml ├── app ├── .gitignore ├── .idea │ ├── .gitignore │ ├── modules.xml │ ├── misc.xml │ └── gradle.xml ├── src │ ├── main │ │ ├── ic_launcher-playstore.png │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── app_logo.png │ │ │ │ ├── app_logo_login.png │ │ │ │ ├── shape_button_color2.xml │ │ │ │ ├── shape_button_color1.xml │ │ │ │ ├── ic_home.xml │ │ │ │ ├── ic_add_task.xml │ │ │ │ ├── ic_check.xml │ │ │ │ ├── ic_check_.xml │ │ │ │ ├── ic_import.xml │ │ │ │ ├── custom_default_input.xml │ │ │ │ ├── ic_add.xml │ │ │ │ ├── ic_close.xml │ │ │ │ ├── custom_shape_list_clicked.xml │ │ │ │ ├── custom_shape_list_default.xml │ │ │ │ ├── custom_input_login.xml │ │ │ │ ├── custom_invalid_input.xml │ │ │ │ ├── gradient_background.xml │ │ │ │ ├── custom_secundary_default_input.xml │ │ │ │ ├── ic_costumer.xml │ │ │ │ ├── ic_add_event.xml │ │ │ │ ├── ic_calendar.xml │ │ │ │ ├── ic_profile.xml │ │ │ │ ├── ic_assignment.xml │ │ │ │ └── ic_spending.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── values │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── colors.xml │ │ │ │ └── themes.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── menu │ │ │ │ ├── delete_menu.xml │ │ │ │ ├── update_delete_menu.xml │ │ │ │ └── bottom_nav_menu.xml │ │ │ ├── anim │ │ │ │ ├── rotate_close_anim.xml │ │ │ │ ├── rotate_open_anim.xml │ │ │ │ ├── from_bottom_center_anim.xml │ │ │ │ ├── from_bottom_left_anim.xml │ │ │ │ ├── from_bottom_right_anim.xml │ │ │ │ ├── to_bottom_center_anim.xml │ │ │ │ ├── to_bottom_left_anim.xml │ │ │ │ └── to_bottom_right_anim.xml │ │ │ ├── drawable-xhdpi │ │ │ │ └── custom_secundary_invalid_input.xml │ │ │ └── layout │ │ │ │ ├── activity_splash.xml │ │ │ │ ├── dialog_calendar.xml │ │ │ │ ├── item_job_and_client.xml │ │ │ │ ├── item_category.xml │ │ │ │ ├── fragment_report_daily.xml │ │ │ │ ├── custom_loading_dialog.xml │ │ │ │ ├── item_days_week_button.xml │ │ │ │ ├── fragment_report_period.xml │ │ │ │ ├── fragment_report_monthly.xml │ │ │ │ ├── item_new_expense.xml │ │ │ │ ├── fragment_new_category.xml │ │ │ │ ├── fragment_job_list.xml │ │ │ │ ├── custom_loading_buttom.xml │ │ │ │ ├── fragment_list_event.xml │ │ │ │ ├── item_report.xml │ │ │ │ ├── fragment_list_client.xml │ │ │ │ └── fragment_new_client.xml │ │ ├── java │ │ │ └── br │ │ │ │ └── com │ │ │ │ └── beautystyle │ │ │ │ ├── repository │ │ │ │ ├── ResultsCallBack.java │ │ │ │ ├── ConstantsRepository.java │ │ │ │ ├── Resource.java │ │ │ │ ├── OpeningHoursRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ ├── ui │ │ │ │ ├── adapter │ │ │ │ │ ├── ConstantsAdapter.java │ │ │ │ │ └── recyclerview │ │ │ │ │ │ └── listener │ │ │ │ │ │ └── AdapterListener.java │ │ │ │ ├── activity │ │ │ │ │ └── ContantsActivity.java │ │ │ │ ├── ProgressBottom.java │ │ │ │ ├── ListDaysView.java │ │ │ │ └── fragment │ │ │ │ │ ├── ConstantFragment.java │ │ │ │ │ ├── TimePickerFragment.java │ │ │ │ │ ├── CalendarViewFragment.java │ │ │ │ │ ├── ProfileFragment.java │ │ │ │ │ └── report │ │ │ │ │ └── DailyReportFragment.java │ │ │ │ ├── util │ │ │ │ ├── SortByJobName.java │ │ │ │ ├── ConstantsUtil.java │ │ │ │ ├── SortByClientName.java │ │ │ │ ├── SortByEventStartTime.java │ │ │ │ ├── TimeUtil.java │ │ │ │ ├── CoinUtil.java │ │ │ │ ├── CalendarUtil.java │ │ │ │ ├── MoneyTextWatcher.java │ │ │ │ └── CreateListsUtil.java │ │ │ │ ├── retrofit │ │ │ │ ├── NoConnectivityException.java │ │ │ │ ├── service │ │ │ │ │ ├── UserService.java │ │ │ │ │ ├── BlockTimeService.java │ │ │ │ │ ├── JobService.java │ │ │ │ │ ├── CategoryService.java │ │ │ │ │ ├── CostumerService.java │ │ │ │ │ ├── ReportService.java │ │ │ │ │ ├── EventService.java │ │ │ │ │ └── ExpenseService.java │ │ │ │ ├── callback │ │ │ │ │ ├── CallbackMessages.java │ │ │ │ │ ├── CallBackWithoutReturn.java │ │ │ │ │ └── CallBackReturn.java │ │ │ │ ├── model │ │ │ │ │ ├── form │ │ │ │ │ │ ├── UserLoginForm.java │ │ │ │ │ │ └── EventForm.java │ │ │ │ │ └── dto │ │ │ │ │ │ ├── EventTimeNotAvailableDto.java │ │ │ │ │ │ ├── EventWithClientAndJobsDto.java │ │ │ │ │ │ └── UserDto.java │ │ │ │ ├── webclient │ │ │ │ │ ├── UserWebClient.java │ │ │ │ │ ├── BlockTimeWebClient.java │ │ │ │ │ └── ReportWebClient.java │ │ │ │ └── NetworkConnectionInterceptor.java │ │ │ │ ├── BeautyStyleApplication.java │ │ │ │ ├── database │ │ │ │ ├── converters │ │ │ │ │ ├── LocalDateConverter.java │ │ │ │ │ ├── BigDecimalConverter.java │ │ │ │ │ └── LocalTimeConverter.java │ │ │ │ ├── dao │ │ │ │ │ ├── RoomEventWithJobsDao.java │ │ │ │ │ ├── RoomUserDao.java │ │ │ │ │ ├── RoomOpeningHoursDao.java │ │ │ │ │ ├── RoomBlockTimeDao.java │ │ │ │ │ ├── RoomJobDao.java │ │ │ │ │ ├── RoomCustomerDao.java │ │ │ │ │ ├── RoomCategoryDao.java │ │ │ │ │ ├── RoomExpenseDao.java │ │ │ │ │ └── RoomEventDao.java │ │ │ │ ├── DatabaseModule.java │ │ │ │ ├── rxjava │ │ │ │ │ ├── OpeningHoursRxJava.java │ │ │ │ │ ├── BlockTimeRxJava.java │ │ │ │ │ ├── CategoryRxJava.java │ │ │ │ │ ├── JobRxJava.java │ │ │ │ │ ├── CostumerRxJava.java │ │ │ │ │ ├── ExpenseRxJava.java │ │ │ │ │ └── EventRxJava.java │ │ │ │ ├── BeautyStyleDatabase.java │ │ │ │ └── references │ │ │ │ │ └── EventWithClientAndJobs.java │ │ │ │ ├── BeautyStyleModule.java │ │ │ │ ├── ViewModel │ │ │ │ ├── JobViewModel.java │ │ │ │ ├── CategoryViewModel.java │ │ │ │ ├── factory │ │ │ │ │ ├── JobFactory.java │ │ │ │ │ ├── UserFactory.java │ │ │ │ │ ├── EventFactory.java │ │ │ │ │ ├── ReportFactory.java │ │ │ │ │ ├── ExpenseFactory.java │ │ │ │ │ ├── CategoryFactory.java │ │ │ │ │ ├── CostumerFactory.java │ │ │ │ │ └── BlockTimeFactory.java │ │ │ │ ├── CostumerViewModel.java │ │ │ │ ├── UserViewModel.java │ │ │ │ ├── BlockTimeViewModel.java │ │ │ │ ├── ExpenseViewModel.java │ │ │ │ └── EventViewModel.java │ │ │ │ ├── model │ │ │ │ ├── entity │ │ │ │ │ ├── TypeOfReport.java │ │ │ │ │ ├── EventJobCrossRef.java │ │ │ │ │ ├── User.java │ │ │ │ │ ├── Category.java │ │ │ │ │ ├── OpeningHours.java │ │ │ │ │ ├── BlockTime.java │ │ │ │ │ ├── Expense.java │ │ │ │ │ └── Job.java │ │ │ │ └── util │ │ │ │ │ └── Report.java │ │ │ │ └── ApplicationComponent.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── br │ │ │ └── com │ │ │ └── beautystyle │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── br │ │ └── com │ │ └── beautystyle │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro ├── sampledata │ └── beautystyle.json └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── gradle.properties └── gradlew.bat /.idea/.name: -------------------------------------------------------------------------------- 1 | Beauty Style -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /app/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/dictionaries/Ribas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/drawable/app_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_logo_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/drawable/app_logo_login.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F2D8E3 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RibeiroRibas/app-android-agendamento/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/repository/ResultsCallBack.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.repository; 2 | 3 | public interface ResultsCallBack { 4 | 5 | void onSuccess(T result); 6 | void onError(String error); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ui/adapter/ConstantsAdapter.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ui.adapter; 2 | 3 | public interface ConstantsAdapter { 4 | String ITEM_MENU_REMOVE = "Excluir"; 5 | String ITEM_MENU_UPDATE = "Editar"; 6 | String BLOCK_TIME = "HORÁRIO BLOQUEADO"; 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_button_color2.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_button_color1.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | -------------------------------------------------------------------------------- /app/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/menu/delete_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/update_delete_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_home.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_task.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_check.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_check_.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/anim/rotate_close_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/anim/rotate_open_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 3 | repositories { 4 | google() 5 | mavenCentral() 6 | maven { url 'https://jitpack.io' } 7 | jcenter() // Warning: this repository is going to shut down soon 8 | } 9 | } 10 | rootProject.name = "Beauty Style" 11 | include ':app' 12 | -------------------------------------------------------------------------------- /app/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_import.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/util/SortByJobName.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.util; 2 | 3 | import java.util.Comparator; 4 | 5 | import br.com.beautystyle.model.entity.Job; 6 | 7 | public class SortByJobName implements Comparator { 8 | @Override 9 | public int compare(Job o1, Job o2) { 10 | return o1.getName().compareToIgnoreCase(o2.getName()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_default_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/util/ConstantsUtil.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.util; 2 | 3 | public interface ConstantsUtil { 4 | String DD_MM_YYYY = "dd/MM/yyyy"; 5 | String MMMM = "MMMM"; 6 | String MMMM_YYYY = "MMMM / yyyy"; 7 | String YYYY = "yyyy"; 8 | String DD = "dd"; 9 | String E = "E"; 10 | String DESIRED_FORMAT = "R$ "; 11 | String REMOVE_SYMBOL = ""; 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/NoConnectivityException.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit; 2 | 3 | import static br.com.beautystyle.retrofit.callback.CallbackMessages.NO_INTERNET_CONNECTION; 4 | 5 | import java.io.IOException; 6 | 7 | public class NoConnectivityException extends IOException { 8 | 9 | @Override 10 | public String getMessage() { 11 | return NO_INTERNET_CONNECTION; 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/util/SortByClientName.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.util; 2 | 3 | import java.util.Comparator; 4 | 5 | import br.com.beautystyle.model.entity.Customer; 6 | 7 | public class SortByClientName implements Comparator { 8 | 9 | @Override 10 | public int compare(Customer o1, Customer o2) { 11 | return o1.getName().compareToIgnoreCase(o2.getName()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_shape_list_clicked.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/BeautyStyleApplication.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle; 2 | 3 | import android.app.Application; 4 | 5 | public class BeautyStyleApplication extends Application { 6 | 7 | public ApplicationComponent applicationComponent; 8 | 9 | @Override 10 | public void onCreate() { 11 | super.onCreate(); 12 | applicationComponent = DaggerApplicationComponent.factory().create(this); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_shape_list_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/service/UserService.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit.service; 2 | 3 | import br.com.beautystyle.retrofit.model.dto.UserDto; 4 | import br.com.beautystyle.retrofit.model.form.UserLoginForm; 5 | import retrofit2.Call; 6 | import retrofit2.http.Body; 7 | import retrofit2.http.POST; 8 | 9 | public interface UserService { 10 | 11 | @POST("auth") 12 | Call auth(@Body UserLoginForm login); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_input_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_invalid_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gradient_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_secundary_default_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/custom_secundary_invalid_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_costumer.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ui/activity/ContantsActivity.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ui.activity; 2 | 3 | public interface ContantsActivity { 4 | 5 | int REQUEST_CODE_INSERT_EVENT = 1; 6 | int REQUEST_CODE_UPDATE_EVENT = 2; 7 | int REQUEST_CODE_UPDATE_EXPENSE = 3; 8 | int REQUEST_CODE_INSERT_EXPENSE = 4; 9 | int INVALID_POSITION = -1; 10 | String KEY_CLICK_FAB_NAVIGATION = "fabNavigation"; 11 | String TAG_EVENT_DURATION = "eventDuration"; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/test/java/br/com/beautystyle/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/callback/CallbackMessages.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit.callback; 2 | 3 | public interface CallbackMessages { 4 | 5 | String MESSAGE_ERROR = "Ocorreu um erro"; 6 | String NO_INTERNET_CONNECTION = "Internet Indisponível"; 7 | String MESSAGE_SERVER_ERROR = "Erro no Servidor"; 8 | String BAD_CREDENTIALS = "Email ou Senha Inválidos"; 9 | String DURATION_TIME_IS_NOT_AVAILABLE = "Tempo de duração excede o tempo disponível na agenda!"; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/util/SortByEventStartTime.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.util; 2 | 3 | import java.util.Comparator; 4 | 5 | import br.com.beautystyle.database.references.EventWithClientAndJobs; 6 | 7 | 8 | public class SortByEventStartTime implements Comparator { 9 | 10 | @Override 11 | public int compare(EventWithClientAndJobs o1, EventWithClientAndJobs o2) { 12 | return o1.getEvent().getStartTime().compareTo(o2.getEvent().getStartTime()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_event.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_calendar.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/converters/LocalDateConverter.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database.converters; 2 | 3 | import androidx.room.TypeConverter; 4 | 5 | import java.time.LocalDate; 6 | 7 | public class LocalDateConverter { 8 | 9 | @TypeConverter 10 | public static LocalDate fromLong(Long date) { 11 | return date == null ? null : LocalDate.ofEpochDay(date); 12 | } 13 | 14 | @TypeConverter 15 | public static Long fromLocalDate(LocalDate date) { 16 | return date == null ? null : date.toEpochDay(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_calendar.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jul 08 15:40:25 BRT 2022 2 | = 3 | 4 | = 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 6 | 7 | 8 | = 9 | = 10 | = 11 | = 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ui/ProgressBottom.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ui; 2 | 3 | import android.view.View; 4 | import android.widget.ProgressBar; 5 | 6 | public class ProgressBottom { 7 | 8 | private final View progressbar; 9 | 10 | public ProgressBottom(ProgressBar progressBar) { 11 | progressbar = progressBar; 12 | } 13 | 14 | public void buttonActivated() { 15 | progressbar.setVisibility(View.VISIBLE); 16 | } 17 | 18 | public void buttonFinished() { 19 | progressbar.setVisibility(View.GONE); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/repository/ConstantsRepository.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.repository; 2 | 3 | public interface ConstantsRepository { 4 | 5 | String TOKEN_SHARED_PREFERENCES = "token"; 6 | String TENANT_SHARED_PREFERENCES = "companyId"; 7 | String PROFILE_SHARED_PREFERENCES = "profile"; 8 | String EMAIL_SHARED_PREFERENCES = "email"; 9 | String IS_LOGGED_SHARED_PREFERENCES = "isLogged"; 10 | String USER_SHARED_PREFERENCES = "user_preferences"; 11 | String USER_PREMIUM = "ROLE_PREMIUM_ACCOUNT"; 12 | String FREE_ACCOUNT = "ROLE_FREE_ACCOUNT"; 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/res/anim/from_bottom_center_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 15 | 16 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/anim/from_bottom_left_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 15 | 16 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/anim/from_bottom_right_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 15 | 16 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_assignment.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/BeautyStyleModule.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle; 2 | 3 | import static br.com.beautystyle.repository.ConstantsRepository.USER_SHARED_PREFERENCES; 4 | 5 | import android.content.Context; 6 | import android.content.SharedPreferences; 7 | 8 | import javax.inject.Singleton; 9 | 10 | import dagger.Module; 11 | import dagger.Provides; 12 | 13 | @Module 14 | public class BeautyStyleModule { 15 | 16 | @Singleton 17 | @Provides 18 | public SharedPreferences providesSharedPreferences( Context context){ 19 | return context.getSharedPreferences(USER_SHARED_PREFERENCES,Context.MODE_PRIVATE); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/anim/to_bottom_center_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 17 | 18 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/anim/to_bottom_left_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 17 | 18 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/anim/to_bottom_right_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 17 | 18 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_spending.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/JobViewModel.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel; 2 | 3 | import androidx.lifecycle.LiveData; 4 | import androidx.lifecycle.ViewModel; 5 | 6 | import java.util.List; 7 | 8 | import br.com.beautystyle.model.entity.Job; 9 | import br.com.beautystyle.repository.JobRepository; 10 | import br.com.beautystyle.repository.Resource; 11 | 12 | public class JobViewModel extends ViewModel { 13 | 14 | private final JobRepository repository; 15 | 16 | public JobViewModel(JobRepository repository) { 17 | this.repository = repository; 18 | } 19 | 20 | public LiveData>> getAllLiveData() { 21 | return repository.getAllLiveData(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/converters/BigDecimalConverter.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database.converters; 2 | 3 | import androidx.room.TypeConverter; 4 | 5 | import java.math.BigDecimal; 6 | import java.math.RoundingMode; 7 | 8 | public class BigDecimalConverter { 9 | 10 | @TypeConverter 11 | public static BigDecimal fromLong(Long value) { 12 | return value == null ? null : new BigDecimal(value) 13 | .divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); 14 | } 15 | 16 | @TypeConverter 17 | public static Long fromBigDecimal(BigDecimal value) { 18 | return value == null ? null : value.multiply(new BigDecimal(100)) 19 | .longValueExact(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/dao/RoomEventWithJobsDao.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Insert; 5 | import androidx.room.OnConflictStrategy; 6 | import androidx.room.Query; 7 | 8 | import java.util.List; 9 | 10 | import br.com.beautystyle.model.entity.EventJobCrossRef; 11 | import io.reactivex.rxjava3.core.Completable; 12 | 13 | @Dao 14 | public interface RoomEventWithJobsDao { 15 | 16 | @Insert(onConflict = OnConflictStrategy.REPLACE) 17 | Completable insert(List eventJobCrossRef); 18 | 19 | @Query("DELETE FROM EventJobCrossRef WHERE eventId IN (:eventIds)") 20 | Completable deleteAllByIds(Long[] eventIds); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/DatabaseModule.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database; 2 | 3 | import static br.com.beautystyle.database.DatabaseMigrations.ALL_MIGRATIONS; 4 | 5 | import android.content.Context; 6 | 7 | import androidx.room.Room; 8 | 9 | import javax.inject.Singleton; 10 | 11 | import dagger.Module; 12 | import dagger.Provides; 13 | 14 | @Module 15 | public class DatabaseModule { 16 | 17 | @Singleton 18 | @Provides 19 | public BeautyStyleDatabase providesLocalDataBase(Context context){ 20 | return Room 21 | .databaseBuilder(context, BeautyStyleDatabase.class, "beautyStyle.db") 22 | .addMigrations(ALL_MIGRATIONS) 23 | .build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF37BC 4 | #FEE2F5 5 | #FF000000 6 | #FFFFFFFF 7 | #FF3700B3 8 | #F5F5F5 9 | #FFFF00 10 | #FF0000 11 | #228C22 12 | #808080 13 | #d8d9d8 14 | @color/pink 15 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/dao/RoomUserDao.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Insert; 5 | import androidx.room.OnConflictStrategy; 6 | import androidx.room.Query; 7 | import androidx.room.Update; 8 | 9 | import br.com.beautystyle.model.entity.User; 10 | import io.reactivex.rxjava3.core.Completable; 11 | import io.reactivex.rxjava3.core.Single; 12 | 13 | @Dao 14 | public interface RoomUserDao { 15 | 16 | 17 | @Insert(onConflict = OnConflictStrategy.REPLACE) 18 | Completable insert(User user); 19 | 20 | @Update 21 | Completable update(User user); 22 | 23 | @Query("SELECT * FROM user u WHERE u.email =:email") 24 | Single getByEmail(String email); 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/CategoryViewModel.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel; 2 | 3 | import androidx.lifecycle.LiveData; 4 | import androidx.lifecycle.ViewModel; 5 | 6 | import java.util.List; 7 | 8 | import br.com.beautystyle.model.entity.Category; 9 | import br.com.beautystyle.repository.CategoryRepository; 10 | import br.com.beautystyle.repository.Resource; 11 | 12 | public class CategoryViewModel extends ViewModel { 13 | 14 | private final CategoryRepository repository; 15 | 16 | public CategoryViewModel(CategoryRepository repository) { 17 | this.repository = repository; 18 | } 19 | 20 | public LiveData>> getAllLiveData() { 21 | return repository.getAllLiveData(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/dao/RoomOpeningHoursDao.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Insert; 5 | import androidx.room.OnConflictStrategy; 6 | import androidx.room.Query; 7 | 8 | import java.util.List; 9 | 10 | import br.com.beautystyle.model.entity.OpeningHours; 11 | import io.reactivex.rxjava3.core.Completable; 12 | import io.reactivex.rxjava3.core.Single; 13 | 14 | @Dao 15 | public interface RoomOpeningHoursDao { 16 | 17 | @Query("SELECT * FROM OpeningHours WHERE tenant= :tenant") 18 | Single> getAll(Long tenant); 19 | 20 | @Insert(onConflict = OnConflictStrategy.REPLACE) 21 | Completable insertAll(List openingHours); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/converters/LocalTimeConverter.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database.converters; 2 | 3 | import androidx.room.TypeConverter; 4 | 5 | import java.time.LocalTime; 6 | import java.time.format.DateTimeFormatter; 7 | 8 | public class LocalTimeConverter { 9 | 10 | @TypeConverter 11 | public static LocalTime fromString(String time) { 12 | DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("H:mm"); 13 | return LocalTime.parse(time, timeFormatter); 14 | } 15 | 16 | @TypeConverter 17 | public static String fromLocalTime(LocalTime time) { 18 | DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("H:mm"); 19 | return time == null ? null : time.format(timeFormatter); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/model/entity/TypeOfReport.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.model.entity; 2 | 3 | import java.util.List; 4 | import java.util.stream.Collectors; 5 | import java.util.stream.Stream; 6 | 7 | public enum TypeOfReport { 8 | 9 | MONTHLY("Mensal"), DAILY("Diário"), BYPERIOD("Por período"); 10 | 11 | private final String description; 12 | 13 | TypeOfReport(String description) { 14 | this.description = description; 15 | } 16 | 17 | public String getDescription() { 18 | return description; 19 | } 20 | 21 | public static List getTypeOfReportList() { 22 | return Stream.of(values()) 23 | .map(TypeOfReport::getDescription) 24 | .collect(Collectors.toList()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/factory/JobFactory.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel.factory; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.lifecycle.ViewModel; 5 | import androidx.lifecycle.ViewModelProvider; 6 | 7 | import br.com.beautystyle.ViewModel.JobViewModel; 8 | import br.com.beautystyle.repository.JobRepository; 9 | 10 | public class JobFactory implements ViewModelProvider.Factory { 11 | 12 | private final JobRepository repository; 13 | 14 | public JobFactory(JobRepository repository) { 15 | this.repository = repository; 16 | } 17 | 18 | @SuppressWarnings("unchecked") 19 | @NonNull 20 | @Override 21 | public T create(@NonNull Class aClass) { 22 | return (T) new JobViewModel(repository); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/factory/UserFactory.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel.factory; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.lifecycle.ViewModel; 5 | import androidx.lifecycle.ViewModelProvider; 6 | 7 | import br.com.beautystyle.ViewModel.UserViewModel; 8 | import br.com.beautystyle.repository.UserRepository; 9 | 10 | public class UserFactory implements ViewModelProvider.Factory { 11 | 12 | private final UserRepository repository; 13 | 14 | public UserFactory(UserRepository repository) { 15 | this.repository = repository; 16 | } 17 | 18 | @SuppressWarnings("unchecked") 19 | @NonNull 20 | @Override 21 | public T create(@NonNull Class aClass) { 22 | return (T) new UserViewModel(repository); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/factory/EventFactory.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel.factory; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.lifecycle.ViewModel; 5 | import androidx.lifecycle.ViewModelProvider; 6 | 7 | import br.com.beautystyle.ViewModel.EventViewModel; 8 | import br.com.beautystyle.repository.EventRepository; 9 | 10 | public class EventFactory implements ViewModelProvider.Factory { 11 | 12 | private final EventRepository repository; 13 | 14 | public EventFactory(EventRepository repository) { 15 | this.repository = repository; 16 | } 17 | 18 | @SuppressWarnings("unchecked") 19 | @NonNull 20 | @Override 21 | public T create(@NonNull Class aClass) { 22 | return (T) new EventViewModel(repository); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/factory/ReportFactory.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel.factory; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.lifecycle.ViewModel; 5 | import androidx.lifecycle.ViewModelProvider; 6 | 7 | import br.com.beautystyle.ViewModel.ReportViewModel; 8 | import br.com.beautystyle.repository.ReportRepository; 9 | 10 | public class ReportFactory implements ViewModelProvider.Factory { 11 | 12 | private final ReportRepository repository; 13 | 14 | public ReportFactory(ReportRepository repository) { 15 | this.repository = repository; 16 | } 17 | 18 | @SuppressWarnings("unchecked") 19 | @NonNull 20 | @Override 21 | public T create(@NonNull Class aClass) { 22 | return (T) new ReportViewModel(repository); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/factory/ExpenseFactory.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel.factory; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.lifecycle.ViewModel; 5 | import androidx.lifecycle.ViewModelProvider; 6 | 7 | import br.com.beautystyle.ViewModel.ExpenseViewModel; 8 | import br.com.beautystyle.repository.ExpenseRepository; 9 | 10 | public class ExpenseFactory implements ViewModelProvider.Factory { 11 | 12 | private final ExpenseRepository repository; 13 | 14 | public ExpenseFactory(ExpenseRepository repository) { 15 | this.repository = repository; 16 | } 17 | 18 | @SuppressWarnings("unchecked") 19 | @NonNull 20 | @Override 21 | public T create(@NonNull Class aClass) { 22 | return (T) new ExpenseViewModel(repository); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/factory/CategoryFactory.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel.factory; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.lifecycle.ViewModel; 5 | import androidx.lifecycle.ViewModelProvider; 6 | 7 | import br.com.beautystyle.ViewModel.CategoryViewModel; 8 | import br.com.beautystyle.repository.CategoryRepository; 9 | 10 | public class CategoryFactory implements ViewModelProvider.Factory { 11 | 12 | private final CategoryRepository repository; 13 | 14 | public CategoryFactory(CategoryRepository repository) { 15 | this.repository = repository; 16 | } 17 | 18 | @SuppressWarnings("unchecked") 19 | @NonNull 20 | @Override 21 | public T create(@NonNull Class aClass) { 22 | return (T) new CategoryViewModel(repository); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/res/menu/bottom_nav_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 13 | 14 | 17 | 18 | 22 | 23 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/service/BlockTimeService.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit.service; 2 | 3 | import br.com.beautystyle.model.entity.BlockTime; 4 | import retrofit2.Call; 5 | import retrofit2.http.Body; 6 | import retrofit2.http.DELETE; 7 | import retrofit2.http.Header; 8 | import retrofit2.http.POST; 9 | import retrofit2.http.PUT; 10 | import retrofit2.http.Path; 11 | 12 | public interface BlockTimeService { 13 | 14 | @POST("block_time") 15 | Call insert(@Body BlockTime blockTime, @Header("Authorization") String token); 16 | 17 | @PUT("block_time/{id}") 18 | Call update(@Path("id") Long id, @Body BlockTime blockTime, @Header("Authorization") String token); 19 | 20 | @DELETE("block_time/{id}") 21 | Call delete(@Path("id") Long id, @Header("Authorization") String token); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/factory/CostumerFactory.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel.factory; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.lifecycle.ViewModel; 5 | import androidx.lifecycle.ViewModelProvider; 6 | 7 | import br.com.beautystyle.ViewModel.CostumerViewModel; 8 | import br.com.beautystyle.repository.ClientRepository; 9 | 10 | public class CostumerFactory implements ViewModelProvider.Factory { 11 | 12 | private final ClientRepository repository; 13 | 14 | public CostumerFactory(ClientRepository clientRepository) { 15 | this.repository = clientRepository; 16 | } 17 | 18 | @SuppressWarnings("unchecked") 19 | @NonNull 20 | @Override 21 | public T create(@NonNull Class aClass) { 22 | return (T) new CostumerViewModel(repository); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/factory/BlockTimeFactory.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel.factory; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.lifecycle.ViewModel; 5 | import androidx.lifecycle.ViewModelProvider; 6 | 7 | import br.com.beautystyle.ViewModel.BlockTimeViewModel; 8 | import br.com.beautystyle.repository.BlockTimeRepository; 9 | 10 | public class BlockTimeFactory implements ViewModelProvider.Factory { 11 | 12 | private final BlockTimeRepository repository; 13 | 14 | public BlockTimeFactory(BlockTimeRepository repository) { 15 | this.repository = repository; 16 | } 17 | 18 | @SuppressWarnings("unchecked") 19 | @NonNull 20 | @Override 21 | public T create(@NonNull Class aClass) { 22 | return (T) new BlockTimeViewModel(repository); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/sampledata/beautystyle.json: -------------------------------------------------------------------------------- 1 | { 2 | "beautystyle": [ 3 | { 4 | "Client": "Grace Hopper", 5 | "Hour" : "7:00 - 8:00", 6 | "Service": "Pintar a unha da mão \n \n Pintar a Unha do pé ", 7 | "Price" : "R$30,00 \n \n R$30,00", 8 | "Date": "29/10/2021" 9 | }, 10 | { 11 | "Client": "Ada Lovelace", 12 | "Hour" : "8:00 - 9:30", 13 | "Service": "Alongamento", 14 | "Price" : "R$120,00", 15 | "Date": "29/10/2021" 16 | }, 17 | { 18 | "Client": "Joana Dark", 19 | "Hour" : "9:30 10:00", 20 | "Service": "Pintar a unha da mão", 21 | "Price" : "R$30,00", 22 | "Date": "29/10/2021" 23 | }, 24 | { 25 | "Client": "Maria do relento", 26 | "Hour" : "10:00 - 12:00", 27 | "Service": "Manutenção", 28 | "Price" : "R$150,00", 29 | "Date": "29/10/2021" 30 | } 31 | ] 32 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/br/com/beautystyle/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.example.beautystyle", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/model/form/UserLoginForm.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit.model.form; 2 | 3 | import br.com.beautystyle.model.entity.User; 4 | 5 | public class UserLoginForm { 6 | 7 | private String email; 8 | private String password; 9 | 10 | public UserLoginForm(String email, String password) { 11 | this.email = email; 12 | this.password = password; 13 | } 14 | 15 | public UserLoginForm(User user) { 16 | this.email = user.getEmail(); 17 | this.password = user.getPassword(); 18 | } 19 | 20 | public String getEmail() { 21 | return email; 22 | } 23 | 24 | public void setEmail(String email) { 25 | this.email = email; 26 | } 27 | 28 | public String getPassword() { 29 | return password; 30 | } 31 | 32 | public void setPassword(String password) { 33 | this.password = password; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/service/JobService.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit.service; 2 | 3 | import java.util.List; 4 | 5 | import br.com.beautystyle.model.entity.Job; 6 | import retrofit2.Call; 7 | import retrofit2.http.Body; 8 | import retrofit2.http.DELETE; 9 | import retrofit2.http.GET; 10 | import retrofit2.http.Header; 11 | import retrofit2.http.POST; 12 | import retrofit2.http.PUT; 13 | import retrofit2.http.Path; 14 | 15 | public interface JobService { 16 | 17 | @GET("job") 18 | Call> getAll(@Header("Authorization") String token); 19 | 20 | @POST("job") 21 | Call insert(@Body Job job, @Header("Authorization") String token); 22 | 23 | @PUT("job/{id}") 24 | Call update(@Path("id") Long id,@Body Job job, @Header("Authorization") String token); 25 | 26 | @DELETE("job/{id}") 27 | Call delete(@Path("id") Long id, @Header("Authorization") String token); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_job_and_client.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/CostumerViewModel.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.lifecycle.LiveData; 6 | import androidx.lifecycle.ViewModel; 7 | 8 | import java.util.List; 9 | 10 | import br.com.beautystyle.model.entity.Customer; 11 | import br.com.beautystyle.repository.ClientRepository; 12 | import br.com.beautystyle.repository.Resource; 13 | 14 | public class CostumerViewModel extends ViewModel { 15 | 16 | private final ClientRepository repository; 17 | 18 | 19 | public CostumerViewModel(ClientRepository repository) { 20 | this.repository = repository; 21 | } 22 | 23 | public LiveData>> getAllLiveData() { 24 | return repository.getAllLiveData(); 25 | } 26 | 27 | public LiveData> getContactListFromSmartphone(Context context) { 28 | return repository.getContactListFromSmartphone(context); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/UserViewModel.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel; 2 | 3 | import androidx.lifecycle.LiveData; 4 | import androidx.lifecycle.ViewModel; 5 | 6 | import br.com.beautystyle.retrofit.model.form.UserLoginForm; 7 | import br.com.beautystyle.retrofit.model.dto.UserDto; 8 | import br.com.beautystyle.model.entity.User; 9 | import br.com.beautystyle.repository.Resource; 10 | import br.com.beautystyle.repository.UserRepository; 11 | 12 | public class UserViewModel extends ViewModel { 13 | 14 | private final UserRepository repository; 15 | 16 | public UserViewModel(UserRepository repository) { 17 | this.repository = repository; 18 | } 19 | 20 | public LiveData> getByEmail(String email) { 21 | return repository.getByEmail(email); 22 | } 23 | 24 | public LiveData> authUser(UserLoginForm userLoginForm) { 25 | return repository.authUser(userLoginForm); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/service/CategoryService.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit.service; 2 | 3 | import java.util.List; 4 | 5 | import br.com.beautystyle.model.entity.Category; 6 | import retrofit2.Call; 7 | import retrofit2.http.Body; 8 | import retrofit2.http.DELETE; 9 | import retrofit2.http.GET; 10 | import retrofit2.http.Header; 11 | import retrofit2.http.POST; 12 | import retrofit2.http.PUT; 13 | import retrofit2.http.Path; 14 | 15 | public interface CategoryService { 16 | 17 | @GET("category") 18 | Call> getAll(@Header("Authorization") String token); 19 | 20 | @POST("category") 21 | Call insert(@Body Category category, @Header("Authorization") String token); 22 | 23 | @PUT("category/{id}") 24 | Call update(@Path("id") Long id, @Body Category category, @Header("Authorization") String token); 25 | 26 | @DELETE("category/{id}") 27 | Call delete(@Path("id") Long id, @Header("Authorization") String token); 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/dao/RoomBlockTimeDao.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Delete; 5 | import androidx.room.Insert; 6 | import androidx.room.OnConflictStrategy; 7 | import androidx.room.Query; 8 | import androidx.room.Update; 9 | 10 | import java.time.LocalDate; 11 | import java.util.List; 12 | 13 | import br.com.beautystyle.model.entity.BlockTime; 14 | import io.reactivex.rxjava3.core.Completable; 15 | import io.reactivex.rxjava3.core.Single; 16 | 17 | @Dao 18 | public interface RoomBlockTimeDao { 19 | 20 | @Query("SELECT * FROM BlockTime WHERE tenant=:tenant AND date=:date ") 21 | Single> getAll(Long tenant, LocalDate date); 22 | 23 | @Insert(onConflict = OnConflictStrategy.REPLACE) 24 | Single> insertAll(List blockTimes); 25 | 26 | @Delete 27 | Completable delete(BlockTime blockTimes); 28 | 29 | @Update 30 | Completable update(BlockTime category); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/model/dto/EventTimeNotAvailableDto.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit.model.dto; 2 | 3 | import java.time.LocalTime; 4 | 5 | public class EventTimeNotAvailableDto { 6 | 7 | private String statusCode; 8 | private String message; 9 | private LocalTime data; 10 | 11 | public EventTimeNotAvailableDto() { 12 | } 13 | 14 | public EventTimeNotAvailableDto(String error) { 15 | this.message = error; 16 | } 17 | 18 | public String getStatusCode() { 19 | return statusCode; 20 | } 21 | 22 | public void setStatusCode(String statusCode) { 23 | this.statusCode = statusCode; 24 | } 25 | 26 | public String getMessage() { 27 | return message; 28 | } 29 | 30 | public void setMessage(String message) { 31 | this.message = message; 32 | } 33 | 34 | public LocalTime getData() { 35 | return data; 36 | } 37 | 38 | public void setData(LocalTime endTime) { 39 | this.data = endTime; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/ViewModel/BlockTimeViewModel.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.ViewModel; 2 | 3 | import androidx.lifecycle.LiveData; 4 | import androidx.lifecycle.ViewModel; 5 | 6 | import br.com.beautystyle.model.entity.BlockTime; 7 | import br.com.beautystyle.repository.BlockTimeRepository; 8 | import br.com.beautystyle.repository.Resource; 9 | 10 | public class BlockTimeViewModel extends ViewModel { 11 | 12 | private final BlockTimeRepository blockTimeRepository; 13 | 14 | public BlockTimeViewModel(BlockTimeRepository blockTimeRepository) { 15 | this.blockTimeRepository = blockTimeRepository; 16 | } 17 | 18 | public LiveData> insert(BlockTime blockTime) { 19 | return blockTimeRepository.insert(blockTime); 20 | } 21 | 22 | public LiveData> delete(BlockTime blockTime) { 23 | return blockTimeRepository.delete(blockTime); 24 | } 25 | 26 | public LiveData> update(BlockTime blockTime) { 27 | return blockTimeRepository.update(blockTime); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/repository/Resource.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.repository; 2 | 3 | import static br.com.beautystyle.retrofit.callback.CallbackMessages.DURATION_TIME_IS_NOT_AVAILABLE; 4 | 5 | public class Resource { 6 | private T data; 7 | private String error; 8 | 9 | public Resource(T data, String error) { 10 | this.data = data; 11 | this.error = error; 12 | } 13 | 14 | 15 | public T getData() { 16 | return data; 17 | } 18 | 19 | public void setData(T data) { 20 | this.data = data; 21 | } 22 | 23 | public String getError() { 24 | return error; 25 | } 26 | 27 | public void setError(String error) { 28 | this.error = error; 29 | } 30 | 31 | public boolean isDataNotNull() { 32 | return this.data!=null; 33 | } 34 | 35 | public boolean isErrorNotNull() { 36 | return this.error!=null; 37 | } 38 | 39 | public boolean isDurationTimeNotAvailable() { 40 | return error.contains(DURATION_TIME_IS_NOT_AVAILABLE); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/database/dao/RoomJobDao.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.database.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Delete; 5 | import androidx.room.Insert; 6 | import androidx.room.Query; 7 | import androidx.room.Update; 8 | 9 | import java.util.List; 10 | 11 | import br.com.beautystyle.model.entity.Job; 12 | import io.reactivex.rxjava3.core.Completable; 13 | import io.reactivex.rxjava3.core.Observable; 14 | import io.reactivex.rxjava3.core.Single; 15 | 16 | @Dao 17 | public interface RoomJobDao { 18 | 19 | @Query("SELECT * FROM Job WHERE tenant= :tenant") 20 | Single> getAll(Long tenant); 21 | 22 | @Update 23 | Completable update(Job service); 24 | 25 | @Delete 26 | Completable delete(Job service); 27 | 28 | @Insert 29 | Single> insertAll(List response); 30 | 31 | @Update 32 | Completable updateAll(List updateJobs); 33 | 34 | @Query("SELECT * FROM Job WHERE tenant= :tenant") 35 | Observable> getAllLiveData(Long tenant); 36 | 37 | @Insert 38 | Completable insert(Job job); 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/util/TimeUtil.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.util; 2 | 3 | import java.time.LocalTime; 4 | import java.time.format.DateTimeFormatter; 5 | import java.util.List; 6 | 7 | public class TimeUtil { 8 | 9 | private static DateTimeFormatter timeFormatter; 10 | 11 | public static String formatLocalTime(LocalTime time) { 12 | timeFormatter = DateTimeFormatter.ofPattern("H:mm"); 13 | return time.format(timeFormatter); 14 | } 15 | 16 | public static LocalTime sumTimeOfJobs(List listTimeService) { 17 | LocalTime timeOfDuration = LocalTime.of(0, 0, 0); 18 | for (LocalTime timeOfService : listTimeService) { 19 | timeOfDuration = timeOfDuration.plusHours(timeOfService.getHour()); 20 | timeOfDuration = timeOfDuration.plusMinutes(timeOfService.getMinute()); 21 | } 22 | return timeOfDuration; 23 | } 24 | 25 | public static LocalTime formatDurationService(String duration) { 26 | timeFormatter = DateTimeFormatter.ofPattern("H:mm"); 27 | return LocalTime.parse(duration, timeFormatter); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/br/com/beautystyle/retrofit/service/CostumerService.java: -------------------------------------------------------------------------------- 1 | package br.com.beautystyle.retrofit.service; 2 | 3 | import java.util.List; 4 | 5 | import br.com.beautystyle.model.entity.Customer; 6 | import retrofit2.Call; 7 | import retrofit2.http.Body; 8 | import retrofit2.http.DELETE; 9 | import retrofit2.http.GET; 10 | import retrofit2.http.Header; 11 | import retrofit2.http.POST; 12 | import retrofit2.http.PUT; 13 | import retrofit2.http.Path; 14 | 15 | public interface CostumerService { 16 | 17 | @GET("customer") 18 | Call> getAll(@Header("Authorization") String token); 19 | 20 | @POST("customer") 21 | Call insert(@Body Customer customer, @Header("Authorization") String token); 22 | 23 | @POST("customer/insert_all") 24 | Call> insertAll(@Body List customer, @Header("Authorization") String token); 25 | 26 | @PUT("customer/{id}") 27 | Call update(@Body Customer customer, @Header("Authorization") String token); 28 | 29 | @DELETE("customer/{id}") 30 | Call delete(@Path("id") long id, @Header("Authorization") String token); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | 18 | 19 |