"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RopidVYMIEventsRoutesModel = void 0;
const const_1 = require("../../../schema-definitions/const");
const ropid_vymi_1 = require("../../../schema-definitions/ropid-vymi");
const models_1 = require("@golemio/core/dist/integration-engine/models");
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
/**
 * Custom Postgres model for Ropid VYMI Events Routes
 */
class RopidVYMIEventsRoutesModel extends models_1.PostgresModel {
    constructor(addAuditAttributes = false) {
        super(ropid_vymi_1.RopidVYMI.eventsRoutes.name + "Model", {
            hasTmpTable: true,
            outputSequelizeAttributes: ropid_vymi_1.RopidVYMI.eventsRoutes.outputSequelizeAttributes,
            pgTableName: ropid_vymi_1.RopidVYMI.eventsRoutes.pgTableName,
            pgSchema: const_1.PG_SCHEMA,
            savingType: "insertOnly",
            addAuditAttributes: addAuditAttributes,
        }, new golemio_validator_1.JSONSchemaValidator(ropid_vymi_1.RopidVYMI.eventsRoutes.name + "ModelValidator", ropid_vymi_1.RopidVYMI.eventsRoutes.outputJsonSchema));
    }
    async findByEventId(eventId) {
        return await this.find({
            where: {
                event_id: eventId,
            },
            raw: true,
        });
    }
}
exports.RopidVYMIEventsRoutesModel = RopidVYMIEventsRoutesModel;
//# sourceMappingURL=RopidVYMIEventsRoutesModel.js.map