Uecko_ERP/modules/customer-invoices/src/api/infrastructure/sequelize/customer-invoiceParticipantAddress.mo.del.ts.bak

95 lines
2.5 KiB
TypeScript
Raw Normal View History

2025-03-18 08:05:00 +00:00
import {
CreationOptional,
DataTypes,
InferAttributes,
InferCreationAttributes,
Model,
NonAttribute,
Sequelize,
} from "sequelize";
2025-06-12 06:55:17 +00:00
import { CustomerInvoiceParticipant_Model } from "./customer-invoiceParticipant.mo.del.ts.bak";
2025-03-18 08:05:00 +00:00
2025-06-11 15:13:44 +00:00
export type TCreationCustomerInvoiceParticipantAddress_Model = InferCreationAttributes<
CustomerInvoiceParticipantAddress_Model,
2025-03-18 08:05:00 +00:00
{ omit: "participant" }
>;
2025-06-11 15:13:44 +00:00
export class CustomerInvoiceParticipantAddress_Model extends Model<
InferAttributes<CustomerInvoiceParticipantAddress_Model, { omit: "participant" }>,
InferCreationAttributes<CustomerInvoiceParticipantAddress_Model, { omit: "participant" }>
2025-03-18 08:05:00 +00:00
> {
static associate(connection: Sequelize) {
2025-06-11 15:13:44 +00:00
const { CustomerInvoiceParticipantAddress_Model, CustomerInvoiceParticipant_Model } = connection.models;
CustomerInvoiceParticipantAddress_Model.belongsTo(CustomerInvoiceParticipant_Model, {
2025-03-18 08:05:00 +00:00
as: "participant",
foreignKey: "participant_id",
});
}
declare address_id: string;
declare participant_id: string;
declare type: string;
declare street: CreationOptional<string>;
declare postal_code: CreationOptional<string>;
declare city: CreationOptional<string>;
declare province: CreationOptional<string>;
declare country: CreationOptional<string>;
declare phone: CreationOptional<string>;
declare email: CreationOptional<string>;
2025-06-11 15:13:44 +00:00
declare participant?: NonAttribute<CustomerInvoiceParticipant_Model>;
2025-03-18 08:05:00 +00:00
}
export default (sequelize: Sequelize) => {
2025-06-11 15:13:44 +00:00
CustomerInvoiceParticipantAddress_Model.init(
2025-03-18 08:05:00 +00:00
{
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,
2025-06-12 06:55:17 +00:00
tableName: "customerInvoice_participant_addresses",
2025-04-01 14:26:15 +00:00
}
2025-03-18 08:05:00 +00:00
);
2025-06-11 15:13:44 +00:00
return CustomerInvoiceParticipantAddress_Model;
2025-03-18 08:05:00 +00:00
};