# ProcessApprovallService

**Kind:** Class

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

**Part of:** [Pams](subsystem-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

| Method | Signature | Returns |
|---|---|---|
| `saveProcessApprovallSettings` | `saveProcessApprovallSettings(company: Company)` | `void` |
| `getApprovalProsseslist` | `getApprovalProsseslist()` | `void` |
| `save2wayAuthenticationsSettings` | `save2wayAuthenticationsSettings(doubleFactor: undefined)` | `void` |
| `get2wayAuthenticationsSettings` | `get2wayAuthenticationsSettings()` | `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)

- `PamsServicesModule` — `Pams/Web/Pams.Web/Client/app/services/pams-services.module.ts`:1
