Skip to content

Commit c264b39

Browse files
committed
improve: yvert catalog numbers now can be up to 5 characters long and contain letters.
Fix #1421
1 parent d588ea7 commit c264b39

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

src/main/java/ru/mystamps/web/feature/series/AddSeriesForm.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ public class AddSeriesForm implements AddSeriesDto, HasImageOrImageUrl, Nullable
112112
@Price
113113
private BigDecimal scottPrice;
114114

115-
@CatalogNumbers
115+
// @todo #1421 /series/add: add integration test to check that Yvert numbers may contain letters
116+
@CatalogNumbers(allowLetters = true)
116117
private String yvertNumbers;
117118

118119
@Price

src/main/resources/liquibase/version/0.4.4.xml

+1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<include file="0.4.4/2020-05-04--series_sale_condition.xml" relativeToChangelogFile="true" />
1010
<include file="0.4.4/2020-05-04--collections_series_condition.xml" relativeToChangelogFile="true" />
1111
<include file="0.4.4/2020-05-23--modify_condition_field.xml" relativeToChangelogFile="true" />
12+
<include file="0.4.4/2020-06-01--yvert_code_length.xml" relativeToChangelogFile="true" />
1213

1314
</databaseChangeLog>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<databaseChangeLog
3+
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
6+
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
7+
8+
<changeSet id="modify-yvert_catalog-code-length" author="php-coder" context="scheme">
9+
10+
<modifyDataType
11+
tableName="yvert_catalog"
12+
columnName="code"
13+
newDataType="VARCHAR(5)" />
14+
15+
<!--
16+
modifyDataType loses NOT NULL property on MySQL:
17+
https://forum.liquibase.org/topic/warning-of-losing-primary-key-autoincrement-for-mysql
18+
In order to fix that, we patch the SQL query to specify NOT NULL again.
19+
-->
20+
<modifySql dbms="mysql">
21+
<append value=" NOT NULL" />
22+
</modifySql>
23+
24+
</changeSet>
25+
26+
</databaseChangeLog>

src/test/robotframework/series/creation/validation-user.robot

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Invalid Catalog Numbers Should Be Rejected
9090
... Any number may end with a latin letter in lower case
9191
Element Text Should Be id:michelNumbers.errors Value must be a list of numbers separated by comma
9292
Element Text Should Be id:scottNumbers.errors ${alnumMessage}
93-
Element Text Should Be id:yvertNumbers.errors Value must be a list of numbers separated by comma
93+
Element Text Should Be id:yvertNumbers.errors ${alnumMessage}
9494
Element Text Should Be id:gibbonsNumbers.errors Value must be a list of numbers separated by comma
9595
Element Text Should Be id:solovyovNumbers.errors Value must be a list of numbers separated by comma
9696
Element Text Should Be id:zagorskiNumbers.errors Value must be a list of numbers separated by comma

0 commit comments

Comments
 (0)