@axelor/aos-mobile-purchase 8.3.0

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 (148) hide show
  1. package/README.md +44 -0
  2. package/lib/api/index.d.ts +5 -0
  3. package/lib/api/index.js +23 -0
  4. package/lib/api/index.js.map +1 -0
  5. package/lib/api/product-api.d.ts +4 -0
  6. package/lib/api/product-api.js +69 -0
  7. package/lib/api/product-api.js.map +1 -0
  8. package/lib/api/purchase-request-api.d.ts +23 -0
  9. package/lib/api/purchase-request-api.js +104 -0
  10. package/lib/api/purchase-request-api.js.map +1 -0
  11. package/lib/api/purchase-request-line-api.d.ts +17 -0
  12. package/lib/api/purchase-request-line-api.js +100 -0
  13. package/lib/api/purchase-request-line-api.js.map +1 -0
  14. package/lib/api/supplier-api.d.ts +5 -0
  15. package/lib/api/supplier-api.js +47 -0
  16. package/lib/api/supplier-api.js.map +1 -0
  17. package/lib/api/unit-api.d.ts +4 -0
  18. package/lib/api/unit-api.js +29 -0
  19. package/lib/api/unit-api.js.map +1 -0
  20. package/lib/components/atoms/DropdownRequestCharacteristics/DropdownRequestCharacteristics.d.ts +3 -0
  21. package/lib/components/atoms/DropdownRequestCharacteristics/DropdownRequestCharacteristics.js +39 -0
  22. package/lib/components/atoms/DropdownRequestCharacteristics/DropdownRequestCharacteristics.js.map +1 -0
  23. package/lib/components/atoms/RequestCard/RequestCard.d.ts +11 -0
  24. package/lib/components/atoms/RequestCard/RequestCard.js +51 -0
  25. package/lib/components/atoms/RequestCard/RequestCard.js.map +1 -0
  26. package/lib/components/atoms/RequestHeader/RequestHeader.d.ts +3 -0
  27. package/lib/components/atoms/RequestHeader/RequestHeader.js +47 -0
  28. package/lib/components/atoms/RequestHeader/RequestHeader.js.map +1 -0
  29. package/lib/components/atoms/RequestLineCard/RequestLineCard.d.ts +11 -0
  30. package/lib/components/atoms/RequestLineCard/RequestLineCard.js +49 -0
  31. package/lib/components/atoms/RequestLineCard/RequestLineCard.js.map +1 -0
  32. package/lib/components/atoms/RequestSeeLinesButton/RequestSeeLinesButton.d.ts +3 -0
  33. package/lib/components/atoms/RequestSeeLinesButton/RequestSeeLinesButton.js +67 -0
  34. package/lib/components/atoms/RequestSeeLinesButton/RequestSeeLinesButton.js.map +1 -0
  35. package/lib/components/atoms/index.d.ts +5 -0
  36. package/lib/components/atoms/index.js +23 -0
  37. package/lib/components/atoms/index.js.map +1 -0
  38. package/lib/components/index.d.ts +4 -0
  39. package/lib/components/index.js +22 -0
  40. package/lib/components/index.js.map +1 -0
  41. package/lib/components/molecules/RequestDropdownCards/RequestDropdownCards.d.ts +5 -0
  42. package/lib/components/molecules/RequestDropdownCards/RequestDropdownCards.js +33 -0
  43. package/lib/components/molecules/RequestDropdownCards/RequestDropdownCards.js.map +1 -0
  44. package/lib/components/molecules/index.d.ts +1 -0
  45. package/lib/components/molecules/index.js +19 -0
  46. package/lib/components/molecules/index.js.map +1 -0
  47. package/lib/components/organisms/RequestButtons/RequestButtons.d.ts +3 -0
  48. package/lib/components/organisms/RequestButtons/RequestButtons.js +136 -0
  49. package/lib/components/organisms/RequestButtons/RequestButtons.js.map +1 -0
  50. package/lib/components/organisms/index.d.ts +1 -0
  51. package/lib/components/organisms/index.js +19 -0
  52. package/lib/components/organisms/index.js.map +1 -0
  53. package/lib/components/templates/CompanyPicker/CompanyPicker.d.ts +9 -0
  54. package/lib/components/templates/CompanyPicker/CompanyPicker.js +30 -0
  55. package/lib/components/templates/CompanyPicker/CompanyPicker.js.map +1 -0
  56. package/lib/components/templates/HorizontalOrRuleText/HorizontalOrRuleText.d.ts +5 -0
  57. package/lib/components/templates/HorizontalOrRuleText/HorizontalOrRuleText.js +35 -0
  58. package/lib/components/templates/HorizontalOrRuleText/HorizontalOrRuleText.js.map +1 -0
  59. package/lib/components/templates/ProductSearchBar/ProductSearchBar.d.ts +13 -0
  60. package/lib/components/templates/ProductSearchBar/ProductSearchBar.js +35 -0
  61. package/lib/components/templates/ProductSearchBar/ProductSearchBar.js.map +1 -0
  62. package/lib/components/templates/RequestCreationButtons/RequestCreationButtons.d.ts +13 -0
  63. package/lib/components/templates/RequestCreationButtons/RequestCreationButtons.js +59 -0
  64. package/lib/components/templates/RequestCreationButtons/RequestCreationButtons.js.map +1 -0
  65. package/lib/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.d.ts +10 -0
  66. package/lib/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.js +29 -0
  67. package/lib/components/templates/RequestCreationQuantityCard/RequestCreationQuantityCard.js.map +1 -0
  68. package/lib/components/templates/SupplierSearchBar/SupplierSearchBar.d.ts +11 -0
  69. package/lib/components/templates/SupplierSearchBar/SupplierSearchBar.js +38 -0
  70. package/lib/components/templates/SupplierSearchBar/SupplierSearchBar.js.map +1 -0
  71. package/lib/components/templates/UnitSearchBar/UnitSearchBar.d.ts +13 -0
  72. package/lib/components/templates/UnitSearchBar/UnitSearchBar.js +35 -0
  73. package/lib/components/templates/UnitSearchBar/UnitSearchBar.js.map +1 -0
  74. package/lib/components/templates/index.d.ts +7 -0
  75. package/lib/components/templates/index.js +25 -0
  76. package/lib/components/templates/index.js.map +1 -0
  77. package/lib/features/asyncFunctions-index.d.ts +5 -0
  78. package/lib/features/asyncFunctions-index.js +23 -0
  79. package/lib/features/asyncFunctions-index.js.map +1 -0
  80. package/lib/features/index.d.ts +5 -0
  81. package/lib/features/index.js +23 -0
  82. package/lib/features/index.js.map +1 -0
  83. package/lib/features/productSlice.d.ts +16 -0
  84. package/lib/features/productSlice.js +49 -0
  85. package/lib/features/productSlice.js.map +1 -0
  86. package/lib/features/purchaseRequestLineSlice.d.ts +49 -0
  87. package/lib/features/purchaseRequestLineSlice.js +96 -0
  88. package/lib/features/purchaseRequestLineSlice.js.map +1 -0
  89. package/lib/features/purchaseRequestSlice.d.ts +58 -0
  90. package/lib/features/purchaseRequestSlice.js +101 -0
  91. package/lib/features/purchaseRequestSlice.js.map +1 -0
  92. package/lib/features/supplierSlice.d.ts +16 -0
  93. package/lib/features/supplierSlice.js +49 -0
  94. package/lib/features/supplierSlice.js.map +1 -0
  95. package/lib/features/unitSlice.d.ts +16 -0
  96. package/lib/features/unitSlice.js +49 -0
  97. package/lib/features/unitSlice.js.map +1 -0
  98. package/lib/hooks/use-purchase-header-actions.d.ts +1 -0
  99. package/lib/hooks/use-purchase-header-actions.js +46 -0
  100. package/lib/hooks/use-purchase-header-actions.js.map +1 -0
  101. package/lib/i18n/en.json +45 -0
  102. package/lib/i18n/fr.json +45 -0
  103. package/lib/index.d.ts +6 -0
  104. package/lib/index.js +69 -0
  105. package/lib/index.js.map +1 -0
  106. package/lib/models/forms.d.ts +2 -0
  107. package/lib/models/forms.js +61 -0
  108. package/lib/models/forms.js.map +1 -0
  109. package/lib/models/index.d.ts +5 -0
  110. package/lib/models/index.js +23 -0
  111. package/lib/models/index.js.map +1 -0
  112. package/lib/models/objectFields.d.ts +2 -0
  113. package/lib/models/objectFields.js +49 -0
  114. package/lib/models/objectFields.js.map +1 -0
  115. package/lib/models/searchFields.d.ts +2 -0
  116. package/lib/models/searchFields.js +23 -0
  117. package/lib/models/searchFields.js.map +1 -0
  118. package/lib/models/sortFields.d.ts +2 -0
  119. package/lib/models/sortFields.js +21 -0
  120. package/lib/models/sortFields.js.map +1 -0
  121. package/lib/models/typeObjects.d.ts +2 -0
  122. package/lib/models/typeObjects.js +86 -0
  123. package/lib/models/typeObjects.js.map +1 -0
  124. package/lib/screens/RequestCreationScreen.d.ts +3 -0
  125. package/lib/screens/RequestCreationScreen.js +139 -0
  126. package/lib/screens/RequestCreationScreen.js.map +1 -0
  127. package/lib/screens/RequestDetailsScreen.d.ts +5 -0
  128. package/lib/screens/RequestDetailsScreen.js +67 -0
  129. package/lib/screens/RequestDetailsScreen.js.map +1 -0
  130. package/lib/screens/RequestLineFormScreen.d.ts +6 -0
  131. package/lib/screens/RequestLineFormScreen.js +71 -0
  132. package/lib/screens/RequestLineFormScreen.js.map +1 -0
  133. package/lib/screens/RequestLineListScreen.d.ts +5 -0
  134. package/lib/screens/RequestLineListScreen.js +51 -0
  135. package/lib/screens/RequestLineListScreen.js.map +1 -0
  136. package/lib/screens/RequestListScreen.d.ts +5 -0
  137. package/lib/screens/RequestListScreen.js +47 -0
  138. package/lib/screens/RequestListScreen.js.map +1 -0
  139. package/lib/screens/index.d.ts +59 -0
  140. package/lib/screens/index.js +66 -0
  141. package/lib/screens/index.js.map +1 -0
  142. package/lib/types/index.d.ts +1 -0
  143. package/lib/types/index.js +19 -0
  144. package/lib/types/index.js.map +1 -0
  145. package/lib/types/request-creation.d.ts +7 -0
  146. package/lib/types/request-creation.js +25 -0
  147. package/lib/types/request-creation.js.map +1 -0
  148. package/package.json +45 -0
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: Purchase
3
+ tags: Readme
4
+ ---
5
+
6
+ <h1 align="center">@axelor/aos-mobile-purchase</h1>
7
+
8
+ <div align="center">
9
+ <img src="https://i.imgur.com/KJAAFlT.png" width="30%"/>
10
+ </div>
11
+
12
+ ## Presentation
13
+
14
+ This package was developed for the [Axelor Open Mobile](https://github.com/axelor/axelor-mobile) application.
15
+
16
+ The purpose of this package is to link with the purchase module of the [Axelor Open Suite (AOS)](https://github.com/axelor/axelor-open-suite) ERP. It provides a simplified version of a number of processes available on the webapp. This package is compatible with AOS from version 8.3.0.
17
+
18
+ ## Usage
19
+
20
+ Install the library :
21
+
22
+ ```bash
23
+ yarn add @axelor/aos-mobile-purchase
24
+ ```
25
+
26
+ Compatibility with React v18.2.x and React Native v0.73.x.
27
+
28
+ To add this package in your application, you need to add it in the _modules_ props of the component `Application` from @axelor/aos-mobile-core package.
29
+
30
+ ```typescript
31
+ import React from 'react';
32
+ import {Application} from '@axelor/aos-mobile-core';
33
+ import {PurchaseModule} from '@axelor/aos-mobile-purchase';
34
+
35
+ const App = () => {
36
+ return <Application modules={[PurchaseModule]} mainMenu="auth_menu_user" />;
37
+ };
38
+
39
+ export default App;
40
+ ```
41
+
42
+ ## Developpment
43
+
44
+ This package is developed as part of the Axelor Open Mobile application. To contribute, please go to the [Github project](https://github.com/axelor/axelor-mobile) and follow the guidelines. You will also find an installation guide to help you configure your environment.
@@ -0,0 +1,5 @@
1
+ export { searchProduct as searchProductApi } from './product-api';
2
+ export { createPurchaseRequest as createPurchaseRequestApi, getPurchaseRequest as getPurchaseRequestApi, searchPurchaseRequest as searchPurchaseRequestApi, updatePurchaseRequest as updatePurchaseRequestApi, updatePurchaseRequestStatus as updatePurchaseRequestStatusApi, } from './purchase-request-api';
3
+ export { createPurchaseRequestLine as createPurchaseRequestLineApi, fetchPurchaseRequestLine as fetchPurchaseRequestLineApi, searchPurchaseRequestLine as searchPurchaseRequestLineApi, updatePurchaseRequestLine as updatePurchaseRequestLineApi, } from './purchase-request-line-api';
4
+ export { searchSupplier as searchSupplierApi } from './supplier-api';
5
+ export { searchUnit as searchUnitApi } from './unit-api';
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ export { searchProduct as searchProductApi } from './product-api';
19
+ export { createPurchaseRequest as createPurchaseRequestApi, getPurchaseRequest as getPurchaseRequestApi, searchPurchaseRequest as searchPurchaseRequestApi, updatePurchaseRequest as updatePurchaseRequestApi, updatePurchaseRequestStatus as updatePurchaseRequestStatusApi, } from './purchase-request-api';
20
+ export { createPurchaseRequestLine as createPurchaseRequestLineApi, fetchPurchaseRequestLine as fetchPurchaseRequestLineApi, searchPurchaseRequestLine as searchPurchaseRequestLineApi, updatePurchaseRequestLine as updatePurchaseRequestLineApi, } from './purchase-request-line-api';
21
+ export { searchSupplier as searchSupplierApi } from './supplier-api';
22
+ export { searchUnit as searchUnitApi } from './unit-api';
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,aAAa,IAAI,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,qBAAqB,IAAI,wBAAwB,EACjD,kBAAkB,IAAI,qBAAqB,EAC3C,qBAAqB,IAAI,wBAAwB,EACjD,qBAAqB,IAAI,wBAAwB,EACjD,2BAA2B,IAAI,8BAA8B,GAC9D,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,IAAI,4BAA4B,EACzD,wBAAwB,IAAI,2BAA2B,EACvD,yBAAyB,IAAI,4BAA4B,EACzD,yBAAyB,IAAI,4BAA4B,GAC1D,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,cAAc,IAAI,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAC,UAAU,IAAI,aAAa,EAAC,MAAM,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export function searchProduct({ page, searchValue }: {
2
+ page?: number;
3
+ searchValue: any;
4
+ }): Promise<any>;
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createStandardSearch, getNowDateZonesISOString, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ const createProductCriteria = ({ searchValue }) => {
20
+ const criterias = [
21
+ getSearchCriterias('purchase_product', searchValue),
22
+ {
23
+ fieldName: 'isModel',
24
+ operator: '=',
25
+ value: false,
26
+ },
27
+ {
28
+ fieldName: 'expense',
29
+ operator: '=',
30
+ value: false,
31
+ },
32
+ {
33
+ operator: 'or',
34
+ criteria: [
35
+ {
36
+ fieldName: 'endDate',
37
+ operator: 'isNull',
38
+ },
39
+ {
40
+ fieldName: 'endDate',
41
+ operator: '>',
42
+ value: getNowDateZonesISOString().split('T')[0],
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ fieldName: 'purchasable',
48
+ operator: '=',
49
+ value: true,
50
+ },
51
+ {
52
+ fieldName: 'dtype',
53
+ operator: '=',
54
+ value: 'Product',
55
+ },
56
+ ];
57
+ return criterias;
58
+ };
59
+ export async function searchProduct({ page = 0, searchValue }) {
60
+ return createStandardSearch({
61
+ model: 'com.axelor.apps.base.db.Product',
62
+ criteria: createProductCriteria({ searchValue }),
63
+ fieldKey: 'purchase_product',
64
+ sortKey: 'purchase_product',
65
+ page,
66
+ provider: 'model',
67
+ });
68
+ }
69
+ //# sourceMappingURL=product-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-api.js","sourceRoot":"","sources":["../../src/api/product-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,qBAAqB,GAAG,CAAC,EAAC,WAAW,EAAC,EAAE,EAAE;IAC9C,MAAM,SAAS,GAAG;QAChB,kBAAkB,CAAC,kBAAkB,EAAE,WAAW,CAAC;QACnD;YACE,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,KAAK;SACb;QACD;YACE,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,KAAK;SACb;QACD;YACE,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE;gBACR;oBACE,SAAS,EAAE,SAAS;oBACpB,QAAQ,EAAE,QAAQ;iBACnB;gBACD;oBACE,SAAS,EAAE,SAAS;oBACpB,QAAQ,EAAE,GAAG;oBACb,KAAK,EAAE,wBAAwB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;iBAChD;aACF;SACF;QACD;YACE,SAAS,EAAE,aAAa;YACxB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,IAAI;SACZ;QACD;YACE,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,SAAS;SACjB;KACF,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,WAAW,EAAC;IACzD,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,iCAAiC;QACxC,QAAQ,EAAE,qBAAqB,CAAC,EAAC,WAAW,EAAC,CAAC;QAC9C,QAAQ,EAAE,kBAAkB;QAC5B,OAAO,EAAE,kBAAkB;QAC3B,IAAI;QACJ,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,23 @@
1
+ export function searchPurchaseRequest({ page, searchValue, statusList, supplier, companyId, }: {
2
+ page?: number;
3
+ searchValue: any;
4
+ statusList: any;
5
+ supplier: any;
6
+ companyId: any;
7
+ }): Promise<any>;
8
+ export function getPurchaseRequest({ id }: {
9
+ id: any;
10
+ }): Promise<any>;
11
+ export function updatePurchaseRequestStatus({ purchaseRequest, status }: {
12
+ purchaseRequest: any;
13
+ status: any;
14
+ }): Promise<void>;
15
+ export function createPurchaseRequest({ companyId, status, description, purchaseRequestLineList, }: {
16
+ companyId: any;
17
+ status: any;
18
+ description: any;
19
+ purchaseRequestLineList: any;
20
+ }): Promise<void>;
21
+ export function updatePurchaseRequest({ purchaseRequest }: {
22
+ purchaseRequest: any;
23
+ }): Promise<void>;
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createStandardFetch, createStandardSearch, formatRequestBody, getActionApi, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ const createPurchaseRequestCriteria = ({ searchValue, statusList, supplier }) => {
20
+ const criterias = [
21
+ getSearchCriterias('purchase_purchaseRequest', searchValue),
22
+ ];
23
+ if (supplier) {
24
+ criterias.push({
25
+ fieldName: 'supplierPartner.id',
26
+ operator: '=',
27
+ value: supplier.id,
28
+ });
29
+ }
30
+ if (Array.isArray(statusList) && statusList.length > 0) {
31
+ criterias.push({
32
+ operator: 'or',
33
+ criteria: statusList.map(status => ({
34
+ fieldName: 'statusSelect',
35
+ operator: '=',
36
+ value: status.key,
37
+ })),
38
+ });
39
+ }
40
+ return criterias;
41
+ };
42
+ export async function searchPurchaseRequest({ page = 0, searchValue, statusList, supplier, companyId, }) {
43
+ return createStandardSearch({
44
+ model: 'com.axelor.apps.purchase.db.PurchaseRequest',
45
+ criteria: createPurchaseRequestCriteria({
46
+ searchValue,
47
+ statusList,
48
+ supplier,
49
+ }),
50
+ fieldKey: 'purchase_purchaseRequest',
51
+ sortKey: 'purchase_purchaseRequest',
52
+ page,
53
+ companyId,
54
+ provider: 'model',
55
+ });
56
+ }
57
+ export async function getPurchaseRequest({ id }) {
58
+ return createStandardFetch({
59
+ model: 'com.axelor.apps.purchase.db.PurchaseRequest',
60
+ id,
61
+ fieldKey: 'purchase_purchaseRequest',
62
+ provider: 'model',
63
+ });
64
+ }
65
+ export async function updatePurchaseRequestStatus({ purchaseRequest, status }) {
66
+ return getActionApi().send({
67
+ url: `ws/aos/purchase-request/${status}/${purchaseRequest.id}`,
68
+ method: 'put',
69
+ body: {
70
+ version: purchaseRequest.version,
71
+ },
72
+ description: 'update purchase request status',
73
+ });
74
+ }
75
+ export async function createPurchaseRequest({ companyId, status, description, purchaseRequestLineList, }) {
76
+ return getActionApi().send({
77
+ url: 'ws/aos/purchase-request/create',
78
+ method: 'post',
79
+ body: {
80
+ companyId,
81
+ status,
82
+ description,
83
+ purchaseRequestLineList,
84
+ },
85
+ description: 'create purchase request',
86
+ });
87
+ }
88
+ export async function updatePurchaseRequest({ purchaseRequest }) {
89
+ const { matchers } = formatRequestBody(purchaseRequest, 'data');
90
+ return getActionApi().send({
91
+ url: '/ws/rest/com.axelor.apps.purchase.db.PurchaseRequest',
92
+ method: 'post',
93
+ body: {
94
+ data: purchaseRequest,
95
+ },
96
+ description: 'update purchase request',
97
+ matchers: {
98
+ modelName: 'com.axelor.apps.purchase.db.PurchaseRequest',
99
+ id: purchaseRequest.id,
100
+ fields: matchers,
101
+ },
102
+ });
103
+ }
104
+ //# sourceMappingURL=purchase-request-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purchase-request-api.js","sourceRoot":"","sources":["../../src/api/purchase-request-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,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@ -0,0 +1,17 @@
1
+ export function searchPurchaseRequestLine({ page, searchValue, purchaseRequestId, newProduct, }: {
2
+ page?: number;
3
+ searchValue: any;
4
+ purchaseRequestId: any;
5
+ newProduct: any;
6
+ }): Promise<any>;
7
+ export function fetchPurchaseRequestLine({ id }: {
8
+ id: any;
9
+ }): Promise<any>;
10
+ export function createPurchaseRequestLine({ purchaseRequestId, purchaseRequestVersion, purchaseRequestLine, }: {
11
+ purchaseRequestId: any;
12
+ purchaseRequestVersion: any;
13
+ purchaseRequestLine: any;
14
+ }): Promise<void>;
15
+ export function updatePurchaseRequestLine({ purchaseRequestLine }: {
16
+ purchaseRequestLine: any;
17
+ }): Promise<void>;
@@ -0,0 +1,100 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createStandardFetch, createStandardSearch, formatRequestBody, getActionApi, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ const createPurchaseRequestLineCriteria = ({ searchValue, purchaseRequestId, newProduct, }) => {
20
+ const criterias = [
21
+ getSearchCriterias('purchase_purchaseRequestLine', searchValue),
22
+ {
23
+ fieldName: 'purchaseRequest.id',
24
+ operator: '=',
25
+ value: purchaseRequestId,
26
+ },
27
+ ];
28
+ if (newProduct != null) {
29
+ criterias.push({
30
+ fieldName: 'newProduct',
31
+ operator: '=',
32
+ value: newProduct,
33
+ });
34
+ }
35
+ return criterias;
36
+ };
37
+ export async function searchPurchaseRequestLine({ page = 0, searchValue, purchaseRequestId, newProduct, }) {
38
+ return createStandardSearch({
39
+ model: 'com.axelor.apps.purchase.db.PurchaseRequestLine',
40
+ criteria: createPurchaseRequestLineCriteria({
41
+ searchValue,
42
+ purchaseRequestId,
43
+ newProduct,
44
+ }),
45
+ fieldKey: 'purchase_purchaseRequestLine',
46
+ sortKey: 'purchase_purchaseRequestLine',
47
+ page,
48
+ provider: 'model',
49
+ });
50
+ }
51
+ export async function fetchPurchaseRequestLine({ id }) {
52
+ return createStandardFetch({
53
+ model: 'com.axelor.apps.purchase.db.PurchaseRequestLine',
54
+ id,
55
+ fieldKey: 'purchase_purchaseRequestLine',
56
+ provider: 'model',
57
+ });
58
+ }
59
+ export async function createPurchaseRequestLine({ purchaseRequestId, purchaseRequestVersion, purchaseRequestLine, }) {
60
+ return getActionApi().send({
61
+ url: `ws/aos/purchase-request/add-line/${purchaseRequestId}`,
62
+ method: 'put',
63
+ body: {
64
+ version: purchaseRequestVersion,
65
+ productId: purchaseRequestLine.product?.id,
66
+ productTitle: purchaseRequestLine.productTitle,
67
+ unitId: purchaseRequestLine.unit?.id,
68
+ quantity: purchaseRequestLine.quantity,
69
+ },
70
+ description: 'create purchase request line',
71
+ matchers: {
72
+ modelName: 'com.axelor.apps.purchase.db.PurchaseRequestLine',
73
+ id: Date.now(),
74
+ fields: {
75
+ productId: 'product.id',
76
+ unitId: 'unit.id',
77
+ },
78
+ },
79
+ });
80
+ }
81
+ export async function updatePurchaseRequestLine({ purchaseRequestLine }) {
82
+ const { matchers } = formatRequestBody(purchaseRequestLine, 'data');
83
+ return getActionApi().send({
84
+ url: '/ws/rest/com.axelor.apps.purchase.db.PurchaseRequestLine',
85
+ method: 'post',
86
+ body: {
87
+ data: {
88
+ ...purchaseRequestLine,
89
+ newProduct: purchaseRequestLine.product == null,
90
+ },
91
+ },
92
+ description: 'update purchase request line',
93
+ matchers: {
94
+ modelName: 'com.axelor.apps.purchase.db.PurchaseRequestLine',
95
+ id: purchaseRequestLine.id,
96
+ fields: matchers,
97
+ },
98
+ });
99
+ }
100
+ //# sourceMappingURL=purchase-request-line-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purchase-request-line-api.js","sourceRoot":"","sources":["../../src/api/purchase-request-line-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,iCAAiC,GAAG,CAAC,EACzC,WAAW,EACX,iBAAiB,EACjB,UAAU,GACX,EAAE,EAAE;IACH,MAAM,SAAS,GAAG;QAChB,kBAAkB,CAAC,8BAA8B,EAAE,WAAW,CAAC;QAC/D;YACE,SAAS,EAAE,oBAAoB;YAC/B,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,iBAAiB;SACzB;KACF,CAAC;IAEF,IAAI,UAAU,IAAI,IAAI,EAAE;QACtB,SAAS,CAAC,IAAI,CAAC;YACb,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,UAAU;SAClB,CAAC,CAAC;KACJ;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,EAC9C,IAAI,GAAG,CAAC,EACR,WAAW,EACX,iBAAiB,EACjB,UAAU,GACX;IACC,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,iDAAiD;QACxD,QAAQ,EAAE,iCAAiC,CAAC;YAC1C,WAAW;YACX,iBAAiB;YACjB,UAAU;SACX,CAAC;QACF,QAAQ,EAAE,8BAA8B;QACxC,OAAO,EAAE,8BAA8B;QACvC,IAAI;QACJ,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,EAAC,EAAE,EAAC;IACjD,OAAO,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EAAE,mBAAmB,CAAC,EAAE;YAC1B,MAAM,EAAE,QAAQ;SACjB;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ export function searchSupplier({ page, searchValue, companyId }: {
2
+ page?: number;
3
+ searchValue: any;
4
+ companyId: any;
5
+ }): Promise<any>;
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createStandardSearch, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ const createSupplierCriteria = searchValue => {
20
+ const criterias = [
21
+ getSearchCriterias('purchase_supplier', searchValue),
22
+ {
23
+ fieldName: 'isContact',
24
+ operator: '=',
25
+ value: false,
26
+ },
27
+ {
28
+ fieldName: 'isSupplier',
29
+ operator: '=',
30
+ value: true,
31
+ },
32
+ ];
33
+ return criterias;
34
+ };
35
+ export async function searchSupplier({ page = 0, searchValue, companyId }) {
36
+ return createStandardSearch({
37
+ model: 'com.axelor.apps.base.db.Partner',
38
+ criteria: createSupplierCriteria(searchValue),
39
+ fieldKey: 'purchase_supplier',
40
+ sortKey: 'purchase_supplier',
41
+ page,
42
+ companyId,
43
+ isCompanyM2M: true,
44
+ provider: 'model',
45
+ });
46
+ }
47
+ //# sourceMappingURL=supplier-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"supplier-api.js","sourceRoot":"","sources":["../../src/api/supplier-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,sBAAsB,GAAG,WAAW,CAAC,EAAE;IAC3C,MAAM,SAAS,GAAG;QAChB,kBAAkB,CAAC,mBAAmB,EAAE,WAAW,CAAC;QACpD;YACE,SAAS,EAAE,WAAW;YACtB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,KAAK;SACb;QACD;YACE,SAAS,EAAE,YAAY;YACvB,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE,IAAI;SACZ;KACF,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,WAAW,EAAE,SAAS,EAAC;IACrE,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,iCAAiC;QACxC,QAAQ,EAAE,sBAAsB,CAAC,WAAW,CAAC;QAC7C,QAAQ,EAAE,mBAAmB;QAC7B,OAAO,EAAE,mBAAmB;QAC5B,IAAI;QACJ,SAAS;QACT,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ export function searchUnit({ page, searchValue }: {
2
+ page?: number;
3
+ searchValue: any;
4
+ }): Promise<any>;
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { createStandardSearch, getSearchCriterias, } from '@axelor/aos-mobile-core';
19
+ export async function searchUnit({ page = 0, searchValue }) {
20
+ return createStandardSearch({
21
+ model: 'com.axelor.apps.base.db.Unit',
22
+ criteria: [getSearchCriterias('purchase_unit', searchValue)],
23
+ fieldKey: 'purchase_unit',
24
+ sortKey: 'purchase_unit',
25
+ page,
26
+ provider: 'model',
27
+ });
28
+ }
29
+ //# sourceMappingURL=unit-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit-api.js","sourceRoot":"","sources":["../../src/api/unit-api.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAAC,IAAI,GAAG,CAAC,EAAE,WAAW,EAAC;IACtD,OAAO,oBAAoB,CAAC;QAC1B,KAAK,EAAE,8BAA8B;QACrC,QAAQ,EAAE,CAAC,kBAAkB,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;QAC5D,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,eAAe;QACxB,IAAI;QACJ,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DropdownRequestCharacteristics: () => React.JSX.Element;
3
+ export default DropdownRequestCharacteristics;
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React from 'react';
19
+ import { View } from 'react-native';
20
+ import { checkNullString, Label, LabelText } from '@axelor/aos-mobile-ui';
21
+ import { useSelector, useTranslator } from '@axelor/aos-mobile-core';
22
+ const DropdownRequestCharacteristics = () => {
23
+ const I18n = useTranslator();
24
+ const { purchaseRequest } = useSelector(state => state.purchase_purchaseRequest);
25
+ if (checkNullString(purchaseRequest.supplierPartner?.fullName) &&
26
+ checkNullString(purchaseRequest.stockLocation?.name) &&
27
+ checkNullString(purchaseRequest.requesterUser?.fullName) &&
28
+ checkNullString(purchaseRequest.validatorUser?.fullName)) {
29
+ return (<Label message={I18n.t('Purchase_NoInformationAvailable')} type="info" iconName="info-circle-fill"/>);
30
+ }
31
+ return (<View>
32
+ {!checkNullString(purchaseRequest.supplierPartner?.fullName) && (<LabelText title={purchaseRequest.supplierPartner?.fullName} iconName="person-fill" textSize={16}/>)}
33
+ {!checkNullString(purchaseRequest.stockLocation?.name) && (<LabelText title={`${I18n.t('Purchase_StockLocation')} :`} value={purchaseRequest.stockLocation?.name} textSize={16}/>)}
34
+ {!checkNullString(purchaseRequest.requesterUser?.fullName) && (<LabelText title={`${I18n.t('Purchase_RequesterUser')} :`} value={purchaseRequest.requesterUser?.fullName} textSize={16}/>)}
35
+ {!checkNullString(purchaseRequest.validatorUser?.fullName) && (<LabelText title={`${I18n.t('Purchase_ValidatorUser')} :`} value={purchaseRequest.validatorUser?.fullName} textSize={16}/>)}
36
+ </View>);
37
+ };
38
+ export default DropdownRequestCharacteristics;
39
+ //# sourceMappingURL=DropdownRequestCharacteristics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownRequestCharacteristics.js","sourceRoot":"","sources":["../../../../src/components/atoms/DropdownRequestCharacteristics/DropdownRequestCharacteristics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C,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAC/C,KAAK,CAAC,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,CAAC,CAC3C,QAAQ,CAAC,CAAC,EAAE,CAAC,EACb,CACH,CACD;MAAA,CAAC,CAAC,eAAe,CAAC,eAAe,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,CAC5D,CAAC,SAAS,CACR,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAC/C,KAAK,CAAC,CAAC,eAAe,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC/C,QAAQ,CAAC,CAAC,EAAE,CAAC,EACb,CACH,CACD;MAAA,CAAC,CAAC,eAAe,CAAC,eAAe,CAAC,aAAa,EAAE,QAAQ,CAAC,IAAI,CAC5D,CAAC,SAAS,CACR,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAC/C,KAAK,CAAC,CAAC,eAAe,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC/C,QAAQ,CAAC,CAAC,EAAE,CAAC,EACb,CACH,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,8BAA8B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface RequestCardProps {
3
+ style?: any;
4
+ companyName: string;
5
+ supplierPartnerName: string;
6
+ reference: string;
7
+ statusSelect: number;
8
+ onPress: () => void;
9
+ }
10
+ declare const RequestCard: ({ style, companyName, supplierPartnerName, reference, statusSelect, onPress, }: RequestCardProps) => React.JSX.Element;
11
+ export default RequestCard;
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Axelor Business Solutions
3
+ *
4
+ * Copyright (C) 2025 Axelor (<http://axelor.com>).
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU Affero General Public License, version 3,
8
+ * as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import React, { useMemo } from 'react';
19
+ import { StyleSheet } from 'react-native';
20
+ import { ObjectCard } from '@axelor/aos-mobile-ui';
21
+ import { useTypeHelpers, useTypes } from '@axelor/aos-mobile-core';
22
+ const RequestCard = ({ style, companyName, supplierPartnerName, reference, statusSelect, onPress, }) => {
23
+ const { PurchaseRequest } = useTypes();
24
+ const { getItemColor } = useTypeHelpers();
25
+ const borderStyle = useMemo(() => {
26
+ return getStyles(getItemColor(PurchaseRequest?.statusSelect, statusSelect)?.background)?.border;
27
+ }, [PurchaseRequest?.statusSelect, getItemColor, statusSelect]);
28
+ return (<ObjectCard onPress={onPress} style={[borderStyle, style]} upperTexts={{
29
+ items: [
30
+ {
31
+ isTitle: true,
32
+ displayText: reference,
33
+ },
34
+ {
35
+ iconName: 'person-fill',
36
+ indicatorText: supplierPartnerName,
37
+ hideIfNull: true,
38
+ },
39
+ {
40
+ iconName: 'building',
41
+ indicatorText: companyName,
42
+ hideIfNull: true,
43
+ },
44
+ ],
45
+ }}/>);
46
+ };
47
+ const getStyles = (color) => StyleSheet.create({
48
+ border: { borderLeftWidth: 7, borderLeftColor: color },
49
+ });
50
+ export default RequestCard;
51
+ //# sourceMappingURL=RequestCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RequestCard.js","sourceRoot":"","sources":["../../../../src/components/atoms/RequestCard/RequestCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,U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C,CAAC;AAEL,eAAe,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const RequestHeader: ({}: {}) => React.JSX.Element;
3
+ export default RequestHeader;