diff options
| author | Marius Peter <dev@marius-peter.com> | 2025-11-30 11:11:09 +0100 |
|---|---|---|
| committer | Marius Peter <dev@marius-peter.com> | 2025-11-30 11:11:09 +0100 |
| commit | 355bbfd898a8b61797b3a077f15c5f97ab7ebb04 (patch) | |
| tree | f4d64c5db18d04dec249eb939ede834148a26acc /models/crop-requirement.rkt | |
| parent | d70e4dc1318d461d4da9fec5b5c1aa73a299f23c (diff) | |
Add contracts related to nutrient-value.
Diffstat (limited to 'models/crop-requirement.rkt')
| -rw-r--r-- | models/crop-requirement.rkt | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/models/crop-requirement.rkt b/models/crop-requirement.rkt index e26f1dc..4176ae4 100644 --- a/models/crop-requirement.rkt +++ b/models/crop-requirement.rkt @@ -6,20 +6,17 @@ crop-requirement-profile crop-requirement-crop-id (rename-out [crop-requirement-nutrient-values crop-requirement-values]) - (contract-out [create-crop-requirement! - (->* (string? nutrient-value-hash/c) ((or/c #f crop?)) crop-requirement?)] - [get-crop-requirements (-> (listof crop-requirement?))] - [get-crop-requirement - (->* () - (#:id (or/c #f exact-nonnegative-integer?) #:profile (or/c #f string?)) - (or/c crop-requirement? #f))] - [get-crop-requirement-values - (-> crop-requirement-or-id/c nutrient-value-hash/c)] - [get-crop-requirement-value (-> crop-requirement-or-id/c nutrient? number?)] - [delete-crop-requirement! (-> crop-requirement-or-id/c void?)] - [average-crop-requirement-nutrient-values - (-> (listof (cons/c crop-requirement? (and/c real? (>=/c 0) (<=/c 100)))) - nutrient-value-hash/c)])) + (contract-out + [create-crop-requirement! (->* (string? nutrient-value-hash/c) (crop?) crop-requirement?)] + [get-crop-requirements (-> (listof crop-requirement?))] + [get-crop-requirement + (->* () (#:id exact-nonnegative-integer? #:profile string?) (or/c crop-requirement? #f))] + [get-crop-requirement-values (-> crop-requirement-or-id/c nutrient-value-hash/c)] + [get-crop-requirement-value (-> crop-requirement-or-id/c nutrient? maybe-nutrient-value?)] + [delete-crop-requirement! (-> crop-requirement-or-id/c void?)] + [average-crop-requirement-nutrient-values + (-> (listof (cons/c crop-requirement? (and/c real? (>=/c 0) (<=/c 100)))) + nutrient-value-hash/c)])) (require racket/contract db |