fix: correct some typos and misuse of comma expression
This commit is contained in:
@@ -8,12 +8,12 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"prebuild": "rimraf dist",
|
"prebuild": "rimraf dist",
|
||||||
"build": "nest build",
|
"build": "nest build",
|
||||||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
|
||||||
"start": "nest start",
|
"start": "nest start",
|
||||||
"start:dev": "nest start --watch",
|
"start:dev": "nest start --watch",
|
||||||
"start:debug": "nest start --debug --watch",
|
"start:debug": "nest start --debug --watch",
|
||||||
"start:prod": "node dist/main",
|
"start:prod": "node dist/main",
|
||||||
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
"lint": "eslint \"{src,apps,libs,tests}/**/*.ts\" --fix",
|
||||||
"test": "jest --config .jestrc.json",
|
"test": "jest --config .jestrc.json",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"test:cov": "jest --coverage",
|
"test:cov": "jest --coverage",
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ export abstract class SqlRepositoryBase<
|
|||||||
|
|
||||||
this.logger.debug(
|
this.logger.debug(
|
||||||
`[${RequestContextService.getRequestId()}] deleting entities ${
|
`[${RequestContextService.getRequestId()}] deleting entities ${
|
||||||
(entity.id, this.tableName)
|
entity.id
|
||||||
}`,
|
} from ${this.tableName}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
const result = await this.pool.query(query);
|
const result = await this.pool.query(query);
|
||||||
@@ -102,7 +102,7 @@ export abstract class SqlRepositoryBase<
|
|||||||
async insert(entity: Aggregate | Aggregate[]): Promise<void> {
|
async insert(entity: Aggregate | Aggregate[]): Promise<void> {
|
||||||
const entities = Array.isArray(entity) ? entity : [entity];
|
const entities = Array.isArray(entity) ? entity : [entity];
|
||||||
|
|
||||||
const records = entities.map(this.mapper.toPersistance);
|
const records = entities.map(this.mapper.toPersistence);
|
||||||
|
|
||||||
const query = this.generateInsertQuery(records);
|
const query = this.generateInsertQuery(records);
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export interface Mapper<
|
|||||||
DbRecord,
|
DbRecord,
|
||||||
Response = any,
|
Response = any,
|
||||||
> {
|
> {
|
||||||
toPersistance(entity: DomainEntity): DbRecord;
|
toPersistence(entity: DomainEntity): DbRecord;
|
||||||
toDomain(record: any): DomainEntity;
|
toDomain(record: any): DomainEntity;
|
||||||
toResponse(entity: DomainEntity): Response;
|
toResponse(entity: DomainEntity): Response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { Injectable } from '@nestjs/common';
|
|||||||
export class UserMapper
|
export class UserMapper
|
||||||
implements Mapper<UserEntity, UserModel, UserResponseDto>
|
implements Mapper<UserEntity, UserModel, UserResponseDto>
|
||||||
{
|
{
|
||||||
toPersistance(entity: UserEntity): UserModel {
|
toPersistence(entity: UserEntity): UserModel {
|
||||||
const copy = entity.getPropsCopy();
|
const copy = entity.getPropsCopy();
|
||||||
const record: UserModel = {
|
const record: UserModel = {
|
||||||
id: copy.id,
|
id: copy.id,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { WalletModel, walletSchema } from './database/wallet.repository';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class WalletMapper implements Mapper<WalletEntity, WalletModel> {
|
export class WalletMapper implements Mapper<WalletEntity, WalletModel> {
|
||||||
toPersistance(entity: WalletEntity): WalletModel {
|
toPersistence(entity: WalletEntity): WalletModel {
|
||||||
const copy = entity.getPropsCopy();
|
const copy = entity.getPropsCopy();
|
||||||
const record: WalletModel = {
|
const record: WalletModel = {
|
||||||
id: copy.id,
|
id: copy.id,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { CreateUserTestContext } from '@tests/user/user-shared-steps';
|
|||||||
import { DefineStepFunction } from 'jest-cucumber';
|
import { DefineStepFunction } from 'jest-cucumber';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test steps that an be shared between all tests
|
* Test steps that can be shared between all tests
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const iReceiveAnErrorWithStatusCode = (
|
export const iReceiveAnErrorWithStatusCode = (
|
||||||
|
|||||||
Reference in New Issue
Block a user