Added Settings links in every schemas
RENAME
src/assets/server/rest/v1/schemas/setting/setting-sac-set.json
src/assets/server/rest/v1/schemas/setting/setting-analytics-set.json
{
- "$id": "setting-sac-set",
- "title": "Set SAP Analytics Settings",
+ "$id": "setting-analytics-set",
+ "title": "Set Analytics Settings",
"type": "object",
"properties": {
"content": {
}
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"type": {
"type": "string",
"sanitize": "mongo",

MODIFY
src/assets/server/rest/v1/schemas/setting/setting-billing-set.json
src/assets/server/rest/v1/schemas/setting/setting-billing-set.json
}
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"type": {
"type": "string",
"sanitize": "mongo",

DELETE
src/assets/server/rest/v1/schemas/setting/setting-create.json
-{
- "$id": "setting-create",
- "title": "Setting creation Request",
- "type": "object",
- "properties": {
- "identifier": {
- "$ref": "setting#/definitions/identifier"
- },
- "sensitiveData": {
- "$ref": "setting#/definitions/sensitiveData"
- },
- "content": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string",
- "sanitize": "mongo"
- },
- "links": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "sanitize": "mongo"
- },
- "name": {
- "type": "string",
- "sanitize": "mongo"
- },
- "description": {
- "type": "string",
- "sanitize": "mongo"
- },
- "role": {
- "type": "string",
- "sanitize": "mongo"
- },
- "url": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- }
- },
- "sac": {
- "type": "object",
- "properties": {
- "mainUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "timezone": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "ocpi": {
- "type": "object",
- "properties": {
- "businessDetails": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "sanitize": "mongo"
- },
- "website": {
- "type": "string",
- "sanitize": "mongo"
- },
- "logo": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "sanitize": "mongo"
- },
- "thumbnail": {
- "type": "string",
- "sanitize": "mongo"
- },
- "category": {
- "type": "string",
- "sanitize": "mongo"
- },
- "type": {
- "type": "string",
- "sanitize": "mongo"
- },
- "width": {
- "type": "number",
- "sanitize": "mongo"
- },
- "height": {
- "type": "number",
- "sanitize": "mongo"
- }
- }
- }
- }
- },
- "cpo": {
- "type": "object",
- "properties": {
- "countryCode": {
- "type": "string",
- "sanitize": "mongo"
- },
- "partyID": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "emsp": {
- "type": "object",
- "properties": {
- "countryCode": {
- "type": "string",
- "sanitize": "mongo"
- },
- "partyID": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "currency": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "oicp": {
- "type": "object",
- "properties": {
- "businessDetails": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "sanitize": "mongo"
- },
- "website": {
- "type": "string",
- "sanitize": "mongo"
- },
- "logo": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "sanitize": "mongo"
- },
- "thumbnail": {
- "type": "string",
- "sanitize": "mongo"
- },
- "category": {
- "type": "string",
- "sanitize": "mongo"
- },
- "type": {
- "type": "string",
- "sanitize": "mongo"
- },
- "width": {
- "type": "number",
- "sanitize": "mongo"
- },
- "height": {
- "type": "number",
- "sanitize": "mongo"
- }
- }
- }
- }
- },
- "cpo": {
- "type": "object",
- "properties": {
- "countryCode": {
- "type": "string",
- "sanitize": "mongo"
- },
- "partyID": {
- "type": "string",
- "sanitize": "mongo"
- },
- "key": {
- "type": "string",
- "sanitize": "mongo"
- },
- "cert": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "emsp": {
- "type": "object",
- "properties": {
- "countryCode": {
- "type": "string",
- "sanitize": "mongo"
- },
- "partyID": {
- "type": "string",
- "sanitize": "mongo"
- },
- "key": {
- "type": "string",
- "sanitize": "mongo"
- },
- "cert": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "currency": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "concur": {
- "type": "object",
- "properties": {
- "authenticationUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "apiUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "appUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientId": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientSecret": {
- "type": "string",
- "sanitize": "mongo"
- },
- "paymentTypeId": {
- "type": "string",
- "sanitize": "mongo"
- },
- "expenseTypeCode": {
- "type": "string",
- "sanitize": "mongo"
- },
- "policyId": {
- "type": "string",
- "sanitize": "mongo"
- },
- "reportName": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "convergentCharging": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "sanitize": "mongo"
- },
- "chargeableItemName": {
- "type": "string",
- "sanitize": "mongo"
- },
- "user": {
- "type": "string",
- "sanitize": "mongo"
- },
- "password": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "simple": {
- "type": "object",
- "properties": {
- "price": {
- "type": "number",
- "sanitize": "mongo"
- },
- "currency": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "billing": {
- "type": "object",
- "properties": {
- "isTransactionBillingActivated": {
- "type": "boolean",
- "sanitize": "mongo"
- },
- "immediateBillingAllowed": {
- "type": "boolean",
- "sanitize": "mongo"
- },
- "periodicBillingAllowed": {
- "type": "boolean",
- "sanitize": "mongo"
- },
- "taxID": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "stripe": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "sanitize": "mongo"
- },
- "secretKey": {
- "type": "string",
- "sanitize": "mongo"
- },
- "publicKey": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "sapSmartCharging": {
- "type": "object",
- "properties": {
- "optimizerUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "user": {
- "type": "string",
- "sanitize": "mongo"
- },
- "password": {
- "type": "string",
- "sanitize": "mongo"
- },
- "stickyLimitation": {
- "type": "boolean",
- "sanitize": "mongo"
- },
- "limitBufferDC": {
- "type": "number",
- "sanitize": "mongo"
- },
- "limitBufferAC": {
- "type": "number",
- "sanitize": "mongo"
- }
- }
- },
- "asset": {
- "type": "object",
- "properties": {
- "connections": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "sanitize": "mongo"
- },
- "name": {
- "type": "string",
- "sanitize": "mongo"
- },
- "description": {
- "type": "string",
- "sanitize": "mongo"
- },
- "url": {
- "type": "string",
- "sanitize": "mongo"
- },
- "type": {
- "type": "string",
- "sanitize": "mongo"
- },
- "refreshIntervalMins": {
- "type": "string",
- "sanitize": "mongo"
- },
- "schneiderConnection": {
- "type": "object",
- "properties": {
- "user": {
- "type": "string",
- "sanitize": "mongo"
- },
- "password": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "greenComConnection": {
- "type": "object",
- "properties": {
- "clientId": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientSecret": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "iothinkConnection": {
- "type": "object",
- "properties": {
- "user": {
- "type": "string",
- "sanitize": "mongo"
- },
- "password": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "witConnection": {
- "type": "object",
- "properties": {
- "authenticationUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientId": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientSecret": {
- "type": "string",
- "sanitize": "mongo"
- },
- "user": {
- "type": "string",
- "sanitize": "mongo"
- },
- "password": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "lacroix": {
- "type": "object",
- "properties": {
- "user": {
- "type": "string",
- "sanitize": "mongo"
- },
- "password": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- }
- }
- }
- }
- }
- },
- "carConnector": {
- "type": "object",
- "properties": {
- "connections": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "sanitize": "mongo"
- },
- "name": {
- "type": "string",
- "sanitize": "mongo"
- },
- "description": {
- "type": "string",
- "sanitize": "mongo"
- },
- "type": {
- "type": "string",
- "sanitize": "mongo"
- },
- "mercedesConnection": {
- "type": "object",
- "properties": {
- "authenticationUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "apiUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientId": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientSecret": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- },
- "tronityConnection": {
- "type": "object",
- "properties": {
- "apiUrl": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientId": {
- "type": "string",
- "sanitize": "mongo"
- },
- "clientSecret": {
- "type": "string",
- "sanitize": "mongo"
- }
- }
- }
- }
- }
- }
- }
- },
- "crypto": {
- "type": "object",
- "properties": {
- "key": {
- "type": "string",
- "sanitize": "mongo"
- },
- "keyProperties": {
- "type": "object",
- "properties": {
- "blockCypher": {
- "type": "string",
- "sanitize": "mongo"
- },
- "blockSize": {
- "type": "number",
- "sanitize": "mongo"
- },
- "operationMode": {
- "type": "number",
- "sanitize": "mongo"
- }
- }
- },
- "formerKey": {
- "type": "string",
- "sanitize": "mongo"
- },
- "formerKeyProperties": {
- "type": "object",
- "properties": {
- "blockCypher": {
- "type": "string",
- "sanitize": "mongo"
- },
- "blockSize": {
- "type": "number",
- "sanitize": "mongo"
- },
- "operationMode": {
- "type": "number",
- "sanitize": "mongo"
- }
- }
- }
- }
- },
- "user": {
- "type": "object",
- "properties": {
- "autoActivateAccountAfterValidation": {
- "type": "boolean",
- "sanitize": "mongo"
- }
- }
- }
- },
- "required": [
- "type"
- ],
- "oneOf": [
- { "required": [] },
- { "required": ["sac"] },
- { "required": ["ocpi"] },
- { "required": ["oicp"] },
- { "required": ["concur"] },
- { "required": ["convergentCharging"] },
- { "required": ["simple"] },
- { "required": ["billing"] },
- { "required": ["stripe"] },
- { "required": ["smartCharging"] },
- { "required": ["asset"] },
- { "required": ["carConnector"] },
- { "required": ["crypto"] },
- { "required": ["user"] }
- ]
- }
- },
- "required": [
- "identifier",
- "content"
- ]
-}

MODIFY
src/assets/server/rest/v1/schemas/setting/setting-crypto-set.json
src/assets/server/rest/v1/schemas/setting/setting-crypto-set.json
}
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"type": {
"type": "string",
"sanitize": "mongo",

MODIFY
src/assets/server/rest/v1/schemas/setting/setting-ocpi-set.json
src/assets/server/rest/v1/schemas/setting/setting-ocpi-set.json
}
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"type": {
"type": "string",
"sanitize": "mongo",

MODIFY
src/assets/server/rest/v1/schemas/setting/setting-oicp-set.json
src/assets/server/rest/v1/schemas/setting/setting-oicp-set.json
"enum": ["oicp"]
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"required": [
"type"
]

MODIFY
src/assets/server/rest/v1/schemas/setting/setting-pricing-set.json
src/assets/server/rest/v1/schemas/setting/setting-pricing-set.json
"enum": ["simple", "convergentCharging"]
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"required": [
"type"
]

MODIFY
src/assets/server/rest/v1/schemas/setting/setting-refund-set.json
src/assets/server/rest/v1/schemas/setting/setting-refund-set.json
}
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"type": {
"type": "string",
"sanitize": "mongo",

MODIFY
src/assets/server/rest/v1/schemas/setting/setting-smart-charging-set.json
src/assets/server/rest/v1/schemas/setting/setting-smart-charging-set.json
"enum": ["sapSmartCharging"]
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"required": [
"type",
"sapSmartCharging"

MODIFY
src/assets/server/rest/v1/schemas/setting/setting-user-set.json
src/assets/server/rest/v1/schemas/setting/setting-user-set.json
"enum": ["user"]
}
},
+ "links": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "$ref": "common#/definitions/id"
+ },
+ "name": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "description": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "role": {
+ "type": "string",
+ "sanitize": "mongo"
+ },
+ "url": {
+ "type": "string",
+ "sanitize": "mongo"
+ }
+ }
+ }
+ },
"required": [
"type",
"user"

MODIFY
src/server/rest/v1/service/SettingService.ts
src/server/rest/v1/service/SettingService.ts
@@ -203,7 +203,7 @@ export default class SettingService {
filteredRequest = SettingValidator.getInstance().validateSettingPricingSetReq(req.body);
break;
case IntegrationSettings.SAC:
- filteredRequest = SettingValidator.getInstance().validateSettingSacSetReq(req.body);
+ filteredRequest = SettingValidator.getInstance().validateSettingAnalyticsSetReq(req.body);
break;
default:
filteredRequest = SettingSecurity.filterSettingUpdateRequest(req.body);

MODIFY
src/server/rest/v1/validator/SettingValidator.ts
src/server/rest/v1/validator/SettingValidator.ts
@@ -13,7 +13,7 @@ export default class SettingValidator extends SchemaValidator {
private settingRefundSet: Schema;
private settingPricingSet: Schema;
private settingCryptoSet: Schema;
- private settingSacSet: Schema;
+ private settingAnalyticsSet: Schema;
private settingOICPSet: Schema;
private settingBillingSet: Schema;
@@ -25,7 +25,7 @@ export default class SettingValidator extends SchemaValidator {
this.settingRefundSet = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/setting/setting-refund-set.json`, 'utf8'));
this.settingPricingSet = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/setting/setting-pricing-set.json`, 'utf8'));
this.settingCryptoSet = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/setting/setting-crypto-set.json`, 'utf8'));
- this.settingSacSet = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/setting/setting-sac-set.json`, 'utf8'));
+ this.settingAnalyticsSet = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/setting/setting-analytics-set.json`, 'utf8'));
this.settingOICPSet = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/setting/setting-oicp-set.json`, 'utf8'));
this.settingBillingSet = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/setting/setting-billing-set.json`, 'utf8'));
}
@@ -61,8 +61,8 @@ export default class SettingValidator extends SchemaValidator {
return this.validate(this.settingCryptoSet, data);
}
- public validateSettingSacSetReq(data: Record<string, unknown>): HttpSettingSacSetRequest {
- return this.validate(this.settingSacSet, data);
+ public validateSettingAnalyticsSetReq(data: Record<string, unknown>): HttpSettingSacSetRequest {
+ return this.validate(this.settingAnalyticsSet, data);
}
public validateSettingOICPSetReq(data: Record<string, unknown>): HttpSettingOICPSetRequest {

Added Settings links in every schemas