HEX
Server: Apache
System: Linux srv4.garantili.com.tr 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: ekspardev (1006)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/ekspardev/tubisad-backend/src/app/demand/model/demand.model.js
const { DataTypes } = require('sequelize');
const sequelize = require('../../../core/config/db/db.conn');
const WasteTypes = require('../../../core/model/waste-type/wasted_type.model');
const DonatedProjects = require('../../../core/model/donated-projects/donated_projects.model');


const Demands = sequelize.define('demands_talepler', {
    id: {
        autoIncrement: true,
        type: DataTypes.INTEGER,
        allowNull: false,
        primaryKey: true
    },
    wasteType: {
        type: DataTypes.INTEGER,
        allowNull: true,
        foreignKey: true,
        references: {
            model: WasteTypes,
            foreignKey: 'id',
        },
        comment: "Atık Tipi, İsmi: Yeniden Kullanım/Geri Dönüşüm"
    },
    wasteWeight: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Atık ağırlığı"
    },
    wasteDoc: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Atık resmi ya da dökümanı"
    },
    city: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "İl"
    },
    district: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "İlçe"
    },
    street: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Sokak/Cadde"
    },
    neighborhood: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Mahalle"
    },
    outdoorNo: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Dış Kapı No"
    },
    doorNo: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Daire No"
    },
    locationLat: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Konum Latitude"
    },
    locationLon: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Konum Longitude"
    },
    donorFullName: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Bağışçı ismi veya şirket ünvanı"
    },
    donorPhone: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Bağışçı Telefon No"
    },
    donorEmail: {
        type: DataTypes.STRING,
        allowNull: true,
        comment: "Bağışçı Email"
    },
    donatedProject: {
        type: DataTypes.INTEGER,
        allowNull: true,
        foreignKey: true,
        references: {
            model: DonatedProjects,
            key: 'id',
        },
        comment: "Bağışlanacak Proje"
    },
    textApproval: {
        type: DataTypes.BOOLEAN,
        allowNull: true,
        comment: "Bilgilendirme ve rıza metni onayı"
    },
    kvkkApproval: {
        type: DataTypes.BOOLEAN,
        allowNull: true,
        comment: "KVKK metni onayı"
    },
    smsApproval: {
        type: DataTypes.BOOLEAN,
        allowNull: true,
        comment: "SMS metni onayı"
    },
},
    {
        sequelize,
        tableName: 'demands_talepler',
        timestamps: true,
        paranoid: true,
    }
);

Demands.sync({ alter: true });

module.exports = Demands;