This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const FlightRegionType: { | |
| DOMESTIC: 'DOMESTIC', | |
| INTERNATIONAL: 'INTERNATIONAL' | |
| }; | |
| export const CabinClass: { | |
| ECONOMY: 'ECONOMY', | |
| BUSINESS: 'BUSINESS', | |
| FIRST: 'FIRST' | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Connect to postgres | |
| PGPASSWORD="pass" psql -h localhost -p 5432 -U user -d db-name | |
| # You can also use .pgpass, TBH it does not work in my experience. BTW this is much much safer from point of security - No track in terminal history. | |
| touch ~/.pgpass | |
| # Replace its values: | |
| db_host:db_port:db_name:db_user:db_pass | |
| # Dump from postgres | |
| # Doc: https://www.postgresql.org/docs/14/app-pgdump.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Module } from '@nestjs/common'; | |
| import { ThrottlerModule } from '@nestjs/throttler'; | |
| import { ThrottlerStorageRedisService } from 'nestjs-throttler-storage-redis'; | |
| import { AppService } from './service/app.service'; | |
| import { AppController } from './app.controller'; | |
| import { APP_GUARD } from '@nestjs/core'; | |
| import { GlobalThrottlerGuard } from './guards/global-throttler.guard'; | |
| @Module({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is your Prisma schema file | |
| // learn more about it in the docs: https://pris.ly/d/prisma-schema | |
| // N:M relationship in prisma | |
| datasource db { | |
| provider = "postgres" | |
| url = env("DATABASE_URL") | |
| } | |
| generator client { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| log: | |
| level: DEBUG | |
| filepath: "/etc/traefik/log/traefik.log" | |
| api: | |
| dashboard: true | |
| insecure: false | |
| debug: true | |
| # Define ports - UDP or TCP - which will recieve packets | |
| entryPoints: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sequelize = require("../sequelize"); | |
| const Order = require("./order"); | |
| const Payment = require("./payment"); | |
| sequelize | |
| .getSeq() | |
| .sync({ force: true }) | |
| .then(async () => { | |
| // queries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { DataTypes, Model } = require("sequelize"); | |
| const sequelize = require("../sequelize"); | |
| const Order = require("./order"); | |
| class Payment extends Model { | |
| static col = { | |
| id: "id", | |
| refId: "refId", | |
| orderId: "orderId", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { DataTypes, Model } = require("sequelize"); | |
| const sequelize = require("../sequelize"); | |
| class Order extends Model { | |
| static col = { | |
| id: "id", | |
| name: "name", | |
| }; | |
| static alias = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { DataTypes, Model } = require("sequelize"); | |
| const Role = require("./role"); | |
| const sequelize = require("../sequelize"); | |
| class User extends Model { | |
| static col = { | |
| id: "id", | |
| name: "name", | |
| roleId: "roleId", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { DataTypes, Model } = require("sequelize"); | |
| const sequelize = require("../sequelize"); | |
| class Role extends Model { | |
| static col = { | |
| id: "id", | |
| name: "name", | |
| }; | |
| static alias = { |
NewerOlder