Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add abroad residency flag on tenant #908

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading