chore: added stauts_history
This commit is contained in:
@@ -33,6 +33,7 @@ data class Application(
|
||||
var recruiter: String,
|
||||
var message: String,
|
||||
var linked_application: String,
|
||||
var status_history: String,
|
||||
var flairs: List<Flair>,
|
||||
var views: List<View>,
|
||||
) {
|
||||
@@ -52,6 +53,7 @@ data class Application(
|
||||
rs.getString("recruiter"),
|
||||
rs.getString("message"),
|
||||
rs.getString("linked_application"),
|
||||
rs.getString("status_history"),
|
||||
emptyList(),
|
||||
emptyList(),
|
||||
)
|
||||
@@ -182,6 +184,7 @@ class ApplicationsController(
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
emptyList(),
|
||||
emptyList(),
|
||||
)
|
||||
@@ -259,6 +262,13 @@ class ApplicationsController(
|
||||
}
|
||||
|
||||
application.status = info.status
|
||||
val status_string = "${info.status}";
|
||||
var status_history = application.status_history.split(",").filter { it.length >= 1 }
|
||||
if (status_history.indexOf(status_string) == -1) {
|
||||
status_history = status_history.plus("${info.status}");
|
||||
}
|
||||
|
||||
application.status_history = status_history.joinToString(",") { it }
|
||||
|
||||
applicationService.update(application)
|
||||
|
||||
@@ -466,7 +476,7 @@ class ApplicationService(
|
||||
}
|
||||
|
||||
db.update(
|
||||
"insert into applications (id, url, original_url, unique_url, title, user_id, extra_data, payrange, status, company, recruiter, message, linked_application) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
|
||||
"insert into applications (id, url, original_url, unique_url, title, user_id, extra_data, payrange, status, company, recruiter, message, linked_application, status_history) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
|
||||
application.id,
|
||||
application.url,
|
||||
application.original_url,
|
||||
@@ -480,6 +490,7 @@ class ApplicationService(
|
||||
application.recruiter,
|
||||
application.message,
|
||||
application.linked_application,
|
||||
application.status_history,
|
||||
)
|
||||
|
||||
return true
|
||||
@@ -516,7 +527,7 @@ class ApplicationService(
|
||||
|
||||
public fun update(application: Application): Application {
|
||||
db.update(
|
||||
"update applications set url=?, original_url=?, unique_url=?, title=?, user_id=?, extra_data=?, payrange=?, status=?, company=?, recruiter=?, message=?, linked_application=? where id=?",
|
||||
"update applications set url=?, original_url=?, unique_url=?, title=?, user_id=?, extra_data=?, payrange=?, status=?, company=?, recruiter=?, message=?, linked_application=?, status_history=? where id=?",
|
||||
application.url,
|
||||
application.original_url,
|
||||
application.unique_url,
|
||||
@@ -529,6 +540,7 @@ class ApplicationService(
|
||||
application.recruiter,
|
||||
application.message,
|
||||
application.linked_application,
|
||||
application.status_history,
|
||||
application.id,
|
||||
)
|
||||
return application
|
||||
|
||||
@@ -20,6 +20,7 @@ create table if not exists applications (
|
||||
recruiter text,
|
||||
title text,
|
||||
mesasge text default '',
|
||||
status_history text default '',
|
||||
user_id text,
|
||||
extra_data text,
|
||||
status integer,
|
||||
|
||||
Reference in New Issue
Block a user