|
@@ -21,9 +21,28 @@ times, the scheduling should be automatic.
|
|
|
* Introduction
|
|
|
|
|
|
* System Definition
|
|
|
- foo
|
|
|
+ To achieve the use of this software, I define an ASDF package, and a
|
|
|
+ couple of CL packages to avoid cluttering the main namespace.
|
|
|
|
|
|
** DefSystem
|
|
|
+ The application is designed to be used mostly for the purposes of
|
|
|
+ demonstration, but could be used alongside others as a library. To
|
|
|
+ allow for this, I use ASDF to define a loadable system.
|
|
|
+
|
|
|
+#+CAPTION: ASDF System Definition
|
|
|
+#+Name: asdf-definition
|
|
|
+#+BEGIN_SRC lisp
|
|
|
+ (asdf:defsystem #:autoschedule
|
|
|
+ :serial t
|
|
|
+ :description "Automatic Scheduling"
|
|
|
+ :author "Samuel W. Flint <swflint@flintfam.org>"
|
|
|
+ :license "GNU General Public License"
|
|
|
+ :depends-on (#:sxql
|
|
|
+ #:cl-postgres)
|
|
|
+ :components ((:file "package")
|
|
|
+ (:file "autoschedule")
|
|
|
+ (:file "test")))
|
|
|
+#+END_SRC
|
|
|
|
|
|
** Package Definition
|
|
|
This system has two packages, a primary package, and a test
|
|
@@ -45,8 +64,44 @@ times, the scheduling should be automatic.
|
|
|
#+END_SRC
|
|
|
|
|
|
* A Base Database
|
|
|
+ To allow this system to be as flexible as possible, the table must
|
|
|
+ be as simple as possible. It also should be fairly simple.
|
|
|
+
|
|
|
+#+CAPTION: Schedule Table
|
|
|
+#+Name: Schedule
|
|
|
+#+BEGIN_SRC lisp
|
|
|
+ (defvar *generate-scheduling-table*
|
|
|
+ (create-table :schedule
|
|
|
+ ((artist-id :type 'integer
|
|
|
+ :primary-key t
|
|
|
+ :not-null t)
|
|
|
+ (start-block :type '(integer 0 47)
|
|
|
+ :not-null t)
|
|
|
+ (end-block :type '(integer 0 47)
|
|
|
+ :not-null t)
|
|
|
+ (julian-date :type 'integer
|
|
|
+ :not-null t)
|
|
|
+ (type :type '(integer 1 3)
|
|
|
+ :not-null t)
|
|
|
+ (project :type 'integer
|
|
|
+ :not-null nil))))
|
|
|
+#+END_SRC
|
|
|
|
|
|
* The Manual Scheduler
|
|
|
+ An important part of the scheduler is to be able to schedule things
|
|
|
+ manually, partly because of the ability to schedule leave, and the
|
|
|
+ need to schedule things in off hours.
|
|
|
+
|
|
|
+#+CAPTION: Manual Scheduler
|
|
|
+#+Name: manual-scheduler
|
|
|
+#+BEGIN_SRC lisp
|
|
|
+ (defun schedule-manually (artist start-block end-block julian type &optional project)
|
|
|
+ "Manually schedules an appointment or time entry."
|
|
|
+ (declare (unsigned-int artist)
|
|
|
+ (type (integer 0 47) start-block end-block)
|
|
|
+ (integer julian type))
|
|
|
+ )
|
|
|
+#+END_SRC
|
|
|
|
|
|
* The Auto Scheduler
|
|
|
|