Skip to content

Commit

Permalink
vendors: update vendor jsonschema
Browse files Browse the repository at this point in the history
* Adds currency and TVA rate to vendor resource.
* Updates elasticsearch mapping.
* Updates fixtures.

Co-Authored-by: Lauren-D <laurent.dubois@itld-solutions.be>
  • Loading branch information
lauren-d committed Jan 23, 2020
1 parent ef89454 commit b4d7e61
Show file tree
Hide file tree
Showing 9 changed files with 501 additions and 390 deletions.
14 changes: 14 additions & 0 deletions data/vendors.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"street": "Via de Lostan 3",
"country": "Italia"
},
"currency": "EUR",
"tva_rate": 22,
"organisation": {
"$ref": "https://ils.rero.ch/api/organisations/1"
}
Expand All @@ -32,6 +34,8 @@
"street": "Via Chambery 82",
"country": "Italia"
},
"currency": "EUR",
"tva_rate": 22,
"organisation": {
"$ref": "https://ils.rero.ch/api/organisations/1"
}
Expand All @@ -48,6 +52,8 @@
"street": "Via G. Aichino 9",
"country": "Italia"
},
"currency": "EUR",
"tva_rate": 22,
"organisation": {
"$ref": "https://ils.rero.ch/api/organisations/1"
}
Expand All @@ -66,6 +72,8 @@
"street": "Diagon Alley",
"country": "UK"
},
"currency": "EUR",
"tva_rate": 20,
"organisation": {
"$ref": "https://ils.rero.ch/api/organisations/2"
}
Expand All @@ -77,6 +85,8 @@
"default_contact": {
"city": "Hogsmeade"
},
"currency": "EUR",
"tva_rate": 21.5,
"organisation": {
"$ref": "https://ils.rero.ch/api/organisations/2"
}
Expand All @@ -95,6 +105,8 @@
"street": "Carrer dels Banys Vells 21",
"country": "Spain"
},
"currency": "EUR",
"tva_rate": 21,
"organisation": {
"$ref": "https://ils.rero.ch/api/organisations/3"
}
Expand All @@ -112,6 +124,8 @@
"street": "Diagon Alley",
"country": "UK"
},
"currency": "EUR",
"tva_rate": 20,
"organisation": {
"$ref": "https://ils.rero.ch/api/organisations/3"
}
Expand Down
21 changes: 21 additions & 0 deletions rero_ils/modules/vendors/jsonschemas/vendors/vendor-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
"website",
"communication_language",
"note",
"currency",
"tva_rate",
"default_contact",
"order_contact"
],
"required": [
"$schema",
"pid",
"name",
"currency",
"tva_rate",
"organisation"
],
"properties": {
Expand Down Expand Up @@ -221,6 +225,23 @@
}
}
},
"currency": {
"title": "Currency",
"type": "string",
"enum": [
"CHF",
"EUR",
"USD"
],
"default": "CHF",
"pattern": "^[A-Z]{3}$"
},
"tva_rate": {
"title": "TVA rate",
"type": "number",
"minimum": 0,
"maximum": 100
},
"organisation": {
"title": "Organisation",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"vendor_name": {
"type": "keyword"
},
"currency": {
"type": "keyword"
},
"tva_rate": {
"type": "keyword"
},
"organisation": {
"properties": {
"pid": {
Expand Down

0 comments on commit b4d7e61

Please sign in to comment.