Skip to content

Commit

Permalink
Merge branch 'release/2024.12.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
poissoj committed Dec 18, 2024
2 parents f115c6b + b30796f commit f4df1c9
Show file tree
Hide file tree
Showing 74 changed files with 209 additions and 984 deletions.
Binary file removed .fonts/Arial Bold Italic.ttf
Binary file not shown.
Binary file removed .fonts/Arial Bold.ttf
Binary file not shown.
Binary file removed .fonts/Arial Italic.ttf
Binary file not shown.
Binary file removed .fonts/Arial.ttf
Binary file not shown.
Binary file removed .fonts/HelveticaWorld-Bold.ttf
Binary file not shown.
Binary file removed .fonts/HelveticaWorld-BoldItalic.ttf
Binary file not shown.
Binary file removed .fonts/HelveticaWorld-Italic.ttf
Binary file not shown.
Binary file removed .fonts/HelveticaWorld-Regular.ttf
Binary file not shown.
Binary file removed .fonts/Times New Roman Bold Italic.ttf
Binary file not shown.
Binary file removed .fonts/Times New Roman Bold.ttf
Binary file not shown.
Binary file removed .fonts/Times New Roman Italic.ttf
Binary file not shown.
Binary file removed .fonts/Times New Roman.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public OwnerModel register(AccountForm accountForm) {
String email = accountForm.getEmail();
Owner owner = ownerRepository.findByEmailAndEnabledFalse(email)
.orElse(Owner.builder().email(email).build());
// TODO : useless ?
owner.setPassword(bCryptPasswordEncoder.encode(accountForm.getPassword()));
owner.setKeycloakId(keycloakService.createKeycloakUserAccountCreation(accountForm, owner));
owner.setFranceConnect(false);
ownerRepository.save(owner);
Expand Down Expand Up @@ -99,7 +97,6 @@ public OwnerModel createPassword(String token, String password) {
.orElseThrow(() -> new PasswordRecoveryTokenNotFoundException(token));
User user = passwordRecoveryToken.getUser();
user.setEnabled(true);
user.setPassword(bCryptPasswordEncoder.encode(password));
if (user.getKeycloakId() == null || user.getKeycloakId().isBlank()) {
var keycloakId = keycloakService.getKeycloakId(user.getEmail());
if (keycloakId == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ public class RegisterController {
private final AuthenticationFacade authenticationFacade;
private final LogService logService;

@PostMapping(value = "/account", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<TenantModel> account(@Validated(Dossier.class) @RequestBody AccountForm accountForm) {
TenantModel tenantModel = tenantService.saveStepRegister(null, accountForm, StepRegister.ACCOUNT);
logService.saveLog(LogType.ACCOUNT_CREATED, tenantModel.getId());
return ok(tenantModel);
}

@PreAuthorize("hasPermissionOnTenant(#namesForm.tenantId)")
@PostMapping(value = "/names", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<TenantModel> names(@Validated(Dossier.class) @RequestBody NamesForm namesForm) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import fr.dossierfacile.api.front.model.tenant.TenantModel;
import fr.dossierfacile.api.front.register.enums.StepRegister;
import fr.dossierfacile.api.front.register.form.guarantor.organism.DocumentGuaranteeProviderCertificateForm;
import fr.dossierfacile.api.front.register.form.guarantor.organism.DocumentIdentificationGuarantorOrganismForm;
import fr.dossierfacile.api.front.security.interfaces.AuthenticationFacade;
import fr.dossierfacile.api.front.service.interfaces.TenantService;
import fr.dossierfacile.api.front.validator.group.Dossier;
Expand All @@ -29,16 +28,6 @@ public class RegisterGuarantorOrganismController {
private final TenantMapper tenantMapper;
private final AuthenticationFacade authenticationFacade;

@PreAuthorize("hasPermissionOnTenant(#documentIdentificationGuarantorOrganismForm.tenantId)")
@PostMapping("/documentIdentification")
@Deprecated
public ResponseEntity<TenantModel> documentIdentification(@Validated(Dossier.class) DocumentIdentificationGuarantorOrganismForm documentIdentificationGuarantorOrganismForm) {
var tenant = authenticationFacade.getTenant(documentIdentificationGuarantorOrganismForm.getTenantId());
tenantService.saveStepRegister(tenant, documentIdentificationGuarantorOrganismForm, StepRegister.DOCUMENT_IDENTIFICATION_GUARANTOR_ORGANISM);
Tenant loggedTenant = (documentIdentificationGuarantorOrganismForm.getTenantId() == null) ? tenant : authenticationFacade.getLoggedTenant();
return ok(tenantMapper.toTenantModel(loggedTenant, null));
}

@PreAuthorize("hasPermissionOnTenant(#form.tenantId)")
@PostMapping("/documentCertificate")
public ResponseEntity<TenantModel> documentCertificate(@Validated(Dossier.class) DocumentGuaranteeProviderCertificateForm form) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public void setCategoriesMapper(CategoriesMapper categoriesMapper) {
this.categoriesMapper = categoriesMapper;
}

@Mapping(target = "passwordEnabled", expression = "java(tenant.getPassword() != null)")
public abstract TenantModel toTenantModel(Tenant tenant, @Context UserApi userApi);

@Mapping(target = "name", expression = "java((document.getWatermarkFile() != null )? applicationBaseUrl + \"/" + PATH + "/\" + document.getName() : null)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ public class TenantModel {
private List<DocumentModel> documents;
private List<GuarantorModel> guarantors;
private boolean franceConnect;
private boolean passwordEnabled;
private String warningMessage;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import fr.dossierfacile.api.front.model.tenant.TenantModel;
import fr.dossierfacile.api.front.register.enums.StepRegister;
import fr.dossierfacile.api.front.register.form.guarantor.organism.DocumentGuaranteeProviderCertificateForm;
import fr.dossierfacile.api.front.register.form.guarantor.organism.DocumentIdentificationGuarantorOrganismForm;
import fr.dossierfacile.api.front.service.interfaces.TenantService;
import fr.dossierfacile.api.front.validator.group.ApiPartner;
import fr.dossierfacile.api.front.validator.group.DocumentIdentificationGuarantor;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
Expand All @@ -25,15 +23,6 @@ public class ApiPartnerRegisterGuarantorOrganismController {

private final TenantService tenantService;

@PreAuthorize("hasPermissionOnTenant(#documentIdentificationGuarantorOrganismForm.tenantId)")
@PostMapping("/documentIdentification")
@Deprecated
public ResponseEntity<TenantModel> documentIdentification(@Validated({ApiPartner.class, DocumentIdentificationGuarantor.class}) DocumentIdentificationGuarantorOrganismForm documentIdentificationGuarantorOrganismForm) {
var tenant = tenantService.findById(documentIdentificationGuarantorOrganismForm.getTenantId());
var tenantModel = tenantService.saveStepRegister(tenant, documentIdentificationGuarantorOrganismForm, StepRegister.DOCUMENT_IDENTIFICATION_GUARANTOR_ORGANISM);
return ok(tenantModel);
}

@PreAuthorize("hasPermissionOnTenant(#form.tenantId)")
@PostMapping("/documentCertificate")
public ResponseEntity<TenantModel> documentCertificate(@Validated({ApiPartner.class}) DocumentGuaranteeProviderCertificateForm form) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import fr.dossierfacile.api.front.register.guarantor.natural_person.DocumentTaxGuarantorNaturalPerson;
import fr.dossierfacile.api.front.register.guarantor.natural_person.NameGuarantorNaturalPerson;
import fr.dossierfacile.api.front.register.guarantor.organism.DocumentGuaranteeProviderCertificate;
import fr.dossierfacile.api.front.register.guarantor.organism.DocumentIdentificationGuarantorOrganism;
import fr.dossierfacile.api.front.register.tenant.Account;
import fr.dossierfacile.api.front.register.tenant.AccountApiPartner;
import fr.dossierfacile.api.front.register.tenant.Application;
import fr.dossierfacile.api.front.register.tenant.DocumentFinancial;
Expand All @@ -29,7 +27,6 @@
@Getter
public enum StepRegister {
ACCOUNT_PARTNER_API(AccountApiPartner.class),
ACCOUNT(Account.class),
NAMES(Names.class),
APPLICATION(Application.class),
HONOR_DECLARATION(HonorDeclaration.class),
Expand All @@ -45,7 +42,6 @@ public enum StepRegister {
DOCUMENT_PROFESSIONAL_GUARANTOR_NATURAL_PERSON(DocumentProfessionalGuarantorNaturalPerson.class),
DOCUMENT_FINANCIAL_GUARANTOR_NATURAL_PERSON(DocumentFinancialGuarantorNaturalPerson.class),
DOCUMENT_TAX_GUARANTOR_NATURAL_PERSON(DocumentTaxGuarantorNaturalPerson.class),
DOCUMENT_IDENTIFICATION_GUARANTOR_ORGANISM(DocumentIdentificationGuarantorOrganism.class),
DOCUMENT_GUARANTEE_PROVIDER_CERTIFICATE(DocumentGuaranteeProviderCertificate.class),
DOCUMENT_IDENTIFICATION_GUARANTOR_LEGAL_PERSON(DocumentIdentificationGuarantorLegalPerson.class),
DOCUMENT_IDENTIFICATION_REPRESENTANT_GUARANTOR_LEGAL_PERSON(DocumentIdentificationRepresentanGuarantorLegalPerson.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
public class DocumentResidencyGuarantorNaturalPersonForm extends DocumentGuarantorFormAbstract {

@NotNull
@DocumentSubcategorySubset(anyOf =
{TENANT, OWNER, GUEST, GUEST_PARENTS, GUEST_ORGANISM, SHORT_TERM_RENTAL, OTHER_RESIDENCY}, groups = ApiVersion.V3.class)
@DocumentSubcategorySubset(anyOf =
{TENANT, OWNER, GUEST, GUEST_COMPANY, GUEST_ORGANISM, SHORT_TERM_RENTAL, OTHER_RESIDENCY}, groups = ApiVersion.V4.class)
private DocumentSubCategory typeDocumentResidency;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ public class AccountPartnerForm {
@UniqueEmailActiveAccount
@JsonDeserialize(using = EmailDeserializer.class)
private String email;

private String internalPartnerId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import fr.dossierfacile.api.front.validator.annotation.tenant.account.UniqueEmailActiveAccount;
import fr.dossierfacile.common.deserializer.EmailDeserializer;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand All @@ -19,9 +18,6 @@ public class AccountForm {
@UniqueEmailActiveAccount
private String email;

@NotBlank
private String password;

private String source;

private String firstName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
public class DocumentResidencyForm extends DocumentForm {

@NotNull
@DocumentSubcategorySubset(anyOf =
{TENANT, OWNER, GUEST, GUEST_PARENTS, GUEST_ORGANISM, SHORT_TERM_RENTAL, OTHER_RESIDENCY}, groups = ApiVersion.V3.class)
@DocumentSubcategorySubset(anyOf =
{TENANT, OWNER, GUEST, GUEST_COMPANY, GUEST_ORGANISM, SHORT_TERM_RENTAL, OTHER_RESIDENCY}, groups = ApiVersion.V4.class)
private DocumentSubCategory typeDocumentResidency;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public TenantModel saveStep(Tenant t, AccountPartnerForm accountForm) {
String email = accountForm.getEmail().toLowerCase();
Tenant tenant = findDisabledTenantOrCreateTenant(email);
UserApi userApi = clientAuthenticationFacade.getClient();
partnerCallBackService.registerTenant(accountForm.getInternalPartnerId(), tenant, userApi);
partnerCallBackService.registerTenant(tenant, userApi);

mailService.sendEmailWelcomeForPartnerUser(tenantMapperForMail.toDto(tenant), userApiMapperForMail.toDto(userApi));

Expand Down
Loading

0 comments on commit f4df1c9

Please sign in to comment.