kamau1 commited on
Commit
c5fdc5d
·
1 Parent(s): dcd97c0

fix: make user_id optional for self-service and auto-set before auth check; update schema, service, and docs

Browse files
docs/api/inventory/quickref.md CHANGED
@@ -107,7 +107,6 @@
107
  ```json
108
  {
109
  "project_inventory_distribution_id": "uuid",
110
- "user_id": "uuid",
111
  "unit_identifier": "ONT-12345",
112
  "ticket_id": "uuid",
113
  "notes": "Collected for TKT-001"
@@ -115,7 +114,8 @@
115
  ```
116
 
117
  **Notes:**
118
- - `user_id` is auto-set to yourself (field agents can't record for others)
 
119
  - `unit_identifier` must be unique (serial number, box number, etc.)
120
  - `ticket_id` is optional - link to ticket if you know which job it's for
121
 
 
107
  ```json
108
  {
109
  "project_inventory_distribution_id": "uuid",
 
110
  "unit_identifier": "ONT-12345",
111
  "ticket_id": "uuid",
112
  "notes": "Collected for TKT-001"
 
114
  ```
115
 
116
  **Notes:**
117
+ - `user_id` is optional - auto-set to yourself for self-service
118
+ - Field agents can only record for themselves (admins/PMs can specify user_id for others)
119
  - `unit_identifier` must be unique (serial number, box number, etc.)
120
  - `ticket_id` is optional - link to ticket if you know which job it's for
121
 
docs/devlogs/browser/browserconsole.txt CHANGED
@@ -2,76 +2,9 @@ chunk-276SZO74.js?v=60545445:21551 Download the React DevTools for a better deve
2
  core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/auth/me
3
  react-router-dom.js?v=eea2f7f2:4393 ⚠️ React Router Future Flag Warning: React Router will begin wrapping state updates in `React.startTransition` in v7. You can use the `v7_startTransition` future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_starttransition.
4
  warnOnce @ react-router-dom.js?v=eea2f7f2:4393
5
- react-router-dom.js?v=eea2f7f2:4393 ⚠️ React Router Future Flag Warning: Relative route resolution within Splat routes is changing in v7. You can use the `v7_relativeSplatPath` future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath.
6
- warnOnce @ react-router-dom.js?v=eea2f7f2:4393
7
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/auth/me → 200 (1.73s)
8
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/tickets/stats?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a
9
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/tickets?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a&skip=0&limit=50
10
- core.ts:117 ℹ️ [11:55:34] [COMPONENT] TicketsDashboard: Tickets dashboard loaded Object
11
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/auth/me/preferences
12
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/auth/me/preferences → 200 (866ms)
13
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/tickets?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a&skip=0&limit=50 → 200 (1.18s)
14
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/tickets/stats?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a → 200 (1.40s)
15
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions
16
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions → 200 (733ms)
17
- core.ts:117 ℹ️ [11:55:39] [COMPONENT] AppLauncher: App clicked Object
18
- core.ts:117 ℹ️ [11:55:39] [COMPONENT] AppLauncher: Navigation decision Object
19
- core.ts:117 ℹ️ [11:55:39] [COMPONENT] AppLauncher: Navigating to project-scoped route Object
20
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats
21
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory?
22
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team
23
- team:1 Failed to load resource: the server responded with a status of 403 ()
24
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team → 403 (812ms)
25
- my-inventory:1 Failed to load resource: the server responded with a status of 422 ()
26
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory? → 422 (814ms)
27
- my-stats:1 Failed to load resource: the server responded with a status of 422 ()
28
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats → 422 (828ms)
29
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team
30
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory?
31
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats
32
- team:1 Failed to load resource: the server responded with a status of 403 ()
33
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team → 403 (466ms)
34
- my-inventory:1 Failed to load resource: the server responded with a status of 422 ()
35
- my-stats:1 Failed to load resource: the server responded with a status of 422 ()
36
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory? → 422 (461ms)
37
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats → 422 (447ms)
38
- chunk-ZJHC3U5H.js?v=60545445:340 Warning: Missing `Description` or `aria-describedby={undefined}` for {DialogContent}.
39
- (anonymous) @ chunk-ZJHC3U5H.js?v=60545445:340
40
- chunk-ZJHC3U5H.js?v=60545445:340 Warning: Missing `Description` or `aria-describedby={undefined}` for {DialogContent}.
41
- (anonymous) @ chunk-ZJHC3U5H.js?v=60545445:340
42
- commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
43
- commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
44
- commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
45
- commitPassiveMountEffects_begin @ chunk-276SZO74.js?v=60545445:18119
46
- commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
47
- flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
48
- flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
49
- commitRootImpl @ chunk-276SZO74.js?v=60545445:19416
50
- commitRoot @ chunk-276SZO74.js?v=60545445:19277
51
- performSyncWorkOnRoot @ chunk-276SZO74.js?v=60545445:18895
52
- flushSyncCallbacks @ chunk-276SZO74.js?v=60545445:9119
53
- (anonymous) @ chunk-276SZO74.js?v=60545445:18627
54
- core.ts:117 ℹ️ [11:56:31] [COMPONENT] TicketsDashboard: Tickets dashboard loaded {projectId: '0ade6bd1-e492-4e25-b681-59f42058d29a'}
55
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions
56
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions → 200 (464ms)
57
- core.ts:117 ℹ️ [11:58:49] [COMPONENT] AppLauncher: App clicked {appCode: 'inventory', route: '/inventory', primaryProject: '0ade6bd1-e492-4e25-b681-59f42058d29a', currentPath: '/project/0ade6bd1-e492-4e25-b681-59f42058d29a/tickets', metaApps: Array(4)}
58
- core.ts:117 ℹ️ [11:58:49] [COMPONENT] AppLauncher: Navigation decision {hasProject: true, isInProjectContext: true, isMetaApp: false, appCode: 'inventory', metaApps: Array(4)}
59
- core.ts:117 ℹ️ [11:58:49] [COMPONENT] AppLauncher: Navigating to project-scoped route {projectRoute: '/project/0ade6bd1-e492-4e25-b681-59f42058d29a/inventory', appCode: 'inventory'}
60
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats
61
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory?
62
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team
63
- project-setup.service.ts:335 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team 403 (Forbidden)
64
- getTeam @ project-setup.service.ts:335
65
- queryFn @ Index.tsx:19
66
- fetchFn @ @tanstack_react-query.js?v=1e855d7b:881
67
- run @ @tanstack_react-query.js?v=1e855d7b:513
68
- start @ @tanstack_react-query.js?v=1e855d7b:555
69
- fetch @ @tanstack_react-query.js?v=1e855d7b:969
70
- executeFetch_fn @ @tanstack_react-query.js?v=1e855d7b:2280
71
- onSubscribe @ @tanstack_react-query.js?v=1e855d7b:1983
72
- subscribe @ @tanstack_react-query.js?v=1e855d7b:24
73
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:3147
74
- subscribeToStore @ chunk-276SZO74.js?v=60545445:11984
75
  commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
76
  commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
77
  commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
@@ -79,50 +12,15 @@ commitPassiveMountEffects_begin @ chunk-276SZO74.js?v=60545445:18119
79
  commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
80
  flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
81
  flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
82
- commitRootImpl @ chunk-276SZO74.js?v=60545445:19416
83
- commitRoot @ chunk-276SZO74.js?v=60545445:19277
84
- performSyncWorkOnRoot @ chunk-276SZO74.js?v=60545445:18895
85
- flushSyncCallbacks @ chunk-276SZO74.js?v=60545445:9119
86
- (anonymous) @ chunk-276SZO74.js?v=60545445:18627
87
- api-client.ts:124 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory? 422 (Unprocessable Content)
88
- request @ api-client.ts:124
89
- get @ api-client.ts:190
90
- getMyInventory @ inventory.service.ts:190
91
- queryFn @ FieldAgentInventory.tsx:116
92
- fetchFn @ @tanstack_react-query.js?v=1e855d7b:881
93
- run @ @tanstack_react-query.js?v=1e855d7b:513
94
- start @ @tanstack_react-query.js?v=1e855d7b:555
95
- fetch @ @tanstack_react-query.js?v=1e855d7b:969
96
- executeFetch_fn @ @tanstack_react-query.js?v=1e855d7b:2280
97
- onSubscribe @ @tanstack_react-query.js?v=1e855d7b:1983
98
- subscribe @ @tanstack_react-query.js?v=1e855d7b:24
99
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:3147
100
- subscribeToStore @ chunk-276SZO74.js?v=60545445:11984
101
- commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
102
- commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
103
- commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
104
- commitPassiveMountEffects_begin @ chunk-276SZO74.js?v=60545445:18119
105
- commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
106
- flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
107
- flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
108
- commitRootImpl @ chunk-276SZO74.js?v=60545445:19416
109
- commitRoot @ chunk-276SZO74.js?v=60545445:19277
110
- performSyncWorkOnRoot @ chunk-276SZO74.js?v=60545445:18895
111
- flushSyncCallbacks @ chunk-276SZO74.js?v=60545445:9119
112
- (anonymous) @ chunk-276SZO74.js?v=60545445:18627
113
- api-client.ts:124 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats 422 (Unprocessable Content)
114
- request @ api-client.ts:124
115
- get @ api-client.ts:190
116
- getFieldAgentStats @ inventory.service.ts:179
117
- fetchFn @ @tanstack_react-query.js?v=1e855d7b:881
118
- run @ @tanstack_react-query.js?v=1e855d7b:513
119
- start @ @tanstack_react-query.js?v=1e855d7b:555
120
- fetch @ @tanstack_react-query.js?v=1e855d7b:969
121
- executeFetch_fn @ @tanstack_react-query.js?v=1e855d7b:2280
122
- onSubscribe @ @tanstack_react-query.js?v=1e855d7b:1983
123
- subscribe @ @tanstack_react-query.js?v=1e855d7b:24
124
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:3147
125
- subscribeToStore @ chunk-276SZO74.js?v=60545445:11984
126
  commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
127
  commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
128
  commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
@@ -130,82 +28,56 @@ commitPassiveMountEffects_begin @ chunk-276SZO74.js?v=60545445:18119
130
  commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
131
  flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
132
  flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
133
- commitRootImpl @ chunk-276SZO74.js?v=60545445:19416
134
- commitRoot @ chunk-276SZO74.js?v=60545445:19277
135
- performSyncWorkOnRoot @ chunk-276SZO74.js?v=60545445:18895
136
- flushSyncCallbacks @ chunk-276SZO74.js?v=60545445:9119
137
- (anonymous) @ chunk-276SZO74.js?v=60545445:18627
138
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team → 403 (1.34s)
139
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory? → 422 (1.34s)
140
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats → 422 (1.35s)
141
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team
142
- core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory?
143
  core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats
144
- project-setup.service.ts:335 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team 403 (Forbidden)
145
- getTeam @ project-setup.service.ts:335
146
- queryFn @ Index.tsx:19
147
- fetchFn @ @tanstack_react-query.js?v=1e855d7b:881
148
- run @ @tanstack_react-query.js?v=1e855d7b:513
149
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:538
150
- Promise.then
151
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:534
152
- Promise.catch
153
- run @ @tanstack_react-query.js?v=1e855d7b:517
154
- start @ @tanstack_react-query.js?v=1e855d7b:555
155
- fetch @ @tanstack_react-query.js?v=1e855d7b:969
156
- executeFetch_fn @ @tanstack_react-query.js?v=1e855d7b:2280
157
- onSubscribe @ @tanstack_react-query.js?v=1e855d7b:1983
158
- subscribe @ @tanstack_react-query.js?v=1e855d7b:24
159
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:3147
160
- subscribeToStore @ chunk-276SZO74.js?v=60545445:11984
161
- commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
162
- commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
163
- commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
164
- commitPassiveMountEffects_begin @ chunk-276SZO74.js?v=60545445:18119
165
- commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
166
- flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
167
- flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
168
- commitRootImpl @ chunk-276SZO74.js?v=60545445:19416
169
- commitRoot @ chunk-276SZO74.js?v=60545445:19277
170
- performSyncWorkOnRoot @ chunk-276SZO74.js?v=60545445:18895
171
- flushSyncCallbacks @ chunk-276SZO74.js?v=60545445:9119
172
- (anonymous) @ chunk-276SZO74.js?v=60545445:18627
173
- api-client.ts:124 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats 422 (Unprocessable Content)
174
  request @ api-client.ts:124
175
- get @ api-client.ts:190
176
- getFieldAgentStats @ inventory.service.ts:179
177
- fetchFn @ @tanstack_react-query.js?v=1e855d7b:881
178
  run @ @tanstack_react-query.js?v=1e855d7b:513
179
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:538
180
- Promise.then
181
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:534
182
- Promise.catch
183
- run @ @tanstack_react-query.js?v=1e855d7b:517
184
  start @ @tanstack_react-query.js?v=1e855d7b:555
185
- fetch @ @tanstack_react-query.js?v=1e855d7b:969
186
- executeFetch_fn @ @tanstack_react-query.js?v=1e855d7b:2280
187
- onSubscribe @ @tanstack_react-query.js?v=1e855d7b:1983
188
- subscribe @ @tanstack_react-query.js?v=1e855d7b:24
189
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:3147
190
- subscribeToStore @ chunk-276SZO74.js?v=60545445:11984
191
- commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
192
- commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
193
- commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
194
- commitPassiveMountEffects_begin @ chunk-276SZO74.js?v=60545445:18119
195
- commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
196
- flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
197
- flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
198
- commitRootImpl @ chunk-276SZO74.js?v=60545445:19416
199
- commitRoot @ chunk-276SZO74.js?v=60545445:19277
200
- performSyncWorkOnRoot @ chunk-276SZO74.js?v=60545445:18895
201
- flushSyncCallbacks @ chunk-276SZO74.js?v=60545445:9119
202
- (anonymous) @ chunk-276SZO74.js?v=60545445:18627
203
- api-client.ts:124 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory? 422 (Unprocessable Content)
 
 
 
 
204
  request @ api-client.ts:124
205
- get @ api-client.ts:190
206
- getMyInventory @ inventory.service.ts:190
207
- queryFn @ FieldAgentInventory.tsx:116
208
- fetchFn @ @tanstack_react-query.js?v=1e855d7b:881
209
  run @ @tanstack_react-query.js?v=1e855d7b:513
210
  (anonymous) @ @tanstack_react-query.js?v=1e855d7b:538
211
  Promise.then
@@ -213,24 +85,59 @@ Promise.then
213
  Promise.catch
214
  run @ @tanstack_react-query.js?v=1e855d7b:517
215
  start @ @tanstack_react-query.js?v=1e855d7b:555
216
- fetch @ @tanstack_react-query.js?v=1e855d7b:969
217
- executeFetch_fn @ @tanstack_react-query.js?v=1e855d7b:2280
218
- onSubscribe @ @tanstack_react-query.js?v=1e855d7b:1983
219
- subscribe @ @tanstack_react-query.js?v=1e855d7b:24
220
- (anonymous) @ @tanstack_react-query.js?v=1e855d7b:3147
221
- subscribeToStore @ chunk-276SZO74.js?v=60545445:11984
222
- commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
223
- commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
224
- commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
225
- commitPassiveMountEffects_begin @ chunk-276SZO74.js?v=60545445:18119
226
- commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
227
- flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
228
- flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
229
- commitRootImpl @ chunk-276SZO74.js?v=60545445:19416
230
- commitRoot @ chunk-276SZO74.js?v=60545445:19277
231
- performSyncWorkOnRoot @ chunk-276SZO74.js?v=60545445:18895
232
- flushSyncCallbacks @ chunk-276SZO74.js?v=60545445:9119
233
- (anonymous) @ chunk-276SZO74.js?v=60545445:18627
234
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team → 403 (463ms)
235
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats → 422 (448ms)
236
- core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory? → 422 (450ms)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/auth/me
3
  react-router-dom.js?v=eea2f7f2:4393 ⚠️ React Router Future Flag Warning: React Router will begin wrapping state updates in `React.startTransition` in v7. You can use the `v7_startTransition` future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_starttransition.
4
  warnOnce @ react-router-dom.js?v=eea2f7f2:4393
5
+ logDeprecation @ react-router-dom.js?v=eea2f7f2:4396
6
+ logV6DeprecationWarnings @ react-router-dom.js?v=eea2f7f2:4399
7
+ (anonymous) @ react-router-dom.js?v=eea2f7f2:5271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
9
  commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
10
  commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
 
12
  commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
13
  flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
14
  flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
15
+ (anonymous) @ chunk-276SZO74.js?v=60545445:19328
16
+ workLoop @ chunk-276SZO74.js?v=60545445:197
17
+ flushWork @ chunk-276SZO74.js?v=60545445:176
18
+ performWorkUntilDeadline @ chunk-276SZO74.js?v=60545445:384
19
+ react-router-dom.js?v=eea2f7f2:4393 ⚠️ React Router Future Flag Warning: Relative route resolution within Splat routes is changing in v7. You can use the `v7_relativeSplatPath` future flag to opt-in early. For more information, see https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath.
20
+ warnOnce @ react-router-dom.js?v=eea2f7f2:4393
21
+ logDeprecation @ react-router-dom.js?v=eea2f7f2:4396
22
+ logV6DeprecationWarnings @ react-router-dom.js?v=eea2f7f2:4402
23
+ (anonymous) @ react-router-dom.js?v=eea2f7f2:5271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  commitHookEffectListMount @ chunk-276SZO74.js?v=60545445:16915
25
  commitPassiveMountOnFiber @ chunk-276SZO74.js?v=60545445:18156
26
  commitPassiveMountEffects_complete @ chunk-276SZO74.js?v=60545445:18129
 
28
  commitPassiveMountEffects @ chunk-276SZO74.js?v=60545445:18109
29
  flushPassiveEffectsImpl @ chunk-276SZO74.js?v=60545445:19490
30
  flushPassiveEffects @ chunk-276SZO74.js?v=60545445:19447
31
+ (anonymous) @ chunk-276SZO74.js?v=60545445:19328
32
+ workLoop @ chunk-276SZO74.js?v=60545445:197
33
+ flushWork @ chunk-276SZO74.js?v=60545445:176
34
+ performWorkUntilDeadline @ chunk-276SZO74.js?v=60545445:384
35
+ core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/auth/me → 200 (947ms)
 
 
 
 
 
36
  core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats
37
+ core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory?is_returned=false
38
+ core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/auth/me/preferences
39
+ core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/auth/me/preferences → 200 (336ms)
40
+ core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-stats → 200 (616ms)
41
+ core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/my-inventory?is_returned=false → 200 (615ms)
42
+ core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions
43
+ core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions → 200 (852ms)
44
+ core.ts:167 %cGET%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/regions/4cd27765-5720-4cc0-872e-bf0da3cd1898/available
45
+ core.ts:167 GET https://kamau1-swiftops-backend.hf.space/api/v1/inventory/regions/4cd27765-5720-4cc0-872e-bf0da3cd1898/available → 200 (682ms)
46
+ core.ts:167 %cPOST%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/assignments
47
+ api-client.ts:124 POST https://kamau1-swiftops-backend.hf.space/api/v1/inventory/assignments 422 (Unprocessable Content)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  request @ api-client.ts:124
49
+ post @ api-client.ts:201
50
+ collectInventory @ inventory.service.ts:200
51
+ fn @ @tanstack_react-query.js?v=1e855d7b:1236
52
  run @ @tanstack_react-query.js?v=1e855d7b:513
 
 
 
 
 
53
  start @ @tanstack_react-query.js?v=1e855d7b:555
54
+ execute @ @tanstack_react-query.js?v=1e855d7b:1272
55
+ await in execute
56
+ mutate @ @tanstack_react-query.js?v=1e855d7b:2692
57
+ (anonymous) @ @tanstack_react-query.js?v=1e855d7b:3415
58
+ handleSubmit @ CollectInventoryModal.tsx:77
59
+ callCallback2 @ chunk-276SZO74.js?v=60545445:3674
60
+ invokeGuardedCallbackDev @ chunk-276SZO74.js?v=60545445:3699
61
+ invokeGuardedCallback @ chunk-276SZO74.js?v=60545445:3733
62
+ invokeGuardedCallbackAndCatchFirstError @ chunk-276SZO74.js?v=60545445:3736
63
+ executeDispatch @ chunk-276SZO74.js?v=60545445:7014
64
+ processDispatchQueueItemsInOrder @ chunk-276SZO74.js?v=60545445:7034
65
+ processDispatchQueue @ chunk-276SZO74.js?v=60545445:7043
66
+ dispatchEventsForPlugins @ chunk-276SZO74.js?v=60545445:7051
67
+ (anonymous) @ chunk-276SZO74.js?v=60545445:7174
68
+ batchedUpdates$1 @ chunk-276SZO74.js?v=60545445:18913
69
+ batchedUpdates @ chunk-276SZO74.js?v=60545445:3579
70
+ dispatchEventForPluginEventSystem @ chunk-276SZO74.js?v=60545445:7173
71
+ dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ chunk-276SZO74.js?v=60545445:5478
72
+ dispatchEvent @ chunk-276SZO74.js?v=60545445:5472
73
+ dispatchDiscreteEvent @ chunk-276SZO74.js?v=60545445:5449
74
+ core.ts:167 POST https://kamau1-swiftops-backend.hf.space/api/v1/inventory/assignments → 422 (621ms)
75
+ core.ts:167 %cPOST%c https://kamau1-swiftops-backend.hf.space/api/v1/inventory/assignments
76
+ api-client.ts:124 POST https://kamau1-swiftops-backend.hf.space/api/v1/inventory/assignments 422 (Unprocessable Content)
77
  request @ api-client.ts:124
78
+ post @ api-client.ts:201
79
+ collectInventory @ inventory.service.ts:200
80
+ fn @ @tanstack_react-query.js?v=1e855d7b:1236
 
81
  run @ @tanstack_react-query.js?v=1e855d7b:513
82
  (anonymous) @ @tanstack_react-query.js?v=1e855d7b:538
83
  Promise.then
 
85
  Promise.catch
86
  run @ @tanstack_react-query.js?v=1e855d7b:517
87
  start @ @tanstack_react-query.js?v=1e855d7b:555
88
+ execute @ @tanstack_react-query.js?v=1e855d7b:1272
89
+ await in execute
90
+ mutate @ @tanstack_react-query.js?v=1e855d7b:2692
91
+ (anonymous) @ @tanstack_react-query.js?v=1e855d7b:3415
92
+ handleSubmit @ CollectInventoryModal.tsx:77
93
+ callCallback2 @ chunk-276SZO74.js?v=60545445:3674
94
+ invokeGuardedCallbackDev @ chunk-276SZO74.js?v=60545445:3699
95
+ invokeGuardedCallback @ chunk-276SZO74.js?v=60545445:3733
96
+ invokeGuardedCallbackAndCatchFirstError @ chunk-276SZO74.js?v=60545445:3736
97
+ executeDispatch @ chunk-276SZO74.js?v=60545445:7014
98
+ processDispatchQueueItemsInOrder @ chunk-276SZO74.js?v=60545445:7034
99
+ processDispatchQueue @ chunk-276SZO74.js?v=60545445:7043
100
+ dispatchEventsForPlugins @ chunk-276SZO74.js?v=60545445:7051
101
+ (anonymous) @ chunk-276SZO74.js?v=60545445:7174
102
+ batchedUpdates$1 @ chunk-276SZO74.js?v=60545445:18913
103
+ batchedUpdates @ chunk-276SZO74.js?v=60545445:3579
104
+ dispatchEventForPluginEventSystem @ chunk-276SZO74.js?v=60545445:7173
105
+ dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ chunk-276SZO74.js?v=60545445:5478
106
+ dispatchEvent @ chunk-276SZO74.js?v=60545445:5472
107
+ dispatchDiscreteEvent @ chunk-276SZO74.js?v=60545445:5449
108
+ core.ts:167 POST https://kamau1-swiftops-backend.hf.space/api/v1/inventory/assignments → 422 (329ms)
109
+ chunk-276SZO74.js?v=60545445:521 Warning: Cannot update a component (`ForwardRef`) while rendering a different component (`ForwardRef`). To locate the bad setState() call inside `ForwardRef`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
110
+ at http://localhost:8080/node_modules/.vite/deps/sonner.js?v=c0221b4e:269:17
111
+ at Toaster (http://localhost:8080/src/components/ui/sonner.tsx:24:23)
112
+ at Provider (http://localhost:8080/node_modules/.vite/deps/chunk-6JTMSBF5.js?v=60545445:38:15)
113
+ at TooltipProvider (http://localhost:8080/node_modules/.vite/deps/@radix-ui_react-tooltip.js?v=fb41200b:64:5)
114
+ at ThemeProvider (http://localhost:8080/src/contexts/ThemeProvider.tsx:29:33)
115
+ at UserPreferencesProvider (http://localhost:8080/src/contexts/UserPreferencesContext.tsx:28:43)
116
+ at QueryClientProvider (http://localhost:8080/node_modules/.vite/deps/@tanstack_react-query.js?v=1e855d7b:2934:3)
117
+ at App (http://localhost:8080/src/App.tsx?t=1764591933683:157:35)
118
+ printWarning @ chunk-276SZO74.js?v=60545445:521
119
+ error @ chunk-276SZO74.js?v=60545445:505
120
+ warnAboutRenderPhaseUpdatesInDEV @ chunk-276SZO74.js?v=60545445:19793
121
+ scheduleUpdateOnFiber @ chunk-276SZO74.js?v=60545445:18546
122
+ dispatchSetState @ chunk-276SZO74.js?v=60545445:12403
123
+ (anonymous) @ sonner.js?v=c0221b4e:277
124
+ (anonymous) @ sonner.js?v=c0221b4e:68
125
+ dismiss @ sonner.js?v=c0221b4e:68
126
+ (anonymous) @ sonner.js?v=c0221b4e:272
127
+ basicStateReducer @ chunk-276SZO74.js?v=60545445:11703
128
+ updateReducer @ chunk-276SZO74.js?v=60545445:11794
129
+ updateState @ chunk-276SZO74.js?v=60545445:12021
130
+ useState @ chunk-276SZO74.js?v=60545445:12753
131
+ useState @ chunk-ZMLY2J2T.js?v=60545445:1066
132
+ (anonymous) @ sonner.js?v=c0221b4e:269
133
+ renderWithHooks @ chunk-276SZO74.js?v=60545445:11548
134
+ updateForwardRef @ chunk-276SZO74.js?v=60545445:14325
135
+ beginWork @ chunk-276SZO74.js?v=60545445:15946
136
+ beginWork$1 @ chunk-276SZO74.js?v=60545445:19753
137
+ performUnitOfWork @ chunk-276SZO74.js?v=60545445:19198
138
+ workLoopSync @ chunk-276SZO74.js?v=60545445:19137
139
+ renderRootSync @ chunk-276SZO74.js?v=60545445:19116
140
+ performConcurrentWorkOnRoot @ chunk-276SZO74.js?v=60545445:18678
141
+ workLoop @ chunk-276SZO74.js?v=60545445:197
142
+ flushWork @ chunk-276SZO74.js?v=60545445:176
143
+ performWorkUntilDeadline @ chunk-276SZO74.js?v=60545445:384
docs/devlogs/server/runtimeerror.txt CHANGED
@@ -1,110 +1,285 @@
1
- ===== Application Startup at 2025-12-01 11:54:41 =====
2
 
3
  INFO: Started server process [7]
4
  INFO: Waiting for application startup.
5
- INFO: 2025-12-01T11:55:07 - app.main: ============================================================
6
- INFO: 2025-12-01T11:55:07 - app.main: 🚀 SwiftOps API v1.0.0 | PRODUCTION
7
- INFO: 2025-12-01T11:55:07 - app.main: 📊 Dashboard: Enabled
8
- INFO: 2025-12-01T11:55:07 - app.main: ============================================================
9
- INFO: 2025-12-01T11:55:07 - app.main: 📦 Database:
10
- INFO: 2025-12-01T11:55:07 - app.main: ✓ Connected | 45 tables | 6 users
11
- INFO: 2025-12-01T11:55:07 - app.main: 💾 Cache & Sessions:
12
- INFO: 2025-12-01T11:55:08 - app.services.otp_service: ✅ OTP Service initialized with Redis storage
13
- INFO: 2025-12-01T11:55:09 - app.main: ✓ Redis: Connected
14
- INFO: 2025-12-01T11:55:09 - app.main: 🔌 External Services:
15
- INFO: 2025-12-01T11:55:09 - app.main: ✓ Cloudinary: Connected
16
- INFO: 2025-12-01T11:55:09 - app.main: ✓ Resend: Configured
17
- INFO: 2025-12-01T11:55:09 - app.main: ○ WASender: Failed
18
- INFO: 2025-12-01T11:55:09 - app.main: ✓ Supabase: Connected | 6 buckets
19
- INFO: 2025-12-01T11:55:09 - app.main: ============================================================
20
- INFO: 2025-12-01T11:55:09 - app.main: ✅ Startup complete | Ready to serve requests
21
- INFO: 2025-12-01T11:55:09 - app.main: ============================================================
22
  INFO: Application startup complete.
23
  INFO: Uvicorn running on http://0.0.0.0:7860 (Press CTRL+C to quit)
24
- INFO: 10.16.2.97:13527 - "GET /health HTTP/1.1" 200 OK
25
- INFO: 10.16.21.26:13132 - "GET /health HTTP/1.1" 200 OK
26
- INFO: 10.16.21.26:49402 - "GET /health HTTP/1.1" 200 OK
27
- INFO: 2025-12-01T11:55:33 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
28
- INFO: 2025-12-01T11:55:33 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
29
- INFO: 10.16.25.209:13366 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
30
- INFO: 2025-12-01T11:55:34 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
31
- INFO: 2025-12-01T11:55:34 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
32
- INFO: 10.16.30.4:14415 - "GET /api/v1/auth/me/preferences HTTP/1.1" 200 OK
33
- INFO: 2025-12-01T11:55:35 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
34
- INFO: 2025-12-01T11:55:35 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
35
- /app/src/app/services/ticket_service.py:694: SAWarning: Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
36
- query = query.filter(Ticket.project_id.in_(team_projects))
37
- INFO: 10.16.11.176:2316 - "GET /api/v1/auth/me/preferences/available-apps HTTP/1.1" 200 OK
38
- INFO: 10.16.25.209:13366 - "GET /api/v1/tickets?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a&skip=0&limit=50 HTTP/1.1" 200 OK
39
- INFO: 10.16.30.4:20915 - "GET /api/v1/tickets/stats?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a HTTP/1.1" 200 OK
40
- INFO: 2025-12-01T11:55:36 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
41
- INFO: 2025-12-01T11:55:36 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
42
- INFO: 10.16.30.4:20915 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions HTTP/1.1" 200 OK
43
- INFO: 2025-12-01T11:55:39 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
44
- INFO: 2025-12-01T11:55:39 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
45
- INFO: 2025-12-01T11:55:39 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
46
- INFO: 2025-12-01T11:55:39 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
47
- INFO: 2025-12-01T11:55:39 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
48
- INFO: 2025-12-01T11:55:39 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
49
- INFO: 10.16.21.26:3194 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team HTTP/1.1" 403 Forbidden
50
- INFO: 10.16.2.97:4550 - "GET /api/v1/inventory/my-stats HTTP/1.1" 422 Unprocessable Entity
51
- INFO: 10.16.2.97:36301 - "GET /api/v1/inventory/my-inventory HTTP/1.1" 422 Unprocessable Entity
52
- INFO: 2025-12-01T11:55:41 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
53
- INFO: 2025-12-01T11:55:41 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
54
- INFO: 2025-12-01T11:55:41 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
55
- INFO: 2025-12-01T11:55:41 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
56
- INFO: 2025-12-01T11:55:41 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
57
- INFO: 2025-12-01T11:55:41 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
58
- INFO: 10.16.21.26:3194 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team HTTP/1.1" 403 Forbidden
59
- INFO: 10.16.25.209:63696 - "GET /api/v1/inventory/my-inventory HTTP/1.1" 422 Unprocessable Entity
60
- INFO: 10.16.30.4:63993 - "GET /api/v1/inventory/my-stats HTTP/1.1" 422 Unprocessable Entity
61
- INFO: 10.16.2.97:30975 - "GET /health HTTP/1.1" 200 OK
62
- INFO: 10.16.21.26:34243 - "GET /health HTTP/1.1" 200 OK
63
- INFO: 2025-12-01T11:56:32 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
64
- INFO: 2025-12-01T11:56:32 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
65
- INFO: 10.16.34.155:22786 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions HTTP/1.1" 200 OK
66
- INFO: 10.16.21.26:34243 - "GET /health HTTP/1.1" 200 OK
67
- INFO: 10.16.21.26:11186 - "GET /health HTTP/1.1" 200 OK
68
- INFO: 10.16.21.26:53426 - "GET /health HTTP/1.1" 200 OK
69
- INFO: 10.16.25.209:24760 - "GET /health HTTP/1.1" 200 OK
70
- INFO: 10.16.11.176:39354 - "GET /health HTTP/1.1" 200 OK
71
- INFO: 2025-12-01T11:58:49 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
72
- INFO: 2025-12-01T11:58:49 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
73
- INFO: 2025-12-01T11:58:49 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
74
- INFO: 2025-12-01T11:58:49 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
75
- INFO: 2025-12-01T11:58:49 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
76
- INFO: 2025-12-01T11:58:49 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
77
- INFO: 10.16.34.155:4008 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team HTTP/1.1" 403 Forbidden
78
- INFO: 10.16.25.209:21996 - "GET /api/v1/inventory/my-inventory HTTP/1.1" 422 Unprocessable Entity
79
- INFO: 10.16.21.26:46879 - "GET /api/v1/inventory/my-stats HTTP/1.1" 422 Unprocessable Entity
80
- INFO: 2025-12-01T11:58:51 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
81
- INFO: 2025-12-01T11:58:51 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
82
- INFO: 2025-12-01T11:58:51 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
83
- INFO: 2025-12-01T11:58:51 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
84
- INFO: 2025-12-01T11:58:51 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
85
- INFO: 2025-12-01T11:58:51 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
86
- INFO: 10.16.11.176:14223 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team HTTP/1.1" 403 Forbidden
87
- INFO: 10.16.25.209:21996 - "GET /api/v1/inventory/my-inventory HTTP/1.1" 422 Unprocessable Entity
88
- INFO: 10.16.34.155:4008 - "GET /api/v1/inventory/my-stats HTTP/1.1" 422 Unprocessable Entity
89
- INFO: 10.16.25.209:10306 - "GET /health HTTP/1.1" 200 OK
90
- INFO: 10.16.11.176:55763 - "GET /health HTTP/1.1" 200 OK
91
- INFO: 10.16.11.176:39854 - "GET /health HTTP/1.1" 200 OK
92
- INFO: 10.16.34.155:38867 - "GET /health HTTP/1.1" 200 OK
93
- INFO: 2025-12-01T11:59:58 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
94
- INFO: 2025-12-01T11:59:58 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
95
- INFO: 10.16.21.26:8782 - "GET /api/v1/inventory/my-stats HTTP/1.1" 422 Unprocessable Entity
96
- INFO: 2025-12-01T11:59:58 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
97
- INFO: 2025-12-01T11:59:58 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
98
- INFO: 10.16.30.4:13627 - "GET /api/v1/inventory/my-inventory?is_returned=false HTTP/1.1" 422 Unprocessable Entity
99
- INFO: 2025-12-01T11:59:59 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
100
- INFO: 2025-12-01T11:59:59 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
101
- INFO: 10.16.30.4:13627 - "GET /api/v1/inventory/my-stats HTTP/1.1" 422 Unprocessable Entity
102
- INFO: 2025-12-01T12:00:00 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
103
- INFO: 2025-12-01T12:00:00 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
104
- INFO: 10.16.30.4:13627 - "GET /api/v1/inventory/my-inventory?is_returned=false HTTP/1.1" 422 Unprocessable Entity
105
- INFO: 10.16.11.176:2148 - "GET /health HTTP/1.1" 200 OK
106
- INFO: 10.16.11.176:13151 - "GET /health HTTP/1.1" 200 OK
107
- INFO: 10.16.11.176:18032 - "GET /health HTTP/1.1" 200 OK
108
- INFO: 10.16.2.97:51256 - "GET /health HTTP/1.1" 200 OK
109
- INFO: 10.16.25.209:25448 - "GET /health HTTP/1.1" 200 OK
110
- INFO: 10.16.21.26:56822 - "GET /health HTTP/1.1" 200 OK
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ===== Application Startup at 2025-12-01 12:07:44 =====
2
 
3
  INFO: Started server process [7]
4
  INFO: Waiting for application startup.
5
+ INFO: 2025-12-01T12:07:56 - app.main: ============================================================
6
+ INFO: 2025-12-01T12:07:56 - app.main: 🚀 SwiftOps API v1.0.0 | PRODUCTION
7
+ INFO: 2025-12-01T12:07:56 - app.main: 📊 Dashboard: Enabled
8
+ INFO: 2025-12-01T12:07:56 - app.main: ============================================================
9
+ INFO: 2025-12-01T12:07:56 - app.main: 📦 Database:
10
+ INFO: 2025-12-01T12:07:56 - app.main: ✓ Connected | 45 tables | 6 users
11
+ INFO: 2025-12-01T12:07:56 - app.main: 💾 Cache & Sessions:
12
+ INFO: 2025-12-01T12:07:57 - app.services.otp_service: ✅ OTP Service initialized with Redis storage
13
+ INFO: 2025-12-01T12:07:57 - app.main: ✓ Redis: Connected
14
+ INFO: 2025-12-01T12:07:57 - app.main: 🔌 External Services:
15
+ INFO: 2025-12-01T12:07:58 - app.main: ✓ Cloudinary: Connected
16
+ INFO: 2025-12-01T12:07:58 - app.main: ✓ Resend: Configured
17
+ INFO: 2025-12-01T12:07:58 - app.main: ○ WASender: Failed
18
+ INFO: 2025-12-01T12:07:58 - app.main: ✓ Supabase: Connected | 6 buckets
19
+ INFO: 2025-12-01T12:07:58 - app.main: ============================================================
20
+ INFO: 2025-12-01T12:07:58 - app.main: ✅ Startup complete | Ready to serve requests
21
+ INFO: 2025-12-01T12:07:58 - app.main: ============================================================
22
  INFO: Application startup complete.
23
  INFO: Uvicorn running on http://0.0.0.0:7860 (Press CTRL+C to quit)
24
+ INFO: 10.16.2.97:46248 - "GET /health HTTP/1.1" 200 OK
25
+ INFO: 10.16.11.176:15490 - "GET /health HTTP/1.1" 200 OK
26
+ INFO: 2025-12-01T12:08:10 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
27
+ INFO: 2025-12-01T12:08:10 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
28
+ INFO: 10.16.2.97:60279 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
29
+ INFO: 2025-12-01T12:08:10 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
30
+ INFO: 2025-12-01T12:08:10 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
31
+ INFO: 10.16.2.97:60279 - "GET /api/v1/inventory/my-stats HTTP/1.1" 200 OK
32
+ INFO: 2025-12-01T12:08:11 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
33
+ INFO: 2025-12-01T12:08:11 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
34
+ INFO: 10.16.34.155:13956 - "GET /api/v1/inventory/my-inventory?is_returned=false HTTP/1.1" 200 OK
35
+ INFO: 2025-12-01T12:08:11 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
36
+ INFO: 2025-12-01T12:08:11 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
37
+ INFO: 10.16.34.155:28338 - "GET /api/v1/auth/me/preferences/available-apps HTTP/1.1" 200 OK
38
+ INFO: 2025-12-01T12:08:11 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
39
+ INFO: 2025-12-01T12:08:11 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
40
+ INFO: 10.16.34.155:15353 - "GET /api/v1/auth/me/preferences HTTP/1.1" 200 OK
41
+ INFO: 2025-12-01T12:08:11 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
42
+ INFO: 2025-12-01T12:08:11 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
43
+ INFO: 10.16.25.209:8012 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team HTTP/1.1" 403 Forbidden
44
+ INFO: 2025-12-01T12:08:12 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
45
+ INFO: 2025-12-01T12:08:12 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
46
+ INFO: 10.16.34.155:15353 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/team HTTP/1.1" 403 Forbidden
47
+ INFO: 10.16.2.97:45619 - "GET /health HTTP/1.1" 200 OK
48
+ INFO: 10.16.2.97:37061 - "GET /health HTTP/1.1" 200 OK
49
+ INFO: 10.16.21.26:34899 - "GET /health HTTP/1.1" 200 OK
50
+ INFO: 10.16.25.209:1916 - "GET /health HTTP/1.1" 200 OK
51
+ INFO: 10.16.34.155:55077 - "GET /health HTTP/1.1" 200 OK
52
+ INFO: 10.16.25.209:45426 - "GET /health HTTP/1.1" 200 OK
53
+ INFO: 10.16.34.155:1699 - "GET /health HTTP/1.1" 200 OK
54
+ INFO: 2025-12-01T12:10:38 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
55
+ INFO: 2025-12-01T12:10:38 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
56
+ INFO: 2025-12-01T12:10:38 - app.core.supabase_auth: Session refreshed successfully
57
+ INFO: 2025-12-01T12:10:38 - app.api.v1.auth: Token refreshed successfully for: viyisa8151@feralrex.com
58
+ INFO: 10.16.21.26:56280 - "POST /api/v1/auth/refresh-token HTTP/1.1" 200 OK
59
+ INFO: 10.16.11.176:61956 - "GET /api/v1/analytics/user/overview?limit=50 HTTP/1.1" 200 OK
60
+ INFO: 10.16.11.176:1327 - "GET /health HTTP/1.1" 200 OK
61
+ INFO: 10.16.25.209:65332 - "GET /health HTTP/1.1" 200 OK
62
+ INFO: 10.16.2.97:28641 - "GET /health HTTP/1.1" 200 OK
63
+ INFO: 2025-12-01T12:12:26 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
64
+ INFO: 2025-12-01T12:12:26 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
65
+ INFO: 10.16.25.209:11082 - "GET /api/v1/auth/me/preferences/available-apps HTTP/1.1" 200 OK
66
+ INFO: 2025-12-01T12:12:27 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
67
+ INFO: 2025-12-01T12:12:27 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
68
+ INFO: 10.16.21.26:11251 - "GET /api/v1/auth/me/preferences HTTP/1.1" 200 OK
69
+ INFO: 10.16.25.209:26762 - "GET /health HTTP/1.1" 200 OK
70
+ INFO: 10.16.34.155:12206 - "GET /health HTTP/1.1" 200 OK
71
+ INFO: 10.16.2.97:15835 - "GET /health HTTP/1.1" 200 OK
72
+ INFO: 10.16.11.176:46613 - "GET /health HTTP/1.1" 200 OK
73
+ INFO: 10.16.11.176:15692 - "GET /health HTTP/1.1" 200 OK
74
+ INFO: 10.16.21.26:10887 - "GET /health HTTP/1.1" 200 OK
75
+ INFO: 2025-12-01T12:17:29 - app.core.supabase_auth: Session refreshed successfully
76
+ INFO: 2025-12-01T12:17:29 - app.api.v1.auth: Token refreshed successfully for: viyisa8151@feralrex.com
77
+ INFO: 10.16.2.97:28860 - "POST /api/v1/auth/refresh-token HTTP/1.1" 200 OK
78
+ INFO: 2025-12-01T12:17:30 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
79
+ INFO: 2025-12-01T12:17:30 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
80
+ INFO: 10.16.34.155:5509 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
81
+ INFO: 2025-12-01T12:17:31 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
82
+ INFO: 2025-12-01T12:17:31 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
83
+ INFO: 10.16.2.97:28860 - "GET /api/v1/auth/me/preferences/available-apps HTTP/1.1" 200 OK
84
+ INFO: 2025-12-01T12:17:31 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
85
+ INFO: 2025-12-01T12:17:31 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
86
+ INFO: 10.16.25.209:48441 - "GET /api/v1/auth/me/preferences HTTP/1.1" 200 OK
87
+ INFO: 2025-12-01T12:17:31 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
88
+ INFO: 2025-12-01T12:17:31 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
89
+ INFO: 10.16.34.155:5509 - "GET /api/v1/analytics/user/overview?limit=50 HTTP/1.1" 200 OK
90
+ INFO: 2025-12-01T12:17:31 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
91
+ INFO: 2025-12-01T12:17:31 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
92
+ INFO: 10.16.34.155:5509 - "GET /api/v1/projects?page=1&per_page=100&status=active HTTP/1.1" 200 OK
93
+ INFO: 2025-12-01T12:17:35 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
94
+ INFO: 2025-12-01T12:17:35 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
95
+ INFO: 2025-12-01T12:17:35 - app.services.audit_service: Audit log created: logout on auth by system
96
+ INFO: 2025-12-01T12:17:35 - app.api.v1.auth: User logged out: viyisa8151@feralrex.com
97
+ INFO: 10.16.2.97:53015 - "POST /api/v1/auth/logout HTTP/1.1" 200 OK
98
+ INFO: 2025-12-01T12:17:41 - app.core.supabase_auth: User signed in successfully: brea.0@nembors.com
99
+ INFO: 2025-12-01T12:17:41 - app.services.audit_service: Audit log created: login on auth by brea.0@nembors.com
100
+ INFO: 2025-12-01T12:17:41 - app.api.v1.auth: User logged in successfully: brea.0@nembors.com
101
+ INFO: 10.16.2.97:39669 - "POST /api/v1/auth/login HTTP/1.1" 200 OK
102
+ INFO: 2025-12-01T12:17:41 - app.api.deps: Checking active user: 58d694e5-9f73-4a7a-986c-77784144787e, is_active: True, type: <class 'bool'>
103
+ INFO: 2025-12-01T12:17:41 - app.api.deps: User 58d694e5-9f73-4a7a-986c-77784144787e is active - proceeding
104
+ INFO: 10.16.34.155:20374 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
105
+ INFO: 2025-12-01T12:17:42 - app.api.deps: Checking active user: 58d694e5-9f73-4a7a-986c-77784144787e, is_active: True, type: <class 'bool'>
106
+ INFO: 2025-12-01T12:17:42 - app.api.deps: User 58d694e5-9f73-4a7a-986c-77784144787e is active - proceeding
107
+ INFO: 10.16.34.155:20374 - "GET /api/v1/users?skip=0&limit=20 HTTP/1.1" 200 OK
108
+ INFO: 2025-12-01T12:17:42 - app.api.deps: Checking active user: 58d694e5-9f73-4a7a-986c-77784144787e, is_active: True, type: <class 'bool'>
109
+ INFO: 2025-12-01T12:17:42 - app.api.deps: User 58d694e5-9f73-4a7a-986c-77784144787e is active - proceeding
110
+ INFO: 10.16.11.176:63750 - "GET /api/v1/clients?skip=0&limit=20 HTTP/1.1" 200 OK
111
+ INFO: 2025-12-01T12:17:42 - app.api.deps: Checking active user: 58d694e5-9f73-4a7a-986c-77784144787e, is_active: True, type: <class 'bool'>
112
+ INFO: 2025-12-01T12:17:42 - app.api.deps: User 58d694e5-9f73-4a7a-986c-77784144787e is active - proceeding
113
+ INFO: 10.16.34.155:1454 - "GET /api/v1/contractors?skip=0&limit=20 HTTP/1.1" 200 OK
114
+ INFO: 10.16.34.155:1454 - "GET /api/v1/audit-logs?skip=0&limit=20 HTTP/1.1" 200 OK
115
+ INFO: 2025-12-01T12:18:09 - app.api.deps: Checking active user: 58d694e5-9f73-4a7a-986c-77784144787e, is_active: True, type: <class 'bool'>
116
+ INFO: 2025-12-01T12:18:09 - app.api.deps: User 58d694e5-9f73-4a7a-986c-77784144787e is active - proceeding
117
+ INFO: 2025-12-01T12:18:09 - app.services.audit_service: Audit log created: logout on auth by system
118
+ INFO: 2025-12-01T12:18:09 - app.api.v1.auth: User logged out: brea.0@nembors.com
119
+ INFO: 10.16.11.176:57564 - "POST /api/v1/auth/logout HTTP/1.1" 200 OK
120
+ INFO: 2025-12-01T12:18:12 - app.core.supabase_auth: User signed in successfully: nadina73@nembors.com
121
+ INFO: 2025-12-01T12:18:12 - app.services.audit_service: Audit log created: login on auth by nadina73@nembors.com
122
+ INFO: 2025-12-01T12:18:12 - app.api.v1.auth: User logged in successfully: nadina73@nembors.com
123
+ INFO: 10.16.25.209:1669 - "POST /api/v1/auth/login HTTP/1.1" 200 OK
124
+ INFO: 2025-12-01T12:18:13 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
125
+ INFO: 2025-12-01T12:18:13 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
126
+ INFO: 10.16.11.176:15714 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
127
+ INFO: 2025-12-01T12:18:13 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
128
+ INFO: 2025-12-01T12:18:13 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
129
+ INFO: 10.16.11.176:15714 - "GET /api/v1/analytics/user/overview HTTP/1.1" 200 OK
130
+ INFO: 2025-12-01T12:18:14 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
131
+ INFO: 2025-12-01T12:18:14 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
132
+ INFO: 10.16.11.176:15714 - "GET /api/v1/projects?page=1&per_page=100 HTTP/1.1" 200 OK
133
+ INFO: 2025-12-01T12:18:21 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
134
+ INFO: 2025-12-01T12:18:21 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
135
+ INFO: 10.16.25.209:36558 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
136
+ INFO: 10.16.25.209:18317 - "GET /health HTTP/1.1" 200 OK
137
+ INFO: 2025-12-01T12:18:22 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
138
+ INFO: 2025-12-01T12:18:22 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
139
+ INFO: 10.16.25.209:18317 - "GET /api/v1/auth/me/preferences/available-apps HTTP/1.1" 200 OK
140
+ INFO: 2025-12-01T12:18:22 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
141
+ INFO: 2025-12-01T12:18:22 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
142
+ INFO: 10.16.21.26:25381 - "GET /api/v1/auth/me/preferences HTTP/1.1" 200 OK
143
+ INFO: 2025-12-01T12:18:22 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
144
+ INFO: 2025-12-01T12:18:22 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
145
+ INFO: 10.16.21.26:22703 - "GET /api/v1/analytics/user/overview HTTP/1.1" 200 OK
146
+ INFO: 2025-12-01T12:18:22 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
147
+ INFO: 2025-12-01T12:18:22 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
148
+ INFO: 10.16.2.97:7569 - "GET /api/v1/projects?page=1&per_page=100 HTTP/1.1" 200 OK
149
+ INFO: 2025-12-01T12:18:24 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
150
+ INFO: 2025-12-01T12:18:24 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
151
+ INFO: 2025-12-01T12:18:25 - app.services.audit_service: Audit log created: update on user_preferences by nadina73@nembors.com
152
+ INFO: 2025-12-01T12:18:25 - app.api.v1.auth: Preferences updated for user: nadina73@nembors.com
153
+ INFO: 10.16.34.155:32296 - "PUT /api/v1/auth/me/preferences HTTP/1.1" 200 OK
154
+ INFO: 2025-12-01T12:18:25 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
155
+ INFO: 2025-12-01T12:18:25 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
156
+ INFO: 2025-12-01T12:18:25 - app.services.dashboard_service: Dashboard cache MISS for project 0ade6bd1-e492-4e25-b681-59f42058d29a, user c5cf92be-4172-4fe2-af5c-f05d83b3a938 - building fresh data
157
+ INFO: 2025-12-01T12:18:25 - app.services.dashboard_service: Built and cached dashboard for project 0ade6bd1-e492-4e25-b681-59f42058d29a
158
+ INFO: 10.16.2.97:7569 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/dashboard HTTP/1.1" 200 OK
159
+ INFO: 2025-12-01T12:18:25 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
160
+ INFO: 2025-12-01T12:18:25 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
161
+ INFO: 10.16.25.209:42564 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
162
+ INFO: 10.16.11.176:17133 - "GET /api/v1/notifications?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a&page_size=50 HTTP/1.1" 200 OK
163
+ INFO: 10.16.34.155:32296 - "GET /api/v1/tickets/stats?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a HTTP/1.1" 200 OK
164
+ INFO: 2025-12-01T12:18:37 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
165
+ INFO: 2025-12-01T12:18:37 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
166
+ INFO: 10.16.25.209:16097 - "GET /api/v1/inventory/stats?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a HTTP/1.1" 200 OK
167
+ INFO: 2025-12-01T12:18:37 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
168
+ INFO: 2025-12-01T12:18:37 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
169
+ INFO: 10.16.34.155:30714 - "GET /api/v1/inventory?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a&page=1&page_size=20 HTTP/1.1" 200 OK
170
+ INFO: 2025-12-01T12:18:43 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
171
+ INFO: 2025-12-01T12:18:43 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
172
+ INFO: 10.16.2.97:39846 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions HTTP/1.1" 200 OK
173
+ INFO: 10.16.11.176:24668 - "GET /health HTTP/1.1" 200 OK
174
+ INFO: 2025-12-01T12:19:00 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
175
+ INFO: 2025-12-01T12:19:00 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
176
+ INFO: 2025-12-01T12:19:00 - app.services.inventory_service: Auto-created task dec302b0-3996-4e08-ab81-efc3eea6dd23 for distribution 6dbd4854-4864-47f3-bd22-a8031df4b179
177
+ INFO: 2025-12-01T12:19:00 - app.services.inventory_service: Created distribution: 6dbd4854-4864-47f3-bd22-a8031df4b179 for inventory 50aaaf7b-787a-43d3-83dc-4fd07ca3b26a
178
+ INFO: 2025-12-01T12:19:00 - app.services.audit_service: Audit log created: create on inventory_distribution by nadina73@nembors.com
179
+ INFO: 10.16.11.176:28081 - "POST /api/v1/inventory/distributions HTTP/1.1" 201 Created
180
+ INFO: 2025-12-01T12:19:00 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
181
+ INFO: 2025-12-01T12:19:00 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
182
+ INFO: 10.16.2.97:5138 - "GET /api/v1/inventory/stats?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a HTTP/1.1" 200 OK
183
+ INFO: 2025-12-01T12:19:00 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
184
+ INFO: 2025-12-01T12:19:00 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
185
+ INFO: 10.16.21.26:62784 - "GET /api/v1/inventory?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a&page=1&page_size=20 HTTP/1.1" 200 OK
186
+ INFO: 2025-12-01T12:19:00 - app.api.deps: Checking active user: c5cf92be-4172-4fe2-af5c-f05d83b3a938, is_active: True, type: <class 'bool'>
187
+ INFO: 2025-12-01T12:19:00 - app.api.deps: User c5cf92be-4172-4fe2-af5c-f05d83b3a938 is active - proceeding
188
+ INFO: 10.16.34.155:56903 - "GET /api/v1/inventory?project_id=0ade6bd1-e492-4e25-b681-59f42058d29a&page=1&page_size=20 HTTP/1.1" 200 OK
189
+ INFO: 10.16.25.209:36635 - "GET /health HTTP/1.1" 200 OK
190
+ INFO: 10.16.34.155:54495 - "GET /health HTTP/1.1" 200 OK
191
+ INFO: 10.16.11.176:46367 - "GET /health HTTP/1.1" 200 OK
192
+ INFO: 10.16.2.97:47167 - "GET /health HTTP/1.1" 200 OK
193
+ INFO: 2025-12-01T12:20:14 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
194
+ INFO: 2025-12-01T12:20:14 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
195
+ INFO: 10.16.21.26:56357 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
196
+ INFO: 2025-12-01T12:20:15 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
197
+ INFO: 2025-12-01T12:20:15 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
198
+ INFO: 10.16.2.97:47167 - "GET /api/v1/auth/me/preferences/available-apps HTTP/1.1" 200 OK
199
+ INFO: 2025-12-01T12:20:15 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
200
+ INFO: 2025-12-01T12:20:15 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
201
+ INFO: 10.16.2.97:38566 - "GET /api/v1/auth/me/preferences HTTP/1.1" 200 OK
202
+ INFO: 2025-12-01T12:20:15 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
203
+ INFO: 2025-12-01T12:20:15 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
204
+ INFO: 10.16.25.209:51750 - "GET /api/v1/inventory/my-inventory?is_returned=false HTTP/1.1" 200 OK
205
+ INFO: 2025-12-01T12:20:15 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
206
+ INFO: 2025-12-01T12:20:15 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
207
+ INFO: 10.16.25.209:41694 - "GET /api/v1/inventory/my-stats HTTP/1.1" 200 OK
208
+ INFO: 10.16.2.97:61877 - "GET /health HTTP/1.1" 200 OK
209
+ INFO: 10.16.2.97:43812 - "GET /health HTTP/1.1" 200 OK
210
+ INFO: 2025-12-01T12:20:34 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
211
+ INFO: 2025-12-01T12:20:34 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
212
+ INFO: 10.16.11.176:47479 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions HTTP/1.1" 200 OK
213
+ INFO: 10.16.11.176:30897 - "GET /health HTTP/1.1" 200 OK
214
+ INFO: 10.16.34.155:51325 - "GET /health HTTP/1.1" 200 OK
215
+ INFO: 10.16.2.97:17849 - "GET /health HTTP/1.1" 200 OK
216
+ INFO: 2025-12-01T12:22:20 - app.core.supabase_auth: Session refreshed successfully
217
+ INFO: 2025-12-01T12:22:20 - app.api.v1.auth: ✅ Token refreshed successfully for: viyisa8151@feralrex.com
218
+ INFO: 10.16.34.155:44021 - "POST /api/v1/auth/refresh-token HTTP/1.1" 200 OK
219
+ INFO: 10.16.34.155:44021 - "GET /health HTTP/1.1" 200 OK
220
+ INFO: 10.16.11.176:65053 - "GET /health HTTP/1.1" 200 OK
221
+ INFO: 10.16.25.209:13863 - "GET /health HTTP/1.1" 200 OK
222
+ INFO: 10.16.11.176:51122 - "GET /health HTTP/1.1" 200 OK
223
+ INFO: 10.16.11.176:6011 - "GET /health HTTP/1.1" 200 OK
224
+ INFO: 10.16.2.97:40137 - "GET /health HTTP/1.1" 200 OK
225
+ INFO: 10.16.21.26:23111 - "GET /health HTTP/1.1" 200 OK
226
+ INFO: 10.16.2.97:62756 - "GET /health HTTP/1.1" 200 OK
227
+ INFO: 10.16.21.26:30132 - "GET /health HTTP/1.1" 200 OK
228
+ INFO: 10.16.2.97:34928 - "GET /health HTTP/1.1" 200 OK
229
+ INFO: 2025-12-01T12:25:56 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
230
+ INFO: 2025-12-01T12:25:56 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
231
+ INFO: 10.16.25.209:8810 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions HTTP/1.1" 200 OK
232
+ INFO: 2025-12-01T12:26:04 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
233
+ INFO: 2025-12-01T12:26:04 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
234
+ INFO: 10.16.11.176:4159 - "GET /api/v1/auth/me HTTP/1.1" 200 OK
235
+ INFO: 10.16.2.97:28650 - "GET /health HTTP/1.1" 200 OK
236
+ INFO: 2025-12-01T12:26:04 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
237
+ INFO: 2025-12-01T12:26:04 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
238
+ INFO: 10.16.2.97:28650 - "GET /api/v1/auth/me/preferences HTTP/1.1" 200 OK
239
+ INFO: 2025-12-01T12:26:04 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
240
+ INFO: 2025-12-01T12:26:04 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
241
+ INFO: 10.16.25.209:48496 - "GET /api/v1/auth/me/preferences/available-apps HTTP/1.1" 200 OK
242
+ INFO: 2025-12-01T12:26:04 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
243
+ INFO: 2025-12-01T12:26:04 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
244
+ INFO: 10.16.21.26:15361 - "GET /api/v1/inventory/my-stats HTTP/1.1" 200 OK
245
+ INFO: 2025-12-01T12:26:04 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
246
+ INFO: 2025-12-01T12:26:04 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
247
+ INFO: 10.16.25.209:11866 - "GET /api/v1/inventory/my-inventory?is_returned=false HTTP/1.1" 200 OK
248
+ INFO: 10.16.21.26:53557 - "GET /health HTTP/1.1" 200 OK
249
+ INFO: 10.16.2.97:16817 - "GET /health HTTP/1.1" 200 OK
250
+ INFO: 10.16.21.26:54221 - "GET /health HTTP/1.1" 200 OK
251
+ INFO: 10.16.2.97:54348 - "GET /health HTTP/1.1" 200 OK
252
+ INFO: 10.16.11.176:11459 - "GET /health HTTP/1.1" 200 OK
253
+ INFO: 10.16.34.155:58828 - "GET /health HTTP/1.1" 200 OK
254
+ INFO: 10.16.34.155:13148 - "GET /health HTTP/1.1" 200 OK
255
+ INFO: 10.16.25.209:32071 - "GET /health HTTP/1.1" 200 OK
256
+ INFO: 10.16.2.97:27660 - "GET /health HTTP/1.1" 200 OK
257
+ INFO: 10.16.21.26:62156 - "GET /health HTTP/1.1" 200 OK
258
+ INFO: 10.16.2.97:25205 - "GET /health HTTP/1.1" 200 OK
259
+ INFO: 10.16.25.209:43569 - "GET /health HTTP/1.1" 200 OK
260
+ INFO: 10.16.34.155:34778 - "GET /health HTTP/1.1" 200 OK
261
+ INFO: 10.16.11.176:26737 - "GET /health HTTP/1.1" 200 OK
262
+ INFO: 10.16.21.26:22972 - "GET /health HTTP/1.1" 200 OK
263
+ INFO: 10.16.11.176:3952 - "GET /health HTTP/1.1" 200 OK
264
+ INFO: 10.16.21.26:53826 - "GET /health HTTP/1.1" 200 OK
265
+ INFO: 10.16.34.155:53399 - "GET /health HTTP/1.1" 200 OK
266
+ INFO: 2025-12-01T12:33:03 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
267
+ INFO: 2025-12-01T12:33:03 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
268
+ INFO: 10.16.11.176:61844 - "GET /api/v1/projects/0ade6bd1-e492-4e25-b681-59f42058d29a/regions HTTP/1.1" 200 OK
269
+ INFO: 2025-12-01T12:33:14 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
270
+ INFO: 2025-12-01T12:33:14 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
271
+ INFO: 10.16.21.26:60469 - "GET /api/v1/inventory/regions/4cd27765-5720-4cc0-872e-bf0da3cd1898/available HTTP/1.1" 200 OK
272
+ INFO: 10.16.2.97:53828 - "GET /health HTTP/1.1" 200 OK
273
+ INFO: 2025-12-01T12:33:39 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
274
+ INFO: 2025-12-01T12:33:39 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
275
+ INFO: 10.16.11.176:45948 - "POST /api/v1/inventory/assignments HTTP/1.1" 422 Unprocessable Entity
276
+ INFO: 2025-12-01T12:33:40 - app.api.deps: Checking active user: 43b778b0-2062-4724-abbb-916a4835a9b0, is_active: True, type: <class 'bool'>
277
+ INFO: 2025-12-01T12:33:40 - app.api.deps: User 43b778b0-2062-4724-abbb-916a4835a9b0 is active - proceeding
278
+ INFO: 10.16.11.176:45948 - "POST /api/v1/inventory/assignments HTTP/1.1" 422 Unprocessable Entity
279
+ INFO: 10.16.2.97:8160 - "GET /health HTTP/1.1" 200 OK
280
+ INFO: 10.16.2.97:41666 - "GET /health HTTP/1.1" 200 OK
281
+ INFO: 10.16.11.176:54430 - "GET /health HTTP/1.1" 200 OK
282
+ INFO: 10.16.11.176:24551 - "GET /health HTTP/1.1" 200 OK
283
+ INFO: 10.16.34.155:31327 - "GET /health HTTP/1.1" 200 OK
284
+ INFO: 10.16.25.209:1818 - "GET /health HTTP/1.1" 200 OK
285
+ INFO: 10.16.11.176:43989 - "GET /health HTTP/1.1" 200 OK
src/app/api/v1/projects.py CHANGED
@@ -814,6 +814,7 @@ async def get_project_team(
814
  - project_manager: Can view their own project teams
815
  - sales_manager: Can view their organization's project teams
816
  - dispatcher: Can view their contractor's project teams
 
817
 
818
  **Query Parameters:**
819
  - role: Filter by system role (field_agent, dispatcher, etc.)
@@ -860,6 +861,21 @@ async def get_project_team(
860
  status_code=status.HTTP_403_FORBIDDEN,
861
  detail="You can only view team members for your contractor's projects"
862
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
863
  else:
864
  raise HTTPException(
865
  status_code=status.HTTP_403_FORBIDDEN,
 
814
  - project_manager: Can view their own project teams
815
  - sales_manager: Can view their organization's project teams
816
  - dispatcher: Can view their contractor's project teams
817
+ - field_agent: Can view team members for projects they're assigned to (needed for inventory transfers)
818
 
819
  **Query Parameters:**
820
  - role: Filter by system role (field_agent, dispatcher, etc.)
 
861
  status_code=status.HTTP_403_FORBIDDEN,
862
  detail="You can only view team members for your contractor's projects"
863
  )
864
+ elif current_user.role == 'field_agent':
865
+ # Field agents can view team members of projects they're assigned to
866
+ # This is needed for inventory transfers (selecting recipient agent)
867
+ team_member = db.query(ProjectTeam).filter(
868
+ ProjectTeam.project_id == project_id,
869
+ ProjectTeam.user_id == current_user.id,
870
+ ProjectTeam.deleted_at == None,
871
+ ProjectTeam.removed_at == None
872
+ ).first()
873
+
874
+ if not team_member:
875
+ raise HTTPException(
876
+ status_code=status.HTTP_403_FORBIDDEN,
877
+ detail="You can only view team members for projects you're assigned to"
878
+ )
879
  else:
880
  raise HTTPException(
881
  status_code=status.HTTP_403_FORBIDDEN,
src/app/schemas/inventory.py CHANGED
@@ -258,9 +258,9 @@ class DistributionListResponse(BaseModel):
258
  # ============================================
259
 
260
  class AssignmentCreate(BaseModel):
261
- """Issue unit to field agent"""
262
  project_inventory_distribution_id: UUID
263
- user_id: UUID
264
  ticket_id: Optional[UUID] = None
265
 
266
  unit_identifier: str = Field(..., description="Serial number, box number, or unique ID")
 
258
  # ============================================
259
 
260
  class AssignmentCreate(BaseModel):
261
+ """Issue unit to field agent (self-service or admin-assisted)"""
262
  project_inventory_distribution_id: UUID
263
+ user_id: Optional[UUID] = Field(None, description="Target user (optional for self-service, auto-set to current user)")
264
  ticket_id: Optional[UUID] = None
265
 
266
  unit_identifier: str = Field(..., description="Serial number, box number, or unique ID")
src/app/services/inventory_service.py CHANGED
@@ -542,6 +542,10 @@ class InventoryService:
542
  detail=f"Distribution not found: {data.project_inventory_distribution_id}"
543
  )
544
 
 
 
 
 
545
  # For field agents, force user_id to themselves (can't record for others)
546
  if current_user.role == AppRole.FIELD_AGENT.value:
547
  data.user_id = current_user.id
 
542
  detail=f"Distribution not found: {data.project_inventory_distribution_id}"
543
  )
544
 
545
+ # Auto-set user_id if not provided (self-service)
546
+ if data.user_id is None:
547
+ data.user_id = current_user.id
548
+
549
  # For field agents, force user_id to themselves (can't record for others)
550
  if current_user.role == AppRole.FIELD_AGENT.value:
551
  data.user_id = current_user.id