Skip to content

Commit 85eb5ca

Browse files
authored
Merge pull request #330 from digital-gov-mg/develop
wording : acte de naissance readded toamasina conditions regsitry differences fixes
2 parents 5d347a5 + ca99380 commit 85eb5ca

File tree

4 files changed

+144
-83
lines changed

4 files changed

+144
-83
lines changed

public/helpers.js

Lines changed: 65 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,18 @@ function eventStatement() {
255255
? 'fokontany ' + this.birthChildFokontanyCustomAddress + ','
256256
: '',
257257

258-
'kaominina',
258+
this.birthChildFokontanyCustomAddress
259+
.toLowerCase()
260+
.includes('toamasina')
261+
? ''
262+
: 'kaominina' +
263+
' ' +
259264
(definitionOffice(
260265
replaceByUppercase(placeOfBirthDistrict)
261266
) || '-') +
262267
',' +
263-
'district ' +
268+
'district' +
269+
' ' +
264270
definitionDistrict(placeOfBirthState) || '-'
265271
]
266272
: [
@@ -337,18 +343,26 @@ function eventStatementSimplified(
337343
countryPlaceofbirth == 'Madagascar' || placeOfBirthFacility
338344
? [
339345
'no teraka tao amin’ny',
340-
placeOfBirthFacility
341-
? replaceAbbreviations(placeOfBirthFacility) + ','
342-
: '',
343-
otherPlaceOfBirthAddress ? otherPlaceOfBirthAddress + ',' : '',
344-
birthChildFokontanyCustomAddress
345-
? 'fokontany ' + birthChildFokontanyCustomAddress + ','
346-
: '',
347-
'kaominina',
348-
(definitionOffice(replaceByUppercase(placeOfBirthDistrict)) ||
349-
'-') + ',',
350-
'district',
351-
definitionDistrict(placeOfBirthState) || '-'
346+
[
347+
placeOfBirthFacility
348+
? replaceAbbreviations(placeOfBirthFacility)
349+
: '',
350+
otherPlaceOfBirthAddress ? otherPlaceOfBirthAddress : '',
351+
birthChildFokontanyCustomAddress
352+
? 'fokontany ' + birthChildFokontanyCustomAddress
353+
: '',
354+
355+
birthChildFokontanyCustomAddress?.toLowerCase().includes('toamasina') ||
356+
placeOfBirthFacility?.toLowerCase().includes('toamasina')
357+
? ''
358+
: 'kaominina ' +
359+
(definitionOffice(replaceByUppercase(placeOfBirthDistrict)) || '-') +
360+
', ' +
361+
'district ' +
362+
definitionDistrict(placeOfBirthState) || '-'
363+
]
364+
.filter(Boolean)
365+
.join(', ')
352366
]
353367
: [
354368
'no teraka tao',
@@ -410,7 +424,10 @@ function fatherDetails(fatherPrimaryDistrict) {
410424
(this.birthFatherFokontanyCustomAddress ||
411425
this.birthMotherFokontanyCustomAddress ||
412426
'-') + ',',
413-
'kaominina' +
427+
fatherPrimaryDistrict?.toLowerCase().includes('cu toamasina')
428+
? // && (this.birthFatherFokontanyCustomAddress?.toLowerCase().includes('toamasina') || this.birthMotherFokontanyCustomAddress?.toLowerCase().includes('toamasina'))
429+
''
430+
: 'kaominina' +
414431
' ' +
415432
(definitionOffice(
416433
replaceByUppercase(fatherPrimaryDistrict)
@@ -524,10 +541,12 @@ function fatherDetailsSimplified(fatherDetailsContext) {
524541
(birthFatherFokontanyCustomAddress ||
525542
birthMotherFokontanyCustomAddress ||
526543
'-') + ',',
527-
'kaominina',
528-
(definitionOffice(
529-
replaceByUppercase(fatherPrimaryDistrict)
530-
) || '- ') + ','
544+
fatherPrimaryDistrict?.toLowerCase().includes('cu toamasina')
545+
? ''
546+
: 'kaominina ' +
547+
(definitionOffice(
548+
replaceByUppercase(fatherPrimaryDistrict)
549+
) || '- ') + ','
531550
]
532551
: [
533552
([
@@ -610,9 +629,11 @@ function motherDetailsSimplified(motherDetailsContext) {
610629
? [
611630
'amin’ny fokontany',
612631
(birthMotherFokontanyCustomAddress || '-') + ',',
613-
'kaominina',
614-
(definitionOffice(replaceByUppercase(motherPrimaryDistrict)) ||
615-
'-') + ','
632+
motherPrimaryDistrict?.toLowerCase().includes('cu toamasina')
633+
? ''
634+
: 'kaominina ' +
635+
(definitionOffice(replaceByUppercase(motherPrimaryDistrict)) ||
636+
'-') + ','
616637
]
617638
: [
618639
([
@@ -662,12 +683,16 @@ function motherDetails(motherPrimaryDistrict) {
662683
? [
663684
'amin’ny fokontany',
664685
(this.birthMotherFokontanyCustomAddress || '-') + ',',
665-
'kaominina' +
666-
' ' +
667-
(definitionOffice(
668-
replaceByUppercase(motherPrimaryDistrict)
669-
) || '-') +
670-
','
686+
687+
motherPrimaryDistrict?.toLowerCase().includes('cu toamasina')
688+
? // && this.birthMotherFokontanyCustomAddress.toLowerCase().includes('toamasina')
689+
''
690+
: 'kaominina' +
691+
' ' +
692+
(definitionOffice(
693+
replaceByUppercase(motherPrimaryDistrict)
694+
) || '-') +
695+
','
671696
]
672697
: [
673698
([
@@ -785,6 +810,7 @@ function registrationStatementSimplified(registrationStatementContext) {
785810
birthInformantBirthPlace,
786811
countryPrimaryInformant,
787812
birthInformantFokontanyCustomAddress,
813+
birthFatherFokontanyCustomAddress,
788814
informantPrimaryDistrict,
789815
informantOccupation,
790816
registrarName,
@@ -813,7 +839,7 @@ function registrationStatementSimplified(registrationStatementContext) {
813839
relationMap[
814840
(_a = informantType) === null || _a === void 0 ? void 0 : _a.toLowerCase()
815841
]
816-
const isNotInformantLegalFather = !isInformantLegalFather(
842+
const isInformantNotLegalFather = informantType === 'FATHER' && !isInformantLegalFather(
817843
informantType,
818844
motherMaritalStatus,
819845
birthFatherFatherHasFormallyRecognisedChild
@@ -838,8 +864,7 @@ function registrationStatementSimplified(registrationStatementContext) {
838864
informantFamilyName,
839865
informantFirstName
840866
]) + ',',
841-
(informantType === 'FATHER' &&
842-
isNotInformantLegalFather ? ''
867+
(isInformantNotLegalFather ? ''
843868
: (informantTypeMapped ? informantTypeMapped + ',' : ''))
844869
],
845870
isInformantMotherOrFather(
@@ -866,16 +891,19 @@ function registrationStatementSimplified(registrationStatementContext) {
866891
countryPrimaryInformant == 'Madagascar'
867892
? [
868893
"amin’ny",
869-
birthInformantFokontanyCustomAddress
894+
((isInformantNotLegalFather ? birthFatherFokontanyCustomAddress : '') || birthInformantFokontanyCustomAddress)
870895
? 'fokontany '.concat(
871-
birthInformantFokontanyCustomAddress,
896+
birthInformantFokontanyCustomAddress || birthFatherFokontanyCustomAddress,
872897
','
873898
)
874899
: '',
875-
'kaominina',
876-
(definitionOffice(
877-
replaceByUppercase(informantPrimaryDistrict)
878-
) || '-') + ','
900+
901+
informantPrimaryDistrict?.toLowerCase().includes('cu toamasina')
902+
? ''
903+
: 'kaominina ' +
904+
(definitionOffice(
905+
replaceByUppercase(informantPrimaryDistrict)
906+
) || '-') + ','
879907
]
880908
: [
881909
([

public/main.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,14 @@ window.openPrintModal = async function openPrintModal(id) {
10651065
(a) => a.type === 'PRIMARY_ADDRESS'
10661066
)
10671067

1068+
const birthFatherFokontanyCustomAddress = (
1069+
event?.questionnaire?.find(
1070+
(q) =>
1071+
q.fieldId ===
1072+
'birth.father.father-view-group.fokontanyCustomAddress'
1073+
) || { value: '' }
1074+
).value
1075+
10681076
const fatherDetailsContext = {
10691077
motherMaritalStatus: event.mother.maritalStatus,
10701078
fatherReasonNotApplying: event.father.reasonNotApplying,
@@ -1089,9 +1097,7 @@ window.openPrintModal = async function openPrintModal(id) {
10891097
q.fieldId ===
10901098
'birth.father.father-view-group.customizedExactDateOfBirthUnknown'
10911099
) || { value: false }
1092-
).value == 'true'
1093-
? true
1094-
: false,
1100+
).value == 'true',
10951101
birthFatherYearOfBirth: (
10961102
event?.questionnaire?.find(
10971103
(q) => q.fieldId === 'birth.father.father-view-group.yearOfBirth'
@@ -1117,13 +1123,7 @@ window.openPrintModal = async function openPrintModal(id) {
11171123
countryPrimaryFather: fatherPrimaryAddress?.country
11181124
? countryData[fatherPrimaryAddress?.country][defaultLang]
11191125
: '',
1120-
birthFatherFokontanyCustomAddress: (
1121-
event?.questionnaire?.find(
1122-
(q) =>
1123-
q.fieldId ===
1124-
'birth.mother.mother-view-group.fokontanyCustomAddress'
1125-
) || { value: '' }
1126-
).value,
1126+
birthFatherFokontanyCustomAddress,
11271127
birthMotherFokontanyCustomAddress: (
11281128
event?.questionnaire?.find(
11291129
(q) =>
@@ -1173,9 +1173,7 @@ window.openPrintModal = async function openPrintModal(id) {
11731173
q.fieldId ===
11741174
'birth.mother.mother-view-group.customizedExactDateOfBirthUnknown'
11751175
) || { value: false }
1176-
).value == 'true'
1177-
? true
1178-
: false,
1176+
).value == 'true',
11791177
birthMotherYearOfBirth: (
11801178
event?.questionnaire?.find(
11811179
(q) => q.fieldId === 'birth.mother.mother-view-group.yearOfBirth'
@@ -1262,7 +1260,13 @@ window.openPrintModal = async function openPrintModal(id) {
12621260
.join(' ')
12631261
.trim(),
12641262
birthInformantCustomizedExactDateOfBirthUnknown:
1265-
event.informant.exactDateOfBirthUnknown,
1263+
(
1264+
event?.questionnaire?.find(
1265+
(q) =>
1266+
q.fieldId ===
1267+
'birth.informant.informant-view-group.customizedExactDateOfBirthUnknown'
1268+
) || { value: false }
1269+
).value == 'true',
12661270
birthInformantYearOfBirth: (
12671271
event?.questionnaire?.find(
12681272
(q) =>
@@ -1283,6 +1287,7 @@ window.openPrintModal = async function openPrintModal(id) {
12831287
?.country
12841288
][defaultLang]
12851289
: '',
1290+
birthFatherFokontanyCustomAddress,
12861291
birthInformantFokontanyCustomAddress: (
12871292
event?.questionnaire?.find(
12881293
(q) =>

src/form/common/certificate/handlebars/helpers.ts

Lines changed: 59 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -223,22 +223,32 @@ export function eventStatement(): Handlebars.HelperDelegate {
223223
...(this.countryPlaceofbirth == 'Madagascar' || this.placeOfBirthFacility
224224
? [
225225
'no teraka tao amin’ny',
226-
this.placeOfBirthFacility
227-
? replaceAbbreviations(this.placeOfBirthFacility) + ','
228-
: '',
229-
this.birthChildOtherPlaceOfBirthAddress
230-
? this.birthChildOtherPlaceOfBirthAddress + ','
231-
: '',
232-
this.birthChildFokontanyCustomAddress
233-
? 'fokontany ' + this.birthChildFokontanyCustomAddress + ','
234-
: '',
235-
236-
'kaominina',
237-
(definitionOffice(replaceByUppercase(placeOfBirthDistrict)) ||
238-
'-') +
239-
', ' +
240-
'district ' +
241-
(definitionDistrict(placeOfBirthState) || '-')
226+
[
227+
this.placeOfBirthFacility
228+
? replaceAbbreviations(this.placeOfBirthFacility)
229+
: '',
230+
this.birthChildOtherPlaceOfBirthAddress
231+
? this.birthChildOtherPlaceOfBirthAddress
232+
: '',
233+
this.birthChildFokontanyCustomAddress
234+
? 'fokontany ' + this.birthChildFokontanyCustomAddress
235+
: '',
236+
237+
this.birthChildFokontanyCustomAddress
238+
?.toLowerCase()
239+
.includes('toamasina') ||
240+
this.placeOfBirthFacility?.toLowerCase().includes('toamasina')
241+
? ''
242+
: 'kaominina ' +
243+
(definitionOffice(
244+
replaceByUppercase(placeOfBirthDistrict)
245+
) || '-') +
246+
', ' +
247+
'district ' +
248+
definitionDistrict(placeOfBirthState) || '-'
249+
]
250+
.filter(Boolean)
251+
.join(', ')
242252
]
243253
: [
244254
'no teraka tao',
@@ -307,10 +317,13 @@ function fatherDetails(
307317
(this.birthFatherFokontanyCustomAddress ||
308318
this.birthMotherFokontanyCustomAddress ||
309319
'-') + ',',
310-
'kaominina ' +
311-
(definitionOffice(replaceByUppercase(fatherPrimaryDistrict)) ||
312-
'- ') +
313-
','
320+
fatherPrimaryDistrict?.toLowerCase().includes('cu toamasina')
321+
? ''
322+
: 'kaominina ' +
323+
(definitionOffice(
324+
replaceByUppercase(fatherPrimaryDistrict)
325+
) || '- ') +
326+
','
314327
]
315328
: [
316329
([
@@ -360,10 +373,12 @@ function motherDetails(
360373
'amin’ny fokontany',
361374
(this.birthMotherFokontanyCustomAddress || '-') + ',',
362375

363-
'kaominina ' +
364-
(definitionOffice(replaceByUppercase(motherPrimaryDistrict)) ||
365-
'-') +
366-
','
376+
motherPrimaryDistrict?.toLowerCase().includes('cu toamasina')
377+
? ''
378+
: 'kaominina ' +
379+
(definitionOffice(replaceByUppercase(motherPrimaryDistrict)) ||
380+
'-') +
381+
','
367382
]
368383
: [
369384
([
@@ -449,6 +464,10 @@ export function registrationStatement(): Handlebars.HelperDelegate {
449464
)
450465
const informantTypeMapped =
451466
relationMap[this.informantType?.toLowerCase() as keyof typeof relationMap]
467+
468+
const isInformantNotLegalFather =
469+
this.informantType === 'FATHER' && !isInformantLegalFather(this)
470+
452471
return joinValuesWith([
453472
'---Nosoratana androany',
454473
customizeDateInCertificateContent(registrarDateUTC.split('T')[0]) + ',',
@@ -461,7 +480,7 @@ export function registrationStatement(): Handlebars.HelperDelegate {
461480
this.informantFamilyName,
462481
this.informantFirstName
463482
]) + ',',
464-
this.informantType === 'FATHER' && !isInformantLegalFather(this)
483+
isInformantNotLegalFather
465484
? ''
466485
: informantTypeMapped
467486
? informantTypeMapped + ','
@@ -483,15 +502,24 @@ export function registrationStatement(): Handlebars.HelperDelegate {
483502
...(this.countryPrimaryInformant == 'Madagascar'
484503
? [
485504
`amin’ny`,
486-
this.birthInformantFokontanyCustomAddress
505+
(isInformantNotLegalFather
506+
? this.birthFatherFokontanyCustomAddress
507+
: '') || this.birthInformantFokontanyCustomAddress
487508
? `fokontany ${
488-
this.birthInformantFokontanyCustomAddress || '-'
509+
this.birthInformantFokontanyCustomAddress ||
510+
this.birthFatherFokontanyCustomAddress
489511
},`
490512
: '',
491-
'kaominina',
492-
(definitionOffice(
493-
replaceByUppercase(informantPrimaryDistrict)
494-
) || '-') + ','
513+
514+
informantPrimaryDistrict
515+
?.toLowerCase()
516+
.includes('cu toamasina')
517+
? ''
518+
: 'kaominina ' +
519+
(definitionOffice(
520+
replaceByUppercase(informantPrimaryDistrict)
521+
) || '-') +
522+
','
495523
]
496524
: [
497525
([

src/translations/client.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ form.field.label.deliveryInstitution,,Type or select institution,Tapez ou sélec
11751175
form.field.label.deny,,No,Non,Tsia
11761176
form.field.label.district,Label for District,Commune,Commune,Firaisana
11771177
form.field.label.docTypeAdoption,,Adoption letter,Lettre de reconnaissance,Taratasy fanjanahana
1178-
form.field.label.docTypeBirthCert,,Birth certificate,Certificat de la naissance,Kopia fahaterahana
1178+
form.field.label.docTypeBirthCert,,Birth certificate,Acte de naissance,Kopia fahaterahana
11791179
form.field.label.docTypeChildAgeProof,,Proof of child's age,Preuve de l'âge de l'enfant,Porofo manamarina ny taonan'ilay zaza
11801180
form.field.label.docTypeChildBirthProof,,Notification of birth (Front),Notification de la naissance (Recto),Filazana fahaterahana
11811181
form.field.label.docTypeChildBirthVersoProof,,Notification of birth (Back),Notification de la naissance (Verso),Filazana fahaterahana (Ambadika)

0 commit comments

Comments
 (0)