Skip to content

[TASK:PPD2B002]#7

Merged
MateusOK merged 1 commit into
mainfrom
PPD2B002
Oct 16, 2025
Merged

[TASK:PPD2B002]#7
MateusOK merged 1 commit into
mainfrom
PPD2B002

Conversation

@MateusOK
Copy link
Copy Markdown
Owner

This pull request introduces a major refactor and expansion of the authentication and registration modules, moving from a simple user registration approach to a more robust, role-based registration system that supports both client and specialist user profiles. It replaces the previous registration use case and DTOs with new ones that handle richer domain models, and introduces new domain classes for ClientProfile and SpecialistProfile. The authentication response is also improved to return structured token metadata.

Key changes include:

Registration & User Domain Refactor:

  • Replaced RegisterUserUseCase and related DTOs (CreateUserRequest, CreateUserResponse) with RegistrationUseCase, RegistrationRequest, and RegistrationResponse, enabling registration of both client and specialist users with extended profile information and validation. ([[1]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-31f9056ac2313e70d2cf5a9615fa4deca1e613e94f67403438eb6a9f2d2e23e5R1-R74), [[2]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-8d66de3c850dd44e4a1b54e36fba354611e88a5b02fb2809ba2412a2a790fb4bR1-R44), [[3]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-8cf99a38480341a1539ce5a59faa102e04b291a1466b89f614748ab38526c3b3L5-R6), [[4]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-de8e2df0ad18fb945674a5473619eb87288ce295a7197dfc6517c7fcebf455aaL1-L24), [[5]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-867dbabcde82304ac769d46bab3f50ab1cdec7ff0256d0b42d1e23d217bcf33bL1-L35))
  • Extended the User domain model to include an Address and updated creation/restore methods to use the builder pattern and support the new fields. ([[1]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-96b349826caf8893608c3e489b697c5a6b416f9e257bd1c776fae1b55ef7fc13R5-R15), [[2]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-96b349826caf8893608c3e489b697c5a6b416f9e257bd1c776fae1b55ef7fc13R24-L38))

Domain Model Additions:

  • Introduced new domain classes for ClientProfile and SpecialistProfile, encapsulating profile-specific data for clients and specialists, and providing static creation/restore methods. ([[1]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-cd0337ab9664c74d14fa11bf76857447ed93a0fbe49a42e4bb33a18cc8207020R1-R43), [[2]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-f91fddcec79faab238da67e9fd1bc5f3c14aff541cedc9e0c95b30babfa5a6b1R1-R53))
  • Added a new enum RelationshipDegree to represent the relationship degree for emergency contacts. ([src/main/java/com/soupulsar/modulith/auth/domain/model/enums/RelationshipDegree.javaR1-R21](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-f3fc439f5944fe164555693dd1759e6e9a6a0ec0e892f972ed1994c58b55e190R1-R21))

Authentication Improvements:

  • Enhanced the authentication flow to return a structured AuthUserResponse containing access token, token type, subject, issued at, and expiration information, rather than just a token string. ([[1]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-fc5293661853ce60162cc8b45cc4c6e1422eabb7c2c9120d2dfc567af0936310R4-R22), [[2]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-fc5293661853ce60162cc8b45cc4c6e1422eabb7c2c9120d2dfc567af0936310L31-R46), [[3]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-b4807c2e9254d8f6474252d083bf11ac5b5fa4d0a13720e3d62cac0f96886ce2R1-R13))

Controller and Configuration Updates:

  • Updated AuthController to use the new registration and authentication DTOs and use cases, adding validation and improved HTTP response semantics (e.g., returning 201 Created on registration). ([src/main/java/com/soupulsar/modulith/auth/api/controllers/AuthController.javaL4-R36](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-affc9ddf0a603561caeaf06d26a82b7155cfffade0596b97b6dca8189e4f2957L4-R36))
  • Refactored the configuration to wire up the new RegistrationUseCase and its dependencies. ([[1]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-afbec6d62b82b5b9d0945465dfeec586e369bdd3bc27bd8841dfd7468169b4e4L6-R8), [[2]](https://github.com/MateusOK/pulsar-api/pull/7/files#diff-afbec6d62b82b5b9d0945465dfeec586e369bdd3bc27bd8841dfd7468169b4e4L20-R24))

These changes lay the groundwork for a scalable, role-based user management system with extensible profile data for different user types.

@MateusOK MateusOK self-assigned this Oct 16, 2025
@MateusOK MateusOK merged commit a2c20b3 into main Oct 16, 2025
1 check passed
@MateusOK
Copy link
Copy Markdown
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant