File: invoice.schema.yaml

package info (click to toggle)
kwalify 0.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 1,860 kB
  • ctags: 1,188
  • sloc: ruby: 8,446; xml: 170; makefile: 37; java: 36
file content (43 lines) | stat: -rw-r--r-- 1,141 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
###
### Kwalify schema example for invoice
###
### $Rev$
### $Release: 0.7.2 $
### copyright(c) 2005-2010 kuwata-lab all rights reserved.
###

type:      map
classname: Invoice
required:  yes
mapping:
 "invoice":  { type: int, required: yes, unique: yes }
 "date":     { type: date, required: yes }
 "bill-to":  &customer
    type:      map
    required:  yes
    mapping:
     "given":      { type: str, required: yes }
     "family":     { type: str, required: yes }
     "address":
        type:      map
        required:  yes
        mapping:
         "lines":  { type: str }
         "city":   { type: str }
         "state":  { type: str }
         "postal": { type: int }
 "ship-to":   *customer
 "product":
    type:      seq
    required:  yes
    sequence:
      - type:      map
        required:  yes
        mapping:
         "sku":         { type: str, required: yes, pattern: '/^[A-Z0-9]+$/' }
         "quantity":    { type: int, required: yes }
         "description": { type: str }
         "price":       { type: float }
 "tax":      { type: float }
 "total":    { type: float, required: yes }
 "comments": { type: str }