lint: update type data and lint

pull/25/head
shancheas 2024-07-09 17:47:15 +07:00
parent c87c852509
commit 6261592339
21 changed files with 57 additions and 34 deletions

View File

@ -61,7 +61,7 @@ export class PrivilegeService {
} }
async privilegeConfiguration(): Promise<UserPrivilegeConfigurationEntity> { async privilegeConfiguration(): Promise<UserPrivilegeConfigurationEntity> {
const { module, menu, sub_menu, section } = this.moduleKey(); const { module, menu } = this.moduleKey();
return await this.repository.findOne({ return await this.repository.findOne({
select: ['id', 'view', 'create', 'edit', 'delete', 'cancel', 'confirm'], select: ['id', 'view', 'create', 'edit', 'delete', 'cancel', 'confirm'],
where: { where: {

View File

@ -25,7 +25,7 @@ export abstract class BaseBatchDeleteManager<Entity> extends BaseManager {
async process(): Promise<void> { async process(): Promise<void> {
let totalFailed = 0; let totalFailed = 0;
let totalSuccess = 0; let totalSuccess = 0;
let messages = []; const messages = [];
for (const id of this.dataIds) { for (const id of this.dataIds) {
try { try {

View File

@ -29,7 +29,7 @@ export abstract class BaseBatchUpdateStatusManager<Entity> extends BaseManager {
async process(): Promise<void> { async process(): Promise<void> {
let totalFailed = 0; let totalFailed = 0;
let totalSuccess = 0; let totalSuccess = 0;
let messages = []; const messages = [];
for (const id of this.dataIds) { for (const id of this.dataIds) {
try { try {

View File

@ -24,7 +24,7 @@ export interface validateRelations {
export interface columnUniques { export interface columnUniques {
column: string; column: string;
query?: Object; query?: any;
} }
export interface IEvent<Entity = any> { export interface IEvent<Entity = any> {

View File

@ -1,18 +1,29 @@
import { MigrationInterface, QueryRunner } from "typeorm"; import { MigrationInterface, QueryRunner } from 'typeorm';
export class UpdateTableTransaction1720436852936 implements MigrationInterface { export class UpdateTableTransaction1720436852936 implements MigrationInterface {
name = 'UpdateTableTransaction1720436852936' name = 'UpdateTableTransaction1720436852936';
public async up(queryRunner: QueryRunner): Promise<void> { public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "transaction_taxes" ADD "tax_total_value" numeric`); await queryRunner.query(
await queryRunner.query(`ALTER TABLE "transaction_taxes" DROP COLUMN "taxt_value"`); `ALTER TABLE "transaction_taxes" ADD "tax_total_value" numeric`,
await queryRunner.query(`ALTER TABLE "transaction_taxes" ADD "taxt_value" numeric`); );
} await queryRunner.query(
`ALTER TABLE "transaction_taxes" DROP COLUMN "taxt_value"`,
public async down(queryRunner: QueryRunner): Promise<void> { );
await queryRunner.query(`ALTER TABLE "transaction_taxes" DROP COLUMN "taxt_value"`); await queryRunner.query(
await queryRunner.query(`ALTER TABLE "transaction_taxes" ADD "taxt_value" character varying`); `ALTER TABLE "transaction_taxes" ADD "taxt_value" numeric`,
await queryRunner.query(`ALTER TABLE "transaction_taxes" DROP COLUMN "tax_total_value"`); );
} }
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "transaction_taxes" DROP COLUMN "taxt_value"`,
);
await queryRunner.query(
`ALTER TABLE "transaction_taxes" ADD "taxt_value" character varying`,
);
await queryRunner.query(
`ALTER TABLE "transaction_taxes" DROP COLUMN "tax_total_value"`,
);
}
} }

View File

@ -10,8 +10,6 @@ import { PaymentMethodType } from 'src/modules/transaction/payment-method/consta
@Controller('v1/constant') @Controller('v1/constant')
@Public(true) @Public(true)
export class ConstantController { export class ConstantController {
constructor() {}
@Get('master-data-status') @Get('master-data-status')
async masterDataStatus(): Promise<any> { async masterDataStatus(): Promise<any> {
return [STATUS.ACTIVE, STATUS.DRAFT, STATUS.INACTIVE]; return [STATUS.ACTIVE, STATUS.DRAFT, STATUS.INACTIVE];

View File

@ -1,3 +1,3 @@
export class CronMidnightEvent { export class CronMidnightEvent {
constructor(public readonly data: {}) {} // constructor(public readonly data: {}) {}
} }

View File

@ -16,6 +16,6 @@ export class MidnightCronManager {
console.log('Cron Event executed every 00:00 minutes.', now); console.log('Cron Event executed every 00:00 minutes.', now);
this.eventBus.publishAll([new CronMidnightEvent({})]); this.eventBus.publishAll([new CronMidnightEvent()]);
} }
} }

View File

@ -6,5 +6,7 @@ import { ErrorLogService } from '../../data/services/error-log.service';
export class RecordErrorLogHandler implements IEventHandler<RecordErrorLog> { export class RecordErrorLogHandler implements IEventHandler<RecordErrorLog> {
constructor(private dataservice: ErrorLogService) {} constructor(private dataservice: ErrorLogService) {}
async handle(event: RecordErrorLog) {} async handle(event: RecordErrorLog) {
// TODO: Implement logic here
}
} }

View File

@ -3,5 +3,7 @@ import { RecordLog } from '../entities/log.event';
@EventsHandler(RecordLog) @EventsHandler(RecordLog)
export class RecordLogHandler implements IEventHandler<RecordLog> { export class RecordLogHandler implements IEventHandler<RecordLog> {
async handle(event: RecordLog) {} async handle(event: RecordLog) {
// TODO: Implement logic here
}
} }

View File

@ -22,7 +22,9 @@ export class CreateItemCategoryManager extends BaseCreateManager<ItemCategoryEnt
return; return;
} }
async generateConfig(): Promise<void> {} async generateConfig(): Promise<void> {
// TODO: Implement logic here
}
get validateRelations(): validateRelations[] { get validateRelations(): validateRelations[] {
return []; return [];

View File

@ -19,7 +19,7 @@ export class IndexItemRateManager extends BaseIndexManager<ItemEntity> {
async afterProcess(): Promise<void> { async afterProcess(): Promise<void> {
this.result.data?.map((item) => { this.result.data?.map((item) => {
let prices = []; const prices = [];
for ( for (
let d = new Date(this.filterParam.start_date); let d = new Date(this.filterParam.start_date);
d <= new Date(this.filterParam.end_date); d <= new Date(this.filterParam.end_date);

View File

@ -21,7 +21,7 @@ export async function ValidateSeasonPeriodHelper(dataService, data) {
=> akan tetapi dapat ditindih oleh season period 2024-08-15, 2024-08-28 days [Sabtu, Senin] (karena ini naik prio menjadi priority 2) => akan tetapi dapat ditindih oleh season period 2024-08-15, 2024-08-28 days [Sabtu, Senin] (karena ini naik prio menjadi priority 2)
*/ */
const query = dataService.getRepository().createQueryBuilder('data'); const query = dataService.getRepository().createQueryBuilder('data');
let priority: number = 3; let priority = 3;
// libur / specific date // libur / specific date
if ( if (
data.holidays?.length > 0 || data.holidays?.length > 0 ||

View File

@ -1,3 +1,3 @@
import { BaseFilterEntity } from 'src/core/modules/domain/entities/base-filter.entity'; import { BaseFilterEntity } from 'src/core/modules/domain/entities/base-filter.entity';
export interface FilterSeasonTypeEntity extends BaseFilterEntity {} export type FilterSeasonTypeEntity = BaseFilterEntity;

View File

@ -1,3 +1,3 @@
import { BaseFilterEntity } from 'src/core/modules/domain/entities/base-filter.entity'; import { BaseFilterEntity } from 'src/core/modules/domain/entities/base-filter.entity';
export interface FilterVipCategoryEntity extends BaseFilterEntity {} export type FilterVipCategoryEntity = BaseFilterEntity;

View File

@ -19,7 +19,9 @@ export class CreateVipCategoryManager extends BaseCreateManager<VipCategoryEntit
return; return;
} }
async generateConfig(): Promise<void> {} async generateConfig(): Promise<void> {
// TODO: Implement logic here
}
get validateRelations(): validateRelations[] { get validateRelations(): validateRelations[] {
return []; return [];

View File

@ -1,3 +1,3 @@
import { BaseFilterEntity } from 'src/core/modules/domain/entities/base-filter.entity'; import { BaseFilterEntity } from 'src/core/modules/domain/entities/base-filter.entity';
export interface FilterVipCodeEntity extends BaseFilterEntity {} export type FilterVipCodeEntity = BaseFilterEntity;

View File

@ -30,7 +30,9 @@ export class CreateTenantManager extends BaseCreateManager<UserEntity> {
return; return;
} }
async generateConfig(): Promise<void> {} async generateConfig(): Promise<void> {
// TODO: Implement logic here
}
get uniqueColumns(): columnUniques[] { get uniqueColumns(): columnUniques[] {
return [ return [

View File

@ -1,3 +1,3 @@
import { BaseFilterEntity } from 'src/core/modules/domain/entities/base-filter.entity'; import { BaseFilterEntity } from 'src/core/modules/domain/entities/base-filter.entity';
export interface FilterUserPrivilegeEntity extends BaseFilterEntity {} export type FilterUserPrivilegeEntity = BaseFilterEntity;

View File

@ -24,7 +24,9 @@ export class CreateUserPrivilegeManager extends BaseCreateManager<UserPrivilegeE
return; return;
} }
async generateConfig(): Promise<void> {} async generateConfig(): Promise<void> {
// TODO: Implement logic here
}
get uniqueColumns(): columnUniques[] { get uniqueColumns(): columnUniques[] {
return [{ column: 'name' }]; return [{ column: 'name' }];

View File

@ -31,7 +31,9 @@ export class CreateUserManager extends BaseCreateManager<UserEntity> {
return; return;
} }
async generateConfig(): Promise<void> {} async generateConfig(): Promise<void> {
// TODO: Implement logic here
}
get validateRelations(): validateRelations[] { get validateRelations(): validateRelations[] {
return []; return [];