@goweekdays/layer-common 1.5.1 → 1.5.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @goweekdays/layer-common
2
2
 
3
+ ## 1.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 8a5737a: Remove seats property from orgSetupFee parameter
8
+
9
+ ## 1.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - c94cd5f: Add job post filters and supporting API methods
14
+
3
15
  ## 1.5.1
4
16
 
5
17
  ### Patch Changes
@@ -23,7 +23,7 @@ export function useJobPost() {
23
23
  id: any,
24
24
  { page = 1, search = "", status = "draft", limit = 10, org = "" } = {}
25
25
  ) {
26
- return useNuxtApp().$api<Record<string, any>>(`/api/job/posts/${id}`, {
26
+ return useNuxtApp().$api<Record<string, any>>(`/api/job/posts/org/${id}`, {
27
27
  method: "GET",
28
28
  query: {
29
29
  page,
@@ -56,9 +56,169 @@ export function useJobPost() {
56
56
  );
57
57
  }
58
58
 
59
+ function getLocations({ page = 1, limit = 10, search = "" } = {}) {
60
+ return useNuxtApp().$api<Record<string, any>>(`/api/job/posts/locations`, {
61
+ method: "GET",
62
+ query: {
63
+ page,
64
+ limit,
65
+ search,
66
+ },
67
+ });
68
+ }
69
+
70
+ function getJobTitles({ page = 1, limit = 10, search = "" } = {}) {
71
+ return useNuxtApp().$api<Record<string, any>>(`/api/job/posts/titles`, {
72
+ method: "GET",
73
+ query: {
74
+ page,
75
+ limit,
76
+ search,
77
+ },
78
+ });
79
+ }
80
+
81
+ function getCurrencies({ page = 1, limit = 10, search = "" } = {}) {
82
+ return useNuxtApp().$api<Record<string, any>>(`/api/job/posts/currencies`, {
83
+ method: "GET",
84
+ query: {
85
+ page,
86
+ limit,
87
+ search,
88
+ },
89
+ });
90
+ }
91
+
92
+ const workplaceTypes = [
93
+ { title: "On-site", value: "onsite" },
94
+ { title: "Remote", value: "remote" },
95
+ ];
96
+
97
+ const jobTypes = [
98
+ { title: "Full-time", value: "full-time" },
99
+ { title: "Part-time", value: "part-time" },
100
+ { title: "Internship - Education/OJT", value: "internship-education" },
101
+ { title: "Internship - Career", value: "internship-career" },
102
+ ];
103
+
104
+ const defaultCurrencies = [
105
+ {
106
+ title: "PHP",
107
+ value: "PHP",
108
+ prop: {
109
+ subtitle: "Philippines Peso",
110
+ },
111
+ },
112
+ {
113
+ title: "USD",
114
+ value: "USD",
115
+ prop: {
116
+ subtitle: "United States Dollar",
117
+ },
118
+ },
119
+ {
120
+ title: "EUR",
121
+ value: "EUR",
122
+ prop: {
123
+ subtitle: "Euro",
124
+ },
125
+ },
126
+ {
127
+ title: "GBP",
128
+ value: "GBP",
129
+ prop: {
130
+ subtitle: "British Pound Sterling",
131
+ },
132
+ },
133
+ {
134
+ title: "JPY",
135
+ value: "JPY",
136
+ prop: {
137
+ subtitle: "Japanese Yen",
138
+ },
139
+ },
140
+ {
141
+ title: "AUD",
142
+ value: "AUD",
143
+ prop: {
144
+ subtitle: "Australian Dollar",
145
+ },
146
+ },
147
+ {
148
+ title: "CAD",
149
+ value: "CAD",
150
+ prop: {
151
+ subtitle: "Canadian Dollar",
152
+ },
153
+ },
154
+ {
155
+ title: "CHF",
156
+ value: "CHF",
157
+ prop: {
158
+ subtitle: "Swiss Franc",
159
+ },
160
+ },
161
+ {
162
+ title: "CNY",
163
+ value: "CNY",
164
+ prop: {
165
+ subtitle: "Chinese Yuan",
166
+ },
167
+ },
168
+ {
169
+ title: "INR",
170
+ value: "INR",
171
+ prop: {
172
+ subtitle: "Indian Rupee",
173
+ },
174
+ },
175
+ ];
176
+
177
+ const payPeriodOptions = [
178
+ { title: "Hourly", value: "hourly" },
179
+ { title: "Weekly", value: "weekly" },
180
+ { title: "Bi-Monthly", value: "bi-monthly" },
181
+ { title: "Monthly", value: "monthly" },
182
+ { title: "Annually", value: "annually" },
183
+ ];
184
+
185
+ const searchFilterJobTitle = useState<string>(
186
+ "searchFilterJobTitle",
187
+ () => ""
188
+ );
189
+
190
+ const searchFilterWorkType = useState<string>(
191
+ "searchFilterWorkType",
192
+ () => ""
193
+ );
194
+
195
+ const searchFilterJobType = useState<string>("searchFilterJobType", () => "");
196
+
197
+ const searchFilterLocation = useState<string>(
198
+ "searchFilterLocation",
199
+ () => ""
200
+ );
201
+
202
+ const searchFilterCurrency = useState<string>(
203
+ "searchFilterCurrency",
204
+ () => ""
205
+ );
206
+
59
207
  return {
60
208
  jobPost,
209
+ workplaceTypes,
210
+ jobTypes,
211
+ defaultCurrencies,
212
+ payPeriodOptions,
213
+ searchFilterJobTitle,
214
+ searchFilterWorkType,
215
+ searchFilterJobType,
216
+ searchFilterLocation,
217
+ searchFilterCurrency,
61
218
  getAll,
219
+ getLocations,
220
+ getJobTitles,
221
+ getCurrencies,
62
222
  getJobPostsByOrg,
63
223
  getJobPostsById,
64
224
  deleteJobPostById,
@@ -63,6 +63,18 @@ export default function useOrg() {
63
63
  promoCode: "",
64
64
  });
65
65
 
66
+ function getCompanies(search = "") {
67
+ return useNuxtApp().$api<Record<string, any>[]>(
68
+ "/api/organizations/company",
69
+ {
70
+ method: "GET",
71
+ query: {
72
+ search,
73
+ },
74
+ }
75
+ );
76
+ }
77
+
66
78
  return {
67
79
  org,
68
80
  add,
@@ -70,5 +82,6 @@ export default function useOrg() {
70
82
  getByUserId,
71
83
  getById,
72
84
  updateById,
85
+ getCompanies,
73
86
  };
74
87
  }
@@ -277,6 +277,16 @@ export default function useUtils() {
277
277
  return (v && v >= 1) || "Value must be greater or equal to 1";
278
278
  }
279
279
 
280
+ function getCurrencySymbol(currency: string): string {
281
+ if (!currency) return "";
282
+ return new Intl.NumberFormat(undefined, {
283
+ style: "currency",
284
+ currency,
285
+ })
286
+ .formatToParts(0)
287
+ .find((part) => part.type === "currency")!.value;
288
+ }
289
+
280
290
  return {
281
291
  requiredRule,
282
292
  emailRule,
@@ -304,5 +314,6 @@ export default function useUtils() {
304
314
  setRouteParams,
305
315
  positiveNumberRule,
306
316
  validateKey,
317
+ getCurrencySymbol,
307
318
  };
308
319
  }
@@ -46,9 +46,7 @@ export default function useUser() {
46
46
  }
47
47
 
48
48
  function orgSetupFee(
49
- value: Pick<TOrg, "name" | "email" | "contact" | "createdBy"> & {
50
- seats: number;
51
- }
49
+ value: Pick<TOrg, "name" | "email" | "contact" | "createdBy">
52
50
  ) {
53
51
  return useNuxtApp().$api<Record<string, any>>(
54
52
  "/api/verifications/org-setup-fee",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@goweekdays/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.5.1",
5
+ "version": "1.5.3",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"