@liiift-studio/sales-portal 1.2.1
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/README.md +461 -0
- package/SETUP.md +230 -0
- package/api/getAnalytics.d.ts +38 -0
- package/api/getAnalytics.js +346 -0
- package/api/getBalanceTransactions.d.ts +29 -0
- package/api/getBalanceTransactions.js +125 -0
- package/api/getDesignerInfo.d.ts +37 -0
- package/api/getDesignerInfo.js +98 -0
- package/api/getDesigners.d.ts +28 -0
- package/api/getDesigners.js +63 -0
- package/api/getPreviousSales.d.ts +23 -0
- package/api/getPreviousSales.js +82 -0
- package/api/getSales.d.ts +29 -0
- package/api/getSales.js +50 -0
- package/api/getSalesRange.d.ts +23 -0
- package/api/getSalesRange.js +58 -0
- package/api/utils/authMiddleware.js +84 -0
- package/api/utils/dateUtils.js +69 -0
- package/api/utils/feeCalculator.js +148 -0
- package/api/utils/processors/invoiceProcessor.js +337 -0
- package/api/utils/processors/paymentProcessor.js +462 -0
- package/api/utils/salesDataProcessing.js +596 -0
- package/api/utils/salesDataProcessor.js +224 -0
- package/api/utils/stripeFetcher.js +248 -0
- package/components/DateRangeSalesTable.js +1072 -0
- package/components/DebugValues.js +48 -0
- package/components/LicenseTypeList.js +193 -0
- package/components/LoginForm.js +219 -0
- package/components/PeriodComparison.js +501 -0
- package/components/Sales.js +773 -0
- package/components/SalesChart.js +307 -0
- package/components/SalesPortalPage.js +147 -0
- package/components/SalesTable.js +677 -0
- package/components/SummaryCards.js +345 -0
- package/components/TopPerformers.js +331 -0
- package/components/TypefaceList.js +154 -0
- package/components/table-columns.js +70 -0
- package/components/table-row-cells.js +295 -0
- package/data/countryCode.json +318 -0
- package/hooks/useSalesDateQuery.d.ts +20 -0
- package/hooks/useSalesDateQuery.js +71 -0
- package/index.d.ts +172 -0
- package/index.js +33 -0
- package/package.json +87 -0
- package/styles/sales-portal.module.scss +383 -0
- package/styles/sales-portal.theme.d.ts +5 -0
- package/styles/sales-portal.theme.js +799 -0
- package/utils/currencyUtils.d.ts +20 -0
- package/utils/currencyUtils.js +79 -0
- package/utils/salesDataProcessing.d.ts +44 -0
- package/utils/salesDataProcessing.js +596 -0
- package/utils/useSalesDateQuery.js +71 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "code": "AD", "label": "Andorra", "phone": "376" },
|
|
3
|
+
{ "code": "AE", "label": "United Arab Emirates", "phone": "971" },
|
|
4
|
+
{ "code": "AF", "label": "Afghanistan", "phone": "93" },
|
|
5
|
+
{ "code": "AG", "label": "Antigua and Barbuda", "phone": "1-268" },
|
|
6
|
+
{ "code": "AI", "label": "Anguilla", "phone": "1-264" },
|
|
7
|
+
{ "code": "AL", "label": "Albania", "phone": "355" },
|
|
8
|
+
{ "code": "AM", "label": "Armenia", "phone": "374" },
|
|
9
|
+
{ "code": "AO", "label": "Angola", "phone": "244" },
|
|
10
|
+
{ "code": "AQ", "label": "Antarctica", "phone": "672" },
|
|
11
|
+
{ "code": "AR", "label": "Argentina", "phone": "54" },
|
|
12
|
+
{ "code": "AS", "label": "American Samoa", "phone": "1-684" },
|
|
13
|
+
{ "code": "AT", "label": "Austria", "phone": "43" },
|
|
14
|
+
{ "code": "AU", "label": "Australia", "phone": "61", "suggested": true },
|
|
15
|
+
{ "code": "AW", "label": "Aruba", "phone": "297" },
|
|
16
|
+
{ "code": "AX", "label": "Alland Islands", "phone": "358" },
|
|
17
|
+
{ "code": "AZ", "label": "Azerbaijan", "phone": "994" },
|
|
18
|
+
{ "code": "BA", "label": "Bosnia and Herzegovina", "phone": "387" },
|
|
19
|
+
{ "code": "BB", "label": "Barbados", "phone": "1-246" },
|
|
20
|
+
{ "code": "BD", "label": "Bangladesh", "phone": "880" },
|
|
21
|
+
{ "code": "BE", "label": "Belgium", "phone": "32" },
|
|
22
|
+
{ "code": "BF", "label": "Burkina Faso", "phone": "226" },
|
|
23
|
+
{ "code": "BG", "label": "Bulgaria", "phone": "359" },
|
|
24
|
+
{ "code": "BH", "label": "Bahrain", "phone": "973" },
|
|
25
|
+
{ "code": "BI", "label": "Burundi", "phone": "257" },
|
|
26
|
+
{ "code": "BJ", "label": "Benin", "phone": "229" },
|
|
27
|
+
{ "code": "BL", "label": "Saint Barthelemy", "phone": "590" },
|
|
28
|
+
{ "code": "BM", "label": "Bermuda", "phone": "1-441" },
|
|
29
|
+
{ "code": "BN", "label": "Brunei Darussalam", "phone": "673" },
|
|
30
|
+
{ "code": "BO", "label": "Bolivia", "phone": "591" },
|
|
31
|
+
{ "code": "BR", "label": "Brazil", "phone": "55" },
|
|
32
|
+
{ "code": "BS", "label": "Bahamas", "phone": "1-242" },
|
|
33
|
+
{ "code": "BT", "label": "Bhutan", "phone": "975" },
|
|
34
|
+
{ "code": "BV", "label": "Bouvet Island", "phone": "47" },
|
|
35
|
+
{ "code": "BW", "label": "Botswana", "phone": "267" },
|
|
36
|
+
{ "code": "BY", "label": "Belarus", "phone": "375" },
|
|
37
|
+
{ "code": "BZ", "label": "Belize", "phone": "501" },
|
|
38
|
+
{ "code": "CA", "label": "Canada", "phone": "1", "suggested": true },
|
|
39
|
+
{ "code": "CC", "label": "Cocos (Keeling) Islands", "phone": "61" },
|
|
40
|
+
{ "code": "CD", "label": "Congo, Democratic Republic of the", "phone": "243" },
|
|
41
|
+
{ "code": "CF", "label": "Central African Republic", "phone": "236" },
|
|
42
|
+
{ "code": "CG", "label": "Congo, Republic of the", "phone": "242" },
|
|
43
|
+
{ "code": "CH", "label": "Switzerland", "phone": "41" },
|
|
44
|
+
{ "code": "CI", "label": "Cote d'Ivoire", "phone": "225" },
|
|
45
|
+
{ "code": "CK", "label": "Cook Islands", "phone": "682" },
|
|
46
|
+
{ "code": "CL", "label": "Chile", "phone": "56" },
|
|
47
|
+
{ "code": "CM", "label": "Cameroon", "phone": "237" },
|
|
48
|
+
{ "code": "CN", "label": "China", "phone": "86" },
|
|
49
|
+
{ "code": "CO", "label": "Colombia", "phone": "57" },
|
|
50
|
+
{ "code": "CR", "label": "Costa Rica", "phone": "506" },
|
|
51
|
+
{ "code": "CU", "label": "Cuba", "phone": "53" },
|
|
52
|
+
{ "code": "CV", "label": "Cape Verde", "phone": "238" },
|
|
53
|
+
{ "code": "CW", "label": "Curacao", "phone": "599" },
|
|
54
|
+
{ "code": "CX", "label": "Christmas Island", "phone": "61" },
|
|
55
|
+
{ "code": "CY", "label": "Cyprus", "phone": "357" },
|
|
56
|
+
{ "code": "CZ", "label": "Czech Republic", "phone": "420" },
|
|
57
|
+
{ "code": "DE", "label": "Germany", "phone": "49", "suggested": true },
|
|
58
|
+
{ "code": "DJ", "label": "Djibouti", "phone": "253" },
|
|
59
|
+
{ "code": "DK", "label": "Denmark", "phone": "45" },
|
|
60
|
+
{ "code": "DM", "label": "Dominica", "phone": "1-767" },
|
|
61
|
+
{ "code": "DO", "label": "Dominican Republic", "phone": "1-809" },
|
|
62
|
+
{ "code": "DZ", "label": "Algeria", "phone": "213" },
|
|
63
|
+
{ "code": "EC", "label": "Ecuador", "phone": "593" },
|
|
64
|
+
{ "code": "EE", "label": "Estonia", "phone": "372" },
|
|
65
|
+
{ "code": "EG", "label": "Egypt", "phone": "20" },
|
|
66
|
+
{ "code": "EH", "label": "Western Sahara", "phone": "212" },
|
|
67
|
+
{ "code": "ER", "label": "Eritrea", "phone": "291" },
|
|
68
|
+
{ "code": "ES", "label": "Spain", "phone": "34" },
|
|
69
|
+
{ "code": "ET", "label": "Ethiopia", "phone": "251" },
|
|
70
|
+
{ "code": "FI", "label": "Finland", "phone": "358" },
|
|
71
|
+
{ "code": "FJ", "label": "Fiji", "phone": "679" },
|
|
72
|
+
{ "code": "FK", "label": "Falkland Islands (Malvinas)", "phone": "500" },
|
|
73
|
+
{ "code": "FM", "label": "Micronesia, Federated States of", "phone": "691" },
|
|
74
|
+
{ "code": "FO", "label": "Faroe Islands", "phone": "298" },
|
|
75
|
+
{ "code": "FR", "label": "France", "phone": "33", "suggested": true },
|
|
76
|
+
{ "code": "GA", "label": "Gabon", "phone": "241" },
|
|
77
|
+
{ "code": "GB", "label": "United Kingdom", "phone": "44" },
|
|
78
|
+
{ "code": "GD", "label": "Grenada", "phone": "1-473" },
|
|
79
|
+
{ "code": "GE", "label": "Georgia", "phone": "995" },
|
|
80
|
+
{ "code": "GF", "label": "French Guiana", "phone": "594" },
|
|
81
|
+
{ "code": "GG", "label": "Guernsey", "phone": "44" },
|
|
82
|
+
{ "code": "GH", "label": "Ghana", "phone": "233" },
|
|
83
|
+
{ "code": "GI", "label": "Gibraltar", "phone": "350" },
|
|
84
|
+
{ "code": "GL", "label": "Greenland", "phone": "299" },
|
|
85
|
+
{ "code": "GM", "label": "Gambia", "phone": "220" },
|
|
86
|
+
{ "code": "GN", "label": "Guinea", "phone": "224" },
|
|
87
|
+
{ "code": "GP", "label": "Guadeloupe", "phone": "590" },
|
|
88
|
+
{ "code": "GQ", "label": "Equatorial Guinea", "phone": "240" },
|
|
89
|
+
{ "code": "GR", "label": "Greece", "phone": "30" },
|
|
90
|
+
{ "code": "GS", "label": "South Georgia and the South Sandwich Islands", "phone": "500" },
|
|
91
|
+
{ "code": "GT", "label": "Guatemala", "phone": "502" },
|
|
92
|
+
{ "code": "GU", "label": "Guam", "phone": "1-671" },
|
|
93
|
+
{ "code": "GW", "label": "Guinea-Bissau", "phone": "245" },
|
|
94
|
+
{ "code": "GY", "label": "Guyana", "phone": "592" },
|
|
95
|
+
{ "code": "HK", "label": "Hong Kong", "phone": "852" },
|
|
96
|
+
{ "code": "HM", "label": "Heard Island and McDonald Islands", "phone": "672" },
|
|
97
|
+
{ "code": "HN", "label": "Honduras", "phone": "504" },
|
|
98
|
+
{ "code": "HR", "label": "Croatia", "phone": "385" },
|
|
99
|
+
{ "code": "HT", "label": "Haiti", "phone": "509" },
|
|
100
|
+
{ "code": "HU", "label": "Hungary", "phone": "36" },
|
|
101
|
+
{ "code": "ID", "label": "Indonesia", "phone": "62" },
|
|
102
|
+
{ "code": "IE", "label": "Ireland", "phone": "353" },
|
|
103
|
+
{ "code": "IL", "label": "Israel", "phone": "972" },
|
|
104
|
+
{ "code": "IM", "label": "Isle of Man", "phone": "44" },
|
|
105
|
+
{ "code": "IN", "label": "India", "phone": "91" },
|
|
106
|
+
{ "code": "IO", "label": "British Indian Ocean Territory", "phone": "246" },
|
|
107
|
+
{ "code": "IQ", "label": "Iraq", "phone": "964" },
|
|
108
|
+
{ "code": "IR", "label": "Iran, Islamic Republic of", "phone": "98" },
|
|
109
|
+
{ "code": "IS", "label": "Iceland", "phone": "354" },
|
|
110
|
+
{ "code": "IT", "label": "Italy", "phone": "39" },
|
|
111
|
+
{ "code": "JE", "label": "Jersey", "phone": "44" },
|
|
112
|
+
{ "code": "JM", "label": "Jamaica", "phone": "1-876" },
|
|
113
|
+
{ "code": "JO", "label": "Jordan", "phone": "962" },
|
|
114
|
+
{ "code": "JP", "label": "Japan", "phone": "81", "suggested": true },
|
|
115
|
+
{ "code": "KE", "label": "Kenya", "phone": "254" },
|
|
116
|
+
{ "code": "KG", "label": "Kyrgyzstan", "phone": "996" },
|
|
117
|
+
{ "code": "KH", "label": "Cambodia", "phone": "855" },
|
|
118
|
+
{ "code": "KI", "label": "Kiribati", "phone": "686" },
|
|
119
|
+
{ "code": "KM", "label": "Comoros", "phone": "269" },
|
|
120
|
+
{ "code": "KN", "label": "Saint Kitts and Nevis", "phone": "1-869" },
|
|
121
|
+
{ "code": "KP", "label": "Korea, Democratic People's Republic of", "phone": "850" },
|
|
122
|
+
{ "code": "KR", "label": "Korea, Republic of", "phone": "82" },
|
|
123
|
+
{ "code": "KW", "label": "Kuwait", "phone": "965" },
|
|
124
|
+
{ "code": "KY", "label": "Cayman Islands", "phone": "1-345" },
|
|
125
|
+
{ "code": "KZ", "label": "Kazakhstan", "phone": "7" },
|
|
126
|
+
{ "code": "LA", "label": "Lao People's Democratic Republic", "phone": "856" },
|
|
127
|
+
{ "code": "LB", "label": "Lebanon", "phone": "961" },
|
|
128
|
+
{ "code": "LC", "label": "Saint Lucia", "phone": "1-758" },
|
|
129
|
+
{ "code": "LI", "label": "Liechtenstein", "phone": "423" },
|
|
130
|
+
{ "code": "LK", "label": "Sri Lanka", "phone": "94" },
|
|
131
|
+
{ "code": "LR", "label": "Liberia", "phone": "231" },
|
|
132
|
+
{ "code": "LS", "label": "Lesotho", "phone": "266" },
|
|
133
|
+
{ "code": "LT", "label": "Lithuania", "phone": "370" },
|
|
134
|
+
{ "code": "LU", "label": "Luxembourg", "phone": "352" },
|
|
135
|
+
{ "code": "LV", "label": "Latvia", "phone": "371" },
|
|
136
|
+
{ "code": "LY", "label": "Libya", "phone": "218" },
|
|
137
|
+
{ "code": "MA", "label": "Morocco", "phone": "212" },
|
|
138
|
+
{ "code": "MC", "label": "Monaco", "phone": "377" },
|
|
139
|
+
{ "code": "MD", "label": "Moldova, Republic of", "phone": "373" },
|
|
140
|
+
{ "code": "ME", "label": "Montenegro", "phone": "382" },
|
|
141
|
+
{ "code": "MF", "label": "Saint Martin (French part)", "phone": "590" },
|
|
142
|
+
{ "code": "MG", "label": "Madagascar", "phone": "261" },
|
|
143
|
+
{ "code": "MH", "label": "Marshall Islands", "phone": "692" },
|
|
144
|
+
{ "code": "MK", "label": "Macedonia, the Former Yugoslav Republic of", "phone": "389" },
|
|
145
|
+
{ "code": "ML", "label": "Mali", "phone": "223" },
|
|
146
|
+
{ "code": "MM", "label": "Myanmar", "phone": "95" },
|
|
147
|
+
{ "code": "MN", "label": "Mongolia", "phone": "976" },
|
|
148
|
+
{ "code": "MO", "label": "Macao", "phone": "853" },
|
|
149
|
+
{ "code": "MP", "label": "Northern Mariana Islands", "phone": "1-670" },
|
|
150
|
+
{ "code": "MQ", "label": "Martinique", "phone": "596" },
|
|
151
|
+
{ "code": "MR", "label": "Mauritania", "phone": "222" },
|
|
152
|
+
{ "code": "MS", "label": "Montserrat", "phone": "1-664" },
|
|
153
|
+
{ "code": "MT", "label": "Malta", "phone": "356" },
|
|
154
|
+
{ "code": "MU", "label": "Mauritius", "phone": "230" },
|
|
155
|
+
{ "code": "MV", "label": "Maldives", "phone": "960" },
|
|
156
|
+
{ "code": "MW", "label": "Malawi", "phone": "265" },
|
|
157
|
+
{ "code": "MX", "label": "Mexico", "phone": "52" },
|
|
158
|
+
{ "code": "MY", "label": "Malaysia", "phone": "60" },
|
|
159
|
+
{ "code": "MZ", "label": "Mozambique", "phone": "258" },
|
|
160
|
+
{ "code": "NA", "label": "Namibia", "phone": "264" },
|
|
161
|
+
{ "code": "NC", "label": "New Caledonia", "phone": "687" },
|
|
162
|
+
{ "code": "NE", "label": "Niger", "phone": "227" },
|
|
163
|
+
{ "code": "NF", "label": "Norfolk Island", "phone": "672" },
|
|
164
|
+
{ "code": "NG", "label": "Nigeria", "phone": "234" },
|
|
165
|
+
{ "code": "HN", "label": "Honduras", "phone": "504" },
|
|
166
|
+
{ "code": "HR", "label": "Croatia", "phone": "385" },
|
|
167
|
+
{ "code": "HT", "label": "Haiti", "phone": "509" },
|
|
168
|
+
{ "code": "HU", "label": "Hungary", "phone": "36" },
|
|
169
|
+
{ "code": "ID", "label": "Indonesia", "phone": "62" },
|
|
170
|
+
{ "code": "IE", "label": "Ireland", "phone": "353" },
|
|
171
|
+
{ "code": "IL", "label": "Israel", "phone": "972" },
|
|
172
|
+
{ "code": "IM", "label": "Isle of Man", "phone": "44" },
|
|
173
|
+
{ "code": "IN", "label": "India", "phone": "91" },
|
|
174
|
+
{ "code": "IO", "label": "British Indian Ocean Territory", "phone": "246" },
|
|
175
|
+
{ "code": "IQ", "label": "Iraq", "phone": "964" },
|
|
176
|
+
{ "code": "IR", "label": "Iran, Islamic Republic of", "phone": "98" },
|
|
177
|
+
{ "code": "IS", "label": "Iceland", "phone": "354" },
|
|
178
|
+
{ "code": "IT", "label": "Italy", "phone": "39" },
|
|
179
|
+
{ "code": "JE", "label": "Jersey", "phone": "44" },
|
|
180
|
+
{ "code": "JM", "label": "Jamaica", "phone": "1-876" },
|
|
181
|
+
{ "code": "JO", "label": "Jordan", "phone": "962" },
|
|
182
|
+
{ "code": "JP", "label": "Japan", "phone": "81", "suggested": true },
|
|
183
|
+
{ "code": "KE", "label": "Kenya", "phone": "254" },
|
|
184
|
+
{ "code": "KG", "label": "Kyrgyzstan", "phone": "996" },
|
|
185
|
+
{ "code": "KH", "label": "Cambodia", "phone": "855" },
|
|
186
|
+
{ "code": "KI", "label": "Kiribati", "phone": "686" },
|
|
187
|
+
{ "code": "KM", "label": "Comoros", "phone": "269" },
|
|
188
|
+
{ "code": "KN", "label": "Saint Kitts and Nevis", "phone": "1-869" },
|
|
189
|
+
{ "code": "KP", "label": "Korea, Democratic People's Republic of", "phone": "850" },
|
|
190
|
+
{ "code": "KR", "label": "Korea, Republic of", "phone": "82" },
|
|
191
|
+
{ "code": "KW", "label": "Kuwait", "phone": "965" },
|
|
192
|
+
{ "code": "KY", "label": "Cayman Islands", "phone": "1-345" },
|
|
193
|
+
{ "code": "KZ", "label": "Kazakhstan", "phone": "7" },
|
|
194
|
+
{ "code": "LA", "label": "Lao People's Democratic Republic", "phone": "856" },
|
|
195
|
+
{ "code": "LB", "label": "Lebanon", "phone": "961" },
|
|
196
|
+
{ "code": "LC", "label": "Saint Lucia", "phone": "1-758" },
|
|
197
|
+
{ "code": "LI", "label": "Liechtenstein", "phone": "423" },
|
|
198
|
+
{ "code": "LK", "label": "Sri Lanka", "phone": "94" },
|
|
199
|
+
{ "code": "LR", "label": "Liberia", "phone": "231" },
|
|
200
|
+
{ "code": "LS", "label": "Lesotho", "phone": "266" },
|
|
201
|
+
{ "code": "LT", "label": "Lithuania", "phone": "370" },
|
|
202
|
+
{ "code": "LU", "label": "Luxembourg", "phone": "352" },
|
|
203
|
+
{ "code": "LV", "label": "Latvia", "phone": "371" },
|
|
204
|
+
{ "code": "LY", "label": "Libya", "phone": "218" },
|
|
205
|
+
{ "code": "MA", "label": "Morocco", "phone": "212" },
|
|
206
|
+
{ "code": "MC", "label": "Monaco", "phone": "377" },
|
|
207
|
+
{ "code": "MD", "label": "Moldova, Republic of", "phone": "373" },
|
|
208
|
+
{ "code": "ME", "label": "Montenegro", "phone": "382" },
|
|
209
|
+
{ "code": "MF", "label": "Saint Martin (French part)", "phone": "590" },
|
|
210
|
+
{ "code": "MG", "label": "Madagascar", "phone": "261" },
|
|
211
|
+
{ "code": "MH", "label": "Marshall Islands", "phone": "692" },
|
|
212
|
+
{ "code": "MK", "label": "Macedonia, the Former Yugoslav Republic of", "phone": "389" },
|
|
213
|
+
{ "code": "ML", "label": "Mali", "phone": "223" },
|
|
214
|
+
{ "code": "MM", "label": "Myanmar", "phone": "95" },
|
|
215
|
+
{ "code": "MN", "label": "Mongolia", "phone": "976" },
|
|
216
|
+
{ "code": "MO", "label": "Macao", "phone": "853" },
|
|
217
|
+
{ "code": "MP", "label": "Northern Mariana Islands", "phone": "1-670" },
|
|
218
|
+
{ "code": "MQ", "label": "Martinique", "phone": "596" },
|
|
219
|
+
{ "code": "MR", "label": "Mauritania", "phone": "222" },
|
|
220
|
+
{ "code": "MS", "label": "Montserrat", "phone": "1-664" },
|
|
221
|
+
{ "code": "MT", "label": "Malta", "phone": "356" },
|
|
222
|
+
{ "code": "MU", "label": "Mauritius", "phone": "230" },
|
|
223
|
+
{ "code": "MV", "label": "Maldives", "phone": "960" },
|
|
224
|
+
{ "code": "MW", "label": "Malawi", "phone": "265" },
|
|
225
|
+
{ "code": "MX", "label": "Mexico", "phone": "52" },
|
|
226
|
+
{ "code": "MY", "label": "Malaysia", "phone": "60" },
|
|
227
|
+
{ "code": "MZ", "label": "Mozambique", "phone": "258" },
|
|
228
|
+
{ "code": "NA", "label": "Namibia", "phone": "264" },
|
|
229
|
+
{ "code": "NC", "label": "New Caledonia", "phone": "687" },
|
|
230
|
+
{ "code": "NE", "label": "Niger", "phone": "227" },
|
|
231
|
+
{ "code": "NF", "label": "Norfolk Island", "phone": "672" },
|
|
232
|
+
{ "code": "NG", "label": "Nigeria", "phone": "234" },
|
|
233
|
+
{ "code": "NI", "label": "Nicaragua", "phone": "505" },
|
|
234
|
+
{ "code": "NL", "label": "Netherlands", "phone": "31" },
|
|
235
|
+
{ "code": "NO", "label": "Norway", "phone": "47" },
|
|
236
|
+
{ "code": "NP", "label": "Nepal", "phone": "977" },
|
|
237
|
+
{ "code": "NR", "label": "Nauru", "phone": "674" },
|
|
238
|
+
{ "code": "NU", "label": "Niue", "phone": "683" },
|
|
239
|
+
{ "code": "NZ", "label": "New Zealand", "phone": "64" },
|
|
240
|
+
{ "code": "OM", "label": "Oman", "phone": "968" },
|
|
241
|
+
{ "code": "PA", "label": "Panama", "phone": "507" },
|
|
242
|
+
{ "code": "PE", "label": "Peru", "phone": "51" },
|
|
243
|
+
{ "code": "PF", "label": "French Polynesia", "phone": "689" },
|
|
244
|
+
{ "code": "PG", "label": "Papua New Guinea", "phone": "675" },
|
|
245
|
+
{ "code": "PH", "label": "Philippines", "phone": "63" },
|
|
246
|
+
{ "code": "PK", "label": "Pakistan", "phone": "92" },
|
|
247
|
+
{ "code": "PL", "label": "Poland", "phone": "48" },
|
|
248
|
+
{ "code": "PM", "label": "Saint Pierre and Miquelon", "phone": "508" },
|
|
249
|
+
{ "code": "PN", "label": "Pitcairn", "phone": "870" },
|
|
250
|
+
{ "code": "PR", "label": "Puerto Rico", "phone": "1" },
|
|
251
|
+
{ "code": "PS", "label": "Palestine, State of", "phone": "970" },
|
|
252
|
+
{ "code": "PT", "label": "Portugal", "phone": "351" },
|
|
253
|
+
{ "code": "PW", "label": "Palau", "phone": "680" },
|
|
254
|
+
{ "code": "PY", "label": "Paraguay", "phone": "595" },
|
|
255
|
+
{ "code": "QA", "label": "Qatar", "phone": "974" },
|
|
256
|
+
{ "code": "RE", "label": "Reunion", "phone": "262" },
|
|
257
|
+
{ "code": "RO", "label": "Romania", "phone": "40" },
|
|
258
|
+
{ "code": "RS", "label": "Serbia", "phone": "381" },
|
|
259
|
+
{ "code": "RU", "label": "Russian Federation", "phone": "7" },
|
|
260
|
+
{ "code": "RW", "label": "Rwanda", "phone": "250" },
|
|
261
|
+
{ "code": "SA", "label": "Saudi Arabia", "phone": "966" },
|
|
262
|
+
{ "code": "SB", "label": "Solomon Islands", "phone": "677" },
|
|
263
|
+
{ "code": "SC", "label": "Seychelles", "phone": "248" },
|
|
264
|
+
{ "code": "SD", "label": "Sudan", "phone": "249" },
|
|
265
|
+
{ "code": "SE", "label": "Sweden", "phone": "46" },
|
|
266
|
+
{ "code": "SG", "label": "Singapore", "phone": "65" },
|
|
267
|
+
{ "code": "SH", "label": "Saint Helena", "phone": "290" },
|
|
268
|
+
{ "code": "SI", "label": "Slovenia", "phone": "386" },
|
|
269
|
+
{ "code": "SJ", "label": "Svalbard and Jan Mayen", "phone": "47" },
|
|
270
|
+
{ "code": "SK", "label": "Slovakia", "phone": "421" },
|
|
271
|
+
{ "code": "SL", "label": "Sierra Leone", "phone": "232" },
|
|
272
|
+
{ "code": "SM", "label": "San Marino", "phone": "378" },
|
|
273
|
+
{ "code": "SN", "label": "Senegal", "phone": "221" },
|
|
274
|
+
{ "code": "SO", "label": "Somalia", "phone": "252" },
|
|
275
|
+
{ "code": "SR", "label": "Suriname", "phone": "597" },
|
|
276
|
+
{ "code": "SS", "label": "South Sudan", "phone": "211" },
|
|
277
|
+
{ "code": "ST", "label": "Sao Tome and Principe", "phone": "239" },
|
|
278
|
+
{ "code": "SV", "label": "El Salvador", "phone": "503" },
|
|
279
|
+
{ "code": "SX", "label": "Sint Maarten (Dutch part)", "phone": "1-721" },
|
|
280
|
+
{ "code": "SY", "label": "Syrian Arab Republic", "phone": "963" },
|
|
281
|
+
{ "code": "SZ", "label": "Swaziland", "phone": "268" },
|
|
282
|
+
{ "code": "TC", "label": "Turks and Caicos Islands", "phone": "1-649" },
|
|
283
|
+
{ "code": "TD", "label": "Chad", "phone": "235" },
|
|
284
|
+
{ "code": "TF", "label": "French Southern Territories", "phone": "262" },
|
|
285
|
+
{ "code": "TG", "label": "Togo", "phone": "228" },
|
|
286
|
+
{ "code": "TH", "label": "Thailand", "phone": "66" },
|
|
287
|
+
{ "code": "TJ", "label": "Tajikistan", "phone": "992" },
|
|
288
|
+
{ "code": "TK", "label": "Tokelau", "phone": "690" },
|
|
289
|
+
{ "code": "TL", "label": "Timor-Leste", "phone": "670" },
|
|
290
|
+
{ "code": "TM", "label": "Turkmenistan", "phone": "993" },
|
|
291
|
+
{ "code": "TN", "label": "Tunisia", "phone": "216" },
|
|
292
|
+
{ "code": "TO", "label": "Tonga", "phone": "676" },
|
|
293
|
+
{ "code": "TR", "label": "Turkey", "phone": "90" },
|
|
294
|
+
{ "code": "TT", "label": "Trinidad and Tobago", "phone": "1-868" },
|
|
295
|
+
{ "code": "TV", "label": "Tuvalu", "phone": "688" },
|
|
296
|
+
{ "code": "TW", "label": "Taiwan, Republic of China", "phone": "886" },
|
|
297
|
+
{ "code": "TZ", "label": "United Republic of Tanzania", "phone": "255" },
|
|
298
|
+
{ "code": "UA", "label": "Ukraine", "phone": "380" },
|
|
299
|
+
{ "code": "UG", "label": "Uganda", "phone": "256" },
|
|
300
|
+
{ "code": "US", "label": "United States", "phone": "1", "suggested": true },
|
|
301
|
+
{ "code": "UY", "label": "Uruguay", "phone": "598" },
|
|
302
|
+
{ "code": "UZ", "label": "Uzbekistan", "phone": "998" },
|
|
303
|
+
{ "code": "VA", "label": "Holy See (Vatican City State)", "phone": "379" },
|
|
304
|
+
{ "code": "VC", "label": "Saint Vincent and the Grenadines", "phone": "1-784" },
|
|
305
|
+
{ "code": "VE", "label": "Venezuela", "phone": "58" },
|
|
306
|
+
{ "code": "VG", "label": "British Virgin Islands", "phone": "1-284" },
|
|
307
|
+
{ "code": "VI", "label": "US Virgin Islands", "phone": "1-340" },
|
|
308
|
+
{ "code": "VN", "label": "Vietnam", "phone": "84" },
|
|
309
|
+
{ "code": "VU", "label": "Vanuatu", "phone": "678" },
|
|
310
|
+
{ "code": "WF", "label": "Wallis and Futuna", "phone": "681" },
|
|
311
|
+
{ "code": "WS", "label": "Samoa", "phone": "685" },
|
|
312
|
+
{ "code": "XK", "label": "Kosovo", "phone": "383" },
|
|
313
|
+
{ "code": "YE", "label": "Yemen", "phone": "967" },
|
|
314
|
+
{ "code": "YT", "label": "Mayotte", "phone": "262" },
|
|
315
|
+
{ "code": "ZA", "label": "South Africa", "phone": "27" },
|
|
316
|
+
{ "code": "ZM", "label": "Zambia", "phone": "260" },
|
|
317
|
+
{ "code": "ZW", "label": "Zimbabwe", "phone": "263" }
|
|
318
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Type definitions for useSalesDateQuery hook
|
|
2
|
+
|
|
3
|
+
export interface UseSalesDateQueryReturn {
|
|
4
|
+
month: number;
|
|
5
|
+
year: number;
|
|
6
|
+
date: Date;
|
|
7
|
+
updateMonth: (month: number) => void;
|
|
8
|
+
updateYear: (year: number) => void;
|
|
9
|
+
updateDate: (date: Date) => void;
|
|
10
|
+
nextMonth: () => void;
|
|
11
|
+
prevMonth: () => void;
|
|
12
|
+
nextYear: () => void;
|
|
13
|
+
prevYear: () => void;
|
|
14
|
+
setToday: () => void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function useSalesDateQuery(
|
|
18
|
+
initialMonth?: number,
|
|
19
|
+
initialYear?: number
|
|
20
|
+
): UseSalesDateQueryReturn;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Hook for managing sales date filtering via URL query parameters
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Custom hook that manages month/year selection via URL query parameters
|
|
7
|
+
* Provides synchronized state for date selection and URL updates
|
|
8
|
+
* @returns {Object} Date state and update function
|
|
9
|
+
*/
|
|
10
|
+
export function useSalesDateQuery() {
|
|
11
|
+
const router = useRouter();
|
|
12
|
+
|
|
13
|
+
// State for date management
|
|
14
|
+
const [month, setMonth] = useState(-1);
|
|
15
|
+
const [year, setYear] = useState(-1);
|
|
16
|
+
const [date, setDate] = useState(null);
|
|
17
|
+
|
|
18
|
+
// Initialize from URL query parameters when router is ready
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!router.isReady) return;
|
|
21
|
+
|
|
22
|
+
const queryMonth = router.query.month !== undefined ? parseInt(router.query.month) : -1;
|
|
23
|
+
const queryYear = router.query.year !== undefined ? parseInt(router.query.year) : -1;
|
|
24
|
+
|
|
25
|
+
// If we have valid query params, use them
|
|
26
|
+
if (queryMonth >= 0 && queryMonth <= 11 && queryYear > 2000) {
|
|
27
|
+
setMonth(queryMonth);
|
|
28
|
+
setYear(queryYear);
|
|
29
|
+
} else if (month === -1 || year === -1) {
|
|
30
|
+
// Otherwise use current date (only if not already set)
|
|
31
|
+
const currentDate = new Date();
|
|
32
|
+
setMonth(currentDate.getUTCMonth());
|
|
33
|
+
setYear(currentDate.getUTCFullYear());
|
|
34
|
+
}
|
|
35
|
+
}, [router.isReady, router.query]);
|
|
36
|
+
|
|
37
|
+
// Update date object when month/year change
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (month >= 0 && year > 0) {
|
|
40
|
+
const newDate = new Date(Date.UTC(year, month, 1));
|
|
41
|
+
setDate(newDate);
|
|
42
|
+
}
|
|
43
|
+
}, [month, year]);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Updates the date state and URL query parameters
|
|
47
|
+
* @param {Date} newDate - The new date to set
|
|
48
|
+
*/
|
|
49
|
+
const updateDate = (newDate) => {
|
|
50
|
+
const newMonth = new Date(newDate).getUTCMonth();
|
|
51
|
+
const newYear = new Date(newDate).getUTCFullYear();
|
|
52
|
+
|
|
53
|
+
// Update state
|
|
54
|
+
setMonth(newMonth);
|
|
55
|
+
setYear(newYear);
|
|
56
|
+
|
|
57
|
+
// Update URL query parameters without page reload
|
|
58
|
+
router.push(
|
|
59
|
+
{
|
|
60
|
+
pathname: router.pathname,
|
|
61
|
+
query: { ...router.query, month: newMonth, year: newYear }
|
|
62
|
+
},
|
|
63
|
+
undefined,
|
|
64
|
+
{ shallow: true }
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return { month, year, date, updateDate };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default useSalesDateQuery;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// Type definitions for @liiift/sales-portal
|
|
2
|
+
// Main export file for all components, hooks, and utilities
|
|
3
|
+
|
|
4
|
+
import { FC } from 'react';
|
|
5
|
+
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// COMPONENT EXPORTS
|
|
8
|
+
// ============================================================================
|
|
9
|
+
|
|
10
|
+
export interface Designer {
|
|
11
|
+
_id: string;
|
|
12
|
+
firstName: string;
|
|
13
|
+
lastName: string;
|
|
14
|
+
user: string;
|
|
15
|
+
password?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SalesProps {
|
|
19
|
+
designer: Designer;
|
|
20
|
+
admin?: boolean;
|
|
21
|
+
month?: number;
|
|
22
|
+
year?: number;
|
|
23
|
+
updateDate?: (date: Date) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const Sales: FC<SalesProps>;
|
|
27
|
+
|
|
28
|
+
export interface SalesData {
|
|
29
|
+
id: string;
|
|
30
|
+
date: string;
|
|
31
|
+
customer?: string;
|
|
32
|
+
amount: number;
|
|
33
|
+
typeface: string;
|
|
34
|
+
licenseType: string;
|
|
35
|
+
country?: string;
|
|
36
|
+
currency?: string;
|
|
37
|
+
discount?: number;
|
|
38
|
+
refund?: number;
|
|
39
|
+
invoice_id?: string;
|
|
40
|
+
metadata?: Record<string, any>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface SalesTableProps {
|
|
44
|
+
data: SalesData[];
|
|
45
|
+
loading?: boolean;
|
|
46
|
+
onExport?: () => void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const SalesTable: FC<SalesTableProps>;
|
|
50
|
+
|
|
51
|
+
export interface DateRangeSalesTableProps {
|
|
52
|
+
designer: Designer;
|
|
53
|
+
admin?: boolean;
|
|
54
|
+
loading?: boolean;
|
|
55
|
+
updateLoadingState?: (key: string, state: boolean) => void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const DateRangeSalesTable: FC<DateRangeSalesTableProps>;
|
|
59
|
+
|
|
60
|
+
export interface SalesChartProps {
|
|
61
|
+
data: any[];
|
|
62
|
+
loading?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const SalesChart: FC<SalesChartProps>;
|
|
66
|
+
|
|
67
|
+
export interface SummaryData {
|
|
68
|
+
totalRevenue: number;
|
|
69
|
+
orderCount: number;
|
|
70
|
+
averageOrderValue: number;
|
|
71
|
+
refundAmount?: number;
|
|
72
|
+
discountAmount?: number;
|
|
73
|
+
netRevenue?: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface SummaryCardsProps {
|
|
77
|
+
data: SummaryData;
|
|
78
|
+
previousData?: SummaryData;
|
|
79
|
+
currency?: string;
|
|
80
|
+
loading?: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export const SummaryCards: FC<SummaryCardsProps>;
|
|
84
|
+
|
|
85
|
+
export interface TopPerformersProps {
|
|
86
|
+
data: any[];
|
|
87
|
+
loading?: boolean;
|
|
88
|
+
type?: 'typefaces' | 'designers';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const TopPerformers: FC<TopPerformersProps>;
|
|
92
|
+
|
|
93
|
+
export interface TypefaceListProps {
|
|
94
|
+
data: any[];
|
|
95
|
+
loading?: boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const TypefaceList: FC<TypefaceListProps>;
|
|
99
|
+
|
|
100
|
+
export interface LicenseTypeListProps {
|
|
101
|
+
data: any[];
|
|
102
|
+
loading?: boolean;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const LicenseTypeList: FC<LicenseTypeListProps>;
|
|
106
|
+
|
|
107
|
+
export interface PeriodComparisonProps {
|
|
108
|
+
currentData: SummaryData;
|
|
109
|
+
previousData: SummaryData;
|
|
110
|
+
loading?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const PeriodComparison: FC<PeriodComparisonProps>;
|
|
114
|
+
|
|
115
|
+
export interface DebugValuesProps {
|
|
116
|
+
values: Record<string, any>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const DebugValues: FC<DebugValuesProps>;
|
|
120
|
+
|
|
121
|
+
export const TableRowCells: any;
|
|
122
|
+
export function getCellValue(row: any, column: string): any;
|
|
123
|
+
export const COLUMNS: any[];
|
|
124
|
+
|
|
125
|
+
// ============================================================================
|
|
126
|
+
// HOOK EXPORTS
|
|
127
|
+
// ============================================================================
|
|
128
|
+
|
|
129
|
+
export interface UseSalesDateQueryReturn {
|
|
130
|
+
month: number;
|
|
131
|
+
year: number;
|
|
132
|
+
date: Date;
|
|
133
|
+
updateMonth: (month: number) => void;
|
|
134
|
+
updateYear: (year: number) => void;
|
|
135
|
+
updateDate: (date: Date) => void;
|
|
136
|
+
nextMonth: () => void;
|
|
137
|
+
prevMonth: () => void;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function useSalesDateQuery(
|
|
141
|
+
initialMonth?: number,
|
|
142
|
+
initialYear?: number
|
|
143
|
+
): UseSalesDateQueryReturn;
|
|
144
|
+
|
|
145
|
+
// ============================================================================
|
|
146
|
+
// UTILITY EXPORTS
|
|
147
|
+
// ============================================================================
|
|
148
|
+
|
|
149
|
+
export function formatCurrency(
|
|
150
|
+
amount: number,
|
|
151
|
+
currencyCode?: string,
|
|
152
|
+
locale?: string
|
|
153
|
+
): string;
|
|
154
|
+
|
|
155
|
+
export function parseCurrency(
|
|
156
|
+
formattedAmount: string,
|
|
157
|
+
currencyCode?: string
|
|
158
|
+
): number;
|
|
159
|
+
|
|
160
|
+
export function getCurrencySymbol(currencyCode: string): string;
|
|
161
|
+
|
|
162
|
+
export function processSalesData(data: any[]): SalesData[];
|
|
163
|
+
|
|
164
|
+
export function aggregateSalesData(data: SalesData[]): SummaryData;
|
|
165
|
+
|
|
166
|
+
// ============================================================================
|
|
167
|
+
// THEME EXPORT
|
|
168
|
+
// ============================================================================
|
|
169
|
+
|
|
170
|
+
import { Theme } from '@mui/material/styles';
|
|
171
|
+
|
|
172
|
+
export const salesTheme: Theme;
|
package/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Main export file for @liiift/sales-portal package
|
|
2
|
+
// Exports all components, hooks, and utilities
|
|
3
|
+
|
|
4
|
+
// Page-level components
|
|
5
|
+
export { default as SalesPortalPage } from './components/SalesPortalPage.js';
|
|
6
|
+
export { default as LoginForm } from './components/LoginForm.js';
|
|
7
|
+
|
|
8
|
+
// Dashboard components
|
|
9
|
+
export { default as Sales } from './components/Sales.js';
|
|
10
|
+
export { SalesTable } from './components/SalesTable.js';
|
|
11
|
+
export { DateRangeSalesTable } from './components/DateRangeSalesTable.js';
|
|
12
|
+
export { default as SalesChart } from './components/SalesChart.js';
|
|
13
|
+
export { default as SummaryCards } from './components/SummaryCards.js';
|
|
14
|
+
export { default as TopPerformers } from './components/TopPerformers.js';
|
|
15
|
+
export { default as TypefaceList } from './components/TypefaceList.js';
|
|
16
|
+
export { default as LicenseTypeList } from './components/LicenseTypeList.js';
|
|
17
|
+
export { default as PeriodComparison } from './components/PeriodComparison.js';
|
|
18
|
+
export { default as DebugValues } from './components/DebugValues.js';
|
|
19
|
+
export { TableRowCells, getCellValue } from './components/table-row-cells.js';
|
|
20
|
+
export { COLUMNS } from './components/table-columns.js';
|
|
21
|
+
|
|
22
|
+
// Hooks
|
|
23
|
+
export { useSalesDateQuery } from './hooks/useSalesDateQuery.js';
|
|
24
|
+
|
|
25
|
+
// Utilities
|
|
26
|
+
export * from './utils/currencyUtils.js';
|
|
27
|
+
export * from './utils/salesDataProcessing.js';
|
|
28
|
+
|
|
29
|
+
// Styles theme
|
|
30
|
+
export { salesTheme } from './styles/sales-portal.theme.js';
|
|
31
|
+
|
|
32
|
+
// Note: API handlers are exported separately and should be imported individually
|
|
33
|
+
// Example: import { getDesignerInfo } from '@liiift/sales-portal/api/getDesignerInfo'
|