-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #301 from stakwork/kg/feature/subscriptions
Subscriptions
- Loading branch information
Showing
76 changed files
with
2,770 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...n/java/chat/sphinx/activitymain/navigation/navigators/detail/SubscriptionNavigatorImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package chat.sphinx.activitymain.navigation.navigators.detail | ||
|
||
import chat.sphinx.activitymain.navigation.drivers.DetailNavigationDriver | ||
import chat.sphinx.subscription.navigation.SubscriptionNavigator | ||
import javax.inject.Inject | ||
|
||
internal class SubscriptionNavigatorImpl @Inject constructor( | ||
detailDriver: DetailNavigationDriver, | ||
): SubscriptionNavigator(detailDriver) { | ||
|
||
override suspend fun closeDetailScreen() { | ||
(navigationDriver as DetailNavigationDriver).closeDetailScreen() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
sphinx/application/common/resources/src/main/res/drawable/custom_radio_button.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<item android:state_checked="true" android:state_window_focused="false" | ||
android:drawable="@drawable/ic_check_box_on" /> | ||
<item android:state_checked="false" android:state_window_focused="false" | ||
android:drawable="@drawable/ic_check_box_off" /> | ||
|
||
<item android:state_checked="true" android:state_pressed="true" | ||
android:drawable="@drawable/ic_check_box_on" /> | ||
<item android:state_checked="false" android:state_pressed="true" | ||
android:drawable="@drawable/ic_check_box_on" /> | ||
|
||
<item android:state_checked="true" android:state_focused="true" | ||
android:drawable="@drawable/ic_check_box_on" /> | ||
<item android:state_checked="false" android:state_focused="true" | ||
android:drawable="@drawable/ic_check_box_on" /> | ||
|
||
<item android:state_checked="false" android:drawable="@drawable/ic_check_box_off" /> | ||
<item android:state_checked="true" android:drawable="@drawable/ic_check_box_on" /> | ||
|
||
</selector> |
9 changes: 9 additions & 0 deletions
9
sphinx/application/common/resources/src/main/res/drawable/ic_check_box_off.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M19,5v14H5V5h14m0,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V5c0,-1.1 -0.9,-2 -2,-2z" | ||
android:fillColor="@color/secondaryText"/> | ||
</vector> |
9 changes: 9 additions & 0 deletions
9
sphinx/application/common/resources/src/main/res/drawable/ic_check_box_on.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:pathData="M19,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.11,0 2,-0.9 2,-2L21,5c0,-1.1 -0.89,-2 -2,-2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z" | ||
android:fillColor="@color/primaryBlue"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...mon/wrappers/wrapper-common/src/main/java/chat/sphinx/wrapper_common/subscription/Cron.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package chat.sphinx.wrapper_common.subscription | ||
|
||
@JvmInline | ||
value class Cron(val value: String) { | ||
init { | ||
require(value.isNotEmpty()) { | ||
"Subscription Cron cannot be empty" | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...rappers/wrapper-common/src/main/java/chat/sphinx/wrapper_common/subscription/EndNumber.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package chat.sphinx.wrapper_common.subscription | ||
|
||
@JvmInline | ||
value class EndNumber(val value: Long) { | ||
init { | ||
require(value >= 0) { | ||
"EndNumber must be greater than or equal to 0" | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...wrapper-common/src/main/java/chat/sphinx/wrapper_common/subscription/SubscriptionCount.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package chat.sphinx.wrapper_common.subscription | ||
|
||
@JvmInline | ||
value class SubscriptionCount(val value: Long) { | ||
init { | ||
require(value >= 0) { | ||
"SubscriptionCount must be greater than or equal to 0" | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...ppers/wrapper-subscription/src/main/java/chat/sphinx/wrapper_subscription/Subscription.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package chat.sphinx.wrapper_subscription | ||
|
||
import chat.sphinx.wrapper_common.DateTime | ||
import chat.sphinx.wrapper_common.dashboard.ChatId | ||
import chat.sphinx.wrapper_common.dashboard.ContactId | ||
import chat.sphinx.wrapper_common.lightning.Sat | ||
import chat.sphinx.wrapper_common.subscription.Cron | ||
import chat.sphinx.wrapper_common.subscription.EndNumber | ||
import chat.sphinx.wrapper_common.subscription.SubscriptionCount | ||
import chat.sphinx.wrapper_common.subscription.SubscriptionId | ||
|
||
data class Subscription( | ||
val id: SubscriptionId, | ||
val cron: Cron, | ||
val amount: Sat, | ||
val endNumber: EndNumber?, | ||
val count: SubscriptionCount, | ||
val endDate: DateTime?, | ||
val ended: Boolean, | ||
val paused: Boolean, | ||
val createdAt: DateTime, | ||
val updatedAt: DateTime, | ||
val chatId: ChatId, | ||
val contactId: ContactId | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 24 additions & 1 deletion
25
sphinx/application/data/concepts/concept-coredb/src/main/sqldelight/migrations/2.sqm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
import chat.sphinx.wrapper_common.DateTime; | ||
import chat.sphinx.wrapper_common.dashboard.ChatId; | ||
import chat.sphinx.wrapper_common.dashboard.ContactId; | ||
import chat.sphinx.wrapper_common.lightning.Sat; | ||
import chat.sphinx.wrapper_common.subscription.Cron; | ||
import chat.sphinx.wrapper_common.subscription.EndNumber; | ||
import chat.sphinx.wrapper_common.subscription.SubscriptionCount; | ||
import chat.sphinx.wrapper_common.subscription.SubscriptionId; | ||
import chat.sphinx.wrapper_message.MessageMUID; | ||
|
||
ALTER TABLE messageDbo ADD COLUMN muid TEXT AS MessageMUID; | ||
CREATE TABLE subscriptionDbo( | ||
id INTEGER AS SubscriptionId NOT NULL PRIMARY KEY, | ||
cron TEXT AS Cron NOT NULL, | ||
amount INTEGER AS Sat NOT NULL, | ||
end_number INTEGER AS EndNumber, | ||
count INTEGER AS SubscriptionCount NOT NULL, | ||
end_date INTEGER AS DateTime, | ||
ended INTEGER AS Boolean DEFAULT 0 NOT NULL, | ||
paused INTEGER AS Boolean DEFAULT 0 NOT NULL, | ||
created_at INTEGER AS DateTime NOT NULL, | ||
updated_at INTEGER AS DateTime NOT NULL, | ||
chat_id INTEGER AS ChatId NOT NULL, | ||
contact_id INTEGER AS ContactId NOT NULL | ||
); | ||
|
||
ALTER TABLE messageDbo ADD COLUMN muid TEXT AS MessageMUID; |
1 change: 1 addition & 0 deletions
1
sphinx/application/data/concepts/repositories/concept-repository-subscription/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Oops, something went wrong.