pricing - scheme definition cleanup
RENAME
src/assets/server/rest/v1/schemas/pricing/pricing-definition.json
src/assets/schemas/pricing/pricing-definition.json
{
- "$id": "pricing-definition.json",
+ "$id": "pricing-definition",
"definitions": {
"pricingDimension": {
"type": "object",

MODIFY
src/assets/server/rest/v1/schemas/pricing/pricing-definition-create.json
src/assets/server/rest/v1/schemas/pricing/pricing-definition-create.json
"type": "object",
"properties": {
"flatFee": {
- "$ref": "pricing-definition.json#/definitions/pricingDimension"
+ "$ref": "pricing-definition#/definitions/pricingDimension"
},
"energy": {
- "$ref": "pricing-definition.json#/definitions/pricingDimension"
+ "$ref": "pricing-definition#/definitions/pricingDimension"
},
"chargingTime": {
- "$ref": "pricing-definition.json#/definitions/pricingDimension"
+ "$ref": "pricing-definition#/definitions/pricingDimension"
},
"parkingTime": {
- "$ref": "pricing-definition.json#/definitions/pricingDimension"
+ "$ref": "pricing-definition#/definitions/pricingDimension"
}
}
}

MODIFY
src/assets/server/rest/v1/schemas/pricing/pricing-definition-get.json
src/assets/server/rest/v1/schemas/pricing/pricing-definition-get.json
"type": "object",
"properties": {
"ID": {
- "$ref": "user#/definitions/id"
+ "$ref": "pricing-definition#/definitions/id"
}
},
"required": [

MODIFY
src/assets/server/rest/v1/schemas/pricing/pricing-definition-update.json
src/assets/server/rest/v1/schemas/pricing/pricing-definition-update.json
"type": "object",
"properties": {
"id": {
- "$ref": "common.json#/definitions/id"
+ "$ref": "pricing-definition#/definitions/id"
},
"entityID": {
"type": "string",
"type": "object",
"properties": {
"flatFee": {
- "$ref": "pricing-definition.json#/definitions/pricingDimension"
+ "$ref": "pricing-definition#/definitions/pricingDimension"
},
"energy": {
- "$ref": "pricing-definition.json#/definitions/pricingDimension"
+ "$ref": "pricing-definition#/definitions/pricingDimension"
},
"chargingTime": {
- "$ref": "pricing-definition.json#/definitions/pricingDimension"
+ "$ref": "pricing-definition#/definitions/pricingDimension"
},
"parkingTime": {
- "$ref": "pricing-definition.json#/definitions/pricingDimension"
+ "$ref": "pricing-definition#/definitions/pricingDimension"
}
}
}

MODIFY
src/validator/SchemaValidator.ts
src/validator/SchemaValidator.ts
@@ -30,7 +30,7 @@ export default class SchemaValidator {
private static assetSchema: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/schemas/asset/asset.json`, 'utf8'));
private static companySchema: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/schemas/company/company.json`, 'utf8'));
private static ocpiEndpointSchema: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/schemas/ocpi/ocpi-endpoint.json`, 'utf8'));
- private static pricingDefinitionSchema: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/pricing/pricing-definition.json`, 'utf8'));
+ private static pricingDefinitionSchema: Schema = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/schemas/pricing/pricing-definition.json`, 'utf8'));
private readonly ajv: Ajv;
constructor(readonly moduleName: string,

pricing - scheme definition cleanup