From c3557a7d5f54d7a9cb7fb2ece9487332c264236e Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sat, 6 Dec 2025 17:55:58 +0100 Subject: Update model contracts. Great use of my new modules to factor out common model contract logic! --- models/crop.rkt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'models/crop.rkt') diff --git a/models/crop.rkt b/models/crop.rkt index eff54a3..8c50c14 100644 --- a/models/crop.rkt +++ b/models/crop.rkt @@ -6,18 +6,15 @@ crop-name (contract-out [create-crop! (-> string? crop?)] [get-crops (-> (listof crop?))] - [get-crop - (->* () - (#:id (or/c #f exact-nonnegative-integer?) #:name (or/c #f string?)) - (or/c crop? #f))] - [update-crop! - (->* (exact-nonnegative-integer?) (#:name (or/c #f string?)) (or/c crop? #f))] - [delete-crop! (-> exact-nonnegative-integer? void?)])) + [get-crop (->* () (#:id db-id? #:name string?) (or/c crop? #f))] + [update-crop! (->* (db-id?) (#:name string?) (or/c crop? #f))] + [delete-crop! (-> db-id? void?)])) (require racket/contract db sql - "../db/conn.rkt") + "../db/conn.rkt" + "utils.rkt") (struct crop (id name) #:transparent) -- cgit v1.2.3