npm-pkg-hook 1.0.2 → 1.0.5
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.
- package/.babelrc +13 -13
- package/.env +1 -0
- package/.eslintrc.js +132 -0
- package/.eslintrc.json +107 -107
- package/.github/pull_request_template.md +17 -17
- package/.github/workflows/pepeline.yaml +29 -29
- package/.vscode/extensions.json +6 -0
- package/.vscode/settings.json +12 -0
- package/README.md +1 -1
- package/jsconfig.json +27 -27
- package/next.config.js +128 -128
- package/package.json +8 -6
- package/script.txt +7 -0
- package/src/cookies/index.ts +3 -3
- package/src/hooks/index.js +47 -19
- package/src/hooks/updateExtProductFoodsOptional/index.js +38 -0
- package/src/hooks/useAcumulateDate/index.js +16 -16
- package/src/hooks/useAnimationText/index.jsx +31 -30
- package/src/hooks/useBanner/index.js +19 -0
- package/src/hooks/useCatWithProduct/index.js +42 -0
- package/src/hooks/useCatWithProduct/queries.js +172 -0
- package/src/hooks/useCategoryInStore/index.js +94 -0
- package/src/hooks/{useGetCategorieStore → useCategoryInStore}/queries.js +77 -77
- package/src/hooks/useCategoryStore/index.js +7 -7
- package/src/hooks/useCategoryStore/queries.js +16 -16
- package/src/hooks/useChartData/index.js +170 -0
- package/src/hooks/useCheckbox/index.js +114 -114
- package/src/hooks/useClients/index.js +13 -13
- package/src/hooks/useClients/queries.js +117 -117
- package/src/hooks/useConnection/index.js +23 -0
- package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.js +165 -0
- package/src/hooks/useCreateProduct/index.js +268 -0
- package/src/hooks/useDessert/index.js +141 -0
- package/src/hooks/useDrag/index.js +62 -57
- package/src/hooks/useEvent/index.js +33 -33
- package/src/hooks/useFetchJson/index.js +24 -24
- package/src/hooks/useFetchMoreInteractions/index.jsx +37 -34
- package/src/hooks/useFormTools/index.js +83 -70
- package/src/hooks/useFormatDate/index.js +34 -0
- package/src/hooks/useFullScreenMode/index.js +65 -65
- package/src/hooks/useHover/index.js +28 -28
- package/src/hooks/useImageOptimization/index.js +28 -0
- package/src/hooks/useImageWeight/index.js +52 -0
- package/src/hooks/useImagesStore/index.js +171 -0
- package/src/hooks/useImagesStore/queries.js +216 -0
- package/src/hooks/useInnerHtml/index.js +37 -37
- package/src/hooks/useIntersection/index.js +84 -31
- package/src/hooks/useKeypress/index.js +27 -27
- package/src/hooks/useLazyScript/index.js +72 -0
- package/src/hooks/useLocalSorage/index.js +35 -35
- package/src/hooks/useLocationNavigate/index.js +54 -54
- package/src/hooks/useMobile/index.js +37 -37
- package/src/hooks/useMutateHeight/index.js +37 -0
- package/src/hooks/useProductsFood/index.js +190 -0
- package/src/hooks/{useGetProductsFood → useProductsFood}/queriesStore.js +780 -765
- package/src/hooks/useProductsFood/usetagsProducts.js +57 -0
- package/src/hooks/useReactToPrint/index.js +1201 -0
- package/src/hooks/useReport/index.js +35 -0
- package/src/hooks/useReport/queries.js +122 -0
- package/src/hooks/useRestaurant/index.js +19 -19
- package/src/hooks/useRestaurant/queries.js +79 -69
- package/src/hooks/useSales/index.js +589 -489
- package/src/hooks/useSales/queries.js +290 -229
- package/src/hooks/useSales/useGetSale.js +12 -0
- package/src/hooks/useSales/useTotalSales.js +17 -0
- package/src/hooks/useSaveAvailableProduct/helpers/index.js +30 -0
- package/src/hooks/useSaveAvailableProduct/index.js +26 -0
- package/src/hooks/useSaveAvailableProduct/queries.js +10 -0
- package/src/hooks/useSchedule/index.jsx +23 -0
- package/src/hooks/useSetState/index.js +24 -24
- package/src/hooks/useStore/index.js +17 -17
- package/src/hooks/useStore/queries.js +135 -135
- package/src/hooks/useStoreCalendar/index.js +7 -0
- package/src/hooks/useTimeAgo/useTimeAgo.js +39 -39
- package/src/hooks/useUpdateCart/index.js +124 -124
- package/src/hooks/useUpdateExtProductFoodsSubOptional/index.js +37 -0
- package/src/hooks/useUser/index.js +7 -3
- package/src/hooks/useUser/queries.js +69 -0
- package/src/hooks/useWindowSize/index.js +37 -37
- package/src/index.jsx +2 -1
- package/src/mock/dessert/index.js +16 -0
- package/src/mock/index.js +2 -0
- package/src/utils/index.js +106 -54
- package/src/hooks/useGetCategorieStore/index.js +0 -21
- package/src/hooks/useGetProductsFood/index.js +0 -46
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useQuery } from '@apollo/client'
|
|
2
|
+
import { GET_ALL_SALES, GET_ALL_TOTAL_SALES } from './queries'
|
|
3
|
+
|
|
4
|
+
export const useReport = ({
|
|
5
|
+
more,
|
|
6
|
+
fromDate,
|
|
7
|
+
toDate
|
|
8
|
+
}) => {
|
|
9
|
+
const { data, fetchMore, loading } = useQuery(GET_ALL_SALES,{
|
|
10
|
+
fetchPolicy: 'network-only',
|
|
11
|
+
variables: {
|
|
12
|
+
min: 0,
|
|
13
|
+
fromDate,
|
|
14
|
+
toDate,
|
|
15
|
+
max: more
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
// get total sales
|
|
19
|
+
const { data: totalSales } = useQuery(GET_ALL_TOTAL_SALES, {
|
|
20
|
+
variables: {
|
|
21
|
+
fromDate,
|
|
22
|
+
toDate,
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
// console.log({totalSales})
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
data,
|
|
29
|
+
loading,
|
|
30
|
+
totalSales: totalSales?.getAllSalesStoreTotal.TOTAL ?? 0,
|
|
31
|
+
restaurant: totalSales?.getAllSalesStoreTotal.restaurant ?? 0,
|
|
32
|
+
delivery: totalSales?.getAllSalesStoreTotal.delivery ?? 0,
|
|
33
|
+
fetchMore
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { gql } from '@apollo/client'
|
|
2
|
+
|
|
3
|
+
export const GET_ALL_SALES = gql`
|
|
4
|
+
query getAllSalesStore($idStore: ID,$search: String, $min: Int, $max: Int $fromDate: DateTime, $toDate: DateTime ) {
|
|
5
|
+
getAllSalesStore(idStore: $idStore, search: $search, min: $min, max: $max, toDate: $toDate, fromDate: $fromDate) {
|
|
6
|
+
totalProductsPrice
|
|
7
|
+
pDatCre,
|
|
8
|
+
pCodeRef
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const GET_ALL_TOTAL_SALES = gql`
|
|
14
|
+
query getAllSalesStoreTotal($idStore: ID,$search: String, $min: Int, $max: Int $fromDate: DateTime, $toDate: DateTime ) {
|
|
15
|
+
getAllSalesStoreTotal(idStore: $idStore, search: $search, min: $min, max: $max, toDate: $toDate, fromDate: $fromDate) {
|
|
16
|
+
restaurant
|
|
17
|
+
delivery
|
|
18
|
+
TOTAL
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
export const GET_ALL_SALES_STATISTICS = gql`
|
|
23
|
+
query getAllSalesStoreStatistic($idStore: ID,$search: String, $min: Int, $max: Int $fromDate: DateTime, $toDate: DateTime ) {
|
|
24
|
+
getAllSalesStoreStatistic(idStore: $idStore, search: $search, min: $min, max: $max, toDate: $toDate, fromDate: $fromDate) {
|
|
25
|
+
pdpId
|
|
26
|
+
idStore
|
|
27
|
+
pCodeRef
|
|
28
|
+
payMethodPState
|
|
29
|
+
pPRecoger
|
|
30
|
+
totalProductsPrice
|
|
31
|
+
pSState
|
|
32
|
+
pDatCre
|
|
33
|
+
locationUser
|
|
34
|
+
pDatMod
|
|
35
|
+
getAllPedidoStore{
|
|
36
|
+
pdpId
|
|
37
|
+
pId
|
|
38
|
+
idStore
|
|
39
|
+
ShoppingCard
|
|
40
|
+
pCodeRef
|
|
41
|
+
pPStateP
|
|
42
|
+
payMethodPState
|
|
43
|
+
pPRecoger
|
|
44
|
+
pDatCre
|
|
45
|
+
pDatMod
|
|
46
|
+
getAllShoppingCard {
|
|
47
|
+
ShoppingCard
|
|
48
|
+
comments
|
|
49
|
+
cantProducts
|
|
50
|
+
pId
|
|
51
|
+
productFood{
|
|
52
|
+
pId
|
|
53
|
+
carProId
|
|
54
|
+
colorId
|
|
55
|
+
idStore
|
|
56
|
+
pName
|
|
57
|
+
ProPrice
|
|
58
|
+
ProDescuento
|
|
59
|
+
ProDescription
|
|
60
|
+
ValueDelivery
|
|
61
|
+
ProImage
|
|
62
|
+
ProStar
|
|
63
|
+
pState
|
|
64
|
+
pDatCre
|
|
65
|
+
pDatMod
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`
|
|
72
|
+
|
|
73
|
+
export const GET_ONE_SALES = gql`
|
|
74
|
+
query getOneSalesStore($pCodeRef: String) {
|
|
75
|
+
getOneSalesStore(pCodeRef: $pCodeRef) {
|
|
76
|
+
pdpId
|
|
77
|
+
idStore
|
|
78
|
+
pCodeRef
|
|
79
|
+
payMethodPState
|
|
80
|
+
pPRecoger
|
|
81
|
+
totalProductsPrice
|
|
82
|
+
pSState
|
|
83
|
+
pDatCre
|
|
84
|
+
locationUser
|
|
85
|
+
pDatMod
|
|
86
|
+
getAllPedidoStore{
|
|
87
|
+
pdpId
|
|
88
|
+
pId
|
|
89
|
+
idStore
|
|
90
|
+
ShoppingCard
|
|
91
|
+
pCodeRef
|
|
92
|
+
pPStateP
|
|
93
|
+
payMethodPState
|
|
94
|
+
pPRecoger
|
|
95
|
+
pDatCre
|
|
96
|
+
pDatMod
|
|
97
|
+
getAllShoppingCard {
|
|
98
|
+
ShoppingCard
|
|
99
|
+
comments
|
|
100
|
+
cantProducts
|
|
101
|
+
pId
|
|
102
|
+
productFood{
|
|
103
|
+
pId
|
|
104
|
+
carProId
|
|
105
|
+
colorId
|
|
106
|
+
idStore
|
|
107
|
+
pName
|
|
108
|
+
ProPrice
|
|
109
|
+
ProDescuento
|
|
110
|
+
ProDescription
|
|
111
|
+
ValueDelivery
|
|
112
|
+
ProImage
|
|
113
|
+
ProStar
|
|
114
|
+
pState
|
|
115
|
+
pDatCre
|
|
116
|
+
pDatMod
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
`
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useQuery } from '@apollo/client'
|
|
2
|
-
import { GET_ALL_RESTAURANT } from './queries'
|
|
3
|
-
|
|
4
|
-
export const useRestaurant = () => {
|
|
5
|
-
const {
|
|
6
|
-
data,
|
|
7
|
-
loading,
|
|
8
|
-
error,
|
|
9
|
-
fetchMore
|
|
10
|
-
} = useQuery(GET_ALL_RESTAURANT, {
|
|
11
|
-
fetchPolicy: 'cache-and-network',
|
|
12
|
-
notifyOnNetworkStatusChange: true,
|
|
13
|
-
nextFetchPolicy: 'cache-first',
|
|
14
|
-
refetchWritePolicy: 'merge',
|
|
15
|
-
context: { clientName: 'admin-store'
|
|
16
|
-
}
|
|
17
|
-
})
|
|
18
|
-
return [data, { loading, error, fetchMore }]
|
|
19
|
-
}
|
|
1
|
+
import { useQuery } from '@apollo/client'
|
|
2
|
+
import { GET_ALL_RESTAURANT } from './queries'
|
|
3
|
+
|
|
4
|
+
export const useRestaurant = () => {
|
|
5
|
+
const {
|
|
6
|
+
data,
|
|
7
|
+
loading,
|
|
8
|
+
error,
|
|
9
|
+
fetchMore
|
|
10
|
+
} = useQuery(GET_ALL_RESTAURANT, {
|
|
11
|
+
fetchPolicy: 'cache-and-network',
|
|
12
|
+
notifyOnNetworkStatusChange: true,
|
|
13
|
+
nextFetchPolicy: 'cache-first',
|
|
14
|
+
refetchWritePolicy: 'merge',
|
|
15
|
+
context: { clientName: 'admin-store'
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
return [data, { loading, error, fetchMore }]
|
|
19
|
+
}
|
|
@@ -1,70 +1,80 @@
|
|
|
1
|
-
import { gql } from '@apollo/client'
|
|
2
|
-
export const GET_ALL_RESTAURANT = gql`
|
|
3
|
-
query getAllStoreInStore($search: String, $min: Int, $max: Int){
|
|
4
|
-
getAllStoreInStore(search: $search, min: $min, max: $max) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
import { gql } from '@apollo/client'
|
|
2
|
+
export const GET_ALL_RESTAURANT = gql`
|
|
3
|
+
query getAllStoreInStore($search: String, $min: Int, $max: Int){
|
|
4
|
+
getAllStoreInStore(search: $search, min: $min, max: $max) {
|
|
5
|
+
open
|
|
6
|
+
getStoreSchedules {
|
|
7
|
+
idStore
|
|
8
|
+
schId
|
|
9
|
+
schDay
|
|
10
|
+
schHoSta
|
|
11
|
+
schHoEnd
|
|
12
|
+
schState
|
|
13
|
+
}
|
|
14
|
+
idStore
|
|
15
|
+
cId
|
|
16
|
+
id
|
|
17
|
+
dId
|
|
18
|
+
ctId
|
|
19
|
+
catStore
|
|
20
|
+
neighborhoodStore
|
|
21
|
+
Viaprincipal
|
|
22
|
+
storeOwner
|
|
23
|
+
storeName
|
|
24
|
+
cateStore{
|
|
25
|
+
catStore
|
|
26
|
+
cName
|
|
27
|
+
}
|
|
28
|
+
emailStore
|
|
29
|
+
storePhone
|
|
30
|
+
socialRaz
|
|
31
|
+
Image
|
|
32
|
+
banner
|
|
33
|
+
documentIdentifier
|
|
34
|
+
uPhoNum
|
|
35
|
+
ULocation
|
|
36
|
+
upLat
|
|
37
|
+
upLon
|
|
38
|
+
uState
|
|
39
|
+
siteWeb
|
|
40
|
+
description
|
|
41
|
+
NitStore
|
|
42
|
+
typeRegiments
|
|
43
|
+
typeContribute
|
|
44
|
+
secVia
|
|
45
|
+
addressStore
|
|
46
|
+
createdAt
|
|
47
|
+
pais{
|
|
48
|
+
cId
|
|
49
|
+
cName
|
|
50
|
+
cCalCod
|
|
51
|
+
cState
|
|
52
|
+
cDatCre
|
|
53
|
+
cDatMod
|
|
54
|
+
}
|
|
55
|
+
city {
|
|
56
|
+
ctId
|
|
57
|
+
dId
|
|
58
|
+
cName
|
|
59
|
+
cState
|
|
60
|
+
cDatCre
|
|
61
|
+
cDatMod
|
|
62
|
+
}
|
|
63
|
+
department {
|
|
64
|
+
dId
|
|
65
|
+
cId
|
|
66
|
+
dName
|
|
67
|
+
dState
|
|
68
|
+
dDatCre
|
|
69
|
+
dDatMod
|
|
70
|
+
}
|
|
71
|
+
getAllRatingStar {
|
|
72
|
+
rSId
|
|
73
|
+
rScore
|
|
74
|
+
idStore
|
|
75
|
+
createAt
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
}
|
|
70
80
|
`
|