UNPKG

@golemio/pid

Version:
42 lines (41 loc) 2.09 kB
import { JISInfotextsRopidGTFSStopsModel } from "../../../schema-definitions/jis/models/JISInfotextsRopidGTFSStopsModel"; import { IJISInfotextsRopidGTFSStops } from "../../../schema-definitions/jis/models/interfaces"; import { ILogger } from "@golemio/core/dist/helpers"; import { IDatabaseConnector } from "@golemio/core/dist/helpers/data-access/postgres/IDatabaseConnector"; import { AbstractValidatableRepository } from "@golemio/core/dist/helpers/data-access/postgres/repositories/AbstractValidatableRepository"; import { JSONSchemaValidator } from "@golemio/core/dist/shared/golemio-validator"; import { ModelStatic, Transaction } from "@golemio/core/dist/shared/sequelize"; type RepositoryOptions = { transaction?: Transaction; }; export declare class JISInfotextsRopidGTFSStopsRepository extends AbstractValidatableRepository { private logger; validator: JSONSchemaValidator; schema: string; tableName: string; private sequelizeModel; constructor(connector: IDatabaseConnector, logger: ILogger); /** * Delete all items last updated before a given date and time (where their `updated_at` is less than the given limit) * * @param dateTime The `updated_at` limit, where all items last updated before this limit shall be deleted * @param options Options for the operation * @returns The number of deleted items */ deleteAllLastUpdatedBefore(dateTime: Date, options?: RepositoryOptions): Promise<number>; /** * Insert or update all given data. In case of an update, all attributes except for `created_at` shall be overwritten. * * @param data The data to be upserted * @param options Options for the operation * @returns The upserted items */ upsertAll(data: IJISInfotextsRopidGTFSStops[], options?: RepositoryOptions): ReturnType<ModelStatic<JISInfotextsRopidGTFSStopsModel>["bulkCreate"]>; private getUpdateAttributes; /** * @param options * @returns The number of deleted items */ deleteAll(options?: RepositoryOptions): Promise<number>; } export {};