Skip to content
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
40 changes: 20 additions & 20 deletions src/main/java/com/xtraction/api/auth/documentation/api_docs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Auth Package — API Documentation

> **Base URL:** `/api/v1/auth`
> **Package:** `com.extractor.unraveldocs.auth`
> **Package:** `com.xtraction.api.auth`
> **Last Updated:** 2026-03-07

---
Expand Down Expand Up @@ -123,7 +123,7 @@ auth/
### Enums

#### `Role`
**Package:** `com.extractor.unraveldocs.auth.datamodel`
**Package:** `com.xtraction.api.auth.datamodel`

Defines the authorization roles assignable to a user account.

Expand All @@ -144,7 +144,7 @@ Defines the authorization roles assignable to a user account.
---

#### `VerifiedStatus`
**Package:** `com.extractor.unraveldocs.auth.datamodel`
**Package:** `com.xtraction.api.auth.datamodel`

Tracks the state of a user's email verification lifecycle.

Expand All @@ -160,7 +160,7 @@ Tracks the state of a user's email verification lifecycle.
### Entities

#### `UserVerification`
**Package:** `com.extractor.unraveldocs.auth.model`
**Package:** `com.xtraction.api.auth.model`
**Table:** `user_verification`

Stores all verification and password-reset token data for a `User`. Has a one-to-one relationship with the `User` entity.
Expand All @@ -185,7 +185,7 @@ Stores all verification and password-reset token data for a `User`. Has a one-to
### Request DTOs

#### `SignupRequestDto`
**Package:** `com.extractor.unraveldocs.auth.dto.request`
**Package:** `com.xtraction.api.auth.dto.request`

| Field | Type | Required | Constraints | Example |
|------------------------|-----------|----------|-------------------------------------------------------------------------------------|-------------------------|
Expand All @@ -205,7 +205,7 @@ Stores all verification and password-reset token data for a `User`. Has a one-to
---

#### `LoginRequestDto`
**Package:** `com.extractor.unraveldocs.auth.dto.request`
**Package:** `com.xtraction.api.auth.dto.request`

| Field | Type | Required | Constraints | Example |
|------------|----------|----------|--------------------|-----------------------|
Expand All @@ -215,7 +215,7 @@ Stores all verification and password-reset token data for a `User`. Has a one-to
---

#### `EmailVerificationRequestDto`
**Package:** `com.extractor.unraveldocs.auth.dto.request`
**Package:** `com.xtraction.api.auth.dto.request`

| Field | Type | Required | Constraints | Example |
|---------|----------|----------|--------------------|----------------------|
Expand All @@ -225,7 +225,7 @@ Stores all verification and password-reset token data for a `User`. Has a one-to
---

#### `ResendEmailVerificationDto`
**Package:** `com.extractor.unraveldocs.auth.dto.request`
**Package:** `com.xtraction.api.auth.dto.request`

| Field | Type | Required | Constraints | Example |
|---------|----------|----------|------------------------|-----------------------|
Expand All @@ -234,14 +234,14 @@ Stores all verification and password-reset token data for a `User`. Has a one-to
---

#### `RefreshTokenRequest`
**Package:** `com.extractor.unraveldocs.auth.dto.request`
**Package:** `com.xtraction.api.auth.dto.request`

> ⚠️ **Deprecated:** The refresh token is now read from an HttpOnly cookie, not from the request body. This DTO is retained for backward compatibility but its fields are no longer required.

---

#### `GeneratePasswordDto`
**Package:** `com.extractor.unraveldocs.auth.dto.request`
**Package:** `com.xtraction.api.auth.dto.request`

| Field | Type | Required | Constraints | Example |
|------------------|----------|----------|------------------------------------------------|---------------|
Expand Down Expand Up @@ -699,7 +699,7 @@ No response body.
## Service Layer

### `AuthService` (Facade)
**Package:** `com.extractor.unraveldocs.auth.service`
**Package:** `com.xtraction.api.auth.service`

A thin orchestration layer that delegates every operation to the appropriate interface implementation. Controllers depend only on `AuthService`, keeping them decoupled from implementation details.

Expand All @@ -717,7 +717,7 @@ A thin orchestration layer that delegates every operation to the appropriate int
---

### `SignupUserImpl`
**Package:** `com.extractor.unraveldocs.auth.impl`
**Package:** `com.xtraction.api.auth.impl`
**Implements:** `SignupUserService`
**Transactional:** Yes (`@Transactional`)

Expand All @@ -742,7 +742,7 @@ A thin orchestration layer that delegates every operation to the appropriate int
---

### `LoginUserImpl`
**Package:** `com.extractor.unraveldocs.auth.impl`
**Package:** `com.xtraction.api.auth.impl`
**Implements:** `LoginUserService`

**Login sequence:**
Expand All @@ -767,7 +767,7 @@ A thin orchestration layer that delegates every operation to the appropriate int
---

### `EmailVerificationImpl`
**Package:** `com.extractor.unraveldocs.auth.impl`
**Package:** `com.xtraction.api.auth.impl`
**Implements:** `EmailVerificationService`
**Transactional:** Yes (`@Transactional`)

Expand Down Expand Up @@ -798,7 +798,7 @@ Handles two operations:
---

### `GeneratePasswordImpl`
**Package:** `com.extractor.unraveldocs.auth.impl`
**Package:** `com.xtraction.api.auth.impl`
**Implements:** `GeneratePasswordService`

**Logic:**
Expand All @@ -813,7 +813,7 @@ Handles two operations:
---

### `RefreshTokenImpl`
**Package:** `com.extractor.unraveldocs.auth.impl`
**Package:** `com.xtraction.api.auth.impl`
**Implements:** `RefreshTokenService` (auth.interfaces)

**`refreshToken(RefreshTokenRequest)`**
Expand Down Expand Up @@ -841,7 +841,7 @@ Handles two operations:
---

### `CustomUserDetailsService`
**Package:** `com.extractor.unraveldocs.auth.service`
**Package:** `com.xtraction.api.auth.service`
**Implements:** `UserDetailsService`, `UserEntityById`

| Method | Description |
Expand All @@ -856,7 +856,7 @@ Handles two operations:
The auth package publishes events to Kafka after successful database commits using `TransactionSynchronizationManager.registerSynchronization`. This guarantees that events are only emitted when the database state has been committed, preventing ghost notifications on rollback.

### `UserRegisteredEvent`
**Package:** `com.extractor.unraveldocs.auth.events`
**Package:** `com.xtraction.api.auth.events`
**Published by:** `SignupUserImpl`, `EmailVerificationImpl` (resend flow)

| Field | Type | Description |
Expand All @@ -870,7 +870,7 @@ The auth package publishes events to Kafka after successful database commits usi
---

### `WelcomeEvent`
**Package:** `com.extractor.unraveldocs.auth.events`
**Package:** `com.xtraction.api.auth.events`
**Published by:** `EmailVerificationImpl` (after successful verification)

| Field | Type | Description |
Expand All @@ -882,7 +882,7 @@ The auth package publishes events to Kafka after successful database commits usi
---

### `UserRegisteredEventHandler`
**Package:** `com.extractor.unraveldocs.auth.components`
**Package:** `com.xtraction.api.auth.components`
**Implements:** `EventHandler<UserRegisteredEvent>`
**Event Type:** `EventTypes.USER_REGISTERED`

Expand Down
Loading
Loading