Skip to content

Commit b190ef0

Browse files
committed
deploy: fe42cf2
1 parent 5146a78 commit b190ef0

File tree

6 files changed

+131
-100
lines changed

6 files changed

+131
-100
lines changed

classes/IdentitiesCrudService.html

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ <h3 id="methods">
514514

515515
<tr>
516516
<td class="col-md-4">
517-
<div class="io-line">Defined in <a href="" data-line="140"
518-
class="link-to-prism">src/management/identities/identities-crud.service.ts:140</a></div>
517+
<div class="io-line">Defined in <a href="" data-line="171"
518+
class="link-to-prism">src/management/identities/identities-crud.service.ts:171</a></div>
519519
</td>
520520
</tr>
521521

@@ -706,7 +706,7 @@ <h3 id="methods">
706706
</tr>
707707
<tr>
708708
<td class="col-md-4">
709-
<div class="io-line">Defined in <code><a href="../injectables/AbstractServiceSchema.html#source" target="_self" >AbstractServiceSchema:131</a></code>
709+
<div class="io-line">Defined in <code><a href="../injectables/AbstractServiceSchema.html#source" target="_self" >AbstractServiceSchema:162</a></code>
710710
</div>
711711
</td>
712712
</tr>
@@ -802,7 +802,7 @@ <h3 id="methods">
802802
</tr>
803803
<tr>
804804
<td class="col-md-4">
805-
<div class="io-line">Defined in <code><a href="../injectables/AbstractServiceSchema.html#source" target="_self" >AbstractServiceSchema:35</a></code>
805+
<div class="io-line">Defined in <code><a href="../injectables/AbstractServiceSchema.html#source" target="_self" >AbstractServiceSchema:66</a></code>
806806
</div>
807807
</td>
808808
</tr>
@@ -903,8 +903,8 @@ <h3 id="methods">
903903

904904
<tr>
905905
<td class="col-md-4">
906-
<div class="io-line">Defined in <a href="" data-line="100"
907-
class="link-to-prism">src/management/identities/identities-crud.service.ts:100</a></div>
906+
<div class="io-line">Defined in <a href="" data-line="131"
907+
class="link-to-prism">src/management/identities/identities-crud.service.ts:131</a></div>
908908
</td>
909909
</tr>
910910

@@ -1004,8 +1004,8 @@ <h3 id="methods">
10041004

10051005
<tr>
10061006
<td class="col-md-4">
1007-
<div class="io-line">Defined in <a href="" data-line="108"
1008-
class="link-to-prism">src/management/identities/identities-crud.service.ts:108</a></div>
1007+
<div class="io-line">Defined in <a href="" data-line="139"
1008+
class="link-to-prism">src/management/identities/identities-crud.service.ts:139</a></div>
10091009
</td>
10101010
</tr>
10111011

