Skip to content

ProcessApprovallService

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/services/configurations/process-approvall/process-approvall.service.ts (line 57)

Part of: Pams

ProcessApprovallService manages configuration requests for approval processes and two-way authentication. It provides methods for loading saved settings and submitting updates from configuration screens.

Methods

MethodSignatureReturns
saveProcessApprovallSettingssaveProcessApprovallSettings(company: Company)void
getApprovalProsseslistgetApprovalProsseslist()void
save2wayAuthenticationsSettingssave2wayAuthenticationsSettings(doubleFactor: undefined)void
get2wayAuthenticationsSettingsget2wayAuthenticationsSettings()void

Diagram

mermaid
graph LR
  ConfigurationScreen --> ProcessApprovallService
  ProcessApprovallService --> SaveApproval[saveProcessApprovallSettings]
  ProcessApprovallService --> GetApproval[getApprovalProsseslist]
  ProcessApprovallService --> SaveAuthentication[save2wayAuthenticationsSettings]
  ProcessApprovallService --> GetAuthentication[get2wayAuthenticationsSettings]
  ProcessApprovallService --> ConfigurationApi

Usage

ts
import { Component, OnInit } from '@angular/core';
import { ProcessApprovallService } from './process-approvall.service';

@Component({
  selector: 'app-process-approvall-settings',
  template: `<!-- configuration form -->`,
})
export class ProcessApprovallSettingsComponent implements OnInit {
  approvalProcesses: unknown;
  authenticationSettings: unknown;

  constructor(
    private readonly processApprovallService: ProcessApprovallService,
  ) {}

  ngOnInit(): void {
    this.processApprovallService.getApprovalProsseslist().subscribe((response) => {
      this.approvalProcesses = response;
    });

    this.processApprovallService
      .get2wayAuthenticationsSettings()
      .subscribe((response) => {
        this.authenticationSettings = response;
      });
  }

  saveApprovalSettings(settings: unknown): void {
    this.processApprovallService
      .saveProcessApprovallSettings(settings)
      .subscribe();
  }

  saveAuthenticationSettings(settings: unknown): void {
    this.processApprovallService
      .save2wayAuthenticationsSettings(settings)
      .subscribe();
  }
}

AI Coding Instructions

  • Keep configuration API calls in ProcessApprovallService; components should handle form state and user interaction.
  • Load approval-process and two-way authentication settings before applying form defaults.
  • Preserve the existing getApprovalProsseslist method name when calling the service, including its current spelling.
  • Handle request errors and completion states at the calling screen or through the project’s shared HTTP error-handling pattern.
  • Match the request payload shape expected by the backend before calling either save method.

Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (1)

  • PamsServicesModulePams/Web/Pams.Web/Client/app/services/pams-services.module.ts:1

Was this page helpful?

Download as PDF