From e49ca1f3999127bee5888b44c3900b5483ecebd0 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Thu, 20 Nov 2025 11:27:50 +0100 Subject: raco fmt. --- models/fertilizer-product.rkt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'models/fertilizer-product.rkt') diff --git a/models/fertilizer-product.rkt b/models/fertilizer-product.rkt index 225af10..d4006ac 100644 --- a/models/fertilizer-product.rkt +++ b/models/fertilizer-product.rkt @@ -1,6 +1,5 @@ #lang racket -;; Model struct (provide fertilizer-product fertilizer-product? fertilizer-product-id @@ -8,7 +7,6 @@ [fertilizer-product-nutrient-values fertilizer-product-values] [fertilizer-product-brand-name fertilizer-brand-name]) (contract-out - ;; SQL CRUD [create-fertilizer-product! (->* (string? (listof nutrient-value-pair/c)) (string?) fertilizer-product?)] [get-fertilizer-products (-> (listof fertilizer-product?))] @@ -26,7 +24,6 @@ "../db/conn.rkt" "nutrient.rkt") -;; Instances of this struct are persisted in the fertilizer_products table. (struct fertilizer-product (id canonical-name nutrient-values brand-name) #:transparent #:guard (λ (id canonical-name nutrient-values brand-name _) @@ -161,14 +158,14 @@ n.formula nv.value_ppm #:from (TableExpr:AST ,joined) - #:where (= nm.id ,(fertilizer-product-id fertilizer-product))))]) + #:where (= fp.id ,(fertilizer-product-id fertilizer-product))))]) (cons (nutrient nutrient-id name formula) value_ppm))) (define (get-fertilizer-product-value fertilizer-product nutrient) (query-maybe-value (current-conn) (select value_ppm #:from (TableExpr:AST ,joined) - #:where (and (= nm.id ,(fertilizer-product-id fertilizer-product)) + #:where (and (= fp.id ,(fertilizer-product-id fertilizer-product)) (= nv.nutrient_id ,(nutrient-id nutrient)))))) ;; UPDATE -- cgit v1.2.3