@@ -2707,23 +2707,54 @@ <h3 id="methods">
27072707
options?: SaveOptions,
27082708
): Promise&lt;Document&lt;T, any, T&gt;&gt; {
27092709
data &#x3D; this.transformNullsToString(data);
2710+
2711+
const logPrefix &#x3D; &#x60;Validation [${data.inetOrgPerson.cn}]:&#x60;;
2712+
try {
2713+
this.logger.log(&#x60;${logPrefix} Starting additionalFields transformation.&#x60;);
2714+
if (data.hasOwnProperty(&#x27;metadata&#x27;)) {
2715+
//suppresion de la clé metadata
2716+
delete (data.metadata);
2717+
}
2718+
2719+
await this._validation.transform(data.additionalFields);
2720+
2721+
let validationsAdFields &#x3D; await this._validation.validate(data.additionalFields);
2722+
2723+
this.logger.log(&#x60;${logPrefix} AdditionalFields validation successful.&#x60;);
2724+
this.logger.log(&#x60;Validations Additional fields: ${validationsAdFields}&#x60;);
2725+
} catch (error) {
2726+
console.log(error);
2727+
if (error instanceof ValidationConfigException) {
2728+
this.logger.error(&#x60;${logPrefix} Validation config error. ${JSON.stringify(error.getValidations())}&#x60;);
2729+
throw new ValidationConfigException(error.getPayload());
2730+
}
2731+
if (error instanceof ValidationSchemaException) {
2732+
this.logger.warn(&#x60;${logPrefix} Validation schema error. ${JSON.stringify(error.getValidations())}&#x60;);
2733+
data.additionalFields.validations &#x3D; error.getValidations();
2734+
throw new ValidationSchemaException(error.getPayload());
2735+
} else {
2736+
this.logger.error(&#x60;${logPrefix} Unhandled error: ${error.message}&#x60;);
2737+
throw error; // Rethrow the original error if it&#x27;s not one of the handled types.
2738+
}
2739+
}
2740+
27102741
await this.checkInetOrgPersonJpegPhoto(data);
27112742
if (await this.checkMailAndUid(data) &#x3D;&#x3D;&#x3D; false) {
27122743
this.logger.error(&#x27;Uid ou mail déjà présent dans une autre identité&#x27;);
27132744
throw new HttpException(&quot;Uid ou mail déjà présent dans une autre identité&quot;, 400);
27142745
}
2715-
const logPrefix &#x3D; &#x60;Validation [${data.inetOrgPerson.cn}]:&#x60;;
27162746
this.logger.log(&#x60;${logPrefix} Starting inetOrgPerson validation.&#x60;);
27172747
const check &#x3D; {
2718-
objectClasses: [&#x27;inetorgperson&#x27;],
2719-
attributes: { &#x27;inetorgperson&#x27;: data.inetOrgPerson }
2748+
objectClasses: [&#x27;inetOrgPerson&#x27;],
2749+
attributes: { &#x27;inetOrgPerson&#x27;: data.inetOrgPerson }
27202750
}
27212751
//pour la validation le employeeNumber doit exister on en met un avec une valeur par defaut
2722-
check.attributes.inetorgperson.employeeNumber &#x3D; [&quot;1&quot;];
2752+
check.attributes.inetOrgPerson.employeeNumber &#x3D; [&quot;1&quot;];
27232753
let validations &#x3D; await this._validation.validate(check);
27242754
const created: Document&lt;T, any, T&gt; &#x3D; await super.create(data, options);
27252755
return created;
27262756
}
2757+
27272758
public async update&lt;T extends AbstractSchema | Document&gt;(
27282759
_id: Types.ObjectId | any,
27292760
update: UpdateQuery&lt;T&gt;,
@@ -2745,8 +2776,8 @@ <h3 id="methods">
27452776

27462777
this.logger.log(&#x60;${logPrefix} Starting inetOrgPerson validation.&#x60;);
27472778
const check &#x3D; {
2748-
objectClasses: [&#x27;inetorgperson&#x27;],
2749-
attributes: { &#x27;inetorgperson&#x27;: update.inetOrgPerson }
2779+
objectClasses: [&#x27;inetOrgPerson&#x27;],
2780+
attributes: { &#x27;inetOrgPerson&#x27;: update.inetOrgPerson }
27502781
}
27512782
let validationsInetOrg &#x3D; await this._validation.validate(check);
27522783
let validationsAdFields &#x3D; await this._validation.validate(update.additionalFields);

js/search/search_index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/ManagementModule.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -117,55 +117,55 @@
117117
<title>cluster_ManagementModule</title>
118118
<polygon fill="none" stroke="black" stroke-dasharray="1,5" points="14,-70 14,-195 482,-195 482,-70 14,-70"/>
119119
</g>
120-
<g id="clust6" class="cluster">
121-
<title>cluster_ManagementModule_providers</title>
122-
<polygon fill="none" stroke="black" points="278,-78 278,-130 474,-130 474,-78 278,-78"/>
123-
</g>
124120
<g id="clust3" class="cluster">
125121
<title>cluster_ManagementModule_imports</title>
126-
<polygon fill="none" stroke="black" points="22,-78 22,-130 270,-130 270,-78 22,-78"/>
122+
<polygon fill="none" stroke="black" points="226,-78 226,-130 474,-130 474,-78 226,-78"/>
123+
</g>
124+
<g id="clust6" class="cluster">
125+
<title>cluster_ManagementModule_providers</title>
126+
<polygon fill="none" stroke="black" points="22,-78 22,-130 218,-130 218,-78 22,-78"/>
127127
</g>
128128
<!-- IdentitiesModule -->
129129
<g id="node1" class="node">
130130
<title>IdentitiesModule</title>
131-
<polygon fill="#8dd3c7" stroke="black" points="261.65,-122 258.65,-126 237.65,-126 234.65,-122 150.35,-122 150.35,-86 261.65,-86 261.65,-122"/>
132-
<text text-anchor="middle" x="206" y="-99.8" font-family="Times,serif" font-size="14.00">IdentitiesModule</text>
131+
<polygon fill="#8dd3c7" stroke="black" points="465.65,-122 462.65,-126 441.65,-126 438.65,-122 354.35,-122 354.35,-86 465.65,-86 465.65,-122"/>
132+
<text text-anchor="middle" x="410" y="-99.8" font-family="Times,serif" font-size="14.00">IdentitiesModule</text>
133133
</g>
134134
<!-- ManagementModule -->
135135
<g id="node3" class="node">
136136
<title>ManagementModule</title>
137-
<polygon fill="#8dd3c7" stroke="black" points="272.13,-187 269.13,-191 248.13,-191 245.13,-187 139.87,-187 139.87,-151 272.13,-151 272.13,-187"/>
138-
<text text-anchor="middle" x="206" y="-164.8" font-family="Times,serif" font-size="14.00">ManagementModule</text>
137+
<polygon fill="#8dd3c7" stroke="black" points="351.13,-187 348.13,-191 327.13,-191 324.13,-187 218.87,-187 218.87,-151 351.13,-151 351.13,-187"/>
138+
<text text-anchor="middle" x="285" y="-164.8" font-family="Times,serif" font-size="14.00">ManagementModule</text>
139139
</g>
140140
<!-- IdentitiesModule&#45;&gt;ManagementModule -->
141141
<g id="edge1" class="edge">
142142
<title>IdentitiesModule&#45;&gt;ManagementModule</title>
143-
<path fill="none" stroke="black" d="M206,-122.11C206,-122.11 206,-140.99 206,-140.99"/>
144-
<polygon fill="black" stroke="black" points="202.5,-140.99 206,-150.99 209.5,-140.99 202.5,-140.99"/>
143+
<path fill="none" stroke="black" d="M354.22,-104C347.83,-104 343.54,-104 343.54,-104 343.54,-104 343.54,-140.89 343.54,-140.89"/>
144+
<polygon fill="black" stroke="black" points="340.04,-140.89 343.54,-150.89 347.04,-140.89 340.04,-140.89"/>
145145
</g>
146146
<!-- PasswdModule -->
147147
<g id="node2" class="node">
148148
<title>PasswdModule</title>
149-
<polygon fill="#8dd3c7" stroke="black" points="131.54,-122 128.54,-126 107.54,-126 104.54,-122 30.46,-122 30.46,-86 131.54,-86 131.54,-122"/>
150-
<text text-anchor="middle" x="81" y="-99.8" font-family="Times,serif" font-size="14.00">PasswdModule</text>
149+
<polygon fill="#8dd3c7" stroke="black" points="335.54,-122 332.54,-126 311.54,-126 308.54,-122 234.46,-122 234.46,-86 335.54,-86 335.54,-122"/>
150+
<text text-anchor="middle" x="285" y="-99.8" font-family="Times,serif" font-size="14.00">PasswdModule</text>
151151
</g>
152152
<!-- PasswdModule&#45;&gt;ManagementModule -->
153153
<g id="edge2" class="edge">
154154
<title>PasswdModule&#45;&gt;ManagementModule</title>
155-
<path fill="none" stroke="black" d="M131.68,-104C139.44,-104 144.93,-104 144.93,-104 144.93,-104 144.93,-140.89 144.93,-140.89"/>
156-
<polygon fill="black" stroke="black" points="141.43,-140.89 144.93,-150.89 148.43,-140.89 141.43,-140.89"/>
155+
<path fill="none" stroke="black" d="M285,-122.11C285,-122.11 285,-140.99 285,-140.99"/>
156+
<polygon fill="black" stroke="black" points="281.5,-140.99 285,-150.99 288.5,-140.99 281.5,-140.99"/>
157157
</g>
158158
<!-- ManagementService -->
159159
<g id="node4" class="node">
160160
<title>ManagementService</title>
161-
<ellipse fill="#fdb462" stroke="black" cx="376" cy="-104" rx="90.31" ry="18"/>
162-
<text text-anchor="middle" x="376" y="-99.8" font-family="Times,serif" font-size="14.00">ManagementService</text>
161+
<ellipse fill="#fdb462" stroke="black" cx="120" cy="-104" rx="90.31" ry="18"/>
162+
<text text-anchor="middle" x="120" y="-99.8" font-family="Times,serif" font-size="14.00">ManagementService</text>
163163
</g>
164164
<!-- ManagementService&#45;&gt;ManagementModule -->
165165
<g id="edge3" class="edge">
166166
<title>ManagementService&#45;&gt;ManagementModule</title>
167-
<path fill="none" stroke="black" d="M285.55,-104C274.53,-104 267.07,-104 267.07,-104 267.07,-104 267.07,-140.89 267.07,-140.89"/>
168-
<polygon fill="black" stroke="black" points="263.57,-140.89 267.07,-150.89 270.57,-140.89 263.57,-140.89"/>
167+
<path fill="none" stroke="black" d="M210.75,-104C220.21,-104 226.46,-104 226.46,-104 226.46,-104 226.46,-140.89 226.46,-140.89"/>
168+
<polygon fill="black" stroke="black" points="222.96,-140.89 226.46,-150.89 229.96,-140.89 222.96,-140.89"/>
169169
</g>
170170
</g>
171171
</svg>

modules/ManagementModule/dependencies.svg

Lines changed: 19 additions & 19 deletions
Loading

0 commit comments

Comments
 (0)