Init commit

This commit is contained in:
2024-12-22 16:52:30 +03:30
parent 28ab698dfc
commit aeb38982ca
28 changed files with 1532 additions and 68 deletions
+36
View File
@@ -0,0 +1,36 @@
const Role = require('./roleModel')
const chalk = require('chalk')
const runSeeder = async () => {
const roles = [
{
_id: '66a0144569a37efa10d13628',
englishName: 'Admin',
nativeName: 'ادمین',
permissions: ['66a014057b80c4788e41aab7'],
isActive: true,
},
{
_id: '66a2da5b9b989a8909948848',
englishName: 'SuperAdmin',
nativeName: 'ادمین اصلی',
permissions: [],
isActive: true,
},
{
_id: '66a0144569a37efa10d13629',
englishName: 'User',
nativeName: 'کاربر',
permissions: [],
isActive: true,
},
]
await Role.deleteMany({})
console.log(chalk.red('Deleted all role records.'))
await Role.insertMany(roles, null)
console.log(chalk.green.bold(`ROLE: Created ${roles.length} role(s)`))
}
module.exports = { runSeeder }