[CPO] Fix possible missing last_updated in location response
[CPO] Increase tokens page size
MODIFY
src/client/ocpi/CpoOCPIClient.ts
src/client/ocpi/CpoOCPIClient.ts
@@ -61,9 +61,9 @@ export default class CpoOCPIClient extends OCPIClient {
let tokensUrl = this.getEndpointUrl('tokens', ServerAction.OCPI_PULL_TOKENS);
if (partial) {
const momentFrom = moment().utc().subtract(1, 'days').startOf('day');
- tokensUrl = `${tokensUrl}?date_from=${momentFrom.format()}&limit=25`;
+ tokensUrl = `${tokensUrl}?date_from=${momentFrom.format()}&limit=100`;
} else {
- tokensUrl = `${tokensUrl}?limit=25`;
+ tokensUrl = `${tokensUrl}?limit=100`;
}
let nextResult = true;
while (nextResult) {

MODIFY
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/CPOLocationsEndpoint.ts
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/CPOLocationsEndpoint.ts
@@ -22,7 +22,8 @@ const RECORDS_LIMIT = 20;
/**
* Locations Endpoint
- */export default class CPOLocationsEndpoint extends AbstractEndpoint {
+ */
+export default class CPOLocationsEndpoint extends AbstractEndpoint {
// Create OCPI Service
constructor(ocpiService: AbstractOCPIService) {
super(ocpiService, EP_IDENTIFIER);

MODIFY
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/OCPIMapping.ts
src/server/ocpi/ocpi-services-impl/ocpi-2.1.1/OCPIMapping.ts
@@ -53,7 +53,7 @@ export default class OCPIMapping {
'longitude': site.address.coordinates[0].toString()
},
'evses': await OCPIMapping.getEvsesFromSite(tenant, site, options),
- 'last_updated': site.lastChangedOn
+ 'last_updated': site.lastChangedOn ? site.lastChangedOn : site.createdOn
};
}

[CPO] Fix possible missing last_updated in location response
[CPO] Increase tokens page size