summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/test/store-script/fruits-catalog.scm
blob: 18128f0137afe85ecc2f2bab1076a7b776b45ba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
; Catalog implementation

(define (get converter)
  (define (convert price) (converter "convert" "USD" "USD" price))
  (define code "USD")
  (define symbol (converter "symbol" code))
  (list
    (list (list 'javaClass "services.Item") (list 'name "Apple") (list 'currencyCode code) (list 'currencySymbol symbol) (list 'price (convert 2.99)))
    (list (list 'javaClass "services.Item") (list 'name "Orange") (list 'currencyCode code) (list 'currencySymbol symbol) (list 'price (convert 3.55)))
    (list (list 'javaClass "services.Item") (list 'name "Pear") (list 'currencyCode code) (list 'currencySymbol symbol) (list 'price (convert 1.55)))
  )
)

; TODO remove these JSON-RPC specific functions
(define (system.listMethods converter) (list "Service.get"))
(define Service.get get)