summaryrefslogtreecommitdiff
path: root/lisp/service/resume-service.lisp
blob: a1987d9fcd6608b4812844a887cbaec4f60a68bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(declaim (optimize (speed 0) (safety 3) (debug 3)))

(in-package :resume)

;; shared

(defclass resumes-service (auth-service)
  ((title :initarg :title
          :initform nil
          :accessor title))
  (:documentation ""))

;; resume

(defun resumes-json ()
  (with-auth (instance resumes-service "resume-view")
    (setf (title instance) "Resumes")))

(defclass resumes/view-service (resumes-service resume)
  ((resumes :initarg :resumes
            :initform nil
            :accessor resumes)
   (location-p :initform nil))
  (:documentation ""))

(defun resumes-view-json ()
  (with-auth (instance resumes/view-service "resume-view")
    (with-resume-database
      (let ((resume-pkg (make-instance 'resume-pkg))
            (user (get-user)))
        (setf (resumes instance) (get-all-resumes resume-pkg user))))
    (sanitize-rest-json instance)
    (loop for resume in (resumes instance)
          do (sanitize-json resume))))

(defclass resumes/add-service (resumes/view-service)
  ((form :initarg :form
         :initform nil
         :accessor form))
  (:documentation ""))

(defun resumes-add-json ()
  (with-auth (instance resumes/add-service "resume-modify")
    (setf (title instance) "Resume - Add")
    (setf (form instance) (make-form "resumes-add-form"
                                     nil
                                     t
                                     `((:name "name" :label "Name" :field-type "text" :required "required")
                                       (:label "Add Resume" :field-type "button" :onclick "on_resumes_add_submit_clicked()"))))))

(defun resumes-add-submit-json (name)
  (declare (special name))
  (with-auth (instance resumes/add-service "resume-modify")
    (with-resume-database
      (handler-case
          (let* ((resume-pkg (make-instance 'resume-pkg))
                 (user (get-user))
                 (resume (make-instance 'resume :user_id (id user))))
            (loop for param in (remove-if (lambda (x)
                                            (intersection `(,x) '(id)))
                                          (sb-introspect:function-lambda-list #'resumes-add-submit-json))
                  do (setf (slot-value resume param) (symbol-value param)))
            (insert-resume resume-pkg resume)
            (setf (session-value :message) (format nil "Resume \"~a\" created successfully." (name resume))))
        (error (e)
          (setf (session-value :errormsg) (format nil "Error creating resume \"~a\". ~a" name e)))))))

(defclass resumes/modify-service (resumes/add-service)
  ()
  (:documentation ""))

(defun resumes-modify-json (id)
  (with-auth (instance resumes/modify-service "resume-modify")
    (setf (title instance) "Resume - Modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (user (get-user))
             (resume (get-record resume-pkg (make-instance 'resume :id id :user_id (id user)))))
        (if resume
            (setf (form instance) (make-form "resumes-modify-form"
                                             nil
                                             t
                                             `((:name "id" :field-type "hidden" :value ,(id resume) :required "required")
                                               (:name "name" :label "Name" :field-type "text" :value ,(name resume) :required "required")
                                               (:label "Modify Resume" :field-type "button" :onclick "on_resumes_modify_submit_clicked()"))))
            (setf (session-value :errormsg) "Error: could not modify resume. Not found."))))))

(defun resumes-modify-submit-json (id name)
  (declare (special id name))
  (with-auth (instance resumes/modify-service "resume-modify")
    (setf (title instance) "Resume - Modify")
    (with-resume-database
      (handler-case
          (let* ((resume-pkg (make-instance 'resume-pkg))
                 (user (get-user))
                 (resume (get-record resume-pkg (make-instance 'resume :id id :user_id (id user)))))
            (loop for param in (remove-if (lambda (x)
                                            (intersection `(,x) '(id)))
                                          (sb-introspect:function-lambda-list #'resumes-modify-submit-json))
                  do (setf (slot-value resume param) (symbol-value param)))
            (update-record resume-pkg resume)
            (setf (session-value :message) (format nil "Resume \"~a\" modified successfully." (name resume))))
        (error (e)
          (setf (session-value :errormsg) (format nil "Error modifying resume \"~a\". ~a" name e)))))))

(defclass resumes/delete-service (resumes/add-service)
  ()
  (:documentation ""))

(defun resumes-delete-json (id)
  (with-auth (instance resumes/delete-service "resume-modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (user (get-user))
             (resume (get-record resume-pkg (make-instance 'resume :id id :user_id (id user)))))
        (if resume
            (progn
              (delete-resume resume-pkg resume)
              (setf (session-value :message) (format nil "Resume \"~a\" deleted successfully." (name resume))))
            (setf (session-value :errormsg) "Error: could not delete resume: not found."))))))

;; contactinfo

(defun contactinfo-json ()
  (with-auth (instance resumes-service "resume-view")
    (setf (title instance) "Contact Information")))

(defclass contactinfo/view-service (resumes-service contactinfo)
  ((contactinfos :initarg :contactinfos
                 :initform nil
                 :accessor contactinfos)
   (location-p :initform nil))
  (:documentation ""))

(defun contactinfo-view-json ()
  (with-auth (instance contactinfo/view-service "resume-view")
    (with-resume-database
      (let ((resume-pkg (make-instance 'resume-pkg))
            (user (get-user)))
        (setf (contactinfos instance) (get-all-contactinfo resume-pkg user))))
    (sanitize-rest-json instance)
    (loop for contactinfo-v in (contactinfos instance)
          do (sanitize-json contactinfo-v))))

(defclass contactinfo/add-service (contactinfo/view-service)
  ((form :initarg :form
         :initform nil
         :accessor form))
  (:documentation ""))

(defun state-options (states)
  (mapcar (lambda (state)
            `(:label ,(format nil "~a ~a" (abbr state) (state state)) :value ,(id state)))
          states))

(defun visastatus-options (visastatuses)
  (mapcar (lambda (visastatus)
            `(:label ,(status visastatus) :value ,(id visastatus)))
          visastatuses))

(defun contactinfo-add-json ()
  (with-auth (instance contactinfo/add-service "resume-modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (states (get-records resume-pkg (make-instance 'states) "abbr asc"))
             (visastatuses (get-records resume-pkg (make-instance 'visastatus) "visastatus asc")))
        (setf (title instance) "Contact Info - Add")
        (setf (form instance) (make-form "contactinfo-add-form"
                                         nil
                                         t
                                         `((:name "address" :label "Address" :field-type "text" :required "required")
                                           (:name "city" :label "City" :field-type "text" :required "required")
                                           (:name "state_id" :label "State" :field-type "select" :options ,(state-options states) :required "required")
                                           (:name "phone" :label "Phone" :field-type "text" :required "required")
                                           (:name "email" :label "Email" :field-type "text" :required "required")
                                           (:name "visastatus_id" :label "VISA Status" :field-type "select" :options ,(visastatus-options visastatuses) :required "required")
                                           (:label "Add Contact Info" :field-type "button" :onclick "on_contactinfo_add_submit_clicked()"))))))))

(defun contactinfo-add-submit-json (address city state_id phone email visastatus_id)
  (declare (special address city state_id phone email visastatus_id))
  (with-auth (instance contactinfo/add-service "resume-modify")
    (with-resume-database
      (handler-case
          (let* ((resume-pkg (make-instance 'resume-pkg))
                 (user (get-user))
                 (contactinfo (make-instance 'contactinfo :user_id (id user))))
            (loop for param in (remove-if (lambda (x)
                                            (intersection `(,x) '(id)))
                                          (sb-introspect:function-lambda-list #'contactinfo-add-submit-json))
                  do (setf (slot-value contactinfo param) (symbol-value param)))
            (insert-contactinfo resume-pkg contactinfo)
            (setf (session-value :message) (format nil "Contact Info \"~a, ~a\" created successfully." address city)))
        (error (e)
          (setf (session-value :errormsg) (format nil "Error creating Contact Info \"~a, ~a\". ~a" address city e)))))))

(defclass contactinfo/modify-service (contactinfo/add-service)
  ()
  (:documentation ""))

(defun contactinfo-modify-json (id)
  (with-auth (instance contactinfo/modify-service "resume-modify")
    (setf (title instance) "Contact Info - Modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (user (get-user))
             (states (get-records resume-pkg (make-instance 'states) "abbr asc"))
             (visastatuses (get-records resume-pkg (make-instance 'visastatus) "status asc"))
             (contactinfo-v (get-record resume-pkg (make-instance 'contactinfo-v :id id :user_id (id user)))))
        (if contactinfo-v
            (setf (form instance) (make-form "contactinfo-modify-form"
                                             nil
                                             t
                                             `((:name "id" :field-type "hidden" :value ,(id contactinfo-v) :required "required")
                                               (:name "address" :label "Address" :field-type "text" :value ,(address contactinfo-v) :required "required")
                                               (:name "city" :label "City" :field-type "text" :value ,(city contactinfo-v) :required "required")
                                               (:name "state_id" :label "State" :field-type "select" :value ,(state_id contactinfo-v) :options ,(state-options states) :required "required")
                                               (:name "phone" :label "Phone" :field-type "text" :value ,(phone contactinfo-v) :required "required")
                                               (:name "email" :label "Email" :field-type "text" :value ,(email contactinfo-v) :required "required")
                                               (:name "visastatus_id" :label "VISA Status" :field-type "select" :value ,(visastatus_id contactinfo-v) :options ,(visastatus-options visastatuses) :required "required")
                                               (:label "Modify Contact Info" :field-type "button" :onclick "on_contactinfo_modify_submit_clicked()"))))
            (setf (session-value :errormsg) "Error: could not modify Contact Info. Not found."))))))

(defun contactinfo-modify-submit-json (id address city state_id phone email visastatus_id)
  (declare (special id address city state_id phone email visastatus_id))
  (with-auth (instance contactinfo/modify-service "resume-modify")
    (setf (title instance) "Contact Info - Modify")
    (with-resume-database
      (handler-case
          (let* ((resume-pkg (make-instance 'resume-pkg))
                 (user (get-user))
                 (contactinfo (get-record resume-pkg (make-instance 'contactinfo :id id :user_id (id user)))))
            (loop for param in (remove-if (lambda (x)
                                            (intersection `(,x) '(id)))
                                          (sb-introspect:function-lambda-list #'contactinfo-modify-submit-json))
                  do (setf (slot-value contactinfo param) (symbol-value param)))
            (update-record resume-pkg contactinfo)
            (setf (session-value :message) (format nil "Contact Info \"~a, ~a\" modified successfully." address city)))
        (error (e)
          (setf (session-value :errormsg) (format nil "Error modifying Contact Info \"~a, ~a\". ~a" address city e)))))))

(defclass contactinfo/delete-service (contactinfo/add-service)
  ()
  (:documentation ""))

(defun contactinfo-delete-json (id)
  (with-auth (instance contactinfo/delete-service "resume-modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (user (get-user))
             (contactinfo (get-record resume-pkg (make-instance 'contactinfo :id id :user_id (id user)))))
        (if contactinfo
            (progn
              (delete-record resume-pkg contactinfo)
              (setf (session-value :message) (format nil "Contact Info \"~a, ~a\" deleted successfully." (address contactinfo) (city contactinfo))))
            (setf (session-value :errormsg) "Error: could not delete Contact Info: not found."))))))

;; education

(defun education-json ()
  (with-auth (instance resumes-service "resume-view")
    (setf (title instance) "Education")))

(defclass education/view-service (resumes-service education)
  ((educations :initarg :educations
               :initform nil
               :accessor educations)
   (location-p :initform nil))
  (:documentation ""))

(defun education-view-json ()
  (with-auth (instance education/view-service "resume-view")
    (with-resume-database
      (let ((resume-pkg (make-instance 'resume-pkg))
            (user (get-user)))
        (setf (educations instance) (get-all-education resume-pkg user))))
    (sanitize-rest-json instance)
    (loop for education in (educations instance)
          do (sanitize-json education))))

(defclass education/add-service (education/view-service)
  ((form :initarg :form
         :initform nil
         :accessor form))
  (:documentation ""))

(defun education-add-json ()
  (with-auth (instance education/add-service "resume-modify")
    (setf (form instance) (make-form "education-add-form"
                                     nil
                                     t
                                     `((:name "school" :label "School" :field-type "text" :required "required")
                                       (:name "major" :label "Major" :field-type "text" :required "required")
                                       (:name "minor" :label "Minor" :field-type "text")
                                       (:name "degree" :label "Degree" :field-type "text" :required "required")
                                       (:name "progress" :label "Progress" :field-type "text" :required "required")
                                       (:name "start_date" :label "Start Date" :field-type "text" :required "required")
                                       (:name "end_date" :label "End Date" :field-type "text" :required "required")
                                       (:label "Add Education" :field-type "button" :onclick "on_education_add_submit_clicked()"))))))

(defun education-add-submit-json (school major minor degree progress start_date end_date)
  (declare (special school major minor degree progress start_date end_date))
  (with-auth (instance education/add-service "resume-modify")
    (with-resume-database
      (handler-case
          (let* ((resume-pkg (make-instance 'resume-pkg))
                 (user (get-user))
                 (education (make-instance 'education :user_id (id user))))
            (loop for param in (remove-if (lambda (x)
                                            (intersection `(,x) '(id)))
                                          (sb-introspect:function-lambda-list #'education-add-submit-json))
                  do (setf (slot-value education param) (symbol-value param)))
            (insert-education resume-pkg education)
            (setf (session-value :message) (format nil "Education \"~a, ~a\" created successfully." school major)))
        (error (e)
          (setf (session-value :errormsg) (format nil "Error creating Education \"~a, ~a\". ~a" school major e)))))))

(defclass education/modify-service (education/add-service)
  ()
  (:documentation ""))

(defun education-modify-json (id)
  (with-auth (instance education/modify-service "resume-modify")
    (setf (title instance) "Education - Modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (user (get-user))
             (education (get-record resume-pkg (make-instance 'education :id id :user_id (id user)))))
        (if education
            (setf (form instance) (make-form "education-modify-form"
                                             nil
                                             t
                                             `((:name "id" :field-type "hidden" :value ,(id education) :required "required")
                                               (:name "school" :label "School" :field-type "text" :value ,(school education) :required "required")
                                               (:name "major" :label "Major" :field-type "text" :value ,(major education) :required "required")
                                               (:name "minor" :label "Minor" :field-type "text" :value ,(minor education))
                                               (:name "degree" :label "Degree" :field-type "text" :value ,(degree education) :required "required")
                                               (:name "progress" :label "Progress" :field-type "text" :value ,(progress education) :required "required")
                                               (:name "start_date" :label "Start Date" :field-type "text" :value ,(start_date education) :required "required")
                                               (:name "end_date" :label "End Date" :field-type "text" :value ,(end_date education) :required "required")
                                               (:label "Modify Education" :field-type "button" :onclick "on_education_modify_submit_clicked()"))))
            (setf (session-value :errormsg) "Error: could not modify Education. Not found."))))))

(defun education-modify-submit-json (id school major minor degree progress start_date end_date)
  (declare (special id school major minor degree progress start_date end_date))
  (with-auth (instance education/modify-service "resume-modify")
    (setf (title instance) "Education - Modify")
    (with-resume-database
      (handler-case
          (let* ((resume-pkg (make-instance 'resume-pkg))
                 (user (get-user))
                 (education (get-record resume-pkg (make-instance 'education :id id :user_id (id user)))))
            (loop for param in (remove-if (lambda (x)
                                            (intersection `(,x) '(id)))
                                          (sb-introspect:function-lambda-list #'education-modify-submit-json))
                  do (setf (slot-value education param) (symbol-value param)))
            (update-record resume-pkg education)
            (setf (session-value :message) (format nil "Education \"~a, ~a\" modified successfully." school major)))
        (error (e)
          (setf (session-value :errormsg) (format nil "Error modifying Education \"~a, ~a\". ~a" school major e)))))))

(defclass education/delete-service (education/add-service)
  ()
  (:documentation ""))

(defun education-delete-json (id)
  (with-auth (instance education/delete-service "resume-modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (user (get-user))
             (education (get-record resume-pkg (make-instance 'education :id id :user_id (id user)))))
        (if education
            (progn
              (delete-record resume-pkg education)
              (setf (session-value :message) (format nil "Education \"~a, ~a\" deleted successfully." (school education) (major education))))
            (setf (session-value :errormsg) "Error: could not delete Education: not found."))))))

;; language

(defun language-json ()
  (with-auth (instance resumes-service "resume-view")
    (setf (title instance) "Languages")))

(defclass language/view-service (resumes-service language)
  ((languages :initarg :languages
               :initform nil
               :accessor languages)
   (location-p :initform nil))
  (:documentation ""))

(defun language-view-json ()
  (with-auth (instance language/view-service "resume-view")
    (with-resume-database
      (let ((resume-pkg (make-instance 'resume-pkg))
            (user (get-user)))
        (setf (languages instance) (get-all-languages resume-pkg user))))
    (sanitize-rest-json instance)
    (loop for language in (languages instance)
          do (sanitize-json language))))

(defclass language/add-service (language/view-service)
  ((form :initarg :form
         :initform nil
         :accessor form))
  (:documentation ""))

(defun language-options ()
  (mapcar (lambda (level)
            `(:label ,level :value ,level))
          '("A1" "A2" "B1" "B2" "C1" "C2")))

(defun language-add-json ()
  (with-auth (instance language/add-service "resume-modify")
    (setf (title instance) "Language - Add")
    (setf (form instance) (make-form "language-add-form"
                                     nil
                                     t
                                     `((:name "name" :label "Name" :field-type "text" :required "required")
                                       (:name "understanding_listening" :label "Understanding Listening" :field-type "select" :options ,(language-options) :required "required")
                                       (:name "understanding_reading" :label "Understanding Reading" :field-type "select" :options ,(language-options) :required "required")
                                       (:name "speaking_interaction" :label "Speaking Interaction" :field-type "select" :options ,(language-options) :required "required")
                                       (:name "speaking_production" :label "Speaking Production" :field-type "select" :options ,(language-options) :required "required")
                                       (:name "writing" :label "Writing" :field-type "select" :options ,(language-options) :required "required")
                                       (:label "Add Language" :field-type "button" :onclick "on_language_add_submit_clicked()"))))))

(defun language-add-submit-json (name understanding_listening understanding_reading speaking_interaction speaking_production writing)
  (declare (special name understanding_listening understanding_reading speaking_interaction speaking_production writing))
  (with-auth (instance language/add-service "resume-modify")
    (with-resume-database
      (handler-case
          (let* ((resume-pkg (make-instance 'resume-pkg))
                 (user (get-user))
                 (language (make-instance 'language :user_id (id user))))
            (loop for param in (remove-if (lambda (x)
                                            (intersection `(,x) '(id)))
                                          (sb-introspect:function-lambda-list #'language-add-submit-json))
                  do (setf (slot-value language param) (symbol-value param)))
            (insert-language resume-pkg language)
            (setf (session-value :message) (format nil "Language \"~a\" created successfully." name)))
        (error (e)
          (setf (session-value :errormsg) (format nil "Error creating Language \"~a\". ~a" name e)))))))

(defclass language/modify-service (language/add-service)
  ()
  (:documentation ""))

(defun language-modify-json (id)
  (with-auth (instance language/modify-service "resume-modify")
    (setf (title instance) "Language - Modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (user (get-user))
             (language (get-record resume-pkg (make-instance 'language :id id :user_id (id user)))))
        (if language
            (setf (form instance) (make-form "language-modify-form"
                                             nil
                                             t
                                             `((:name "id" :field-type "hidden" :value ,(id language) :required "required")
                                               (:name "name" :label "Name" :field-type "text" :value ,(name language) :required "required")
                                               (:name "understanding_listening" :label "Understanding Listening" :field-type "select" :options ,(language-options) :value ,(understanding_listening language) :required "required")
                                               (:name "understanding_reading" :label "Understanding Reading" :field-type "select" :options ,(language-options) :value ,(understanding_reading language) :required "required")
                                               (:name "speaking_interaction" :label "Speaking Interaction" :field-type "select" :options ,(language-options) :value ,(speaking_interaction language) :required "required")
                                               (:name "speaking_production" :label "Speaking Production" :field-type "select" :options ,(language-options) :value ,(speaking_production language) :required "required")
                                               (:name "writing" :label "Writing" :field-type "text" :value ,(writing language) :required "required")
                                               
                                               (:label "Modify Language" :field-type "button" :onclick "on_language_modify_submit_clicked()"))))
            (setf (session-value :errormsg) "Error: could not modify Language. Not found."))))))

(defun language-modify-submit-json (id name understanding_listening understanding_reading speaking_interaction speaking_production writing)
  (declare (special id name understanding_listening understanding_reading speaking_interaction speaking_production writing))
  (with-auth (instance language/modify-service "resume-modify")
    (setf (title instance) "Language - Modify")
    (with-resume-database
      (handler-case
          (let* ((resume-pkg (make-instance 'resume-pkg))
                 (user (get-user))
                 (language (get-record resume-pkg (make-instance 'language :id id :user_id (id user)))))
            (loop for param in (remove-if (lambda (x)
                                            (intersection `(,x) '(id)))
                                          (sb-introspect:function-lambda-list #'language-modify-submit-json))
                  do (setf (slot-value language param) (symbol-value param)))
            (update-record resume-pkg language)
            (setf (session-value :message) (format nil "Language \"~a\" modified successfully." name)))
        (error (e)
          (setf (session-value :errormsg) (format nil "Error modifying Language \"~a\". ~a" name e)))))))

(defclass language/delete-service (language/add-service)
  ()
  (:documentation ""))

(defun language-delete-json (id)
  (with-auth (instance language/delete-service "resume-modify")
    (with-resume-database
      (let* ((resume-pkg (make-instance 'resume-pkg))
             (user (get-user))
             (language (get-record resume-pkg (make-instance 'language :id id :user_id (id user)))))
        (if language
            (progn
              (delete-record resume-pkg language)
              (setf (session-value :message) (format nil "Language \"~a\" deleted successfully." (name language))))
            (setf (session-value :errormsg) "Error: could not delete Language: not found."))))))