@controleonline/ui-common 1.2.70 → 1.2.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/.github/actions/workers/manager/action.yml +147 -0
  2. package/.github/actions/workers/qa/action.yml +44 -0
  3. package/.github/actions/workers/security/action.yml +44 -0
  4. package/.github/actions/workers/technical-documenter/action.yml +51 -0
  5. package/.github/workflows/manager-worker.yml +168 -0
  6. package/.github/workflows/publish-npm.yml +45 -0
  7. package/.gitmodules +3 -0
  8. package/AGENTS.md +6 -0
  9. package/README.md +14 -0
  10. package/package.json +32 -28
  11. package/src/api/fetch.js +1 -1
  12. package/src/api/index.js +328 -58
  13. package/src/react/components/AddImportModal.js +95 -111
  14. package/src/react/components/AnimatedModal.js +171 -0
  15. package/src/react/components/AnimatedModal.styles.js +21 -0
  16. package/src/react/components/AppTypeSwitcher.js +164 -0
  17. package/src/react/components/AppTypeSwitcher.styles.js +109 -0
  18. package/src/react/components/BackgroundRuntimeBridge.js +5 -4
  19. package/src/react/components/BottomNavigationBar.config.js +211 -231
  20. package/src/react/components/BottomNavigationBar.js +86 -31
  21. package/src/react/components/BottomNavigationBar.styles.js +118 -110
  22. package/src/react/components/CategoryForm.js +52 -35
  23. package/src/react/components/DefaultProvider.native.js +194 -156
  24. package/src/react/components/DefaultProvider.web.js +188 -112
  25. package/src/react/components/DeliveryPushBridge.native.js +2 -2
  26. package/src/react/components/DeviceAlertSoundService.js +3 -3
  27. package/src/react/components/KioskModeBridge.js +2 -2
  28. package/src/react/components/LauncherModeBridge.js +2 -2
  29. package/src/react/components/ManagerPushBridge.native.js +2 -2
  30. package/src/react/components/NetworkPrinterPreviewModal.js +249 -0
  31. package/src/react/components/NetworkPrinterPreviewModal.styles.js +159 -0
  32. package/src/react/components/RemoteCheckoutService.js +28 -20
  33. package/src/react/components/RuntimeBottomNavigationBar.js +146 -119
  34. package/src/react/components/RuntimeInfoFooter.js +137 -45
  35. package/src/react/components/RuntimeInfoFooter.styles.js +3 -0
  36. package/src/react/components/StateStore.js +258 -0
  37. package/src/react/components/UnifiedPaymentBar.js +7 -4
  38. package/src/react/components/UserAvatar.js +160 -0
  39. package/src/react/components/WebsocketListener.native.js +11 -11
  40. package/src/react/components/integrations/IntegrationHero/index.js +48 -0
  41. package/src/react/components/integrations/IntegrationHero/styles.js +57 -0
  42. package/src/react/components/integrations/IntegrationTabs/index.js +89 -0
  43. package/src/react/components/integrations/IntegrationTabs/styles.js +44 -0
  44. package/src/react/config/deviceConfigBootstrap.js +71 -30
  45. package/src/react/css/orders.js +72 -0
  46. package/src/react/pages/Connections.js +229 -0
  47. package/src/react/pages/Connections.styles.js +222 -0
  48. package/src/react/pages/DeviceDetailPage.js +2814 -0
  49. package/src/react/pages/DeviceDetailPage.styles.js +308 -0
  50. package/src/react/pages/Devices/currentDevice.js +194 -0
  51. package/src/react/pages/Devices/deviceTypes/DeviceGroupCard.js +257 -0
  52. package/src/react/pages/Devices/deviceTypes/all.js +23 -0
  53. package/src/react/pages/Devices/deviceTypes/device.js +25 -0
  54. package/src/react/pages/Devices/deviceTypes/deviceListHelpers.js +178 -0
  55. package/src/react/pages/Devices/deviceTypes/display.js +26 -0
  56. package/src/react/pages/Devices/deviceTypes/index.js +145 -0
  57. package/src/react/pages/Devices/deviceTypes/ipCamera.js +35 -0
  58. package/src/react/pages/Devices/deviceTypes/pdv.js +88 -0
  59. package/src/react/pages/Devices/deviceTypes/printer.js +37 -0
  60. package/src/react/pages/Devices/deviceTypes/shared.js +453 -0
  61. package/src/react/pages/Devices/deviceTypes/useDeviceNetworkConnectivity.js +145 -0
  62. package/src/react/pages/Devices.js +183 -0
  63. package/src/react/pages/Devices.styles.js +353 -0
  64. package/src/react/pages/Food99IntegrationPage/components/Food99CatalogTab.js +219 -0
  65. package/src/react/pages/Food99IntegrationPage/components/Food99OverviewTab.js +134 -0
  66. package/src/react/pages/Food99IntegrationPage/components/Food99PreviewModal.js +173 -0
  67. package/src/react/pages/Food99IntegrationPage/components/Food99ProductCard.js +1 -0
  68. package/src/react/pages/Food99IntegrationPage/components/Food99QuickWalletModal.js +181 -0
  69. package/src/react/pages/Food99IntegrationPage/components/Food99SettingsTab.js +306 -0
  70. package/src/react/pages/Food99IntegrationPage/components/Food99StoreTab.js +417 -0
  71. package/src/react/pages/Food99IntegrationPage/index.js +1530 -0
  72. package/src/react/pages/Food99IntegrationPage/styles.js +792 -0
  73. package/src/react/pages/Food99IntegrationPage/utils.js +155 -0
  74. package/src/react/pages/Food99IntegrationPage.js +1 -0
  75. package/src/react/pages/Food99IntegrationPage.styles.js +1 -0
  76. package/src/react/pages/GenericLogPage.js +42 -167
  77. package/src/react/pages/IFoodIntegrationPage/components/IFoodCatalogTab.js +8 -0
  78. package/src/react/pages/IFoodIntegrationPage/components/IFoodOperationsTab.js +420 -0
  79. package/src/react/pages/IFoodIntegrationPage/components/IFoodOverviewTab.js +118 -0
  80. package/src/react/pages/IFoodIntegrationPage/components/IFoodPreviewModal.js +103 -0
  81. package/src/react/pages/IFoodIntegrationPage/components/IFoodProductCard.js +1 -0
  82. package/src/react/pages/IFoodIntegrationPage/components/IFoodStoreTab.js +150 -0
  83. package/src/react/pages/IFoodIntegrationPage/index.js +1298 -0
  84. package/src/react/pages/IFoodIntegrationPage/styles.js +764 -0
  85. package/src/react/pages/IFoodIntegrationPage/utils.js +91 -0
  86. package/src/react/pages/IFoodIntegrationPage.js +1 -0
  87. package/src/react/pages/IFoodIntegrationPage.styles.js +1 -0
  88. package/src/react/pages/Imports.js +214 -166
  89. package/src/react/pages/IntegrationConfigPage.js +744 -0
  90. package/src/react/pages/IntegrationConfigPage.styles.js +269 -0
  91. package/src/react/pages/Integrations.js +299 -0
  92. package/src/react/pages/Integrations.styles.js +130 -0
  93. package/src/react/pages/ManagerOrderNotificationsPage.js +642 -0
  94. package/src/react/pages/MarketplaceIntegrationPage/components/MarketplaceProductCard.js +205 -0
  95. package/src/react/pages/MarketplaceIntegrationPage/components/RemoteMarketplaceMenuTab.js +335 -0
  96. package/src/react/pages/MarketplaceIntegrationPage/index.js +60 -0
  97. package/src/react/pages/MarketplaceIntegrationPage/utils.js +137 -0
  98. package/src/react/pages/MercadoLivreIntegrationPage.js +538 -0
  99. package/src/react/pages/PrinterDeviceDetailPage.js +1916 -0
  100. package/src/react/pages/PrinterDeviceDetailPage.styles.js +223 -0
  101. package/src/react/pages/PrinterDeviceFormPage.js +521 -0
  102. package/src/react/pages/PrinterDeviceFormPage.styles.js +159 -0
  103. package/src/react/pages/SettingsPage/PaymentTypesByWalletTab.js +484 -454
  104. package/src/react/pages/SettingsPage/index.js +1266 -1167
  105. package/src/react/pages/WhatsAppConnectionPage.js +459 -0
  106. package/src/react/pages/WhatsAppConnectionPage.styles.js +284 -0
  107. package/src/react/pages/integrationsCatalog.js +399 -0
  108. package/src/react/print/providers/local.js +1 -1
  109. package/src/react/router/publicRoutes.js +25 -0
  110. package/src/react/services/Cielo/Checkout.js +39 -0
  111. package/src/react/services/Cielo/Cielo.js +193 -0
  112. package/src/react/services/Cielo/Print.js +7 -0
  113. package/src/react/services/InfinitePay/Checkout.js +33 -0
  114. package/src/react/services/InfinitePay/InfinitePay.js +24 -0
  115. package/src/react/{utils → services}/paymentGatewayExecution.js +91 -91
  116. package/src/react/styles/global.js +115 -0
  117. package/src/react/utils/categoryContexts.js +46 -0
  118. package/src/react/utils/entityDisplay.js +222 -217
  119. package/src/react/utils/fileUrl.js +201 -16
  120. package/src/react/utils/integrationPage.js +16 -0
  121. package/src/react/utils/menuNavigation.js +31 -0
  122. package/src/react/utils/orderIdentity.js +277 -0
  123. package/src/react/utils/remotePayment.js +115 -61
  124. package/src/react/utils/runtimeFooter.js +40 -22
  125. package/src/react/utils/runtimeLanguage.js +50 -9
  126. package/src/react/utils/runtimeMenu.js +190 -98
  127. package/src/react/utils/runtimeZoom.js +43 -0
  128. package/src/react/utils/shopConfig.js +72 -34
  129. package/src/react/utils/shopFranchises.js +182 -23
  130. package/src/react/utils/socketRuntimePipeline.js +14 -14
  131. package/src/react/utils/storeColumns.js +23 -4
  132. package/src/react/utils/userAvatar.js +104 -0
  133. package/src/store/categories/index.js +48 -20
  134. package/src/store/configs/index.js +2 -2
  135. package/src/store/device_config/index.js +62 -21
  136. package/src/store/entity_log/index.js +22 -1
  137. package/src/store/imports/customActions.js +51 -0
  138. package/src/store/imports/index.js +89 -88
  139. package/src/store/status/index.js +11 -11
  140. package/src/store/themes/index.js +22 -0
  141. package/src/store/timezones/index.js +3 -1
  142. package/src/tests/browser/manager/connections.spec.js +143 -0
  143. package/src/tests/browser/manager/devices-current.spec.js +343 -0
  144. package/src/tests/browser/manager/mercado-livre-integration.spec.js +268 -0
  145. package/src/tests/react/api/deviceHeaders.test.js +114 -0
  146. package/src/tests/react/api/loadSmokeIndex.test.js +75 -0
  147. package/src/tests/react/components/AddImportModal.test.js +166 -0
  148. package/src/tests/react/components/BottomNavigationBar.config.test.js +20 -0
  149. package/src/tests/react/components/UserAvatar.test.js +52 -0
  150. package/src/tests/react/config/deviceConfigBootstrap.test.js +47 -0
  151. package/src/tests/react/pages/DevicePickerStyles.test.js +47 -0
  152. package/src/tests/react/pages/Devices/deviceListHelpers.test.js +39 -0
  153. package/src/tests/react/pages/DevicesCurrentDevice.test.js +198 -0
  154. package/src/tests/react/pages/connectionsHelpers.test.js +34 -0
  155. package/src/tests/react/pages/mercadoLivreIntegrationPageContract.test.mjs +16 -0
  156. package/src/tests/react/print/localPrintProvider.test.js +1 -1
  157. package/src/tests/react/services/Cielo.test.js +190 -0
  158. package/src/tests/react/store/categoriesOrdering.test.js +26 -0
  159. package/src/tests/react/utils/appDomain.test.js +62 -0
  160. package/src/tests/react/utils/entityDisplay.test.js +2 -2
  161. package/src/tests/react/utils/fileUrl.test.js +62 -0
  162. package/src/tests/react/utils/formatter.test.mjs +33 -0
  163. package/src/tests/react/utils/importStatus.test.js +2 -2
  164. package/src/tests/react/utils/orderIdentity.test.js +139 -0
  165. package/src/tests/react/utils/remotePayment.test.js +62 -0
  166. package/src/tests/react/utils/runtimeFooter.test.js +32 -9
  167. package/src/tests/react/utils/runtimeLanguage.test.js +80 -10
  168. package/src/tests/react/utils/runtimeMenu.test.js +195 -111
  169. package/src/tests/react/utils/runtimeZoom.test.js +38 -0
  170. package/src/tests/react/utils/shopConfig.test.js +75 -0
  171. package/src/tests/react/utils/shopFranchises.test.js +122 -12
  172. package/src/tests/react/utils/translate.discovery.test.mjs +170 -0
  173. package/src/tests/react/utils/translate.test.helpers.mjs +152 -0
  174. package/src/tests/react/utils/translate.test.mjs +252 -396
  175. package/src/tests/react/utils/userAvatar.test.js +63 -0
  176. package/src/utils/appDomain.js +15 -4
  177. package/src/utils/formatter.js +122 -16
  178. package/src/utils/integrationConfigs.js +1 -0
  179. package/src/utils/translate.js +277 -398
  180. package/src/utils/translateDiscovery.js +96 -0
  181. package/src/utils/translateNormalize.js +33 -0
  182. package/src/utils/translatePending.js +92 -0
  183. package/src/utils/translateStorage.js +142 -0
  184. package/.github/agents/developer.agent.md +0 -30
  185. package/.github/agents/devops.agent.md +0 -30
  186. package/.github/agents/qa.agent.md +0 -30
  187. package/.github/agents/security.agent.md +0 -30
  188. package/.github/workflows/npmjs.yml +0 -35
