added token sell to bank

This commit is contained in:
Kevsl 2024-06-14 15:35:01 +02:00
parent e04bfc0e3d
commit 77f9f59251
2 changed files with 28 additions and 0 deletions

View File

@ -5,6 +5,9 @@
"author": "",
"private": true,
"license": "UNLICENSED",
"prisma": {
"seed": "ts-node ./prisma/seed.ts"
},
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",

25
prisma/seed.ts Normal file
View File

@ -0,0 +1,25 @@
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
await this.prisma.role.create({
name: 'user',
});
await this.prisma.role.create({
name: 'admin',
});
await this.prisma.promoCode.create({
name: 'PROMO1000',
});
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});