-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #761 from Klantinteractie-Servicesysteem/PC143-Kla…
…ntbeeld-kunnen-openen-van-niet-natuurlijke-personen-(zonder-vestigingsnummer) Pc143 klantbeeld kunnen openen van niet natuurlijke personen (zonder vestigingsnummer)
- Loading branch information
Showing
20 changed files
with
492 additions
and
134 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
Kiss.Bff/Intern/Klanten/GetNietNatuurlijkPersoonIdentifier.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Net.Mail; | ||
using System.Security.Claims; | ||
using System.Text; | ||
using Ganss.Xss; | ||
using IdentityModel; | ||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Kiss.Bff.Feedback | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class GetNietNatuurlijkPersoonIdentifier : ControllerBase | ||
{ | ||
|
||
private readonly string _identifier; | ||
|
||
|
||
public GetNietNatuurlijkPersoonIdentifier(IConfiguration configuration) | ||
{ | ||
_identifier = configuration != null && !string.IsNullOrWhiteSpace(configuration["NIETNATUURLIJKPERSOONIDENTIFIER"]) | ||
? configuration["NIETNATUURLIJKPERSOONIDENTIFIER"] | ||
: "rsin"; | ||
} | ||
|
||
//Afhanekelijk van de gebruikte bron (openklant of e-Suite) | ||
//moet men in kunnen stellen welk gegeven gebruikt wordt om | ||
//Kvk gegevens aan klanten te koppelen | ||
//standaard wordt daar vestigingsnummer voor gebruikt, | ||
//maar voor niet natuurlijke personen moet men rsin of kvknummer kunnen gebruiken | ||
//openklant accepteert geen kvknummer, de e-Suite kent geen rsin | ||
[HttpGet] | ||
[AllowAnonymous] | ||
public IActionResult Get() | ||
{ | ||
return Ok(new NietNatuurlijkPersoonIdentifierModel(_identifier)); | ||
} | ||
|
||
|
||
} | ||
|
||
public record NietNatuurlijkPersoonIdentifierModel(string NietNatuurlijkPersoonIdentifier); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
import type { Klant } from "../../types"; | ||
import { useKlantByVestigingsnummer } from "../../service"; | ||
import { useKlantByIdentifier } from "../../service"; | ||
import { combineEnrichers } from "@/services"; | ||
import { useBedrijfByVestigingsnummer } from "../service/UseGetOndernememing"; | ||
import type { Bedrijf } from "../types"; | ||
import { useBedrijfByIdentifier } from "../service/use-bedrijf-by-identifier"; | ||
import type { Bedrijf, BedrijfIdentifier } from "../types"; | ||
|
||
const isKlant = (klantOfBedrijf: Klant | Bedrijf): klantOfBedrijf is Klant => { | ||
return klantOfBedrijf._typeOfKlant === "klant"; | ||
}; | ||
|
||
function getSharedIdentifier( | ||
klantofbedrijf: Klant | Bedrijf, | ||
): BedrijfIdentifier | undefined { | ||
//als er een vestigingsnummer is dan is dat mooi | ||
//zowel kvk als de klantregisters kennen dit | ||
if (klantofbedrijf.vestigingsnummer) { | ||
return { vestigingsnummer: klantofbedrijf.vestigingsnummer }; | ||
} | ||
|
||
if (klantofbedrijf.nietNatuurlijkPersoonIdentifier) { | ||
return { | ||
nietNatuurlijkPersoonIdentifier: klantofbedrijf.nietNatuurlijkPersoonIdentifier, | ||
}; | ||
} | ||
} | ||
|
||
export const useEnrichedBedrijf = combineEnrichers( | ||
useKlantByVestigingsnummer, | ||
useBedrijfByVestigingsnummer, | ||
(either) => either.vestigingsnummer, | ||
isKlant | ||
useKlantByIdentifier, | ||
useBedrijfByIdentifier, | ||
getSharedIdentifier, //een functie die de property waarmee je het bijbehorende object in de andere bron gaat zoeken | ||
isKlant, | ||
); |
Empty file.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.