Skip to content

Commit

Permalink
feat: add abroad residency flag on tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien committed Nov 19, 2024
1 parent 96486b3 commit ff2f341
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class TenantModel {
private String lastName;
private String preferredName;
private String zipCode;
private Boolean abroad;
private String email;
private TenantType tenantType;
private TenantFileStatus status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class TenantModel {
private String lastName;
private String preferredName;
private String zipCode;
private Boolean abroad;
private String email;
private TenantType tenantType;
private TenantFileStatus status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@
@NoArgsConstructor
@CheckFranceConnect(groups = Dossier.class)
public class NamesForm implements FormWithTenantId {

@NotNull
private Long tenantId;

@NotBlank
private String firstName;

@NotBlank
private String lastName;

private String preferredName;

private String zipCode;
private Boolean abroad;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public TenantModel saveStep(Tenant tenant, NamesForm namesForm) {
}
tenant.setPreferredName(namesForm.getPreferredName());
tenant.setZipCode(namesForm.getZipCode());
tenant.setAbroad(namesForm.getAbroad());
tenant.lastUpdateDateProfile(LocalDateTime.now(), null);
apartmentSharingService.resetDossierPdfGenerated(tenant.getApartmentSharing());
tenant = tenantStatusService.updateTenantStatus(tenant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class TenantModel {
private String lastName;
private String preferredName;
private String zipCode;
private Boolean abroad;
private String email;
private TenantType tenantType;
private TenantFileStatus status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,10 @@ <h5 class="modal-title bold" style="width: 80%;float: left;">
</tr>
<tr>
<td>Code postal</td>
<td th:text="${tenant.getZipCode()}"></td>
<td>
<span th:text="${tenant.getZipCode()}"></span>
<span th:if="${tenant.abroad == true}">À l'étranger</span>
</td>
</tr>
<tr>
<td>Type de compte</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public class Tenant extends User implements Person, Serializable {

private String zipCode;

private Boolean abroad;

@Builder.Default
private Boolean honorDeclaration = Boolean.FALSE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class TenantModel {
private String lastName;
private String preferredName;
private String zipCode;
private Boolean abroad;
private String email;
private TenantType tenantType;
private Boolean franceConnect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
public class DeletedTenantModel {
private Long id;
private String zipCode;
private Boolean abroad;
private String hashedEmail;
private String hashedLastname;
private String hashedFirstname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@
<include file="db/migration/202409300000-update-userapi.xml"/>
<include file="db/migration/202410070000-update-jsonprofile-owner_log.xml"/>
<include file="db/migration/202410181600-add-column-dpe-not-required.xml"/>

<include file="db/migration/202411190000-add-column-abroad-residency.xml"/>

</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.10.xsd">
<changeSet id="202411190000" author="fabien">
<addColumn tableName="tenant">
<column name="abroad" type="BOOL" defaultValue="false"/>
</addColumn>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ private void handleWarning2(Tenant t) {
t.setHonorDeclaration(false);
t.setStatus(TenantFileStatus.ARCHIVED);
t.setZipCode("");
t.setAbroad(null);
t.setClarification("");
t.setLastUpdateDate(LocalDateTime.now());
t = tenantRepository.save(t);
Expand Down

0 comments on commit ff2f341

Please sign in to comment.