@citrineos/data
Version:
The OCPP data module which includes all persistence layer implementation.
22 lines (21 loc) • 1.24 kB
TypeScript
import type { BootstrapConfig, ChargingStationSequenceTypeEnumType } from '@citrineos/base';
import { Sequelize } from 'sequelize-typescript';
import type { ILogObj } from 'tslog';
import { Logger } from 'tslog';
import type { IChargingStationSequenceRepository } from '../../../interfaces/index.js';
import { ChargingStationSequence } from '../model/index.js';
import { SequelizeRepository } from './Base.js';
export declare class SequelizeChargingStationSequenceRepository extends SequelizeRepository<ChargingStationSequence> implements IChargingStationSequenceRepository {
private static readonly SEQUENCE_START;
constructor(config: BootstrapConfig, logger?: Logger<ILogObj>, sequelizeInstance?: Sequelize);
/**
* Converts a Sequelize bigint value to a JavaScript number.
* Sequelize returns PostgreSQL BIGINT columns as strings to avoid precision loss,
* but OCPP requires numeric types (e.g., requestId in GetChargingProfilesRequest).
*
* @param value - The value from Sequelize (may be string or number)
* @returns A JavaScript number
*/
private _ensureNumber;
getNextSequenceValue(tenantId: number, stationId: string, type: ChargingStationSequenceTypeEnumType): Promise<number>;
}