@@ -0,0 +1,284 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ const styles = StyleSheet.create({
4
+ container: {
5
+ flex: 1,
6
+ backgroundColor: '#F8FAFC',
7
+ },
8
+ scroll: {
9
+ paddingHorizontal: 16,
10
+ paddingTop: 16,
11
+ paddingBottom: 32,
12
+ },
13
+ centerState: {
14
+ flex: 1,
15
+ justifyContent: 'center',
16
+ alignItems: 'center',
17
+ paddingHorizontal: 28,
18
+ },
19
+ centerStateTitle: {
20
+ marginTop: 16,
21
+ fontSize: 18,
22
+ fontWeight: '700',
23
+ color: '#1E293B',
24
+ textAlign: 'center',
25
+ },
26
+ centerStateText: {
27
+ marginTop: 8,
28
+ fontSize: 14,
29
+ lineHeight: 21,
30
+ color: '#64748B',
31
+ textAlign: 'center',
32
+ },
33
+ heroCard: {
34
+ borderRadius: 28,
35
+ paddingHorizontal: 22,
36
+ paddingVertical: 24,
37
+ marginBottom: 18,
38
+ flexDirection: 'row',
39
+ alignItems: 'flex-start',
40
+ justifyContent: 'space-between',
41
+ },
42
+ heroCopy: {
43
+ flex: 1,
44
+ paddingRight: 16,
45
+ },
46
+ heroEyebrow: {
47
+ fontSize: 13,
48
+ fontWeight: '800',
49
+ letterSpacing: 1.3,
50
+ color: 'rgba(255,255,255,0.82)',
51
+ marginBottom: 10,
52
+ },
53
+ heroTitle: {
54
+ fontSize: 22,
55
+ fontWeight: '800',
56
+ color: '#FFFFFF',
57
+ marginBottom: 8,
58
+ },
59
+ heroText: {
60
+ fontSize: 14,
61
+ lineHeight: 21,
62
+ color: 'rgba(255,255,255,0.88)',
63
+ },
64
+ heroBadge: {
65
+ width: 54,
66
+ height: 54,
67
+ borderRadius: 18,
68
+ backgroundColor: '#FFFFFF',
69
+ alignItems: 'center',
70
+ justifyContent: 'center',
71
+ },
72
+ formCard: {
73
+ borderRadius: 28,
74
+ backgroundColor: '#FFFFFF',
75
+ padding: 18,
76
+ marginBottom: 16,
77
+ },
78
+ formHeader: {
79
+ flexDirection: 'row',
80
+ justifyContent: 'space-between',
81
+ alignItems: 'flex-start',
82
+ gap: 12,
83
+ marginBottom: 18,
84
+ },
85
+ cardTitle: {
86
+ fontSize: 20,
87
+ fontWeight: '800',
88
+ color: '#0F172A',
89
+ marginBottom: 6,
90
+ },
91
+ cardSubtitle: {
92
+ fontSize: 14,
93
+ lineHeight: 21,
94
+ color: '#64748B',
95
+ },
96
+ statusBadge: {
97
+ borderRadius: 999,
98
+ paddingHorizontal: 12,
99
+ paddingVertical: 8,
100
+ },
101
+ statusBadgeText: {
102
+ fontSize: 13,
103
+ fontWeight: '700',
104
+ color: '#2563EB',
105
+ },
106
+ formRow: {
107
+ flexDirection: 'row',
108
+ gap: 12,
109
+ marginBottom: 16,
110
+ },
111
+ inputGroupSmall: {
112
+ width: 88,
113
+ },
114
+ inputGroupLarge: {
115
+ flex: 1,
116
+ },
117
+ inputLabel: {
118
+ fontSize: 12,
119
+ fontWeight: '700',
120
+ color: '#64748B',
121
+ marginBottom: 8,
122
+ },
123
+ input: {
124
+ height: 50,
125
+ borderRadius: 16,
126
+ borderWidth: 1,
127
+ borderColor: '#E2E8F0',
128
+ backgroundColor: '#F8FAFC',
129
+ paddingHorizontal: 14,
130
+ fontSize: 16,
131
+ fontWeight: '600',
132
+ color: '#0F172A',
133
+ },
134
+ primaryButton: {
135
+ height: 52,
136
+ borderRadius: 18,
137
+ alignItems: 'center',
138
+ justifyContent: 'center',
139
+ flexDirection: 'row',
140
+ gap: 10,
141
+ },
142
+ primaryButtonDisabled: {
143
+ opacity: 0.75,
144
+ },
145
+ primaryButtonText: {
146
+ fontSize: 15,
147
+ fontWeight: '800',
148
+ color: '#FFFFFF',
149
+ },
150
+ helperText: {
151
+ marginTop: 12,
152
+ fontSize: 13,
153
+ color: '#64748B',
154
+ },
155
+ qrCard: {
156
+ borderRadius: 28,
157
+ backgroundColor: '#FFFFFF',
158
+ padding: 18,
159
+ marginBottom: 16,
160
+ },
161
+ qrHeader: {
162
+ marginBottom: 18,
163
+ },
164
+ qrContent: {
165
+ alignItems: 'center',
166
+ justifyContent: 'center',
167
+ },
168
+ qrWrap: {
169
+ padding: 18,
170
+ borderRadius: 24,
171
+ backgroundColor: '#FFFFFF',
172
+ borderWidth: 1,
173
+ borderColor: '#E2E8F0',
174
+ },
175
+ qrCaption: {
176
+ marginTop: 16,
177
+ fontSize: 13,
178
+ lineHeight: 20,
179
+ color: '#64748B',
180
+ textAlign: 'center',
181
+ },
182
+ listHeader: {
183
+ flexDirection: 'row',
184
+ alignItems: 'flex-start',
185
+ justifyContent: 'space-between',
186
+ gap: 12,
187
+ marginBottom: 14,
188
+ },
189
+ countBadge: {
190
+ borderRadius: 999,
191
+ backgroundColor: '#EEF2FF',
192
+ paddingHorizontal: 12,
193
+ paddingVertical: 8,
194
+ },
195
+ countBadgeText: {
196
+ fontSize: 13,
197
+ fontWeight: '700',
198
+ color: '#4F46E5',
199
+ },
200
+ listWrap: {
201
+ gap: 14,
202
+ },
203
+ connectionCard: {
204
+ borderRadius: 24,
205
+ backgroundColor: '#FFFFFF',
206
+ padding: 16,
207
+ },
208
+ connectionTop: {
209
+ flexDirection: 'row',
210
+ alignItems: 'center',
211
+ justifyContent: 'space-between',
212
+ marginBottom: 14,
213
+ },
214
+ connectionIconWrap: {
215
+ width: 48,
216
+ height: 48,
217
+ borderRadius: 16,
218
+ alignItems: 'center',
219
+ justifyContent: 'center',
220
+ },
221
+ connectionStatusBadge: {
222
+ borderRadius: 999,
223
+ paddingHorizontal: 12,
224
+ paddingVertical: 8,
225
+ },
226
+ connectionStatusText: {
227
+ fontSize: 13,
228
+ fontWeight: '700',
229
+ color: '#2563EB',
230
+ },
231
+ connectionName: {
232
+ fontSize: 18,
233
+ fontWeight: '800',
234
+ color: '#0F172A',
235
+ marginBottom: 14,
236
+ },
237
+ connectionMetaRow: {
238
+ flexDirection: 'row',
239
+ gap: 12,
240
+ marginBottom: 12,
241
+ },
242
+ connectionMetaItem: {
243
+ flex: 1,
244
+ borderRadius: 18,
245
+ backgroundColor: '#F8FAFC',
246
+ paddingHorizontal: 14,
247
+ paddingVertical: 14,
248
+ },
249
+ connectionMetaLabel: {
250
+ fontSize: 12,
251
+ fontWeight: '700',
252
+ color: '#64748B',
253
+ marginBottom: 6,
254
+ },
255
+ connectionMetaValue: {
256
+ fontSize: 15,
257
+ fontWeight: '700',
258
+ color: '#0F172A',
259
+ },
260
+ emptyStateBox: {
261
+ borderRadius: 22,
262
+ backgroundColor: '#F8FAFC',
263
+ alignItems: 'center',
264
+ justifyContent: 'center',
265
+ paddingHorizontal: 18,
266
+ paddingVertical: 24,
267
+ },
268
+ emptyStateTitle: {
269
+ marginTop: 12,
270
+ fontSize: 16,
271
+ fontWeight: '800',
272
+ color: '#1E293B',
273
+ textAlign: 'center',
274
+ },
275
+ emptyStateText: {
276
+ marginTop: 8,
277
+ fontSize: 14,
278
+ lineHeight: 21,
279
+ color: '#64748B',
280
+ textAlign: 'center',
281
+ },
282
+ });
283
+
284
+ export default styles;
@@ -0,0 +1,399 @@
1
+ import {getOrderChannelLogo} from '@assets/ppc/channels';
2
+
3
+ const buildLogo = app => {
4
+ try {
5
+ return getOrderChannelLogo({app});
6
+ } catch {
7
+ return null;
8
+ }
9
+ };
10
+
11
+ export const INTEGRATION_LIST = [
12
+ {
13
+ key: '99food',
14
+ label: '99Food',
15
+ route: 'MarketplaceIntegrationPage',
16
+ routeParams: {
17
+ providerKey: '99food',
18
+ },
19
+ accent: '#F97316',
20
+ logo: buildLogo('99Food'),
21
+ },
22
+ {
23
+ key: 'ifood',
24
+ label: 'iFood',
25
+ route: 'MarketplaceIntegrationPage',
26
+ routeParams: {
27
+ providerKey: 'ifood',
28
+ },
29
+ accent: '#EA580C',
30
+ logo: buildLogo('iFood'),
31
+ },
32
+ {
33
+ key: 'mercadolivre',
34
+ label: 'Mercado Livre',
35
+ route: 'MarketplaceIntegrationPage',
36
+ routeParams: {
37
+ providerKey: 'mercadolivre',
38
+ },
39
+ accent: '#FFE600',
40
+ icon: 'shopping-bag',
41
+ },
42
+ {
43
+ key: 'uber',
44
+ label: 'Uber',
45
+ route: 'UberIntegrationPage',
46
+ accent: '#111827',
47
+ icon: 'truck',
48
+ },
49
+ {
50
+ key: 'asaas',
51
+ label: 'Asaas',
52
+ route: 'AsaasIntegrationPage',
53
+ accent: '#2563EB',
54
+ icon: 'credit-card',
55
+ },
56
+ {
57
+ key: 'clicksign',
58
+ label: 'ClickSign',
59
+ route: 'ClickSignIntegrationPage',
60
+ accent: '#0F172A',
61
+ icon: 'file-text',
62
+ },
63
+ {
64
+ key: 'receita-federal',
65
+ label: 'Receita Federal',
66
+ route: 'IntegrationConfigPage',
67
+ routeParams: {
68
+ providerKey: 'receita-federal',
69
+ },
70
+ accent: '#166534',
71
+ icon: 'file-text',
72
+ },
73
+ ];
74
+
75
+ export const INTEGRATION_CONFIGS = {
76
+ uber: {
77
+ key: 'uber',
78
+ label: 'Uber',
79
+ accent: '#111827',
80
+ icon: 'truck',
81
+ description:
82
+ 'Conecte sua conta Uber para descobrir e provisionar a store automaticamente.',
83
+ oauthConnect: true,
84
+ authorizationEndpoint:
85
+ '/marketplace/integrations/uber/store/authorization-page',
86
+ connectLabel: 'Conectar Uber',
87
+ requiredKeys: ['OAUTH_UBER_STORE_ID'],
88
+ fields: [],
89
+ },
90
+ asaas: {
91
+ key: 'asaas',
92
+ label: 'Asaas',
93
+ accent: '#2563EB',
94
+ icon: 'credit-card',
95
+ description: 'Chaves da conta para cobranca/PIX e token exclusivo do Webhook Asaas.',
96
+ saveLabel: 'Salvar Asaas',
97
+ requiredKeys: ['asaas-key', 'asaas-receiver-pix-key', 'asaas-webhook-token'],
98
+ fields: [
99
+ {
100
+ key: 'asaas-key',
101
+ label: 'Asaas key',
102
+ placeholder: 'Informe a chave de acesso do Asaas',
103
+ secureTextEntry: true,
104
+ },
105
+ {
106
+ key: 'asaas-receiver-pix-key',
107
+ label: 'Receiver PIX key',
108
+ placeholder: 'Informe a chave PIX de recebimento',
109
+ secureTextEntry: true,
110
+ },
111
+ {
112
+ key: 'asaas-webhook-token',
113
+ label: 'Webhook token',
114
+ placeholder: 'Token de autenticacao do Webhook no painel Asaas',
115
+ secureTextEntry: true,
116
+ },
117
+
118
+ ],
119
+ },
120
+ clicksign: {
121
+ key: 'clicksign',
122
+ label: 'ClickSign',
123
+ accent: '#0F172A',
124
+ icon: 'file-text',
125
+ description:
126
+ 'Chave usada pelo fluxo de assinatura e webhook da empresa atual.',
127
+ saveLabel: 'Salvar ClickSign',
128
+ requiredKeys: ['clicksign-key'],
129
+ fields: [
130
+ {
131
+ key: 'clicksign-key',
132
+ label: 'ClickSign key',
133
+ placeholder: 'Informe a chave da ClickSign',
134
+ secureTextEntry: true,
135
+ },
136
+ ],
137
+ },
138
+
139
+ 'receita-federal': {
140
+ key: 'receita-federal',
141
+ label: 'Receita Federal',
142
+ accent: '#166534',
143
+ icon: 'file-text',
144
+ description:
145
+ 'Configuracoes fiscais por tipo de documento (NF-e, cupom, NFS-e, CT-e, pre-notas).',
146
+ saveLabel: 'Salvar configuracoes fiscais',
147
+ // requiredKeys only enforce "Gerais" minima; tipos sao opcionais conforme operacao da empresa
148
+ requiredKeys: [
149
+ 'receita-federal-tax-regime',
150
+ 'receita-federal-certificate-file',
151
+ 'receita-federal-certificate-password',
152
+ ],
153
+ tabs: [
154
+ {
155
+ key: 'general',
156
+ label: 'Gerais',
157
+ description: 'Dados compartilhados pela empresa para emissao fiscal.',
158
+ fields: [
159
+ {
160
+ key: 'receita-federal-tax-regime',
161
+ label: 'Regime tributario',
162
+ type: 'select',
163
+ options: [
164
+ { value: '1', label: 'Simples Nacional' },
165
+ { value: '2', label: 'Simples Nacional - excesso sublimite' },
166
+ { value: '3', label: 'Regime Normal' },
167
+ ],
168
+ },
169
+ {
170
+ key: 'receita-federal-ibge-code',
171
+ label: 'Codigo IBGE (municipio)',
172
+ placeholder: 'Ex.: 3550308',
173
+ },
174
+ {
175
+ key: 'receita-federal-environment',
176
+ label: 'Ambiente SEFAZ',
177
+ type: 'select',
178
+ options: [
179
+ { value: '2', label: 'Homologacao' },
180
+ { value: '1', label: 'Producao' },
181
+ ],
182
+ },
183
+ {
184
+ key: 'receita-federal-certificate-file',
185
+ label: 'Certificado digital (.pfx / .p12)',
186
+ type: 'file',
187
+ accept: '.pfx,.p12,application/x-pkcs12',
188
+ fileContext: 'company_certificate',
189
+ companyScopedFilePicker: true,
190
+ },
191
+ {
192
+ key: 'receita-federal-certificate-password',
193
+ label: 'Senha do certificado',
194
+ placeholder: 'Informe a senha do certificado',
195
+ secureTextEntry: true,
196
+ },
197
+ ],
198
+ },
199
+ {
200
+ key: 'nfe',
201
+ label: 'NF-e (produtos)',
202
+ description: 'Nota Fiscal Eletronica modelo 55 — saida de mercadorias.',
203
+ fields: [
204
+ {
205
+ key: 'receita-federal-nfe-enabled',
206
+ label: 'Habilitar NF-e',
207
+ type: 'select',
208
+ options: [
209
+ { value: '0', label: 'Nao' },
210
+ { value: '1', label: 'Sim' },
211
+ ],
212
+ },
213
+ {
214
+ key: 'receita-federal-nfe-serie',
215
+ label: 'Serie NF-e',
216
+ placeholder: 'Ex.: 1',
217
+ },
218
+ {
219
+ key: 'receita-federal-nfe-last-number',
220
+ label: 'Ultima NF-e / proximo numero',
221
+ placeholder: 'Ex.: 100',
222
+ },
223
+ ],
224
+ },
225
+ {
226
+ key: 'nfce',
227
+ label: 'NFC-e / Cupom',
228
+ description: 'Cupom fiscal eletronico modelo 65 — consumidor final.',
229
+ fields: [
230
+ {
231
+ key: 'receita-federal-nfce-enabled',
232
+ label: 'Habilitar NFC-e / cupom',
233
+ type: 'select',
234
+ options: [
235
+ { value: '0', label: 'Nao' },
236
+ { value: '1', label: 'Sim' },
237
+ ],
238
+ },
239
+ {
240
+ key: 'receita-federal-nfce-serie',
241
+ label: 'Serie NFC-e',
242
+ placeholder: 'Ex.: 1',
243
+ },
244
+ {
245
+ key: 'receita-federal-nfce-last-number',
246
+ label: 'Ultima NFC-e / proximo numero',
247
+ placeholder: 'Ex.: 100',
248
+ },
249
+ {
250
+ key: 'receita-federal-nfce-csc-id',
251
+ label: 'CSC ID (token)',
252
+ placeholder: 'Identificador do CSC',
253
+ },
254
+ {
255
+ key: 'receita-federal-nfce-csc',
256
+ label: 'CSC (codigo de seguranca)',
257
+ placeholder: 'Codigo CSC da SEFAZ',
258
+ secureTextEntry: true,
259
+ },
260
+ ],
261
+ },
262
+ {
263
+ key: 'nfse',
264
+ label: 'NFS-e (servicos)',
265
+ description: 'Nota de servicos eletronica — prestacao de servicos.',
266
+ fields: [
267
+ {
268
+ key: 'receita-federal-nfse-enabled',
269
+ label: 'Habilitar NFS-e',
270
+ type: 'select',
271
+ options: [
272
+ { value: '0', label: 'Nao' },
273
+ { value: '1', label: 'Sim' },
274
+ ],
275
+ },
276
+ {
277
+ key: 'receita-federal-nfse-serie',
278
+ label: 'Serie RPS / NFS-e',
279
+ placeholder: 'Ex.: 1',
280
+ },
281
+ {
282
+ key: 'receita-federal-nfse-last-number',
283
+ label: 'Ultimo RPS / proximo numero',
284
+ placeholder: 'Ex.: 50',
285
+ },
286
+ {
287
+ key: 'receita-federal-nfse-im',
288
+ label: 'Inscricao municipal',
289
+ placeholder: 'IM do prestador',
290
+ },
291
+ {
292
+ key: 'receita-federal-nfse-cnae',
293
+ label: 'CNAE principal (servico)',
294
+ placeholder: 'Ex.: 6201501',
295
+ },
296
+ ],
297
+ },
298
+ {
299
+ key: 'cte',
300
+ label: 'CT-e',
301
+ description: 'Conhecimento de Transporte Eletronico.',
302
+ fields: [
303
+ {
304
+ key: 'receita-federal-cte-enabled',
305
+ label: 'Habilitar CT-e',
306
+ type: 'select',
307
+ options: [
308
+ { value: '0', label: 'Nao' },
309
+ { value: '1', label: 'Sim' },
310
+ ],
311
+ },
312
+ {
313
+ key: 'receita-federal-cte-serie',
314
+ label: 'Serie CT-e',
315
+ placeholder: 'Ex.: 1',
316
+ },
317
+ {
318
+ key: 'receita-federal-cte-last-number',
319
+ label: 'Ultimo CT-e / proximo numero',
320
+ placeholder: 'Ex.: 10',
321
+ },
322
+ ],
323
+ },
324
+ {
325
+ key: 'prenota',
326
+ label: 'Pre-notas',
327
+ description: 'Rascunhos / pre-notas antes da autorizacao SEFAZ.',
328
+ fields: [
329
+ {
330
+ key: 'receita-federal-prenota-enabled',
331
+ label: 'Habilitar pre-notas',
332
+ type: 'select',
333
+ options: [
334
+ { value: '0', label: 'Nao' },
335
+ { value: '1', label: 'Sim' },
336
+ ],
337
+ },
338
+ {
339
+ key: 'receita-federal-prenota-default-type',
340
+ label: 'Tipo padrao ao gerar pre-nota',
341
+ type: 'select',
342
+ options: [
343
+ { value: 'nfe', label: 'NF-e (produtos)' },
344
+ { value: 'nfce', label: 'NFC-e / cupom' },
345
+ { value: 'nfse', label: 'NFS-e (servicos)' },
346
+ { value: 'cte', label: 'CT-e' },
347
+ ],
348
+ },
349
+ ],
350
+ },
351
+ ],
352
+ // fields flat list derived at runtime from tabs when present
353
+ fields: [],
354
+ },
355
+ };
356
+
357
+ export const getIntegrationListItem = key =>
358
+ INTEGRATION_LIST.find(item => item.key === key) || null;
359
+
360
+ export const getIntegrationConfig = key => INTEGRATION_CONFIGS[key] || null;
361
+
362
+ export const parseIntegrationCollection = response => {
363
+ if (Array.isArray(response)) {
364
+ return response;
365
+ }
366
+
367
+ if (Array.isArray(response?.member)) {
368
+ return response.member;
369
+ }
370
+
371
+ if (Array.isArray(response?.items)) {
372
+ return response.items;
373
+ }
374
+
375
+ if (Array.isArray(response?.['hydra:member'])) {
376
+ return response['hydra:member'];
377
+ }
378
+
379
+ return [];
380
+ };
381
+
382
+ export const getIntegrationByKey = (response, key) => {
383
+ const normalizedKey = String(key || '')
384
+ .trim()
385
+ .toLowerCase();
386
+
387
+ if (!normalizedKey) {
388
+ return null;
389
+ }
390
+
391
+ return (
392
+ parseIntegrationCollection(response).find(
393
+ item =>
394
+ String(item?.key || '')
395
+ .trim()
396
+ .toLowerCase() === normalizedKey,
397
+ ) || null
398
+ );
399
+ };
@@ -1,4 +1,4 @@
1
- import {CieloPrint} from '@controleonline/ui-orders/src/react/services/Cielo/Print';
1
+ import {CieloPrint} from '../../services/Cielo/Print';
2
2
 
