chore: added more data to the applications

This commit is contained in:
2025-04-01 12:58:11 +01:00
parent 1b6a887648
commit 141cfbf7a6
10 changed files with 220 additions and 46 deletions

View File

@@ -52,6 +52,8 @@ data class Application(
var create_time: String,
var simple_url: String,
var job_level: String,
var inperson_type: String,
var location: String,
var flairs: List<Flair>,
var events: List<Event>,
var urls: List<String>,
@@ -73,6 +75,8 @@ data class Application(
rs.getString("create_time"),
rs.getString("simple_url"),
rs.getString("job_level"),
rs.getString("inperson_type"),
rs.getString("location"),
emptyList(),
emptyList(),
emptyList(),
@@ -155,6 +159,8 @@ class ApplicationsController(
"",
"",
"",
"",
"",
emptyList(),
emptyList(),
emptyList(),
@@ -511,6 +517,8 @@ class ApplicationService(
"",
if (elm.contains("linkedin")) elm.split("?")[0] else "",
"",
"",
"",
emptyList(),
emptyList(),
emptyList(),
@@ -533,7 +541,7 @@ class ApplicationService(
// Create time is auto created by the database
db.update(
"insert into applications (id, url, title, user_id, extra_data, payrange, status_id, company, recruiter, message, agency, simple_url, job_level) values (?,?,?,?,?,?,?,?,?,?,?,?,?);",
"insert into applications (id, url, title, user_id, extra_data, payrange, status_id, company, recruiter, message, agency, simple_url, job_level, inperson_type, location) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);",
application.id,
application.url,
application.title,
@@ -547,6 +555,8 @@ class ApplicationService(
application.agency,
application.simple_url,
application.job_level,
application.inperson_type,
application.location,
)
eventService.create(application.id, EventType.Creation)
@@ -594,7 +604,7 @@ class ApplicationService(
public fun update(application: Application): Application {
// I don't want ot update create_time
db.update(
"update applications set url=?, title=?, user_id=?, extra_data=?, payrange=?, company=?, recruiter=?, message=?, agency=?, simple_url=?, job_level=? where id=?",
"update applications set url=?, title=?, user_id=?, extra_data=?, payrange=?, company=?, recruiter=?, message=?, agency=?, simple_url=?, job_level=?, inperson_type=?, location=? where id=?",
application.url,
application.title,
application.user_id,
@@ -606,6 +616,8 @@ class ApplicationService(
application.agency,
application.simple_url,
application.job_level,
application.inperson_type,
application.location,
application.id,
)
return application

View File

@@ -19,6 +19,9 @@ create table if not exists applications (
user_id text,
extra_data text,
job_level text default '',
-- remote - hyrbrid - in-person
inperson_type text default '',
location text default '',
status_id text default null,
agency boolean default false,
create_time timestamp default now ()