add signature setting

For multiple users it helps to
keep track about who did what.
This commit is contained in:
2025-09-29 03:31:16 +02:00
parent 15dc8a1bef
commit 335c1d13af
7 changed files with 94 additions and 11 deletions

View File

@@ -55,6 +55,12 @@ class LunaEvent: Comparable<LunaEvent> {
set(value) {
jo.put("notes", value)
}
var signature: String
get(): String = jo.optString("signature")
set(value) {
if (value.isNotEmpty())
jo.put("signature", value)
}
constructor(jo: JSONObject) {
this.jo = jo
@@ -63,16 +69,18 @@ class LunaEvent: Comparable<LunaEvent> {
throw IllegalArgumentException("JSONObject is not a LunaEvent")
}
constructor(type: String) {
constructor(type: String, signature: String) {
this.jo = JSONObject()
this.time = System.currentTimeMillis() / 1000
this.signature = signature
this.type = type
}
constructor(type: String, quantity: Int) {
constructor(type: String, signature: String, quantity: Int) {
this.jo = JSONObject()
this.time = System.currentTimeMillis() / 1000
this.type = type
this.signature = signature
this.quantity = quantity
}