|
|
@@ -38,6 +38,9 @@ class RcsNumberApi() {
|
|
|
@Resource("configured")
|
|
|
class Configured(val parent: Id)
|
|
|
|
|
|
+ @Resource("wasted")
|
|
|
+ class Wasted(val parent: Id)
|
|
|
+
|
|
|
@Resource("stockFlag/{flag}")
|
|
|
class UpdateStockFlag(val parent: Id, val flag: Int)
|
|
|
}
|
|
|
@@ -104,6 +107,16 @@ class RcsNumberApi() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ suspend fun notifyWasted(id: Int) {
|
|
|
+ CoroutineScope(coroutineContext).launch {
|
|
|
+ try {
|
|
|
+ ktorClient.post(Id.Wasted(Id(RcsNumberApi(), id)))
|
|
|
+ } catch (e: Exception) {
|
|
|
+ Log.e(TAG, "Send Wasted Error: ${e.message}", e)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
suspend fun waitForOtp(id: Int): String? {
|
|
|
return withTimeoutOrNull(60.seconds) {
|
|
|
while (true) {
|