Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/rentals.picotech.app/public_html/server/models/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import { DataTypes } from 'sequelize';
import sequelize from '../config/database.js';
const Renter = sequelize.define('Renter', {
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
name: {
type: DataTypes.STRING,
allowNull: false,
validate: {
notEmpty: true,
len: [2, 100]
}
},
email: {
type: DataTypes.STRING,
allowNull: false,
validate: {
isEmail: true
}
},
phone: {
type: DataTypes.STRING,
allowNull: false
},
alternate_phone: {
type: DataTypes.STRING,
allowNull: true
},
nid: {
type: DataTypes.STRING,
allowNull: true,
unique: true
},
building_id: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'buildings',
key: 'id'
}
},
floor_id: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'floors',
key: 'id'
}
},
room_id: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'rooms',
key: 'id'
}
},
bed_id: {
type: DataTypes.UUID,
allowNull: true,
references: {
model: 'beds',
key: 'id'
}
},
user_id: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'users',
key: 'id'
}
},
rent_amount: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
validate: {
min: 0
}
},
security_deposit: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
validate: {
min: 0
}
},
check_in_date: {
type: DataTypes.DATE,
allowNull: false
},
check_out_date: {
type: DataTypes.DATE,
allowNull: true
},
lease_start_date: {
type: DataTypes.DATE,
allowNull: false
},
lease_end_date: {
type: DataTypes.DATE,
allowNull: false
},
status: {
type: DataTypes.ENUM('active', 'inactive', 'notice_period', 'blacklisted'),
defaultValue: 'active'
},
emergency_contact: {
type: DataTypes.STRING,
allowNull: false
},
emergency_relation: {
type: DataTypes.STRING,
allowNull: false
},
profile_photo: {
type: DataTypes.STRING,
allowNull: true
},
occupation: {
type: DataTypes.STRING,
allowNull: true
},
company: {
type: DataTypes.STRING,
allowNull: true
},
monthly_income: {
type: DataTypes.DECIMAL(10, 2),
allowNull: true
},
previous_address: {
type: DataTypes.TEXT,
allowNull: true
},
references: {
type: DataTypes.TEXT,
allowNull: true
},
notice_period: {
type: DataTypes.INTEGER,
defaultValue: 30
},
preferences: {
type: DataTypes.JSON,
defaultValue: {
food_type: 'both',
smoking_allowed: false,
pet_allowed: false,
guest_policy: 'restricted'
}
},
payment_history: {
type: DataTypes.JSON,
defaultValue: {
on_time_payments: 0,
late_payments: 0,
total_payments: 0
}
}
}, {
tableName: 'renters', // ✅ ensure consistent foreign key resolution
timestamps: true ,
});
export default Renter; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0038 ]-- |