admins can delete cash payments

This commit is contained in:
androidlover5842
2026-01-30 11:40:49 +05:30
parent c5e0648dd1
commit 4fc080f146
7 changed files with 120 additions and 23 deletions

View File

@@ -91,6 +91,9 @@ class MainActivity : ComponentActivity() {
it == "ADMIN" || it == "MANAGER"
} == true
}
val canDeleteCashPayment: (String) -> Boolean = { propertyId ->
state.isSuperAdmin || state.propertyRoles[propertyId]?.contains("ADMIN") == true
}
BackHandler(enabled = currentRoute != AppRoute.Home) {
when (currentRoute) {
@@ -486,6 +489,7 @@ class MainActivity : ComponentActivity() {
propertyId = currentRoute.propertyId,
bookingId = currentRoute.bookingId,
canAddCash = canManagePayuSettings(currentRoute.propertyId),
canDeleteCash = canDeleteCashPayment(currentRoute.propertyId),
onBack = {
route.value = AppRoute.BookingDetailsTabs(
currentRoute.propertyId,