Commit 9fe0443
authored
release: create-application flow and migration (#2545)
* feat: add migration functionality for applications (#2537)
* feat: add migration functionality for applications
- Implemented `migrateApplications` controller to handle application migrations based on specified actions.
- Added `addIsNewField` method in the model to update applications with a new `isNew` field.
- Updated routes to include a new endpoint for triggering migrations.
* fix: improve batch update logic in addIsNewField method
* refactor: rename migration function and update route for adding 'isNew' field
- Renamed `migrateApplications` to `addIsNewFieldMigration` for clarity.
- Updated the route to directly call the new migration function without action parameters.
* style: format route definition for addIsNewFieldMigration
- Reformatted the route definition for better readability by aligning parameters in a multi-line format.
* refactor: update addIsNewField logic and improve readability
* refactor: streamline addIsNewField logic and enhance batch update process
- Removed unnecessary tracking of skipped applications.
- Simplified document processing by directly updating all documents in the snapshot.
- Improved error handling by mapping document IDs for failed updates.
* feat: Implement Create Application Flow for User Onboarding (#2534)
* refactor: restructure application constants and enhance application creation logic
- Updated APPLICATION_STATUS_TYPES to use an object for better clarity and added CHANGES_REQUESTED status.
- Introduced APPLICATION_ROLES for role management.
- Added new API response messages for application creation and updates.
- Refactored addApplication controller to utilize createApplicationService for improved application handling.
- Implemented validation for application roles in the application validator.
- Added getApplicationByUserId method in the applications model to retrieve applications by user ID.
- Created applicationService to encapsulate application creation logic and handle conflicts.
- Updated application types to include role and social link structures.
* test: add imageUrl to application data in integration and validation tests
- Updated integration test to include imageUrl in application creation request.
- Modified unit tests for application validator to include imageUrl in rawData for validation scenarios.
* refactor: enhance application constants and update application retrieval logic
* feat: add new API response message for successful application retrieval
* test: add test for the application create flow (#2536)
* refactor: restructure application constants and enhance application creation logic
- Updated APPLICATION_STATUS_TYPES to use an object for better clarity and added CHANGES_REQUESTED status.
- Introduced APPLICATION_ROLES for role management.
- Added new API response messages for application creation and updates.
- Refactored addApplication controller to utilize createApplicationService for improved application handling.
- Implemented validation for application roles in the application validator.
- Added getApplicationByUserId method in the applications model to retrieve applications by user ID.
- Created applicationService to encapsulate application creation logic and handle conflicts.
- Updated application types to include role and social link structures.
* test: add imageUrl to application data in integration and validation tests
- Updated integration test to include imageUrl in application creation request.
- Modified unit tests for application validator to include imageUrl in rawData for validation scenarios.
* refactor: enhance application constants and update application retrieval logic
* feat: add new API response message for successful application retrieval
* test: add unit tests for createApplicationService to validate application creation logic
- Implemented tests for various scenarios including successful application creation, conflict errors, and boundary cases based on application creation dates.
- Verified correct transformation of payload fields and handling of optional fields.
- Ensured error handling and logging for different error scenarios.
* refactor: simplify imageUrl assignment in application transformation logic
- Removed conditional check for imageUrl and directly assigned it to the transformed object.
- This change streamlines the transformation process for application payloads.
* test: update createApplicationService test to focus on socialLink handling
- Modified the test to specifically check the handling of the optional field socialLink when not provided.
- Ensured that imageUrl is correctly assigned from the mock payload during application creation.1 parent b84002f commit 9fe0443
File tree
11 files changed
+643
-62
lines changed- constants
- controllers
- middlewares/validators
- models
- routes
- services
- test
- fixtures/applications
- integration
- unit
- middlewares
- services
- types
11 files changed
+643
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
2 | 16 | | |
3 | 17 | | |
| 18 | + | |
4 | 19 | | |
5 | 20 | | |
6 | 21 | | |
7 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 88 | + | |
93 | 89 | | |
94 | 90 | | |
95 | | - | |
| 91 | + | |
| 92 | + | |
96 | 93 | | |
97 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
152 | 162 | | |
153 | 163 | | |
154 | 164 | | |
155 | 165 | | |
156 | 166 | | |
| 167 | + | |
157 | 168 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
9 | 27 | | |
10 | 28 | | |
11 | 29 | | |
| |||
34 | 52 | | |
35 | 53 | | |
36 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
37 | 61 | | |
38 | 62 | | |
39 | 63 | | |
40 | 64 | | |
41 | 65 | | |
42 | 66 | | |
43 | | - | |
| 67 | + | |
44 | 68 | | |
45 | 69 | | |
46 | 70 | | |
| |||
55 | 79 | | |
56 | 80 | | |
57 | 81 | | |
58 | | - | |
| 82 | + | |
59 | 83 | | |
60 | 84 | | |
61 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | | - | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | | - | |
101 | | - | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
137 | 195 | | |
138 | 196 | | |
139 | 197 | | |
140 | 198 | | |
141 | 199 | | |
142 | 200 | | |
143 | 201 | | |
| 202 | + | |
144 | 203 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
0 commit comments