@@ -155,11 +155,16 @@ public static function configure(Schema $schema, bool $includeProgram = false):
155155 Group::make ()
156156 ->components ([
157157 TextInput::make ('cnp ' )
158- ->label (__ ('field.cnp ' ))
159- ->placeholder (__ ('placeholder.cnp ' ))
158+ ->label (fn (Get $ get ) => $ get ('has_non_standard_cnp ' )
159+ ? __ ('field.non_standard_cnp ' )
160+ : __ ('field.cnp ' ))
161+ ->placeholder (fn (Get $ get ) => $ get ('has_non_standard_cnp ' )
162+ ? __ ('placeholder.non_standard_cnp ' )
163+ : __ ('placeholder.cnp ' ))
160164 ->unique (ignoreRecord: true )
161165 ->nullable ()
162- ->rule (new ValidCNP )
166+ ->maxLength (13 )
167+ ->rule (new ValidCNP , fn (Get $ get ): bool => ! $ get ('has_non_standard_cnp ' ))
163168 ->disabled (function (Get $ get ) {
164169 return (bool ) $ get ('does_not_have_cnp ' )
165170 || (bool ) $ get ('does_not_provide_cnp ' );
@@ -178,13 +183,23 @@ public static function configure(Schema $schema, bool $includeProgram = false):
178183 }
179184 }),
180185
186+ Checkbox::make ('has_non_standard_cnp ' )
187+ ->label (__ ('field.has_non_standard_cnp ' ))
188+ ->default (false )
189+ ->live ()
190+ ->afterStateUpdated (function (Set $ set ) {
191+ $ set ('does_not_have_cnp ' , false );
192+ $ set ('does_not_provide_cnp ' , false );
193+ }),
194+
181195 Checkbox::make ('does_not_have_cnp ' )
182196 ->label (__ ('field.does_not_have_cnp ' ))
183197 ->default (false )
184198 ->live ()
185199 ->afterStateUpdated (function (Set $ set ) {
186200 $ set ('cnp ' , null );
187201 $ set ('does_not_provide_cnp ' , false );
202+ $ set ('has_non_standard_cnp ' , false );
188203 }),
189204
190205 Checkbox::make ('does_not_provide_cnp ' )
@@ -194,6 +209,7 @@ public static function configure(Schema $schema, bool $includeProgram = false):
194209 ->afterStateUpdated (function (Set $ set ) {
195210 $ set ('cnp ' , null );
196211 $ set ('does_not_have_cnp ' , false );
212+ $ set ('has_non_standard_cnp ' , false );
197213 }),
198214 ]),
199215
0 commit comments