3
3
  export const LOCAL_CIELO_PRINT_UNAVAILABLE_MESSAGE =
4
4
  'Impressao local Cielo indisponivel neste equipamento.';
@@ -0,0 +1,25 @@
1
+ import {app_type} from '@appType';
2
+
3
+ export const PUBLIC_ROUTES = new Set([
4
+ 'SignInPage',
5
+ 'CreateAccount',
6
+ 'ConfirmAccountPage',
7
+ 'ResetPasswordPage',
8
+ 'ShopIndex',
9
+ 'ShopFranchiseLocatorPage',
10
+ 'ShopSearchPage',
11
+ 'ShopCategoryPage',
12
+ 'ShopProductPage',
13
+ 'ShopCartPage',
14
+ 'ShopCheckoutPage',
15
+ 'ShopOrdersPage',
16
+ 'ShopOrderDetailsPage',
17
+ 'ShopProfilePage',
18
+ 'ShopCardsPage',
19
+ 'ShopLoyaltyPage',
20
+ 'ShopDownloadPage',
21
+ ]);
22
+
23
+ export const isPublicRoute = routeName =>
24
+ PUBLIC_ROUTES.has(routeName) ||
25
+ (routeName === 'HomePage' && String(app_type || '').toUpperCase() === 'SHOP');