Merge branch 'development' of ssh://git.eigen.co.id:2222/eigen/pos-be into development
continuous-integration/drone/tag Build is passing Details

pull/26/head devel_10.6.8
Firman Ramdhani 2024-07-09 18:44:12 +07:00
commit 2f03f18d51
68 changed files with 304 additions and 174 deletions

2
env/env.development vendored
View File

@ -6,6 +6,8 @@ JWT_REFRESH_EXPIRES="7d"
ENC_KEY="921c83f3b90c92dca4ba9b947f99b4c9"
IV="a671a96159e97a4f"
COUCHDB_CONFIG="http://root:password@172.10.10.2:5970"
DEFAULT_DB_HOST="postgres"
DEFAULT_DB_PORT="5432"
DEFAULT_DB_USER="root"

View File

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

View File

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

View File

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

View File

@ -75,11 +75,21 @@ export abstract class BaseCreateManager<Entity> extends BaseManager {
if (!this.eventTopics.length) return;
for (const topic of this.eventTopics) {
let data;
if (!topic.data) {
data = await this.dataService.getOneByOptions({
where: {
id: this.result['id'],
},
relations: topic.relations,
});
}
this.eventBus.publishAll([
new topic.topic({
id: this.result['id'],
id: data?.['id'] ?? topic?.data?.['id'],
old: null,
data: topic.data,
data: data ?? topic.data,
user: this.user,
description: '',
module: this.tableName,

View File

@ -4,9 +4,9 @@ import { BaseDataOrchestrator } from './base-data.orchestrator';
export abstract class BaseDataTransactionOrchestrator<
Entity,
> extends BaseDataOrchestrator<Entity> {
abstract active(dataId: string): Promise<String>;
abstract confirm(dataId: string): Promise<String>;
abstract inactive(dataId: string): Promise<String>;
abstract active(dataId: string): Promise<string>;
abstract confirm(dataId: string): Promise<string>;
abstract inactive(dataId: string): Promise<string>;
abstract batchConfirm(dataIds: string[]): Promise<BatchResult>;
abstract batchActive(dataIds: string[]): Promise<BatchResult>;
abstract batchInactive(dataIds: string[]): Promise<BatchResult>;

View File

@ -3,6 +3,6 @@ import { BatchResult } from 'src/core/response/domain/ok-response.interface';
export abstract class BaseDataOrchestrator<Entity> {
abstract create(data: Entity): Promise<Entity>;
abstract update(dataId: string, data: Entity): Promise<Entity>;
abstract delete(dataId: string): Promise<String>;
abstract delete(dataId: string): Promise<string>;
abstract batchDelete(dataIds: string[]): Promise<BatchResult>;
}

View File

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

View File

@ -36,7 +36,7 @@ export class {{pascalCase name}}DataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -46,7 +46,7 @@ export class {{pascalCase name}}DataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -56,7 +56,7 @@ export class {{pascalCase name}}DataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -74,7 +74,7 @@ export class {{pascalCase name}}DataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -43,7 +43,7 @@ import {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -48,7 +48,7 @@ export class {{pascalCase name}}DataOrchestrator extends Base{{pascalCase orches
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.{{constantCase name}});
await this.deleteManager.execute();
@ -65,7 +65,7 @@ export class {{pascalCase name}}DataOrchestrator extends Base{{pascalCase orches
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.{{constantCase name}});
await this.activeManager.execute();
@ -82,7 +82,7 @@ export class {{pascalCase name}}DataOrchestrator extends Base{{pascalCase orches
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.{{constantCase name}});
await this.confirmManager.execute();
@ -99,7 +99,7 @@ export class {{pascalCase name}}DataOrchestrator extends Base{{pascalCase orches
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(
this.serviceData,

View File

@ -36,7 +36,7 @@ export class {{pascalCase name}}DataOrchestrator extends Base{{pascalCase orches
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.{{constantCase name}});
await this.deleteManager.execute();

View File

@ -1,18 +1,29 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { MigrationInterface, QueryRunner } from 'typeorm';
export class UpdateTableTransaction1720436852936 implements MigrationInterface {
name = 'UpdateTableTransaction1720436852936'
name = 'UpdateTableTransaction1720436852936';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "transaction_taxes" ADD "tax_total_value" numeric`);
await queryRunner.query(`ALTER TABLE "transaction_taxes" DROP COLUMN "taxt_value"`);
await queryRunner.query(`ALTER TABLE "transaction_taxes" ADD "taxt_value" numeric`);
}
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"`);
}
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "transaction_taxes" ADD "tax_total_value" numeric`,
);
await queryRunner.query(
`ALTER TABLE "transaction_taxes" DROP COLUMN "taxt_value"`,
);
await queryRunner.query(
`ALTER TABLE "transaction_taxes" ADD "taxt_value" numeric`,
);
}
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')
@Public(true)
export class ConstantController {
constructor() {}
@Get('master-data-status')
async masterDataStatus(): Promise<any> {
return [STATUS.ACTIVE, STATUS.DRAFT, STATUS.INACTIVE];

View File

@ -1 +1 @@
export const DatabaseListen = ['transaction'];
export const DatabaseListen = ['transaction', 'vip_code'];

View File

@ -37,6 +37,7 @@ import { TransactionDataService } from 'src/modules/transaction/transaction/data
import { TransactionModel } from 'src/modules/transaction/transaction/data/models/transaction.model';
import { TransactionTaxModel } from 'src/modules/transaction/transaction/data/models/transaction-tax.model';
import { TransactionItemModel } from 'src/modules/transaction/transaction/data/models/transaction-item.model';
import { VipCodeCreatedHandler } from './domain/managers/vip-code.handler';
@Module({
imports: [
@ -59,6 +60,7 @@ import { TransactionItemModel } from 'src/modules/transaction/transaction/data/m
BookingDeletedEvent,
PaymentMethodDeletedHandler,
PaymentMethodUpdatedHandler,
VipCodeCreatedHandler,
VipCategoryDeletedHandler,
VipCategoryUpdatedHandler,
SeasonPeriodDeletedHandler,

View File

@ -1,21 +1,32 @@
import { Injectable } from '@nestjs/common';
import { Injectable, Logger } from '@nestjs/common';
import { DatabaseListen } from '../../constants';
import { EventBus } from '@nestjs/cqrs';
import { ChangeDocEvent } from '../../domain/events/change-doc.event';
import { ConfigService } from '@nestjs/config';
import * as Nano from 'nano';
@Injectable()
export class CouchService {
constructor(private eventBus: EventBus) {}
constructor(
private eventBus: EventBus,
private configService: ConfigService,
) {}
get nanoInstance() {
const couchConfiguration = this.configService.get<string>('COUCHDB_CONFIG');
return Nano(couchConfiguration);
}
async onModuleInit() {
const nano = require('nano')('http://root:password@172.10.10.2:5970');
const nano = this.nanoInstance;
for (const database of DatabaseListen) {
const db = nano.db.use(database);
db.changesReader.start({ includeDocs: true }).on('change', (change) => {
this.changeDoc(change, database);
});
console.log(`start listen database ${database}`);
Logger.log(`start listen database ${database}`, 'CouchService');
}
}
@ -31,7 +42,7 @@ export class CouchService {
public async createDoc(data, database) {
try {
const nano = require('nano')('http://root:password@172.10.10.2:5970');
const nano = this.nanoInstance;
const db = nano.use(database);
return await db.insert(data);
} catch (error) {}
@ -39,7 +50,7 @@ export class CouchService {
public async deleteDoc(data, database) {
try {
const nano = require('nano')('http://root:password@172.10.10.2:5970');
const nano = this.nanoInstance;
const db = nano.use(database);
const result = await db.get(data.id);
await db.destroy(data.id, result._rev);
@ -48,7 +59,7 @@ export class CouchService {
public async updateDoc(data, database) {
try {
const nano = require('nano')('http://root:password@172.10.10.2:5970');
const nano = this.nanoInstance;
const db = nano.use(database);
const result = await db.get(data.id);
console.log(result, 'dsa');

View File

@ -0,0 +1,22 @@
import { EventsHandler, IEventHandler } from '@nestjs/cqrs';
import { CouchService } from '../../data/services/couch.service';
import { VipCodeCreatedEvent } from 'src/modules/transaction/vip-code/domain/entities/event/vip-code-created.event';
@EventsHandler(VipCodeCreatedEvent)
export class VipCodeCreatedHandler
implements IEventHandler<VipCodeCreatedEvent>
{
constructor(private couchService: CouchService) {}
async handle(event: VipCodeCreatedEvent) {
const data = event.data.data;
await this.couchService.createDoc(
{
_id: data.id,
...data,
},
'vip_code',
);
}
}

View File

@ -1,19 +1,28 @@
import { Body, Controller, Get, Post } from '@nestjs/common';
import { Body, Controller, Get, Injectable, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Unprotected } from 'src/core/guards';
import { Public } from 'src/core/guards';
import * as Nano from 'nano';
import { CreateUserPrivilegeDto } from 'src/modules/user-related/user-privilege/infrastructure/dto/create-user-privilege.dto';
import { ConfigService } from '@nestjs/config';
@ApiTags(`couch`)
@Controller('v1/couch')
@Unprotected()
@Public()
@Injectable()
export class CouchDataController {
constructor(private configService: ConfigService) {}
get nanoInstance() {
const couchConfiguration = this.configService.get<string>('COUCHDB_CONFIG');
return Nano(couchConfiguration);
}
@Post()
async createDoc(@Body() entity: CreateUserPrivilegeDto) {
try {
let n = Nano('http://admin:secret@127.0.0.1:5984');
let db = await n.db.create(entity.name);
const n = this.nanoInstance;
await n.db.create(entity.name);
} catch (error) {
console.log(error, 'dsa');
}
@ -22,17 +31,17 @@ export class CouchDataController {
@Post('doc')
async createDocs(@Body() entity: CreateUserPrivilegeDto) {
try {
const nano = require('nano')('http://admin:secret@127.0.0.1:5984');
const nano = this.nanoInstance;
const people = nano.db.use('string');
console.log(await people.info());
const data = {
id: '1212',
name: 'dsadas',
};
console.log(await people.info(), entity);
// const data = {
// id: '1212',
// name: 'dsadas',
// };
// await people.insert(data)
people.changesReader
.start()
.start({})
.on('change', (change) => {
console.log(change);
})
@ -53,9 +62,10 @@ export class CouchDataController {
@Get()
async getDoc() {
try {
let n = Nano('http://admin:secret@127.0.0.1:5984');
const people = n.use('string');
const n = this.nanoInstance;
const people = n.db.get('user');
return people;
// return people.get();
} catch (error) {
console.log(error, 'dsa');

View File

@ -1,3 +1,3 @@
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);
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> {
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)
export class RecordLogHandler implements IEventHandler<RecordLog> {
async handle(event: RecordLog) {}
async handle(event: RecordLog) {
// TODO: Implement logic here
}
}

View File

@ -49,7 +49,7 @@ export class ItemCategoryDataOrchestrator extends BaseDataTransactionOrchestrato
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.ITEM_CATEGORY);
await this.deleteManager.execute();
@ -66,7 +66,7 @@ export class ItemCategoryDataOrchestrator extends BaseDataTransactionOrchestrato
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.ITEM_CATEGORY);
await this.activeManager.execute();
@ -83,7 +83,7 @@ export class ItemCategoryDataOrchestrator extends BaseDataTransactionOrchestrato
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.ITEM_CATEGORY);
await this.confirmManager.execute();
@ -100,7 +100,7 @@ export class ItemCategoryDataOrchestrator extends BaseDataTransactionOrchestrato
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(this.serviceData, TABLE_NAME.ITEM_CATEGORY);
await this.inactiveManager.execute();

View File

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

View File

@ -34,7 +34,7 @@ export class ItemCategoryDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -44,7 +44,7 @@ export class ItemCategoryDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -54,7 +54,7 @@ export class ItemCategoryDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -72,7 +72,7 @@ export class ItemCategoryDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -36,7 +36,7 @@ export class ItemRateDataOrchestrator extends BaseDataOrchestrator<ItemRateEntit
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.ITEM_RATE);
await this.deleteManager.execute();

View File

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

View File

@ -38,7 +38,7 @@ export class ItemRateDataController {
}
// @Delete(':id')
// async delete(@Param('id') dataId: string): Promise<String> {
// async delete(@Param('id') dataId: string): Promise<string> {
// return await this.orchestrator.delete(dataId);
// }
}

View File

@ -60,7 +60,7 @@ export class ItemDataOrchestrator extends BaseDataTransactionOrchestrator<ItemEn
return this.updateManager.getResult();
}
async delete(dataId, tenantId?: string): Promise<String> {
async delete(dataId, tenantId?: string): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.ITEM);
await this.deleteManager.execute();
@ -77,7 +77,7 @@ export class ItemDataOrchestrator extends BaseDataTransactionOrchestrator<ItemEn
return this.batchDeleteManager.getResult();
}
async active(dataId, tenantId?: string): Promise<String> {
async active(dataId, tenantId?: string): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.ITEM);
await this.activeManager.execute();
@ -94,7 +94,7 @@ export class ItemDataOrchestrator extends BaseDataTransactionOrchestrator<ItemEn
return this.batchActiveManager.getResult();
}
async confirm(dataId, tenantId?: string): Promise<String> {
async confirm(dataId, tenantId?: string): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.ITEM);
await this.confirmManager.execute();
@ -111,7 +111,7 @@ export class ItemDataOrchestrator extends BaseDataTransactionOrchestrator<ItemEn
return this.batchConfirmManager.getResult();
}
async inactive(dataId, tenantId?: string): Promise<String> {
async inactive(dataId, tenantId?: string): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(this.serviceData, TABLE_NAME.ITEM);
await this.inactiveManager.execute();

View File

@ -34,7 +34,7 @@ export class ItemDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -44,7 +44,7 @@ export class ItemDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -54,7 +54,7 @@ export class ItemDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -72,7 +72,7 @@ export class ItemDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

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)
*/
const query = dataService.getRepository().createQueryBuilder('data');
let priority: number = 3;
let priority = 3;
// libur / specific date
if (
data.holidays?.length > 0 ||

View File

@ -60,7 +60,7 @@ export class SeasonPeriodDataOrchestrator extends BaseDataTransactionOrchestrato
return this.updatePriceManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.SEASON_PERIOD);
await this.deleteManager.execute();
@ -77,7 +77,7 @@ export class SeasonPeriodDataOrchestrator extends BaseDataTransactionOrchestrato
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.SEASON_PERIOD);
await this.activeManager.execute();
@ -94,7 +94,7 @@ export class SeasonPeriodDataOrchestrator extends BaseDataTransactionOrchestrato
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.SEASON_PERIOD);
await this.confirmManager.execute();
@ -111,7 +111,7 @@ export class SeasonPeriodDataOrchestrator extends BaseDataTransactionOrchestrato
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(this.serviceData, TABLE_NAME.SEASON_PERIOD);
await this.inactiveManager.execute();

View File

@ -44,7 +44,7 @@ export class SeasonPeriodDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -54,7 +54,7 @@ export class SeasonPeriodDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -64,7 +64,7 @@ export class SeasonPeriodDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -91,7 +91,7 @@ export class SeasonPeriodDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

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

View File

@ -48,7 +48,7 @@ export class SeasonTypeDataOrchestrator extends BaseDataTransactionOrchestrator<
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.SEASON_TYPE);
await this.deleteManager.execute();
@ -65,7 +65,7 @@ export class SeasonTypeDataOrchestrator extends BaseDataTransactionOrchestrator<
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.SEASON_TYPE);
await this.activeManager.execute();
@ -82,7 +82,7 @@ export class SeasonTypeDataOrchestrator extends BaseDataTransactionOrchestrator<
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.SEASON_TYPE);
await this.confirmManager.execute();
@ -99,7 +99,7 @@ export class SeasonTypeDataOrchestrator extends BaseDataTransactionOrchestrator<
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(this.serviceData, TABLE_NAME.SEASON_TYPE);
await this.inactiveManager.execute();

View File

@ -34,7 +34,7 @@ export class SeasonTypeDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -44,7 +44,7 @@ export class SeasonTypeDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -54,7 +54,7 @@ export class SeasonTypeDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -72,7 +72,7 @@ export class SeasonTypeDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -48,7 +48,7 @@ export class PaymentMethodDataOrchestrator extends BaseDataTransactionOrchestrat
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.PAYMENT_METHOD);
await this.deleteManager.execute();
@ -65,7 +65,7 @@ export class PaymentMethodDataOrchestrator extends BaseDataTransactionOrchestrat
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.PAYMENT_METHOD);
await this.activeManager.execute();
@ -82,7 +82,7 @@ export class PaymentMethodDataOrchestrator extends BaseDataTransactionOrchestrat
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.PAYMENT_METHOD);
await this.confirmManager.execute();
@ -99,7 +99,7 @@ export class PaymentMethodDataOrchestrator extends BaseDataTransactionOrchestrat
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(
this.serviceData,

View File

@ -34,7 +34,7 @@ export class PaymentMethodDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -44,7 +44,7 @@ export class PaymentMethodDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -54,7 +54,7 @@ export class PaymentMethodDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -72,7 +72,7 @@ export class PaymentMethodDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -45,6 +45,7 @@ export class IndexReconciliationManager extends BaseIndexManager<TransactionEnti
`${this.tableName}.reconciliation_confirm_by`,
`${this.tableName}.customer_name`,
`${this.tableName}.creator_counter_no`,
`${this.tableName}.payment_type`,
`${this.tableName}.payment_type_method_id`,

View File

@ -39,7 +39,7 @@ export class ReconciliationDataOrchestrator {
return this.recapManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.CONFIRMED);
this.confirmManager.setService(this.serviceData, TABLE_NAME.TRANSACTION);
await this.confirmManager.execute();
@ -56,7 +56,7 @@ export class ReconciliationDataOrchestrator {
return this.batchConfirmManager.getResult();
}
async cancel(dataId): Promise<String> {
async cancel(dataId): Promise<string> {
this.cancelManager.setData(dataId, STATUS.REJECTED);
this.cancelManager.setService(this.serviceData, TABLE_NAME.TRANSACTION);
await this.cancelManager.execute();

View File

@ -34,12 +34,12 @@ export class ReconciliationDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@Patch(':id/cancel')
async cancel(@Param('id') dataId: string): Promise<String> {
async cancel(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.cancel(dataId);
}

View File

@ -50,7 +50,7 @@ export class TaxDataOrchestrator extends BaseDataTransactionOrchestrator<TaxEnti
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(
this.serviceData,
@ -72,7 +72,7 @@ export class TaxDataOrchestrator extends BaseDataTransactionOrchestrator<TaxEnti
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.TAX);
await this.activeManager.execute();
@ -86,7 +86,7 @@ export class TaxDataOrchestrator extends BaseDataTransactionOrchestrator<TaxEnti
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.TAX);
await this.confirmManager.execute();
@ -100,7 +100,7 @@ export class TaxDataOrchestrator extends BaseDataTransactionOrchestrator<TaxEnti
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(
this.serviceData,

View File

@ -34,7 +34,7 @@ export class TaxDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -44,7 +44,7 @@ export class TaxDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -54,7 +54,7 @@ export class TaxDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -72,7 +72,7 @@ export class TaxDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -99,6 +99,10 @@ export function mappingRevertTransaction(data, type) {
season_period_name: data.season_period?.holiday_name ?? null,
season_period_type_id: data.season_period?.season_type?.id ?? null,
season_period_type_name: data.season_period?.season_type?.name ?? null,
payment_type_method_id: data.payment_type_method?.id,
payment_type_method_number: data.payment_type_method?.account_number,
payment_type_method_name: data.payment_type_method?.issuer_name,
payment_type_method_qr: data.payment_type_method?.qr_image,
});
data.items?.map((item) => {

View File

@ -45,7 +45,7 @@ export class TransactionDataOrchestrator {
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.TRANSACTION);
await this.deleteManager.execute();
@ -62,7 +62,7 @@ export class TransactionDataOrchestrator {
return this.batchDeleteManager.getResult();
}
async cancel(dataId): Promise<String> {
async cancel(dataId): Promise<string> {
this.cancelManager.setData(dataId, STATUS.CANCEL);
this.cancelManager.setService(this.serviceData, TABLE_NAME.TRANSACTION);
await this.cancelManager.execute();
@ -79,7 +79,7 @@ export class TransactionDataOrchestrator {
return this.batchCancelManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.TRANSACTION);
await this.confirmManager.execute();
@ -96,7 +96,7 @@ export class TransactionDataOrchestrator {
return this.batchConfirmManager.getResult();
}
async confirmData(dataId): Promise<String> {
async confirmData(dataId): Promise<string> {
this.confirmDataManager.setData(dataId, STATUS.ACTIVE);
this.confirmDataManager.setService(
this.serviceData,

View File

@ -34,7 +34,7 @@ export class TransactionDataController {
}
@Patch(':id/confirm-data')
async confirmData(@Param('id') dataId: string): Promise<String> {
async confirmData(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirmData(dataId);
}
@ -44,7 +44,7 @@ export class TransactionDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -54,7 +54,7 @@ export class TransactionDataController {
}
@Patch(':id/cancel')
async cancel(@Param('id') dataId: string): Promise<String> {
async cancel(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.cancel(dataId);
}
@ -72,7 +72,7 @@ export class TransactionDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -1,3 +1,3 @@
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;
}
async generateConfig(): Promise<void> {}
async generateConfig(): Promise<void> {
// TODO: Implement logic here
}
get validateRelations(): validateRelations[] {
return [];

View File

@ -49,7 +49,7 @@ export class VipCategoryDataOrchestrator extends BaseDataTransactionOrchestrator
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.VIP_CATEGORY);
await this.deleteManager.execute();
@ -66,7 +66,7 @@ export class VipCategoryDataOrchestrator extends BaseDataTransactionOrchestrator
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.VIP_CATEGORY);
await this.activeManager.execute();
@ -83,7 +83,7 @@ export class VipCategoryDataOrchestrator extends BaseDataTransactionOrchestrator
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.VIP_CATEGORY);
await this.confirmManager.execute();
@ -100,7 +100,7 @@ export class VipCategoryDataOrchestrator extends BaseDataTransactionOrchestrator
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(this.serviceData, TABLE_NAME.VIP_CATEGORY);
await this.inactiveManager.execute();

View File

@ -34,7 +34,7 @@ export class VipCategoryDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -44,7 +44,7 @@ export class VipCategoryDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -54,7 +54,7 @@ export class VipCategoryDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -72,7 +72,7 @@ export class VipCategoryDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

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

View File

@ -0,0 +1,40 @@
import { EventsHandler, IEventHandler } from '@nestjs/cqrs';
import { ChangeDocEvent } from 'src/modules/configuration/couch/domain/events/change-doc.event';
import { VipCodeDataService } from '../../../data/services/vip-code-data.service';
import { VipCodeModel } from '../../../data/models/vip-code.model';
import { CouchService } from 'src/modules/configuration/couch/data/services/couch.service';
@EventsHandler(ChangeDocEvent)
export class CreateVipCodeHandler implements IEventHandler<ChangeDocEvent> {
constructor(
private dataService: VipCodeDataService,
private couchService: CouchService,
) {}
async handle(event: ChangeDocEvent) {
const database = event.data.database;
const data = event.data.data;
if (database != 'vip_code') return;
const queryRunner = this.dataService
.getRepository()
.manager.connection.createQueryRunner();
// jika delete
if (data._deleted ?? false) {
} else {
const dataMapped = {
...data,
id: data._id ?? data.id,
vip_category_id: data.vip_category?._id ?? data.vip_category?.id,
};
try {
await this.dataService.create(queryRunner, VipCodeModel, dataMapped);
} catch (error) {
await this.couchService.createDoc(data, 'error_vip_code');
}
}
}
}

View File

@ -35,7 +35,7 @@ export class CreateVipCodeManager extends BaseCreateManager<VipCodeEntity> {
return [
{
topic: VipCodeCreatedEvent,
data: this.data,
relations: ['vip_category'],
},
];
}

View File

@ -21,7 +21,7 @@ export class VipCodeDataOrchestrator extends BaseDataOrchestrator<VipCodeEntity>
update(dataId: string, data: VipCodeEntity): Promise<VipCodeEntity> {
throw new Error('Method not implemented.');
}
delete(dataId: string): Promise<String> {
delete(dataId: string): Promise<string> {
throw new Error('Method not implemented.');
}
batchDelete(dataIds: string[]): Promise<BatchResult> {

View File

@ -19,7 +19,7 @@ export class VipCodeDataController {
}
@Post('generate-code')
async generateCOde(): Promise<String> {
async generateCOde(): Promise<string> {
return await this.orchestrator.generateCode();
}
@ -29,7 +29,7 @@ export class VipCodeDataController {
// }
// @Delete(':id')
// async delete(@Param('id') dataId: string): Promise<String> {
// async delete(@Param('id') dataId: string): Promise<string> {
// return await this.orchestrator.delete(dataId);
// }
}

View File

@ -13,6 +13,8 @@ import { CqrsModule } from '@nestjs/cqrs';
import { IndexVipCodeManager } from './domain/usecases/managers/index-vip-code.manager';
import { VipCodeModel } from './data/models/vip-code.model';
import { GenerateVipCodeManager } from './domain/usecases/managers/geneate-vip-code.manager';
import { CreateVipCodeHandler } from './domain/usecases/handlers/create-vip-code.handler';
import { CouchService } from 'src/modules/configuration/couch/data/services/couch.service';
@Module({
imports: [
@ -22,10 +24,13 @@ import { GenerateVipCodeManager } from './domain/usecases/managers/geneate-vip-c
],
controllers: [VipCodeDataController, VipCodeReadController],
providers: [
CreateVipCodeHandler,
IndexVipCodeManager,
CreateVipCodeManager,
GenerateVipCodeManager,
CouchService,
VipCodeDataService,
VipCodeReadService,

View File

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

View File

@ -58,7 +58,7 @@ export class TenantDataOrchestrator extends BaseDataTransactionOrchestrator<User
return this.updatePasswordManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.TENANT);
await this.deleteManager.execute();
@ -72,7 +72,7 @@ export class TenantDataOrchestrator extends BaseDataTransactionOrchestrator<User
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.TENANT);
await this.activeManager.execute();
@ -86,7 +86,7 @@ export class TenantDataOrchestrator extends BaseDataTransactionOrchestrator<User
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.TENANT);
await this.confirmManager.execute();
@ -100,7 +100,7 @@ export class TenantDataOrchestrator extends BaseDataTransactionOrchestrator<User
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(this.serviceData, TABLE_NAME.TENANT);
await this.inactiveManager.execute();

View File

@ -36,7 +36,7 @@ export class TenantDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -46,7 +46,7 @@ export class TenantDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -56,7 +56,7 @@ export class TenantDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -82,7 +82,7 @@ export class TenantDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -43,7 +43,7 @@ export class TenantItemDataController {
async active(
@Param('tenant_id') tenant_id: string,
@Param('id') dataId: string,
): Promise<String> {
): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -59,7 +59,7 @@ export class TenantItemDataController {
async confirm(
@Param('tenant_id') tenant_id: string,
@Param('id') dataId: string,
): Promise<String> {
): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -75,7 +75,7 @@ export class TenantItemDataController {
async inactive(
@Param('tenant_id') tenant_id: string,
@Param('id') dataId: string,
): Promise<String> {
): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -100,7 +100,7 @@ export class TenantItemDataController {
async delete(
@Param('tenant_id') tenant_id: string,
@Param('id') dataId: string,
): Promise<String> {
): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

@ -1,3 +1,3 @@
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;
}
async generateConfig(): Promise<void> {}
async generateConfig(): Promise<void> {
// TODO: Implement logic here
}
get uniqueColumns(): columnUniques[] {
return [{ column: 'name' }];

View File

@ -49,7 +49,7 @@ export class UserPrivilegeDataOrchestrator extends BaseDataTransactionOrchestrat
return this.updateManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.USER_PRIVILEGE);
await this.deleteManager.execute();
@ -66,7 +66,7 @@ export class UserPrivilegeDataOrchestrator extends BaseDataTransactionOrchestrat
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.USER_PRIVILEGE);
await this.activeManager.execute();
@ -83,7 +83,7 @@ export class UserPrivilegeDataOrchestrator extends BaseDataTransactionOrchestrat
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.USER_PRIVILEGE);
await this.confirmManager.execute();
@ -100,7 +100,7 @@ export class UserPrivilegeDataOrchestrator extends BaseDataTransactionOrchestrat
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(
this.serviceData,

View File

@ -36,7 +36,7 @@ export class UserPrivilegeDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -46,7 +46,7 @@ export class UserPrivilegeDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -56,7 +56,7 @@ export class UserPrivilegeDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -74,7 +74,7 @@ export class UserPrivilegeDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}

View File

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

View File

@ -58,7 +58,7 @@ export class UserDataOrchestrator extends BaseDataTransactionOrchestrator<UserEn
return this.updatePasswordManager.getResult();
}
async delete(dataId): Promise<String> {
async delete(dataId): Promise<string> {
this.deleteManager.setData(dataId);
this.deleteManager.setService(this.serviceData, TABLE_NAME.USER);
await this.deleteManager.execute();
@ -72,7 +72,7 @@ export class UserDataOrchestrator extends BaseDataTransactionOrchestrator<UserEn
return this.batchDeleteManager.getResult();
}
async active(dataId): Promise<String> {
async active(dataId): Promise<string> {
this.activeManager.setData(dataId, STATUS.ACTIVE);
this.activeManager.setService(this.serviceData, TABLE_NAME.USER);
await this.activeManager.execute();
@ -86,7 +86,7 @@ export class UserDataOrchestrator extends BaseDataTransactionOrchestrator<UserEn
return this.batchActiveManager.getResult();
}
async confirm(dataId): Promise<String> {
async confirm(dataId): Promise<string> {
this.confirmManager.setData(dataId, STATUS.ACTIVE);
this.confirmManager.setService(this.serviceData, TABLE_NAME.USER);
await this.confirmManager.execute();
@ -100,7 +100,7 @@ export class UserDataOrchestrator extends BaseDataTransactionOrchestrator<UserEn
return this.batchConfirmManager.getResult();
}
async inactive(dataId): Promise<String> {
async inactive(dataId): Promise<string> {
this.inactiveManager.setData(dataId, STATUS.INACTIVE);
this.inactiveManager.setService(this.serviceData, TABLE_NAME.USER);
await this.inactiveManager.execute();

View File

@ -36,7 +36,7 @@ export class UserDataController {
}
@Patch(':id/active')
async active(@Param('id') dataId: string): Promise<String> {
async active(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.active(dataId);
}
@ -46,7 +46,7 @@ export class UserDataController {
}
@Patch(':id/confirm')
async confirm(@Param('id') dataId: string): Promise<String> {
async confirm(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.confirm(dataId);
}
@ -56,7 +56,7 @@ export class UserDataController {
}
@Patch(':id/inactive')
async inactive(@Param('id') dataId: string): Promise<String> {
async inactive(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.inactive(dataId);
}
@ -82,7 +82,7 @@ export class UserDataController {
}
@Delete(':id')
async delete(@Param('id') dataId: string): Promise<String> {
async delete(@Param('id') dataId: string): Promise<string> {
return await this.orchestrator.delete(dataId);
}
}