-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
204 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
;;;;receipts | ||
(in-package :bartleby) | ||
(load-saved-item (make-receipt (make-appointment 10008 (quote (1001)) (quote (2001)) 0 (date-time (date 4 27 2022) (set-time 10 30)) 30 "violin") 20003 0 30 0 "violin")) | ||
|
||
(load-saved-item (make-receipt (make-appointment 10006 (quote (1001)) (quote (2001)) 0 (date-time (date 4 20 2022) (set-time 10 30)) 30 "violin") 20004 4 45 -15 "violin")) | ||
|
||
(load-saved-item (make-receipt (make-appointment 10004 (quote (1001)) (quote (2001)) 0 (date-time (date 4 13 2022) (set-time 10 30)) 30 "violin") 20005 1 0 0 "violin")) | ||
|
||
(load-saved-item (make-receipt (make-appointment 10003 (quote (1001)) (quote (2001)) 0 (date-time (date 4 6 2022) (set-time 10 30)) 30 "violin") 20006 2 0 30 "violin")) | ||
|
||
(load-saved-item (make-receipt (make-appointment 10010 (quote (1001)) (quote (2001)) 0 (date-time (date 5 4 2022) (set-time 10 30)) 30 "violin") 20001 4 45 -15 "violin" | ||
)) | ||
(load-saved-item (make-receipt (make-appointment 10008 (quote (1001)) (quote (2001)) 0 (date-time (date 4 27 2022) (set-time 10 30)) 30 "violin") 20003 0 30 0 "violin" | ||
)) | ||
(load-saved-item (make-receipt (make-appointment 10008 (quote (1001)) (quote (2001)) 0 (date-time (date 4 27 2022) (set-time 10 30)) 30 "violin") 20003 0 30 0 "violin" | ||
)) | ||
(load-saved-item (make-receipt (make-appointment 10006 (quote (1001)) (quote (2001)) 0 (date-time (date 4 20 2022) (set-time 10 30)) 30 "violin") 20004 4 45 -15 "violin" | ||
)) | ||
(load-saved-item (make-receipt (make-appointment 10006 (quote (1001)) (quote (2001)) 0 (date-time (date 4 20 2022) (set-time 10 30)) 30 "violin") 20004 4 45 -15 "violin" | ||
)) | ||
(load-saved-item (make-receipt (make-appointment 10004 (quote (1001)) (quote (2001)) 0 (date-time (date 4 13 2022) (set-time 10 30)) 30 "violin") 20005 1 0 0 "violin" | ||
)) | ||
(load-saved-item (make-receipt (make-appointment 10004 (quote (1001)) (quote (2001)) 0 (date-time (date 4 13 2022) (set-time 10 30)) 30 "violin") 20005 1 0 0 "violin" | ||
)) | ||
(load-saved-item (make-receipt (make-appointment 10003 (quote (1001)) (quote (2001)) 0 (date-time (date 4 6 2022) (set-time 10 30)) 30 "violin") 20006 2 0 30 "violin" | ||
)) | ||
(load-saved-item (make-receipt (make-appointment 10003 (quote (1001)) (quote (2001)) 0 (date-time (date 4 6 2022) (set-time 10 30)) 30 "violin") 20006 2 0 30 "violin" | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
;;;;bart/package.lisp | ||
|
||
(defpackage #:bart | ||
(:use #:cl #:bartleby)) | ||
(:use #:cl #:bartleby) | ||
|
||
(:export #:bart)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
;;;;bart/view.lisp | ||
;;;; | ||
|
||
(in-package :bart) | ||
|
||
(defgeneric view-print (object) | ||
(:documentation "Prints an object for viewing")) | ||
|
||
(defmethod view-print ((client bartleby:client)) | ||
(format nil "~a ~a, ID: ~a~%~a~%~a~%Credits: ~a~%Notes: ~a~%" | ||
(bartleby::first-name client) | ||
(bartleby::last-name client) | ||
(bartleby::id client) | ||
(bartleby::phone client) | ||
(bartleby::email client) | ||
(bartleby::credit-minutes client) | ||
(bartleby::notes client))) | ||
|
||
(defmethod view-print ((employee bartleby:employee)) | ||
(format nil "~a ~a, ID: ~a~%~a~%~a~%Hourly Rate: ~a~%" | ||
(bartleby::first-name employee) | ||
(bartleby::last-name employee) | ||
(bartleby::id employee) | ||
(bartleby::phone employee) | ||
(bartleby::email employee) | ||
(bartleby::hourly-rate employee))) | ||
|
||
(defmethod view-print ((appointment bartleby:appointment)) | ||
(format nil "~a" | ||
appointment)) | ||
|
||
(defun view-prompt () | ||
(write-line "Please enter a client, employee, or appointment ID.") | ||
(view (parse-integer (prompt-read "ID")))) | ||
|
||
(defun view (&optional id) | ||
(if id | ||
(format t "~a" (view-print (bartleby::id-search (if (numberp id) | ||
id | ||
(parse-integer id))))) | ||
(view-prompt))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
;;;;bart/view.lisp | ||
;;;; | ||
|
||
(in-package :bart) | ||
|
||
(defun view-prompt () | ||
(write-line "Please enter a client, employee, or appointment ID.") | ||
(view (prompt-read "ID"))) | ||
|
||
(defun view (&optional id) | ||
(if id | ||
(browse-print (bartleby::id-search id)) | ||
(view-prompt))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
;;;;sort.lisp | ||
;;;; | ||
|
||
(in-package :bartleby) | ||
|
||
;;;;------------------------------------------------------------------------ | ||
;;;; | ||
;;;;------------------------------------------------------------------------ | ||
|
||
(defun first-name-sort (object-list) | ||
(sort (copy-list object-list) #'(lambda (o1 o2) | ||
(string< (first-name o1) (first-name o2))))) | ||
|
||
(defun last-name-sort (object-list) | ||
(sort (copy-list object-list) #'(lambda (o1 o2) | ||
(string< (last-name o1) (last-name o2))))) | ||
|
||
(defun id-sort (object-list) | ||
(sort (copy-list object-list) #'(lambda (o1 o2) | ||
(< (id o1) (id o2))))) | ||
|
||
;;;;maybe date-time/date/time sorting | ||
(defun date-time-sort (object-list) | ||
(sort (copy-list object-list) #'(lambda (o1 o2) | ||
(later-date-time-p (dt o1) (dt 02))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
;;;;sort.lisp | ||
;;;; | ||
|
||
(in-package :bartleby) | ||
|
||
;;;;------------------------------------------------------------------------ | ||
;;;; | ||
;;;;------------------------------------------------------------------------ | ||
|
||
(defun first-name-sort (object-list) | ||
(sort (copy-list object-list) #'(lambda (o1 o2) | ||
(string> (first-name o1) (first-name o2))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters