This is an automated email from the ASF dual-hosted git repository. aleks pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/fineract.git
commit 264022be4dee0e16db287eb554bda547f96bd066 Author: Arnold Galovics <[email protected]> AuthorDate: Fri Aug 26 15:19:15 2022 +0200 FINERACT-1694: Avro schemas project + code generation + some initial Avro Schemas --- build.gradle | 5 +- .../groovy/org.apache.fineract.dependencies.gradle | 2 + fineract-avro-schemas/build.gradle | 59 ++++++ .../dependencies.gradle | 15 +- fineract-avro-schemas/src/main/avro/MessageV1.avsc | 71 +++++++ .../src/main/avro/client/v1/ClientEventV1.avsc | 82 ++++++++ .../main/avro/client/v1/ClientEventV1Status.avsc | 41 ++-- .../v1/FixedDepositAccountEventV1.avsc | 208 +++++++++++++++++++++ .../v1/FixedDepositAccountEventV1Currency.avsc | 75 ++++++++ ...epositAccountEventV1DepositPeriodFrequency.avsc | 41 ++-- ...ntEventV1InterestCalculationDaysInYearType.avsc | 35 ++-- ...positAccountEventV1InterestCalculationType.avsc | 41 ++-- ...ccountEventV1InterestCompoundingPeriodType.avsc | 41 ++-- ...sitAccountEventV1InterestPostingPeriodType.avsc | 41 ++-- ...xedDepositAccountEventV1MaxDepositTermType.avsc | 41 ++-- ...xedDepositAccountEventV1MinDepositTermType.avsc | 41 ++-- .../v1/FixedDepositAccountEventV1Status.avsc | 110 +++++++++++ .../v1/FixedDepositAccountEventV1Summary.avsc | 41 ++-- .../v1/FixedDepositAccountEventV1Timeline.avsc | 48 +++-- .../generic/v1/CommandProcessingResultEventV1.avsc | 117 ++++++++++++ fineract-provider/build.gradle | 2 +- fineract-war/build.gradle | 5 +- integration-tests/dependencies.gradle | 1 + settings.gradle | 1 + 24 files changed, 1029 insertions(+), 135 deletions(-) diff --git a/build.gradle b/build.gradle index 42947c353..2ad0adca2 100644 --- a/build.gradle +++ b/build.gradle @@ -33,11 +33,13 @@ buildscript { 'fineract-client', 'core', 'service', - 'starter' + 'starter', + 'fineract-avro-schemas' ].contains(it.name) } fineractPublishProjects = subprojects.findAll{ [ + 'fineract-avro-schemas', 'fineract-client' ].contains(it.name) } @@ -80,6 +82,7 @@ plugins { id 'com.github.andygoossens.modernizer' version '1.6.2' apply false id 'com.github.spotbugs' version '5.0.10' apply false id 'se.thinkcode.cucumber-runner' version '0.0.11' apply false + id "com.github.davidmc24.gradle.plugin.avro-base" version "1.3.0" apply false } apply from: "${rootDir}/buildSrc/src/main/groovy/org.apache.fineract.release.gradle" diff --git a/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle b/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle index 46c4e0cc7..c3b47162b 100644 --- a/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle +++ b/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle @@ -185,5 +185,7 @@ dependencyManagement { dependency 'org.mapstruct:mapstruct:1.5.2.Final' dependency 'org.mapstruct:mapstruct-processor:1.5.2.Final' + + dependency "org.apache.avro:avro:1.11.0" } } diff --git a/fineract-avro-schemas/build.gradle b/fineract-avro-schemas/build.gradle new file mode 100644 index 000000000..31dfd658b --- /dev/null +++ b/fineract-avro-schemas/build.gradle @@ -0,0 +1,59 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import com.github.davidmc24.gradle.plugin.avro.GenerateAvroJavaTask + +description = 'Fineract Avro Schemas' + +apply plugin: 'com.github.davidmc24.gradle.plugin.avro-base' + +apply from: 'dependencies.gradle' + +// TODO: @vidakovic we should publish this lib to Maven Central; do in separate PR +task buildJavaSdk(type: GenerateAvroJavaTask) { + source("$projectDir/src/main/avro") + outputDir = file("$buildDir/generated/java/src/main/java") +} + + +compileJava.dependsOn(buildJavaSdk, licenseFormatMain, spotlessMiscApply) + +java { + // keep this at Java 8, not 17 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +tasks.withType(JavaCompile) { + options.compilerArgs -= ["-Werror"] +} + +configurations { + generatedCompileClasspath.extendsFrom implementation + generatedRuntimeClasspath.extendsFrom runtimeClasspath +} + +test { + useJUnitPlatform() +} + +sourceSets.main.java.srcDir new File(buildDir, "generated/java/src/main/java") + +licenseFormatMain.dependsOn buildJavaSdk +licenseMain.dependsOn buildJavaSdk diff --git a/settings.gradle b/fineract-avro-schemas/dependencies.gradle similarity index 70% copy from settings.gradle copy to fineract-avro-schemas/dependencies.gradle index 4fb8b3b67..aac8795c3 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/dependencies.gradle @@ -16,15 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' +dependencies { + implementation('org.apache.avro:avro') +} diff --git a/fineract-avro-schemas/src/main/avro/MessageV1.avsc b/fineract-avro-schemas/src/main/avro/MessageV1.avsc new file mode 100644 index 000000000..1003b04e1 --- /dev/null +++ b/fineract-avro-schemas/src/main/avro/MessageV1.avsc @@ -0,0 +1,71 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +{ + "name": "MessageV1", + "namespace": "org.apache.fineract.avro", + "type": "record", + "fields": [ + { + "name": "id", + "type": "int", + "doc": "The ID of the message to be sent" + }, + { + "name": "source", + "type": "string", + "doc": "A unique identifier of the source service" + }, + { + "name": "type", + "type": "string", + "doc": "The type of event the payload refers to. For example LOAN_APPROVED" + }, + { + "name": "version", + "type": "string", + "doc": "The version of the type of event. For example 1, 2, 3, etc" + }, + { + "name": "category", + "type": "string", + "doc": "The category of event the payload refers to. For example LOAN" + }, + { + "name": "createdAt", + "type": "string", + "doc": "The UTC time of when the event has been raised; in ISO_LOCAL_DATE_TIME format. For example 2011-12-03T10:15:30" + }, + { + "name": "tenantId", + "type": "string", + "doc": "The tenantId that the event has been sent from. For example default" + }, + { + "name": "idempotencyKey", + "type": "string", + "doc": "The idempotency key for this particular event for consumer de-duplication" + }, + { + "name": "payload", + "type": "bytes", + "doc": "The payload serialized into Avro bytes" + } + ] +} \ No newline at end of file diff --git a/fineract-avro-schemas/src/main/avro/client/v1/ClientEventV1.avsc b/fineract-avro-schemas/src/main/avro/client/v1/ClientEventV1.avsc new file mode 100644 index 000000000..e44f4d9c1 --- /dev/null +++ b/fineract-avro-schemas/src/main/avro/client/v1/ClientEventV1.avsc @@ -0,0 +1,82 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +{ + "name": "ClientEventV1", + "namespace": "org.apache.fineract.avro.client.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "accountNo", + "type": [ + "null", + "string" + ] + }, + { + "name": "status", + "type": [ + "null", + "org.apache.fineract.avro.client.v1.ClientEventV1Status" + ] + }, + { + "name": "active", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "fullName", + "type": [ + "null", + "string" + ] + }, + { + "name": "displayName", + "type": [ + "null", + "string" + ] + }, + { + "name": "officeId", + "type": [ + "null", + "int" + ] + }, + { + "name": "officeName", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/client/v1/ClientEventV1Status.avsc similarity index 66% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/client/v1/ClientEventV1Status.avsc index 4fb8b3b67..ee697ac05 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/client/v1/ClientEventV1Status.avsc @@ -16,15 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "ClientEventV1Status", + "namespace": "org.apache.fineract.avro.client.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1.avsc b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1.avsc new file mode 100644 index 000000000..cf83f11c2 --- /dev/null +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1.avsc @@ -0,0 +1,208 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +{ + "name": "FixedDepositAccountEventV1", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "accountNo", + "type": [ + "null", + "string" + ] + }, + { + "name": "clientId", + "type": [ + "null", + "int" + ] + }, + { + "name": "clientName", + "type": [ + "null", + "string" + ] + }, + { + "name": "savingsProductId", + "type": [ + "null", + "int" + ] + }, + { + "name": "savingsProductName", + "type": [ + "null", + "string" + ] + }, + { + "name": "fieldOfficerId", + "type": [ + "null", + "int" + ] + }, + { + "name": "status", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1Status" + ] + }, + { + "name": "timeline", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1Timeline" + ] + }, + { + "name": "currency", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1Currency" + ] + }, + { + "name": "interestCompoundingPeriodType", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1InterestCompoundingPeriodType" + ] + }, + { + "name": "interestPostingPeriodType", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1InterestPostingPeriodType" + ] + }, + { + "name": "interestCalculationType", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1InterestCalculationType" + ] + }, + { + "name": "interestCalculationDaysInYearType", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1InterestCalculationDaysInYearType" + ] + }, + { + "name": "summary", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1Summary" + ] + }, + { + "name": "interestFreePeriodApplicable", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "preClosurePenalApplicable", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "minDepositTerm", + "type": [ + "null", + "int" + ] + }, + { + "name": "maxDepositTerm", + "type": [ + "null", + "int" + ] + }, + { + "name": "minDepositTermType", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1MinDepositTermType" + ] + }, + { + "name": "maxDepositTermType", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1MaxDepositTermType" + ] + }, + { + "name": "depositAmount", + "type": [ + "null", + "float" + ] + }, + { + "name": "maturityAmount", + "type": [ + "null", + "float" + ] + }, + { + "name": "maturityDate", + "type": [ + "null", + "string" + ] + }, + { + "name": "depositPeriod", + "type": [ + "null", + "int" + ] + }, + { + "name": "depositPeriodFrequency", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1DepositPeriodFrequency" + ] + } + ] +} \ No newline at end of file diff --git a/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Currency.avsc b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Currency.avsc new file mode 100644 index 000000000..97a2429fc --- /dev/null +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Currency.avsc @@ -0,0 +1,75 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +{ + "name": "FixedDepositAccountEventV1Currency", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "name", + "type": [ + "null", + "string" + ] + }, + { + "name": "decimalPlaces", + "type": [ + "null", + "int" + ] + }, + { + "name": "inMultiplesOf", + "type": [ + "null", + "int" + ] + }, + { + "name": "displaySymbol", + "type": [ + "null", + "string" + ] + }, + { + "name": "nameCode", + "type": [ + "null", + "string" + ] + }, + { + "name": "displayLabel", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1DepositPeriodFrequency.avsc similarity index 64% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1DepositPeriodFrequency.avsc index 4fb8b3b67..c146be331 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1DepositPeriodFrequency.avsc @@ -16,15 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1DepositPeriodFrequency", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCalculationDaysInYearType.avsc similarity index 64% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCalculationDaysInYearType.avsc index 4fb8b3b67..a1eb54976 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCalculationDaysInYearType.avsc @@ -16,15 +16,26 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1InterestCalculationDaysInYearType", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "accountBalance", + "type": [ + "null", + "float" + ] + }, + { + "name": "currency", + "type": [ + "null", + "org.apache.fineract.avro.fixeddeposit.v1.FixedDepositAccountEventV1Currency" + ] + } + ] +} +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCalculationType.avsc similarity index 64% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCalculationType.avsc index 4fb8b3b67..ca40d5c1a 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCalculationType.avsc @@ -16,15 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1InterestCalculationType", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCompoundingPeriodType.avsc similarity index 64% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCompoundingPeriodType.avsc index 4fb8b3b67..62210ecf6 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestCompoundingPeriodType.avsc @@ -16,15 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1InterestCompoundingPeriodType", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestPostingPeriodType.avsc similarity index 64% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestPostingPeriodType.avsc index 4fb8b3b67..28b80f7bf 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1InterestPostingPeriodType.avsc @@ -16,15 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1InterestPostingPeriodType", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1MaxDepositTermType.avsc similarity index 64% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1MaxDepositTermType.avsc index 4fb8b3b67..2c5ef7738 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1MaxDepositTermType.avsc @@ -16,15 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1MaxDepositTermType", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1MinDepositTermType.avsc similarity index 64% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1MinDepositTermType.avsc index 4fb8b3b67..c6e101d20 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1MinDepositTermType.avsc @@ -16,15 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1MinDepositTermType", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Status.avsc b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Status.avsc new file mode 100644 index 000000000..3bb940192 --- /dev/null +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Status.avsc @@ -0,0 +1,110 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +{ + "name": "FixedDepositAccountEventV1Status", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + }, + { + "name": "submittedAndPendingApproval", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "approved", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "rejected", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "withdrawnByApplicant", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "active", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "closed", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "prematureClosed", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "transferInProgress", + "type": [ + "null", + "boolean" + ] + }, + { + "name": "transferOnHold", + "type": [ + "null", + "boolean" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Summary.avsc similarity index 65% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Summary.avsc index 4fb8b3b67..5161a64eb 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Summary.avsc @@ -16,15 +16,32 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1Summary", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "id", + "type": [ + "null", + "int" + ] + }, + { + "name": "code", + "type": [ + "null", + "string" + ] + }, + { + "name": "description", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/settings.gradle b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Timeline.avsc similarity index 58% copy from settings.gradle copy to fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Timeline.avsc index 4fb8b3b67..1fdf547cc 100644 --- a/settings.gradle +++ b/fineract-avro-schemas/src/main/avro/fixeddeposit/v1/FixedDepositAccountEventV1Timeline.avsc @@ -16,15 +16,39 @@ * specific language governing permissions and limitations * under the License. */ -rootProject.name='fineract' -include ':module:dummy:core' -include ':module:dummy:service' -include ':module:dummy:starter' -include ':custom:foo:service' -include ':fineract-provider' -include ':fineract-war' -include ':integration-tests' -include ':twofactor-tests' -include ':oauth2-tests' -include ':fineract-client' -include ':fineract-doc' + +{ + "name": "FixedDepositAccountEventV1Timeline", + "namespace": "org.apache.fineract.avro.fixeddeposit.v1", + "type": "record", + "fields": [ + { + "name": "submittedOnDate", + "type": [ + "null", + "string" + ] + }, + { + "name": "submittedByUsername", + "type": [ + "null", + "string" + ] + }, + { + "name": "submittedByFirstname", + "type": [ + "null", + "string" + ] + }, + { + "name": "submittedByLastname", + "type": [ + "null", + "string" + ] + } + ] +} \ No newline at end of file diff --git a/fineract-avro-schemas/src/main/avro/generic/v1/CommandProcessingResultEventV1.avsc b/fineract-avro-schemas/src/main/avro/generic/v1/CommandProcessingResultEventV1.avsc new file mode 100644 index 000000000..f9e7faec4 --- /dev/null +++ b/fineract-avro-schemas/src/main/avro/generic/v1/CommandProcessingResultEventV1.avsc @@ -0,0 +1,117 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +{ + "name": "CommandProcessingResultEventV1", + "namespace": "org.apache.fineract.avro.generic.v1", + "type": "record", + "fields": [ + { + "name": "commandId", + "type": [ + "null", + "long" + ] + }, + { + "name": "officeId", + "type": [ + "null", + "long" + ] + }, + { + "name": "groupId", + "type": [ + "null", + "long" + ] + }, + { + "name": "clientId", + "type": [ + "null", + "long" + ] + }, + { + "name": "loanId", + "type": [ + "null", + "long" + ] + }, + { + "name": "savingsId", + "type": [ + "null", + "long" + ] + }, + { + "name": "resourceId", + "type": [ + "null", + "long" + ] + }, + { + "name": "subResourceId", + "type": [ + "null", + "long" + ] + }, + { + "name": "transactionId", + "type": [ + "null", + "long" + ] + }, + { + "name": "resourceIdentifier", + "type": [ + "null", + "string" + ] + }, + { + "name": "productId", + "type": [ + "null", + "long" + ] + }, + { + "name": "gsimId", + "type": [ + "null", + "long" + ] + }, + { + "name": "glimId", + "type": [ + "null", + "long" + ] + } + ] +} \ No newline at end of file diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 7b515a7de..f9e81f36d 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -324,5 +324,5 @@ checkstyleMain.dependsOn resolve checkstyleTest.dependsOn resolve rat.dependsOn prepareInputYaml spotbugsTest.dependsOn resolve -compileTestJava.dependsOn ':fineract-client:processResources' +compileTestJava.dependsOn ':fineract-client:processResources', ':fineract-avro-schemas:processResources' bootJarMainClassName.dependsOn resolve diff --git a/fineract-war/build.gradle b/fineract-war/build.gradle index 1690079ac..5bc0c27c3 100644 --- a/fineract-war/build.gradle +++ b/fineract-war/build.gradle @@ -63,6 +63,9 @@ distributions { from ("$rootDir/fineract-client/build/libs/") { include 'fineract-client-*.jar' } + from ("$rootDir/fineract-avro-schemas/build/libs/") { + include 'fineract-avro-schemas-*.jar' + } from ("$rootDir/fineract-provider/build/libs/") { include 'fineract-provider-*.jar' exclude 'fineract-provider-*-plain.jar' @@ -101,4 +104,4 @@ distributions { binaryDistZip.enabled false srcDistZip.enabled false // NOTE: Gradle suggested these dependencies -binaryDistTar.dependsOn(war, ':fineract-client:jar', ':fineract-provider:build', ':fineract-doc:doc') +binaryDistTar.dependsOn(war, ':fineract-client:jar', ':fineract-avro-schemas:jar', ':fineract-provider:build', ':fineract-doc:doc') diff --git a/integration-tests/dependencies.gradle b/integration-tests/dependencies.gradle index 32d8ffbf7..079fdd32c 100644 --- a/integration-tests/dependencies.gradle +++ b/integration-tests/dependencies.gradle @@ -23,6 +23,7 @@ dependencies { tomcat 'org.apache.tomcat:tomcat:9.0.65@zip' testImplementation( files("$rootDir/fineract-provider/build/classes/java/main/"), project(path: ':fineract-provider', configuration: 'runtimeElements'), + project(path: ':fineract-avro-schemas', configuration: 'runtimeElements'), project(path: ':fineract-client', configuration: 'runtimeElements'), 'io.cucumber:cucumber-spring', 'com.intuit.karate:karate-junit5', diff --git a/settings.gradle b/settings.gradle index 4fb8b3b67..078473734 100644 --- a/settings.gradle +++ b/settings.gradle @@ -28,3 +28,4 @@ include ':twofactor-tests' include ':oauth2-tests' include ':fineract-client' include ':fineract-doc' +include ':fineract-avro-schemas'
