Skip to content

Commit

Permalink
Merge pull request #210 from wmde/postcode-length
Browse files Browse the repository at this point in the history
Donation/Membership form postcode maximum field length validation
  • Loading branch information
Sperling-0 authored Sep 4, 2024
2 parents d420372 + 75fa6dc commit d3e37db
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</options>
</field>
<field name="address" type="string" column="strasse" length="100" nullable="true"/>
<field name="postcode" type="string" column="plz" length="8" nullable="true"/>
<field name="postcode" type="string" column="plz" length="16" nullable="true"/>
<field name="city" type="string" column="ort" length="100" nullable="true"/>
<field name="country" type="string" column="country" length="8" nullable="true">
<options>
Expand Down
22 changes: 22 additions & 0 deletions src/DataAccess/Migrations/Version20240826150940.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare( strict_types=1 );

namespace WMDE\Fundraising\MembershipContext\DataAccess\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20240826150940 extends AbstractMigration {
public function getDescription(): string {
return 'Increase postcode length to 16';
}

public function up( Schema $schema ): void {
$schema->getTable( 'request' )->getColumn( 'plz' )->setLength( 16 );
}

public function down( Schema $schema ): void {
$schema->getTable( 'request' )->getColumn( 'plz' )->setLength( 8 );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MembershipApplicationValidator {
Result::SOURCE_APPLICANT_LAST_NAME => 50,
Result::SOURCE_APPLICANT_SALUTATION => 16,
Result::SOURCE_APPLICANT_STREET_ADDRESS => 100,
Result::SOURCE_APPLICANT_POSTAL_CODE => 8,
Result::SOURCE_APPLICANT_POSTAL_CODE => 16,
Result::SOURCE_APPLICANT_CITY => 100,
Result::SOURCE_APPLICANT_COUNTRY => 8,
];
Expand Down

0 comments on commit d3e37db

Please sign in to comment.