From 10056a1142d386402d1a4f4a8693560205968255 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Thu, 23 Nov 2023 18:36:52 +0900 Subject: [PATCH 1/4] fix: change annotation for delete #172 --- .../org/swm/att/data/remote/service/AttPosService.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/data/src/main/java/org/swm/att/data/remote/service/AttPosService.kt b/data/src/main/java/org/swm/att/data/remote/service/AttPosService.kt index 29601cc0..c068dcef 100644 --- a/data/src/main/java/org/swm/att/data/remote/service/AttPosService.kt +++ b/data/src/main/java/org/swm/att/data/remote/service/AttPosService.kt @@ -24,6 +24,7 @@ import org.swm.att.data.remote.response.StockWithMixedListDTO import org.swm.att.data.remote.response.StockWithStateListDTO import retrofit2.Response import retrofit2.http.Body +import retrofit2.http.DELETE import retrofit2.http.GET import retrofit2.http.Header import retrofit2.http.POST @@ -141,19 +142,19 @@ interface AttPosService { @Body stock: StockDTO ): Response - @PUT("stock/{stockId}") + @DELETE("stock/{stockId}") suspend fun deleteStock( @Header("storeId") storeId: Int, @Path("stockId") stockId: Int ): Response - @PUT("preorder/{preOrderId}") + @DELETE("preorder/{preOrderId}") suspend fun deletePreorder( @Header("storeId") storeId: Int, @Path("preOrderId") preorderId: Int ): Response - @PUT("menu/{menuId}") + @DELETE("menu/{menuId}") suspend fun deleteMenu( @Header("storeId") storeId: Int, @Path("menuId") menuId: Int @@ -165,7 +166,7 @@ interface AttPosService { @Body preOrderedMenus: PreOrderedMenusDTO ): Response - @PUT("order/{orderId}") + @DELETE("order/{orderId}") suspend fun cancelOrder( @Header("storeId") storeId: Int, @Path("orderId") orderId: Int @@ -177,7 +178,7 @@ interface AttPosService { @Body menu: NewMenuDTO ): Response - @PUT("menu/category/{categoryId}") + @DELETE("menu/category/{categoryId}") suspend fun deleteCategory( @Header("storeId") storeId: Int, @Path("categoryId") categoryId: Int From 264bd7219fd71a7375e21494c52f11d7c928b1da Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Thu, 23 Nov 2023 18:37:24 +0900 Subject: [PATCH 2/4] feat: set unit text by with enable filtering #172 --- .../main/java/org/swm/att/home/recipe/MenuRecipeViewHolder.kt | 2 +- feature/main/src/main/res/layout/item_menu_recipe.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/feature/main/src/main/java/org/swm/att/home/recipe/MenuRecipeViewHolder.kt b/feature/main/src/main/java/org/swm/att/home/recipe/MenuRecipeViewHolder.kt index 7088c2e2..50d51688 100644 --- a/feature/main/src/main/java/org/swm/att/home/recipe/MenuRecipeViewHolder.kt +++ b/feature/main/src/main/java/org/swm/att/home/recipe/MenuRecipeViewHolder.kt @@ -41,7 +41,7 @@ class MenuRecipeViewHolder( ArrayAdapter(binding.root.context, org.swm.att.home.R.layout.item_simple_text, unitArray) binding.actMenuUnit.apply { setAdapter(arrayAdapter) -// setText(unit, false) + setText(unit, false) } } diff --git a/feature/main/src/main/res/layout/item_menu_recipe.xml b/feature/main/src/main/res/layout/item_menu_recipe.xml index 250032c8..b2dbb087 100644 --- a/feature/main/src/main/res/layout/item_menu_recipe.xml +++ b/feature/main/src/main/res/layout/item_menu_recipe.xml @@ -81,7 +81,6 @@ From 5f4d7deccb21689f925d9f85e3727c4fad12206e Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Thu, 23 Nov 2023 18:38:45 +0900 Subject: [PATCH 3/4] feat: remove maxLength for stock name #172 --- feature/main/src/main/res/layout/fragment_stock.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/feature/main/src/main/res/layout/fragment_stock.xml b/feature/main/src/main/res/layout/fragment_stock.xml index c52718d3..8d85938c 100644 --- a/feature/main/src/main/res/layout/fragment_stock.xml +++ b/feature/main/src/main/res/layout/fragment_stock.xml @@ -265,7 +265,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:hint="@string/edt_register_stock_name" - android:maxLength="6" android:maxLines="1" android:paddingStart="10dp" android:paddingEnd="10dp" @@ -277,6 +276,7 @@ app:setEditTextStyleByIsModify="@{stockViewModel.isCreate || stockViewModel.isModify}" android:backgroundTint="@{stockViewModel.isCreate || stockViewModel.isModify ? @color/main_trans : @color/white}" tools:text="@string/edt_register_stock_name" + app:layout_constraintHorizontal_weight="1" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" @@ -294,7 +294,6 @@ android:layout_marginStart="10dp" android:layout_marginEnd="10dp" android:enabled="@{stockViewModel.isCreate || stockViewModel.isModify}" - app:layout_constraintHorizontal_weight="2" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@id/cl_stock_name_with_state" From 48187b1ab2aee4282e155880218dbdeb17979c75 Mon Sep 17 00:00:00 2001 From: 915dbfl Date: Thu, 23 Nov 2023 21:04:27 +0900 Subject: [PATCH 4/4] feat: remove endDate from FilteringCalendar #172 --- app/.DS_Store | Bin 6148 -> 10244 bytes .../presenter/base/BaseDialogFiltering.kt | 5 ++- .../calendar/customCalendarViewModel.kt | 7 ---- .../att/common_ui/util/CustomCalendarUtil.kt | 31 +++--------------- .../swm/att/home/bills/DialogBillFiltering.kt | 2 +- .../home/preorder/DialogPreorderFiltering.kt | 2 +- .../home/stock/DialogInventoryDatePicker.kt | 2 +- 7 files changed, 9 insertions(+), 40 deletions(-) diff --git a/app/.DS_Store b/app/.DS_Store index ae2b4c201b81ce4959c00b67e03ac7217881f175..aba90687ebca6a23a1c7554d1429b3e6e2074b2b 100644 GIT binary patch literal 10244 zcmeHMOKcTY82wCup4I}LD($5=2!R5?HNnIvV!}c<#s%>~su34%+?b#XH=@yq|2Z?Q?Jc;lL0HTr=ltjK z|L5_Y??30Ba{&OGGkP2#3IH+%F4+=_?(p$?9_D>gP*Ow^$sRyYX5G=G5Xi2!sgCAi(#BCWE*g7Z@R{)avR4hJ9 z(>*}gL<5-!|&JCw=Lg1N!EGLC+Z6P*C(vc2S`Y znDAv7hX{lS%twI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2SP2xxS?87k7y5GlIym1Tv=~BDEpDw{{a*&t{U6>0I2oVSo2oVSoSO5Zf zzHOAh|L?y0|Njf7ZJ}Sh&d8ULf<6?FW4nbz1dLR(s1`@6yts4u!Gf(DM@dO#fzyvWAWDmpUc%C`T E0PrsqIsgCw diff --git a/common-ui/src/main/java/org/swm/att/common_ui/presenter/base/BaseDialogFiltering.kt b/common-ui/src/main/java/org/swm/att/common_ui/presenter/base/BaseDialogFiltering.kt index 98e118cc..878f8794 100644 --- a/common-ui/src/main/java/org/swm/att/common_ui/presenter/base/BaseDialogFiltering.kt +++ b/common-ui/src/main/java/org/swm/att/common_ui/presenter/base/BaseDialogFiltering.kt @@ -28,16 +28,15 @@ abstract class BaseDialogFiltering : BaseDialog(R.la binding.customCalendar.initCustomCalendarViewModel(customCalendarViewModel) } - abstract fun onFilteringBtnClick(startDate: Date, endDate: Date?) + abstract fun onFilteringBtnClick(startDate: Date) private fun setBtnFilteringSearchClickListener() { binding.btnFilteringSearch.setOnClickListener { dismiss() val startDate = customCalendarViewModel.startDate.value - val endDate = customCalendarViewModel.endDate.value if (startDate != null) { - onFilteringBtnClick(startDate, endDate) + onFilteringBtnClick(startDate) } } } diff --git a/common-ui/src/main/java/org/swm/att/common_ui/presenter/calendar/customCalendarViewModel.kt b/common-ui/src/main/java/org/swm/att/common_ui/presenter/calendar/customCalendarViewModel.kt index 1f696dad..3c66a034 100644 --- a/common-ui/src/main/java/org/swm/att/common_ui/presenter/calendar/customCalendarViewModel.kt +++ b/common-ui/src/main/java/org/swm/att/common_ui/presenter/calendar/customCalendarViewModel.kt @@ -13,15 +13,8 @@ class CustomCalendarViewModel: BaseViewModel() { set(Calendar.SECOND, 0) set(Calendar.MILLISECOND, 0) }.time) val startDate: LiveData = _startDate - private val _endDate = MutableLiveData(null) - val endDate: LiveData = _endDate fun setStartDate(date: Date) { _startDate.postValue(date) - _endDate.postValue(null) - } - - fun setEndDate(date: Date) { - _endDate.postValue(date) } } \ No newline at end of file diff --git a/common-ui/src/main/java/org/swm/att/common_ui/util/CustomCalendarUtil.kt b/common-ui/src/main/java/org/swm/att/common_ui/util/CustomCalendarUtil.kt index 27f6c515..990da7c0 100644 --- a/common-ui/src/main/java/org/swm/att/common_ui/util/CustomCalendarUtil.kt +++ b/common-ui/src/main/java/org/swm/att/common_ui/util/CustomCalendarUtil.kt @@ -39,15 +39,7 @@ class CustomCalendarAdapter( holder.bind(item, baseDateFormat.format(item)) holder.itemView.apply { setOnClickListener { - if (!isDatePicker && customCalendarViewModel.endDate.value == null) { - if (customCalendarViewModel.startDate.value!! >= item) { - customCalendarViewModel.setStartDate(item) - } else { - customCalendarViewModel.setEndDate(item) - } - } else { - customCalendarViewModel.setStartDate(item) - } + customCalendarViewModel.setStartDate(item) } } } @@ -71,29 +63,14 @@ class CustomCalendarDateViewHolder( viewModel.startDate.observe(lifecycleOwner) { changeBackground(date) } - viewModel.endDate.observe(lifecycleOwner) { - changeBackground(date) - } } @SuppressLint("ResourceAsColor") private fun changeBackground(date: Date) { - val background = if(viewModel.endDate.value == null) { - if (viewModel.startDate.value == date) { - R.drawable.shape_oval_date - } else { - R.color.white - } + val background = if (viewModel.startDate.value == date) { + R.drawable.shape_oval_date } else { - if (viewModel.startDate.value == date) { - R.drawable.shape_round_start_date - } else if (viewModel.endDate.value == date) { - R.drawable.shape_round_end_date - } else if (date in viewModel.startDate.value!!..viewModel.endDate.value!!) { - R.color.main_trans - } else { - R.color.white - } + R.color.white } binding.tvCalendarDate.setBackgroundResource(background) } diff --git a/feature/main/src/main/java/org/swm/att/home/bills/DialogBillFiltering.kt b/feature/main/src/main/java/org/swm/att/home/bills/DialogBillFiltering.kt index 92b473c8..2f87f7aa 100644 --- a/feature/main/src/main/java/org/swm/att/home/bills/DialogBillFiltering.kt +++ b/feature/main/src/main/java/org/swm/att/home/bills/DialogBillFiltering.kt @@ -6,7 +6,7 @@ import java.util.Date class DialogBillFiltering( private val billViewModel: BillViewModel ): BaseDialogFiltering() { - override fun onFilteringBtnClick(startDate: Date, endDate: Date?) { + override fun onFilteringBtnClick(startDate: Date) { billViewModel.getBillsForFilteringDates(startDate) } } \ No newline at end of file diff --git a/feature/main/src/main/java/org/swm/att/home/preorder/DialogPreorderFiltering.kt b/feature/main/src/main/java/org/swm/att/home/preorder/DialogPreorderFiltering.kt index 78a6471b..890654fe 100644 --- a/feature/main/src/main/java/org/swm/att/home/preorder/DialogPreorderFiltering.kt +++ b/feature/main/src/main/java/org/swm/att/home/preorder/DialogPreorderFiltering.kt @@ -6,7 +6,7 @@ import java.util.Date class DialogPreorderFiltering( private val preorderViewModel: PreorderViewModel ): BaseDialogFiltering() { - override fun onFilteringBtnClick(startDate: Date, endDate: Date?) { + override fun onFilteringBtnClick(startDate: Date) { preorderViewModel.getPreordersForFilteringDates(startDate) } } \ No newline at end of file diff --git a/feature/main/src/main/java/org/swm/att/home/stock/DialogInventoryDatePicker.kt b/feature/main/src/main/java/org/swm/att/home/stock/DialogInventoryDatePicker.kt index 0f006764..ad25f9c9 100644 --- a/feature/main/src/main/java/org/swm/att/home/stock/DialogInventoryDatePicker.kt +++ b/feature/main/src/main/java/org/swm/att/home/stock/DialogInventoryDatePicker.kt @@ -6,7 +6,7 @@ import java.util.Date class DialogInventoryDatePicker( private val stockViewModel: StockViewModel ): BaseDialogFiltering() { - override fun onFilteringBtnClick(startDate: Date, endDate: Date?) { + override fun onFilteringBtnClick(startDate: Date) { stockViewModel.setLastInventoryDate(startDate) } } \ No newline at end of file