Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ticketing #2

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.0.0
v18.13.0
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.18.0-alpine3.15 as builder
FROM node:18.14-alpine as builder

ENV NODE_ENV build

Expand All @@ -11,7 +11,7 @@ RUN yarn install --frozen-lockfile \

# ---

FROM node:16.18.0-alpine3.15 as production
FROM node:18.14-alpine as production

WORKDIR /usr/src/app

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.14.2-alpine AS development
FROM node:18.14-alpine AS development

ARG NPM_PRIVATE_REGISTRY_URL
ARG NPM_PRIVATE_REGISTRY_TOKEN
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,20 @@
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.2.1",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/platform-socket.io": "^9.3.9",
"@nestjs/schedule": "^2.1.0",
"@nestjs/swagger": "^6.1.0",
"@nestjs/terminus": "^9.1.1",
"@nestjs/typeorm": "^9.0.1",
"@nestjs/websockets": "^9.3.9",
"@openapitools/openapi-generator-cli": "^2.5.2",
"@types/cron": "^2.0.0",
"@types/multer": "^1.4.7",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"dotenv": "^16.0.1",
"es6-promise": "^4.2.8",
"ethers": "^5.0.0",
"ethers": "^6.0.4",
"nestjs-ethers": "^1.0.3",
"nestjs-pino": "^3.1.1",
"nestjs-typeorm-paginate": "^4.0.2",
Expand Down
27 changes: 23 additions & 4 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { NeedEntity } from './entities/need.entity';
import { SignatureModule } from './features/signature/signature.module';
import { SignatureEntity } from './entities/signature.entity';
import { ChildrenEntity } from './entities/children.entity';
import { FamilyEntity, SocialWorkerEntity } from './entities/user.entity';
import { SyncModule } from './features/sync/sync.module';
import { FamilyEntity, ContributorEntity } from './entities/user.entity';
import { ChildrenModule } from './features/children/children.module';
import { NeedModule } from './features/need/need.module';
import { MilestoneModule } from './features/milestone/milestone.module';
Expand All @@ -28,16 +27,32 @@ import { EthereumAccount } from './entities/ethereum.account.entity';
import { EthereumTransaction } from './entities/ethereum.transaction.entity';
import { NgoModule } from './features/ngo/ngo.module';
import { NgoEntity } from './entities/ngo.entity';
import { TicketModule } from './features/ticket/ticket.module';
import { TicketEntity } from './entities/ticket.entity';
import { TicketContentEntity } from './entities/ticketContent.entity';
import { SyncModule } from './features/sync/sync.module';
import { StatusModule } from './features/status/status.module';
import { StatusEntity } from './entities/status.entity';
import { CityEntity } from './entities/city.entity';
import { CityModule } from './features/city/city.module';
import { GatewayModule } from './features/gateway/gateway.module';
import { TicketViewEntity } from './entities/ticketView.entity';

const imports = [
LoggerModule.forRoot(),
ConfigModule.forRoot({ isGlobal: true }),
TypeOrmModule.forRoot({
...config().db,
...config().db1,
...config().db2,
dropSchema: false,
entities: [
CityEntity,
StatusEntity,
TicketEntity,
TicketViewEntity,
TicketContentEntity,
FamilyEntity,
SocialWorkerEntity,
ContributorEntity,
NgoEntity,
PaymentEntity,
ReceiptEntity,
Expand All @@ -51,8 +66,12 @@ const imports = [
EthereumTransaction
],
}),
GatewayModule,
CityModule,
StatusModule,
SyncModule,
UserModule,
TicketModule,
NgoModule,
PaymentModule,
ReceiptModule,
Expand Down
16 changes: 15 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function loadConfig() {
: process.env.NODE_ENV === 'staging' ? process.env.AUTHORIZED_HOST_STAGING : process.env.AUTHORIZED_HOST_PRODUCTION,
logLevel: 'debug',
documentUrl: '',
db: {
db1: {
type: 'postgres' as const,
port: 5432,
host: NODE_ENV === 'development' ? 'localhost' : process.env.DB_HOST,
Expand All @@ -44,6 +44,20 @@ function loadConfig() {
autoLoadEntities: true,
entities: [`${__dirname}/entity/*.js`],
},
db2: {
type: 'postgres' as const,
// port: 35432,
// host: process.env.DB_FLASK_HOST,
// username: process.env.DB_FLASK_USER,
// password: dbPassword ?? process.env.DB_PASs,
// database: process.env.DB_FLASK_NAME,
// enabled: true,
// synchronize: true,
// logging: true,
// dropSchema: false,
// autoLoadEntities: true,
// entities: [`${__dirname}/entity/*.js`],
},
logPretty: 'LOG_PRETTY_PRINT',
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "../../../build-info/dfdb0cb1ac8a1f808b38b526b51f14b8.json"
}
Loading