Skip to content

Commit

Permalink
mobile-wallet (#1)
Browse files Browse the repository at this point in the history
* feat: build.gradle grovvy to dsl

* refactor openMF#1476: migrated data package from java to kotlin

* fix: update Dockerfile

* fix: update ndk version

* fix: use the -S option to read from standard input

* fix: remove sudo

* fix: latest ndk

* fix: hard code Android Home dir

* fix: comment ndk install for now

* fix: corrupt png file

* refactor openMF#1481: migrated core utils and MifosPayApplication to kotlin

---------

Co-authored-by: Rajan Maurya <rajanmaurya154@gmail.com>
Co-authored-by: Pratyush Singh <aries.pratyush@gmail.com>
  • Loading branch information
3 people authored Jan 23, 2024
1 parent ada9ab4 commit e92b306
Show file tree
Hide file tree
Showing 34 changed files with 782 additions and 923 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/master_dev_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
java-version: 17

# Install NDK
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
#- name: Install NDK
# run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}

# Update Gradle Permission
- name: Change gradlew Permission
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM openjdk:8-jdk
FROM openjdk:17-jdk

ENV GRADLE_HOME /opt/gradle
ENV GRADLE_VERSION 4.6
ENV GRADLE_VERSION 8.3

RUN set -o errexit -o nounset \
&& echo "Downloading Gradle" \
Expand Down Expand Up @@ -37,8 +37,8 @@ RUN mkdir "$ANDROID_HOME" .android \
ENV PATH="/home/gradle/gradle/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools/bin:${PATH}"

RUN sdkmanager 'platform-tools'
RUN sdkmanager 'platforms;android-28'
RUN sdkmanager 'build-tools;27.0.3'
RUN sdkmanager 'platforms;android-34'
RUN sdkmanager 'build-tools;34.0.0'
RUN sdkmanager 'extras;google;m2repository'
RUN sdkmanager 'extras;android;m2repository'
RUN sdkmanager 'extras;google;google_play_services'
Expand Down
6 changes: 1 addition & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.gms) apply false
//alias(libs.plugins.butterknife) apply false
alias(libs.plugins.hilt.gradle) apply false
}
}
78 changes: 0 additions & 78 deletions core/build.gradle

This file was deleted.

81 changes: 81 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.kotlin.parcelize)
}

apply(from = "../config/quality/quality.gradle")

group = "com.github.ankurs287"

android {
compileSdk = libs.versions.compileSdk.get().toInt()
namespace = "org.mifos.mobilewallet.core"
defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
getByName("debug") {
isMinifyEnabled = false
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.7"
}

kotlinOptions {
jvmTarget = "17"
}

buildFeatures{
dataBinding = true
buildConfig = true
}

lint {
abortOnError = false
disable += "InvalidPackage"
}
}

dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")

implementation("com.google.dagger:hilt-android:2.48")
kapt("com.google.dagger:hilt-compiler:2.48")

implementation(libs.squareup.retrofit2) {
// exclude Retrofit’s OkHttp peer-dependency module and define your own module import
exclude(module = "okhttp")
}
implementation(libs.squareup.retrofit.adapter.rxjava)
implementation(libs.squareup.retrofit.converter.gson)
implementation(libs.squareup.okhttp)
implementation(libs.squareup.logging.interceptor)

implementation(libs.reactivex.rxjava.android)
implementation(libs.reactivex.rxjava)

implementation(libs.jetbrains.kotlin.jdk7)

testImplementation(libs.junit)
androidTestImplementation("androidx.test.espresso:espresso-core:3.1.0") {
exclude(group = "com.android.support", module = "support-annotations")
}
}

kapt {
correctErrorTypes = true
}
2 changes: 1 addition & 1 deletion core/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# By default, the flags in this file are appended to flags specified
# in /home/naman/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# directive in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down

This file was deleted.

54 changes: 54 additions & 0 deletions core/src/main/java/org/mifos/mobilewallet/core/utils/Constants.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package org.mifos.mobilewallet.core.utils

import java.util.Arrays
import java.util.Collections

/**
* Created by naman on 17/6/17.
*/
object Constants {
const val BASIC = "Basic "
const val SAVINGS = "savingsAccounts"
const val TRANSACTIONS = "transactions"
const val WALLET_ACCOUNT_SAVINGS_PRODUCT_ID = 1
const val MIFOS_MERCHANT_SAVINGS_PRODUCT_ID = 165 // 372
const val MIFOS_CONSUMER_SAVINGS_PRODUCT_ID = 165 // 373
private const val MOBILE_WALLET_ROLE_ID = 471
private const val SUPER_USER_ROLE_ID = 1
@JvmField
val NEW_USER_ROLE_IDS: Collection<Int> = Collections.unmodifiableList(
Arrays.asList(MOBILE_WALLET_ROLE_ID, SUPER_USER_ROLE_ID)
)
const val ENTITY_TYPE_CLIENTS = "clients"
const val FETCH_ACCOUNT_TRANSFER_USECASE = "FetchAccountTransfer"
const val NO_SAVED_CARDS = "No saved cards."
const val MIFOS_PASSWORD = "mifos:password"
const val ERROR_VERIFYING_USER = "Error verifying user"
const val ERROR_REGISTERING_USER = "Error registering user"
const val NO_CLIENTS_FOUND = "No clients found"
const val ERROR_SEARCHING_CLIENTS = "Error searching clients"
const val CLIENTS = "clients"
const val NO_ACCOUNTS_FOUND = "No accounts found"
const val ERROR_FETCHING_ACCOUNTS = "Error fetching accounts"
const val ERROR_MAKING_TRANSFER = "Error making transfer"
const val WALLET_TRANSFER = "Wallet transfer"
const val ERROR_ADDING_BENEFICIARY = "Error adding beneficiary"
const val ERROR_FETCHING_BENEFICIARIES = "Error fetching beneficiaries"
const val ERROR_FETCHING_TO_ACCOUNT = "Error fetching to account"
const val NO_WALLET_FOUND = "No wallet found"
const val ERROR_FETCHING_FROM_ACCOUNT = "Error fetching from account"
const val ERROR_FETCHING_CLIENT_DATA = "Error fetching client data"
const val NO_CLIENT_FOUND = "No client found"
const val ERROR_LOGGING_IN = "Error logging in"
const val ERROR_FETCHING_REMOTE_ACCOUNT_TRANSACTIONS =
"Error fetching remote account transactions"
const val PDF = "PDF"
const val ERROR_FETCHING_ACCOUNT = "Error fetching account"
const val NO_ACCOUNT_FOUND = "No account found"
const val INVOICE_DOES_NOT_EXIST = "Invoice does not exist."
const val INVALID_UPL = "Invalid UPL"
const val MERCHANT = "merchant"
const val FETCH_CLIENT_DETAILS_USE_CASE = "Fetch Client Details UseCase"
const val ERROR_FETCHING_NOTIFICATIONS = "Error fetching notifications"
const val UNAUTHORIZED_ERROR = "401 Unauthorized"
}
Loading

0 comments on commit e92b306

Please sign in to comment.