forked from apache/fineract
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FINERACT-1694: Avro schemas project + code generation + some initial …
…Avro Schemas
- Loading branch information
Showing
24 changed files
with
1,227 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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,21 @@ | ||
/** | ||
* 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. | ||
*/ | ||
dependencies { | ||
implementation('org.apache.avro:avro') | ||
} |
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,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" | ||
} | ||
] | ||
} |
82 changes: 82 additions & 0 deletions
82
fineract-avro-schemas/src/main/avro/client/v1/ClientEventV1.avsc
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,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" | ||
] | ||
} | ||
] | ||
} |
47 changes: 47 additions & 0 deletions
47
fineract-avro-schemas/src/main/avro/client/v1/ClientEventV1Status.avsc
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,47 @@ | ||
/** | ||
* 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": "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" | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.