@@ -7,20 +7,59 @@ import {
77import { addRenunciantPersonAddress } from "./addRenunciantPersonAddress" ;
88import { addRenunciantPersonDetails } from "./addRenunciantPersonDetails" ;
99import { addRenunciantPersonContactDetails } from "./addRenunciantPersonContactDetails" ;
10+ import { toDateString } from "~/services/validation/dateObject" ;
1011
1112const TITLE = "II. Ausschlagende Person" ;
1213
13- const addAcknowledgmentDetails = ( doc : typeof PDFDocument ) => {
14+ const addAcknowledgmentDetails = (
15+ doc : typeof PDFDocument ,
16+ { dateOfReceipt, weitereAngaben } : NachlassErbausschlagungAnfrageUserData ,
17+ ) => {
1418 doc
1519 . moveDown ( )
1620 . font ( FONTS_BUNDESSANS_REGULAR )
1721 . text ( "Kenntnisnahme der Erbenstellung am: " , { continued : true } )
1822 . font ( FONTS_BUNDESSANS_BOLD )
19- . text ( " " )
20- . font ( FONTS_BUNDESSANS_REGULAR )
21- . text ( "Anmerkung zur Kenntnisnahme: " , { continued : true } )
22- . font ( FONTS_BUNDESSANS_BOLD )
23- . text ( " " ) ;
23+ . text ( dateOfReceipt ? toDateString ( dateOfReceipt ) : " " ) ;
24+
25+ if ( weitereAngaben && weitereAngaben ?. length > 0 ) {
26+ doc
27+ . font ( FONTS_BUNDESSANS_REGULAR )
28+ . text ( "Anmerkung zur Kenntnisnahme: " , { continued : true } )
29+ . font ( FONTS_BUNDESSANS_BOLD )
30+ . text ( weitereAngaben ) ;
31+ }
32+ } ;
33+
34+ const testatorText = (
35+ testament : NachlassErbausschlagungAnfrageUserData [ "ausschlagendePersonBeziehungZumErblasser" ] ,
36+ ) : string => {
37+ const responses : Record < string , string > = {
38+ "mother-father" : "Mutter/Vater" ,
39+ "daughter-son" : "Tochter/Sohn" ,
40+ "grandmother-grandfather" : "Großmutter/Großvater" ,
41+ "granddaughter-grandson" : "Enkelin/Enkel" ,
42+ "great-grandmother-great-grandfather" : "Urgroßmutter/Urgroßvater" ,
43+ "sister-brother" : "Schwester/Bruder" ,
44+ "half-sister-half-brother" : "Halbschwester/Halbbruder" ,
45+ "niece-nephew" : "Nichte/Neffe" ,
46+ "aunt-uncle" : "Tante/Onkel" ,
47+ cousin : "Cousin/Cousine" ,
48+ "great-aunt-great-uncle" : "Großtante/Großonkel" ,
49+ "wife-husband" : "Ehefrau/Ehemann" ,
50+ "life-partner" : "Lebenspartner*in" ,
51+ "mother-in-law-father-in-law" : "Schwiegermutter/Schwiegervater" ,
52+ "sister-in-law-brother-in-law" : "Schwägerin/Schwager" ,
53+ "daughter-in-law-son-in-law" : "Schwiegertochter/Schwiegersohn" ,
54+ "stepmother-stepfather" : "Stiefmutter/Stiefvater" ,
55+ "stepdaughter-stepson" : "Stieftochter/Stiefsohn" ,
56+ "stepsister-stepbrother" : "Stiefschwester/Stiefbruder" ,
57+ "foster-child" : "Pflegekind" ,
58+ "adoptive-mother-adoptive-father" : "Pflegemutter/Pflegevater" ,
59+ "godmother-godfather" : "Patentante/Patenonkel" ,
60+ other : "Sonstiges" ,
61+ } ;
62+ return responses [ testament ?? "" ] ?? "" ;
2463} ;
2564
2665export const createRenunciantPerson = (
@@ -53,9 +92,11 @@ export const createRenunciantPerson = (
5392 . font ( FONTS_BUNDESSANS_REGULAR )
5493 . text ( "Familienverhältnis zum Erblasser: " , { continued : true } )
5594 . font ( FONTS_BUNDESSANS_BOLD )
56- . text ( userData . ausschlagendePersonBeziehungZumErblasser ?? "" ) ;
95+ . text (
96+ `Erblasser ist mein(e) ${ testatorText ( userData . ausschlagendePersonBeziehungZumErblasser ) } ` ,
97+ ) ;
5798
58- addAcknowledgmentDetails ( doc ) ;
99+ addAcknowledgmentDetails ( doc , userData ) ;
59100
60101 addRenunciantPersonAddress ( doc , userData ) ;
61102 } ) ,
0 commit comments