import { Injectable } from '@nestjs/common'; import { BaseDetailManager } from 'src/core/modules/domain/usecase/managers/base-detail.manager'; import { ItemEntity } from '../../entities/item.entity'; import { RelationParam } from 'src/core/modules/domain/entities/base-filter.entity'; @Injectable() export class DetailItemManager extends BaseDetailManager { async prepareData(): Promise { return; } async beforeProcess(): Promise { return; } async afterProcess(): Promise { return; } get relations(): RelationParam { return { // relation only join (for query purpose) joinRelations: [], // relation join and select (relasi yang ingin ditampilkan), selectRelations: ['item_category', 'bundling_items', 'tenant'], // relation yang hanya ingin dihitung (akan return number) countRelations: [], }; } get selects(): string[] { return [ `${this.tableName}.id`, `${this.tableName}.image_url`, `${this.tableName}.created_at`, `${this.tableName}.status`, `${this.tableName}.item_type`, `${this.tableName}.name`, `${this.tableName}.limit_type`, `${this.tableName}.limit_value`, `${this.tableName}.hpp`, `${this.tableName}.sales_margin`, `${this.tableName}.share_profit`, `${this.tableName}.total_price`, `${this.tableName}.base_price`, `${this.tableName}.use_queue`, `${this.tableName}.show_to_booking`, `${this.tableName}.breakdown_bundling`, `${this.tableName}.play_estimation`, `item_category.id`, `item_category.name`, 'bundling_items.id', 'bundling_items.name', 'bundling_items.hpp', 'bundling_items.base_price', 'tenant.id', 'tenant.name', ]; } get setFindProperties(): any { return { id: this.dataId, }; } }