...
Table of Contents | ||
---|---|---|
|
Key Principles
Similar principles as with the other APIs are relevant here.
Interface "PortfolioAvailablity"
...
Usage & Contents |
|
---|
/portfolio/availability
portfolioId (optional)
/portfolio/availability
If the API can fulfill the request (response status code 200 = OK) the response must follow the below json-schema.
Note |
---|
|
Code Block | ||||
---|---|---|---|---|
| ||||
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://vcaire.ch/PortfolioAvailability.schema.json",
"title": "Portfolio availability",
"description": "Portfolio availability",
"type": "object",
"properties": {
"request": { "$ref": "#/definitions/request" },
"availability": { "type": "array", "items": {"$ref": "#/definitions/portfolioAvailabilities"} }
},
"required": ["request", "availability"],
"definitions": {
"request": {
"type": "object",
"properties": {
"path": { "const": "/portfolio/availability" }
},
"required": [ "path" ]
},
"portfolioAvailabilities": {
"type": "object",
"properties": {
"portfolioId": {"type": "string"},
"unpublished": { "$ref": "#/definitions/availability" },
"eventDriven": { "$ref": "#/definitions/availability" },
"signedOff": { "$ref": "#/definitions/availability" }
},
"required": [ "portfolioId" ]
},
"availability": {
"type": "object",
"properties": {
"availabilityDate": {"type": "string", "format": "date"},
"quality": {"type": "string", "enum": ["no-errors", "Minor", "Major", "Critical", "Blocker", "Fatal"] }
},
"required": [ "availabilityDate" ]
}
}
} |
If the request can't be fulfilled an appropriate response status code (4xx or 5xx) must be used. Possible errors could be
- bad request structure → expected status = 400
- etc.
The body of the response should contain information about the reason of the error in plain text or as json object.
Reporting Business Logic |
| ||||||
---|---|---|---|---|---|---|---|
Consistency Rules | The following rules should be adhered to by any response and will eventually be checked when consuming a response: Consistency Rules
|
|
- Report scheduling logic (given orders, portfolios availability and existing executions)
- as only the newest date of availability for any quality is given, it can happen that the scheduler misses a past date where availability has also changed.
Interface "PortfolioQuality"
Path |
| ||||||
---|---|---|---|---|---|---|---|
Parameters |
| string | The id of the portfolio (or consolidation) in the data source | ||||
Example call |
| ||||||
Schema |
| ||||||
Example |
|
Interface "PortfolioQuality"
Status | ||||
---|---|---|---|---|
|
Usage & Contents |
| ||
---|---|---|---|
Reporting Business Logic |
| ||
Consistency Rules | The following rules should be adhered to by any response and will eventually be checked when consuming a response:
| ||
Path |
| ||
Parameters |
| string | The id of the portfolio (or consolidation) in the data source |
| string (date) | The date, the reporing is produced for. | |
Example call |
|
If the API can fulfill the request (response status code 200 = OK) the response must follow the below json-schema.
Note |
---|
|
Code Block | ||||
---|---|---|---|---|
| ||||
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://vcaire.ch/PortfolioQuality.schema.json",
"title": "Portfolio data quality",
"description": "Portfolio data quality",
"type": "object",
"properties": {
"request": { "$ref": "#/definitions/request" },
"riskstatus": { "type": "array", "items": { "$ref": "#/definitions/quality" }}
},
"required": [ "request", "quality" ],
"definitions": {
"request": {
"type": "object",
"properties": {
"path": { "const": "/portfolio/quality" },
"parameters": {
"type": "object",
"properties": {
"portfolioId": { "type": "string" },
"reportingDate": { "type": "string", "format": "date" }
},
"required": [ "portfolioId", "reportingDate" ],
"additionalProperties": false
}
},
"required": [ "path", "parameters" ]
},
"quality": {
"type": "object",
"properties": {
"id": { "type": "string" },
"entity": { "type": "string" },
"type": { "type": "string" },
"description": { "type": "string" }
},
"required": [ "id", "description" ],
"additionalProperties": true
}
}
} |
If the request can't be fulfilled an appropriate response status code (4xx or 5xx) must be used. Possible errors could be
- bad request structure → expected status = 400
- etc.
The body of the response should contain information about the reason of the error in plain text or as json object.
The following rules should be adhered to by any response and will eventually be checked when consuming a response:
Code Block | ||||
---|---|---|---|---|
| ||||
* id should be unique |
- None
Interface "PortfolioByLocation"
Schema |
| ||||||
---|---|---|---|---|---|---|---|
Example |
|
Interface "PortfolioByLocation"
Usage & Contents |
|
---|
/portfolio/bylocation
location
The id of the location
- GLOBAL (this location will deliver all the portfolios)
- CSCH
- CSSG
- CSHK
- CSIT
/portfolios?location=CSCH
If the API can fulfill the request (response status code 200 = OK) the response must follow the below json-schema.
Note |
---|
|
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://vcaire.ch/PortfolioByLocation.schema.json",
"title": "Portfolios by Location",
"description": "Portfolios by location",
"type": "object",
"properties": {
"request": { "$ref": "#/definitions/request" },
"portfolios": { "$ref": "#/definitions/portfolios" }
},
"required": ["request", "portfolios"],
"definitions": {
"request": {
"type": "object",
"properties": {
"path": { "const": "/portfolio/bylocation" },
"parameters": {
"type": "object",
"location": { "type": "string" },
"required": [ "location" ]
}
},
"required": [ "path", "parameters" ]
},
"portfolios": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true
}
}
} |
If the request can't be fulfilled an appropriate response status code (4xx or 5xx) must be used. Possible errors could be
- bad request structure → expected status = 400
- locationId not found → expected status = 404
- etc.
The body of the response should contain information about the reason of the error in plain text or as json object.
Reporting Business Logic |
| ||||||
---|---|---|---|---|---|---|---|
Consistency Rules | The following rules should be adhered to by any response and will eventually be checked when consuming a response: Consistency Rules
|
|
- Data scope calculation
Interface "UserPortfolioRoles"
| |||||||
Path |
| ||||||
---|---|---|---|---|---|---|---|
Parameters |
| string | The id of the location
| ||||
Example call |
| ||||||
Schema |
| ||||||
Example |
|
Interface "UserPortfolioRoles"
Usage & Contents |
|
---|
/user/portfolioroles
userId
The id of the user:
- example bmpi: marcus.braendle
- example CSAM: F883476
/user/portfolioroles?userId=marcus.braendle
If the API can fulfill the request (response status code 200 = OK) the response must follow the below json-schema.
Note |
---|
|
Code Block | ||||
---|---|---|---|---|
| ||||
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://vcaire.ch/UserPortfolioRoles.schema.json",
"title": "User portfolio roles ",
"description": "User portfolio roles",
"type": "object",
"properties": {
"request": { "$ref": "#/definitions/request" },
"portfolioroles": { "type": "array", "items": { "$ref": "#/definitions/portfolioroles" }}
},
"required": ["request", "portfolioroles"],
"definitions": {
"request": {
"type": "object",
"properties": {
"path": { "const": "/user/portfolioroles" },
"parameters": {
"type": "object",
"properties": {
"userId": { "type": "string" }
},
"required": [ "userId" ]
}
},
"required": [ "path", "parameters" ]
},
"portfolioroles": {
"type": "object",
"properties": {
"portfolioId": { "type": "string" },
"roles": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }
}
}
}
} |
If the request can't be fulfilled an appropriate response status code (4xx or 5xx) must be used. Possible errors could be
- bad request structure → expected status = 400
- userId not found → expected status = 404
- etc.
The body of the response should contain information about the reason of the error in plain text or as json object.
Reporting Business Logic |
| ||||||
---|---|---|---|---|---|---|---|
Consistency Rules | The following rules should be adhered to by any response and will eventually be checked when consuming a response: Consistency Rules
|
|
- Data scope calculation
Path |
| ||||||
---|---|---|---|---|---|---|---|
Parameters |
| string | The id of the user:
| ||||
Example call |
| ||||||
Schema |
| ||||||
Example |
|