23 lines
815 B
TypeScript
23 lines
815 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { GenericService, QueryParam } from '@iqser/common-ui';
|
|
import { IRules } from '@red/domain';
|
|
import { Observable } from 'rxjs';
|
|
import { List } from '@common-ui/utils';
|
|
|
|
@Injectable({ providedIn: 'root' })
|
|
export class RulesService extends GenericService<IRules> {
|
|
protected readonly _defaultModelPath = 'rules';
|
|
|
|
download(dossierTemplateId: string, ruleFileType: IRules['ruleFileType'] = 'ENTITY') {
|
|
return this._getOne([dossierTemplateId, ruleFileType]);
|
|
}
|
|
|
|
uploadRules(body: IRules) {
|
|
return this._post<unknown>({ ...body, ruleFileType: body.ruleFileType ?? 'ENTITY' });
|
|
}
|
|
|
|
getFor<R = IRules>(entityId: string, queryParams?: List<QueryParam>): Observable<R> {
|
|
return super.getFor(entityId, queryParams);
|
|
}
|
|
}
|