feat: added application_time
This commit is contained in:
		
							parent
							
								
									d8b0556a3e
								
							
						
					
					
						commit
						5253204e17
					
				| @ -2,6 +2,8 @@ package com.andr3h3nriqu3s.applications | |||||||
| 
 | 
 | ||||||
| import java.sql.ResultSet | import java.sql.ResultSet | ||||||
| import java.util.UUID | import java.util.UUID | ||||||
|  | import java.util.Date | ||||||
|  | import java.text.SimpleDateFormat | ||||||
| import kotlin.collections.emptyList | import kotlin.collections.emptyList | ||||||
| import kotlin.collections.setOf | import kotlin.collections.setOf | ||||||
| import org.springframework.http.MediaType | import org.springframework.http.MediaType | ||||||
| @ -34,6 +36,7 @@ data class Application( | |||||||
|         var message: String, |         var message: String, | ||||||
|         var linked_application: String, |         var linked_application: String, | ||||||
|         var status_history: String, |         var status_history: String, | ||||||
|  |         var application_time: String, | ||||||
|         var flairs: List<Flair>, |         var flairs: List<Flair>, | ||||||
|         var views: List<View>, |         var views: List<View>, | ||||||
| ) { | ) { | ||||||
| @ -54,6 +57,7 @@ data class Application( | |||||||
|                     rs.getString("message"), |                     rs.getString("message"), | ||||||
|                     rs.getString("linked_application"), |                     rs.getString("linked_application"), | ||||||
|                     rs.getString("status_history"), |                     rs.getString("status_history"), | ||||||
|  |                     rs.getString("application_time"), | ||||||
|                     emptyList(), |                     emptyList(), | ||||||
|                     emptyList(), |                     emptyList(), | ||||||
|             ) |             ) | ||||||
| @ -185,6 +189,7 @@ class ApplicationsController( | |||||||
|                             "", |                             "", | ||||||
|                             "", |                             "", | ||||||
|                             "", |                             "", | ||||||
|  |                             "", | ||||||
|                             emptyList(), |                             emptyList(), | ||||||
|                             emptyList(), |                             emptyList(), | ||||||
|                     ) |                     ) | ||||||
| @ -270,6 +275,11 @@ class ApplicationsController( | |||||||
| 
 | 
 | ||||||
|         application.status_history = status_history.joinToString(",") { it } |         application.status_history = status_history.joinToString(",") { it } | ||||||
| 
 | 
 | ||||||
|  |         if (info.status == 4) { | ||||||
|  |             val sdf = SimpleDateFormat("dd/MM/yyyy hh:mm:ss") | ||||||
|  |             application.application_time = sdf.format(Date()) | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         applicationService.update(application) |         applicationService.update(application) | ||||||
| 
 | 
 | ||||||
|         return application |         return application | ||||||
| @ -476,7 +486,7 @@ class ApplicationService( | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         db.update( |         db.update( | ||||||
|                 "insert into applications (id, url, original_url, unique_url, title, user_id, extra_data, payrange, status, company, recruiter, message, linked_application, status_history) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", |                 "insert into applications (id, url, original_url, unique_url, title, user_id, extra_data, payrange, status, company, recruiter, message, linked_application, status_history, application_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", | ||||||
|                 application.id, |                 application.id, | ||||||
|                 application.url, |                 application.url, | ||||||
|                 application.original_url, |                 application.original_url, | ||||||
| @ -491,6 +501,7 @@ class ApplicationService( | |||||||
|                 application.message, |                 application.message, | ||||||
|                 application.linked_application, |                 application.linked_application, | ||||||
|                 application.status_history, |                 application.status_history, | ||||||
|  |                 application.application_time, | ||||||
|         ) |         ) | ||||||
| 
 | 
 | ||||||
|         return true |         return true | ||||||
| @ -527,7 +538,7 @@ class ApplicationService( | |||||||
| 
 | 
 | ||||||
|     public fun update(application: Application): Application { |     public fun update(application: Application): Application { | ||||||
|         db.update( |         db.update( | ||||||
|                 "update applications set url=?, original_url=?, unique_url=?, title=?, user_id=?, extra_data=?, payrange=?, status=?, company=?, recruiter=?, message=?, linked_application=?, status_history=? where id=?", |                 "update applications set url=?, original_url=?, unique_url=?, title=?, user_id=?, extra_data=?, payrange=?, status=?, company=?, recruiter=?, message=?, linked_application=?, status_history=?, application_time=? where id=?", | ||||||
|                 application.url, |                 application.url, | ||||||
|                 application.original_url, |                 application.original_url, | ||||||
|                 application.unique_url, |                 application.unique_url, | ||||||
| @ -541,6 +552,7 @@ class ApplicationService( | |||||||
|                 application.message, |                 application.message, | ||||||
|                 application.linked_application, |                 application.linked_application, | ||||||
|                 application.status_history, |                 application.status_history, | ||||||
|  |                 application.application_time, | ||||||
|                 application.id, |                 application.id, | ||||||
|         ) |         ) | ||||||
|         return application |         return application | ||||||
|  | |||||||
| @ -36,3 +36,7 @@ ## Building | |||||||
| You can preview the production build with `npm run preview`. | You can preview the production build with `npm run preview`. | ||||||
| 
 | 
 | ||||||
| > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. | > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. | ||||||
|  | 
 | ||||||
|  | ## TODO | ||||||
|  | 
 | ||||||
|  | https://www.glassdoor.co.uk/job-listing/junior-software-developer-full-stack-onnec-group-JV_IC2671300_KO0,36_KE37,48.htm?jl=1009478590946&utm_source=jobsForYou&utm_medium=email&utm_content=jobs-for-you-jobsForYou-jobpos5-1009478590946&utm_campaign=jobsForYou&src=GD_JOB_AD&uido=5EF1E454F911F36A51BB1DD9CB97C8DB&ao=1136043&jrtk=6-y100011i9mkhgisgqqb801ab7157ddf833b2e1c&cs=1_57b69a24&s=362&t=REC_JOBS&pos=105&guid=00000192656d7c18b164f224f0a88e83&jobListingId=1009478590946&ea=1&vt=e&cb=1728410338190&ctt=1728466768707 | ||||||
|  | |||||||
| @ -48,6 +48,7 @@ export type Application = { | |||||||
|     company: string; |     company: string; | ||||||
|     message: string; |     message: string; | ||||||
|     linked_application: string; |     linked_application: string; | ||||||
|  |     application_time: string; | ||||||
| 	flairs: Flair[]; | 	flairs: Flair[]; | ||||||
|     views: View[]; |     views: View[]; | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -14,8 +14,6 @@ | |||||||
| 	import DropZone from './DropZone.svelte'; | 	import DropZone from './DropZone.svelte'; | ||||||
| 	import { userStore } from '$lib/UserStore.svelte'; | 	import { userStore } from '$lib/UserStore.svelte'; | ||||||
| 	import LinkApplication from './LinkApplication.svelte'; | 	import LinkApplication from './LinkApplication.svelte'; | ||||||
| 	import ApplicationsList from '../ApplicationsList.svelte'; |  | ||||||
| 	import TasksToDoList from '../TasksToDoList.svelte'; |  | ||||||
| 
 | 
 | ||||||
| 	let activeItem: Application | undefined = $state(); | 	let activeItem: Application | undefined = $state(); | ||||||
| 
 | 
 | ||||||
| @ -302,6 +300,14 @@ | |||||||
| 						</div> | 						</div> | ||||||
| 					</fieldset> | 					</fieldset> | ||||||
| 				{/if} | 				{/if} | ||||||
|  | 				{#if activeItem.application_time} | ||||||
|  | 					<fieldset draggable="false"> | ||||||
|  | 						<div class="flabel">Application Time</div> | ||||||
|  | 						<div class="finput bg-white"> | ||||||
|  | 							{activeItem.application_time} | ||||||
|  | 						</div> | ||||||
|  | 					</fieldset> | ||||||
|  | 				{/if} | ||||||
| 				<div> | 				<div> | ||||||
| 					<div class="flabel">Tags</div> | 					<div class="flabel">Tags</div> | ||||||
| 					<div class="flex gap-2 flex-wrap"> | 					<div class="flex gap-2 flex-wrap"> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user