summaryrefslogtreecommitdiff
path: root/lisp/sql/registration.lisp
diff options
context:
space:
mode:
authorckonstanski <carlos.konstanski@olo.com>2024-05-25 18:03:25 -0600
committerckonstanski <carlos.konstanski@olo.com>2024-05-25 18:03:25 -0600
commitb8423f4d05c75094b7b9d09c6f0bb353acc9be1c (patch)
tree3732f71f84191b26f038130c2220fb502d738251 /lisp/sql/registration.lisp
initial commit
Diffstat (limited to 'lisp/sql/registration.lisp')
-rw-r--r--lisp/sql/registration.lisp42
1 files changed, 42 insertions, 0 deletions
diff --git a/lisp/sql/registration.lisp b/lisp/sql/registration.lisp
new file mode 100644
index 0000000..a1a2919
--- /dev/null
+++ b/lisp/sql/registration.lisp
@@ -0,0 +1,42 @@
+;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+(declaim (optimize (speed 0) (safety 3) (debug 3)))
+
+(in-package :woodriverlessons)
+
+(defclass registration (postgres-record)
+ ((id :initarg :id
+ :initform nil
+ :accessor id)
+ (hash :initarg :hash
+ :initform nil
+ :accessor hash)
+ (first_name :initarg :first_name
+ :initform nil
+ :accessor first_name)
+ (last_name :initarg :last_name
+ :initform nil
+ :accessor last_name)
+ (email :initarg :email
+ :initform nil
+ :accessor email)
+ (role_groups :initarg :role_groups
+ :initform nil
+ :accessor role_groups)
+ (created :initarg :created
+ :initform nil)
+ (valid_for :initarg :valid_for
+ :initform nil
+ :accessor valid_for)
+ (*table :initform "auth.registrations")
+ (*where-expression :initform "id = ~a"))
+ (:documentation "Holds the data for an auth.registrations type."))
+
+(defmethod created ((registration registration))
+ (slot-value registration 'created))
+
+(defmethod (setf created) (value (registration registration))
+ (handler-case
+ (setf (slot-value registration 'created) (simple-date-to-date value))
+ (error (e)
+ (declare (ignore e))
+ (setf (slot-value registration 'created) nil))))