pos-be/src/modules/transaction/sales-price-formula/data/services/sales-price-formula-data.se...

27 lines
919 B
TypeScript

import { Injectable } from '@nestjs/common';
import { BaseDataService } from 'src/core/modules/data/service/base-data.service';
import { SalesPriceFormulaEntity } from '../../domain/entities/sales-price-formula.entity';
import { InjectRepository } from '@nestjs/typeorm';
import { SalesPriceFormulaModel } from '../models/sales-price-formula.model';
import { CONNECTION_NAME } from 'src/core/strings/constants/base.constants';
import { Repository } from 'typeorm';
import { FormulaType } from '../../constants';
@Injectable()
export class SalesPriceFormulaDataService extends BaseDataService<SalesPriceFormulaEntity> {
constructor(
@InjectRepository(SalesPriceFormulaModel, CONNECTION_NAME.DEFAULT)
private repo: Repository<SalesPriceFormulaModel>,
) {
super(repo);
}
profitShareFormula() {
return this.repo.find({
where: {
type: FormulaType.PROFIT_SHARE,
},
});
}
}