import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model, NonAttribute, Sequelize, } from "sequelize"; import { CustomerInvoiceParticipant_Model } from "./customer-invoiceParticipant.mo.del.ts.bak"; export type TCreationCustomerInvoiceParticipantAddress_Model = InferCreationAttributes< CustomerInvoiceParticipantAddress_Model, { omit: "participant" } >; export class CustomerInvoiceParticipantAddress_Model extends Model< InferAttributes, InferCreationAttributes > { static associate(connection: Sequelize) { const { CustomerInvoiceParticipantAddress_Model, CustomerInvoiceParticipant_Model } = connection.models; CustomerInvoiceParticipantAddress_Model.belongsTo(CustomerInvoiceParticipant_Model, { as: "participant", foreignKey: "participant_id", }); } declare address_id: string; declare participant_id: string; declare type: string; declare street: CreationOptional; declare postal_code: CreationOptional; declare city: CreationOptional; declare province: CreationOptional; declare country: CreationOptional; declare phone: CreationOptional; declare email: CreationOptional; declare participant?: NonAttribute; } export default (sequelize: Sequelize) => { CustomerInvoiceParticipantAddress_Model.init( { address_id: { type: new DataTypes.UUID(), primaryKey: true, }, participant_id: { type: new DataTypes.UUID(), primaryKey: true, }, type: { type: new DataTypes.STRING(), allowNull: false, }, street: { type: new DataTypes.STRING(), allowNull: true, }, postal_code: { type: new DataTypes.STRING(), allowNull: true, }, city: { type: new DataTypes.STRING(), allowNull: true, }, province: { type: new DataTypes.STRING(), allowNull: true, }, country: { type: new DataTypes.STRING(), allowNull: true, }, email: { type: new DataTypes.STRING(), allowNull: true, }, phone: { type: new DataTypes.STRING(), allowNull: true, }, }, { sequelize, tableName: "customerInvoice_participant_addresses", } ); return CustomerInvoiceParticipantAddress_Model; };