@blackcode_sa/metaestetics-api 1.14.18 → 1.14.26
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/dist/admin/index.js +2 -13
- package/dist/admin/index.mjs +2 -13
- package/dist/backoffice/index.d.mts +9 -4
- package/dist/backoffice/index.d.ts +9 -4
- package/dist/backoffice/index.js +18 -8
- package/dist/backoffice/index.mjs +18 -8
- package/dist/index.d.mts +20 -18
- package/dist/index.d.ts +20 -18
- package/dist/index.js +82 -179
- package/dist/index.mjs +135 -232
- package/package.json +4 -1
- package/src/admin/mailing/practitionerInvite/templates/invitation.template.ts +2 -13
- package/src/backoffice/services/brand.service.ts +21 -4
- package/src/backoffice/types/brand.types.ts +2 -0
- package/src/services/auth/auth.service.ts +7 -203
- package/src/services/practitioner/practitioner.service.ts +79 -4
- package/src/services/user/user.service.ts +1 -51
package/dist/admin/index.js
CHANGED
|
@@ -11860,21 +11860,10 @@ var practitionerInvitationTemplate = `
|
|
|
11860
11860
|
|
|
11861
11861
|
<p>This token will expire on <strong>{{expirationDate}}</strong>.</p>
|
|
11862
11862
|
|
|
11863
|
-
<p
|
|
11864
|
-
|
|
11865
|
-
<p><strong>Option 1: Sign in with Google (Recommended)</strong></p>
|
|
11866
|
-
<ol>
|
|
11867
|
-
<li>Open the MetaEsthetics Doctor App</li>
|
|
11868
|
-
<li>Click "Sign in with Google" on the login screen</li>
|
|
11869
|
-
<li>Select your Google account (use the email address: {{practitionerEmail}})</li>
|
|
11870
|
-
<li>You'll see an invitation to join {{clinicName}} - simply select it and join!</li>
|
|
11871
|
-
</ol>
|
|
11872
|
-
|
|
11873
|
-
<p><strong>Option 2: Use Email/Password with Token</strong></p>
|
|
11863
|
+
<p>To create your account:</p>
|
|
11874
11864
|
<ol>
|
|
11875
11865
|
<li>Visit {{registrationUrl}}</li>
|
|
11876
|
-
<li>
|
|
11877
|
-
<li>Enter your email ({{practitionerEmail}}) and create a password</li>
|
|
11866
|
+
<li>Enter your email and create a password</li>
|
|
11878
11867
|
<li>When prompted, enter the token above</li>
|
|
11879
11868
|
</ol>
|
|
11880
11869
|
|
package/dist/admin/index.mjs
CHANGED
|
@@ -11787,21 +11787,10 @@ var practitionerInvitationTemplate = `
|
|
|
11787
11787
|
|
|
11788
11788
|
<p>This token will expire on <strong>{{expirationDate}}</strong>.</p>
|
|
11789
11789
|
|
|
11790
|
-
<p
|
|
11791
|
-
|
|
11792
|
-
<p><strong>Option 1: Sign in with Google (Recommended)</strong></p>
|
|
11793
|
-
<ol>
|
|
11794
|
-
<li>Open the MetaEsthetics Doctor App</li>
|
|
11795
|
-
<li>Click "Sign in with Google" on the login screen</li>
|
|
11796
|
-
<li>Select your Google account (use the email address: {{practitionerEmail}})</li>
|
|
11797
|
-
<li>You'll see an invitation to join {{clinicName}} - simply select it and join!</li>
|
|
11798
|
-
</ol>
|
|
11799
|
-
|
|
11800
|
-
<p><strong>Option 2: Use Email/Password with Token</strong></p>
|
|
11790
|
+
<p>To create your account:</p>
|
|
11801
11791
|
<ol>
|
|
11802
11792
|
<li>Visit {{registrationUrl}}</li>
|
|
11803
|
-
<li>
|
|
11804
|
-
<li>Enter your email ({{practitionerEmail}}) and create a password</li>
|
|
11793
|
+
<li>Enter your email and create a password</li>
|
|
11805
11794
|
<li>When prompted, enter the token above</li>
|
|
11806
11795
|
</ol>
|
|
11807
11796
|
|
|
@@ -14,6 +14,7 @@ import { z } from 'zod';
|
|
|
14
14
|
* @property manufacturer - Naziv proizvođača
|
|
15
15
|
* @property description - Detaljan opis brenda i njegovih proizvoda
|
|
16
16
|
* @property website - Web stranica brenda
|
|
17
|
+
* @property category - Kategorija brenda (npr. "laser", "peeling", "injectables") - za filtriranje
|
|
17
18
|
* @property isActive - Da li je brend aktivan u sistemu
|
|
18
19
|
* @property createdAt - Datum kreiranja
|
|
19
20
|
* @property updatedAt - Datum poslednjeg ažuriranja
|
|
@@ -28,6 +29,7 @@ interface Brand {
|
|
|
28
29
|
isActive: boolean;
|
|
29
30
|
website?: string;
|
|
30
31
|
description?: string;
|
|
32
|
+
category?: string;
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Kolekcija u Firestore bazi gde se čuvaju brendovi
|
|
@@ -65,23 +67,26 @@ declare class BrandService extends BaseService {
|
|
|
65
67
|
isActive: boolean;
|
|
66
68
|
website?: string | undefined;
|
|
67
69
|
description?: string | undefined;
|
|
70
|
+
category?: string | undefined;
|
|
68
71
|
id: string;
|
|
69
72
|
}>;
|
|
70
73
|
/**
|
|
71
|
-
* Gets a paginated list of active brands, optionally filtered by name.
|
|
74
|
+
* Gets a paginated list of active brands, optionally filtered by name and category.
|
|
72
75
|
* @param rowsPerPage - The number of brands to fetch.
|
|
73
76
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
74
77
|
* @param lastVisible - An optional document snapshot to use as a cursor for pagination.
|
|
78
|
+
* @param category - An optional category to filter brands by.
|
|
75
79
|
*/
|
|
76
|
-
getAll(rowsPerPage: number, searchTerm?: string, lastVisible?: any): Promise<{
|
|
80
|
+
getAll(rowsPerPage: number, searchTerm?: string, lastVisible?: any, category?: string): Promise<{
|
|
77
81
|
brands: Brand[];
|
|
78
82
|
lastVisible: _firebase_firestore.QueryDocumentSnapshot<DocumentData, DocumentData>;
|
|
79
83
|
}>;
|
|
80
84
|
/**
|
|
81
|
-
* Gets the total count of active brands, optionally filtered by name.
|
|
85
|
+
* Gets the total count of active brands, optionally filtered by name and category.
|
|
82
86
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
87
|
+
* @param category - An optional category to filter brands by.
|
|
83
88
|
*/
|
|
84
|
-
getBrandsCount(searchTerm?: string): Promise<number>;
|
|
89
|
+
getBrandsCount(searchTerm?: string, category?: string): Promise<number>;
|
|
85
90
|
/**
|
|
86
91
|
* Gets all active brands for filter dropdowns (not paginated).
|
|
87
92
|
*/
|
|
@@ -14,6 +14,7 @@ import { z } from 'zod';
|
|
|
14
14
|
* @property manufacturer - Naziv proizvođača
|
|
15
15
|
* @property description - Detaljan opis brenda i njegovih proizvoda
|
|
16
16
|
* @property website - Web stranica brenda
|
|
17
|
+
* @property category - Kategorija brenda (npr. "laser", "peeling", "injectables") - za filtriranje
|
|
17
18
|
* @property isActive - Da li je brend aktivan u sistemu
|
|
18
19
|
* @property createdAt - Datum kreiranja
|
|
19
20
|
* @property updatedAt - Datum poslednjeg ažuriranja
|
|
@@ -28,6 +29,7 @@ interface Brand {
|
|
|
28
29
|
isActive: boolean;
|
|
29
30
|
website?: string;
|
|
30
31
|
description?: string;
|
|
32
|
+
category?: string;
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
35
|
* Kolekcija u Firestore bazi gde se čuvaju brendovi
|
|
@@ -65,23 +67,26 @@ declare class BrandService extends BaseService {
|
|
|
65
67
|
isActive: boolean;
|
|
66
68
|
website?: string | undefined;
|
|
67
69
|
description?: string | undefined;
|
|
70
|
+
category?: string | undefined;
|
|
68
71
|
id: string;
|
|
69
72
|
}>;
|
|
70
73
|
/**
|
|
71
|
-
* Gets a paginated list of active brands, optionally filtered by name.
|
|
74
|
+
* Gets a paginated list of active brands, optionally filtered by name and category.
|
|
72
75
|
* @param rowsPerPage - The number of brands to fetch.
|
|
73
76
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
74
77
|
* @param lastVisible - An optional document snapshot to use as a cursor for pagination.
|
|
78
|
+
* @param category - An optional category to filter brands by.
|
|
75
79
|
*/
|
|
76
|
-
getAll(rowsPerPage: number, searchTerm?: string, lastVisible?: any): Promise<{
|
|
80
|
+
getAll(rowsPerPage: number, searchTerm?: string, lastVisible?: any, category?: string): Promise<{
|
|
77
81
|
brands: Brand[];
|
|
78
82
|
lastVisible: _firebase_firestore.QueryDocumentSnapshot<DocumentData, DocumentData>;
|
|
79
83
|
}>;
|
|
80
84
|
/**
|
|
81
|
-
* Gets the total count of active brands, optionally filtered by name.
|
|
85
|
+
* Gets the total count of active brands, optionally filtered by name and category.
|
|
82
86
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
87
|
+
* @param category - An optional category to filter brands by.
|
|
83
88
|
*/
|
|
84
|
-
getBrandsCount(searchTerm?: string): Promise<number>;
|
|
89
|
+
getBrandsCount(searchTerm?: string, category?: string): Promise<number>;
|
|
85
90
|
/**
|
|
86
91
|
* Gets all active brands for filter dropdowns (not paginated).
|
|
87
92
|
*/
|
package/dist/backoffice/index.js
CHANGED
|
@@ -162,12 +162,13 @@ var BrandService = class extends BaseService {
|
|
|
162
162
|
return { id: docRef.id, ...newBrand };
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
-
* Gets a paginated list of active brands, optionally filtered by name.
|
|
165
|
+
* Gets a paginated list of active brands, optionally filtered by name and category.
|
|
166
166
|
* @param rowsPerPage - The number of brands to fetch.
|
|
167
167
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
168
168
|
* @param lastVisible - An optional document snapshot to use as a cursor for pagination.
|
|
169
|
+
* @param category - An optional category to filter brands by.
|
|
169
170
|
*/
|
|
170
|
-
async getAll(rowsPerPage, searchTerm, lastVisible) {
|
|
171
|
+
async getAll(rowsPerPage, searchTerm, lastVisible, category) {
|
|
171
172
|
const constraints = [
|
|
172
173
|
(0, import_firestore.where)("isActive", "==", true),
|
|
173
174
|
(0, import_firestore.orderBy)("name_lowercase")
|
|
@@ -179,6 +180,9 @@ var BrandService = class extends BaseService {
|
|
|
179
180
|
(0, import_firestore.where)("name_lowercase", "<=", lowercasedSearchTerm + "\uF8FF")
|
|
180
181
|
);
|
|
181
182
|
}
|
|
183
|
+
if (category) {
|
|
184
|
+
constraints.push((0, import_firestore.where)("category", "==", category));
|
|
185
|
+
}
|
|
182
186
|
if (lastVisible) {
|
|
183
187
|
constraints.push((0, import_firestore.startAfter)(lastVisible));
|
|
184
188
|
}
|
|
@@ -195,10 +199,11 @@ var BrandService = class extends BaseService {
|
|
|
195
199
|
return { brands, lastVisible: newLastVisible };
|
|
196
200
|
}
|
|
197
201
|
/**
|
|
198
|
-
* Gets the total count of active brands, optionally filtered by name.
|
|
202
|
+
* Gets the total count of active brands, optionally filtered by name and category.
|
|
199
203
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
204
|
+
* @param category - An optional category to filter brands by.
|
|
200
205
|
*/
|
|
201
|
-
async getBrandsCount(searchTerm) {
|
|
206
|
+
async getBrandsCount(searchTerm, category) {
|
|
202
207
|
const constraints = [(0, import_firestore.where)("isActive", "==", true)];
|
|
203
208
|
if (searchTerm) {
|
|
204
209
|
const lowercasedSearchTerm = searchTerm.toLowerCase();
|
|
@@ -207,6 +212,9 @@ var BrandService = class extends BaseService {
|
|
|
207
212
|
(0, import_firestore.where)("name_lowercase", "<=", lowercasedSearchTerm + "\uF8FF")
|
|
208
213
|
);
|
|
209
214
|
}
|
|
215
|
+
if (category) {
|
|
216
|
+
constraints.push((0, import_firestore.where)("category", "==", category));
|
|
217
|
+
}
|
|
210
218
|
const q = (0, import_firestore.query)(this.getBrandsRef(), ...constraints);
|
|
211
219
|
const snapshot = await (0, import_firestore.getCountFromServer)(q);
|
|
212
220
|
return snapshot.data().count;
|
|
@@ -276,6 +284,7 @@ var BrandService = class extends BaseService {
|
|
|
276
284
|
"id",
|
|
277
285
|
"name",
|
|
278
286
|
"manufacturer",
|
|
287
|
+
"category",
|
|
279
288
|
"website",
|
|
280
289
|
"description",
|
|
281
290
|
"isActive"
|
|
@@ -306,14 +315,15 @@ var BrandService = class extends BaseService {
|
|
|
306
315
|
return includeBom ? "\uFEFF" + csvBody : csvBody;
|
|
307
316
|
}
|
|
308
317
|
brandToCsvRow(brand) {
|
|
309
|
-
var _a, _b, _c, _d, _e, _f;
|
|
318
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
310
319
|
const values = [
|
|
311
320
|
(_a = brand.id) != null ? _a : "",
|
|
312
321
|
(_b = brand.name) != null ? _b : "",
|
|
313
322
|
(_c = brand.manufacturer) != null ? _c : "",
|
|
314
|
-
(_d = brand.
|
|
315
|
-
(_e = brand.
|
|
316
|
-
|
|
323
|
+
(_d = brand.category) != null ? _d : "",
|
|
324
|
+
(_e = brand.website) != null ? _e : "",
|
|
325
|
+
(_f = brand.description) != null ? _f : "",
|
|
326
|
+
String((_g = brand.isActive) != null ? _g : "")
|
|
317
327
|
];
|
|
318
328
|
return values.map((v) => this.formatCsvValue(v)).join(",");
|
|
319
329
|
}
|
|
@@ -68,12 +68,13 @@ var BrandService = class extends BaseService {
|
|
|
68
68
|
return { id: docRef.id, ...newBrand };
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
|
-
* Gets a paginated list of active brands, optionally filtered by name.
|
|
71
|
+
* Gets a paginated list of active brands, optionally filtered by name and category.
|
|
72
72
|
* @param rowsPerPage - The number of brands to fetch.
|
|
73
73
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
74
74
|
* @param lastVisible - An optional document snapshot to use as a cursor for pagination.
|
|
75
|
+
* @param category - An optional category to filter brands by.
|
|
75
76
|
*/
|
|
76
|
-
async getAll(rowsPerPage, searchTerm, lastVisible) {
|
|
77
|
+
async getAll(rowsPerPage, searchTerm, lastVisible, category) {
|
|
77
78
|
const constraints = [
|
|
78
79
|
where("isActive", "==", true),
|
|
79
80
|
orderBy("name_lowercase")
|
|
@@ -85,6 +86,9 @@ var BrandService = class extends BaseService {
|
|
|
85
86
|
where("name_lowercase", "<=", lowercasedSearchTerm + "\uF8FF")
|
|
86
87
|
);
|
|
87
88
|
}
|
|
89
|
+
if (category) {
|
|
90
|
+
constraints.push(where("category", "==", category));
|
|
91
|
+
}
|
|
88
92
|
if (lastVisible) {
|
|
89
93
|
constraints.push(startAfter(lastVisible));
|
|
90
94
|
}
|
|
@@ -101,10 +105,11 @@ var BrandService = class extends BaseService {
|
|
|
101
105
|
return { brands, lastVisible: newLastVisible };
|
|
102
106
|
}
|
|
103
107
|
/**
|
|
104
|
-
* Gets the total count of active brands, optionally filtered by name.
|
|
108
|
+
* Gets the total count of active brands, optionally filtered by name and category.
|
|
105
109
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
110
|
+
* @param category - An optional category to filter brands by.
|
|
106
111
|
*/
|
|
107
|
-
async getBrandsCount(searchTerm) {
|
|
112
|
+
async getBrandsCount(searchTerm, category) {
|
|
108
113
|
const constraints = [where("isActive", "==", true)];
|
|
109
114
|
if (searchTerm) {
|
|
110
115
|
const lowercasedSearchTerm = searchTerm.toLowerCase();
|
|
@@ -113,6 +118,9 @@ var BrandService = class extends BaseService {
|
|
|
113
118
|
where("name_lowercase", "<=", lowercasedSearchTerm + "\uF8FF")
|
|
114
119
|
);
|
|
115
120
|
}
|
|
121
|
+
if (category) {
|
|
122
|
+
constraints.push(where("category", "==", category));
|
|
123
|
+
}
|
|
116
124
|
const q = query(this.getBrandsRef(), ...constraints);
|
|
117
125
|
const snapshot = await getCountFromServer(q);
|
|
118
126
|
return snapshot.data().count;
|
|
@@ -182,6 +190,7 @@ var BrandService = class extends BaseService {
|
|
|
182
190
|
"id",
|
|
183
191
|
"name",
|
|
184
192
|
"manufacturer",
|
|
193
|
+
"category",
|
|
185
194
|
"website",
|
|
186
195
|
"description",
|
|
187
196
|
"isActive"
|
|
@@ -212,14 +221,15 @@ var BrandService = class extends BaseService {
|
|
|
212
221
|
return includeBom ? "\uFEFF" + csvBody : csvBody;
|
|
213
222
|
}
|
|
214
223
|
brandToCsvRow(brand) {
|
|
215
|
-
var _a, _b, _c, _d, _e, _f;
|
|
224
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
216
225
|
const values = [
|
|
217
226
|
(_a = brand.id) != null ? _a : "",
|
|
218
227
|
(_b = brand.name) != null ? _b : "",
|
|
219
228
|
(_c = brand.manufacturer) != null ? _c : "",
|
|
220
|
-
(_d = brand.
|
|
221
|
-
(_e = brand.
|
|
222
|
-
|
|
229
|
+
(_d = brand.category) != null ? _d : "",
|
|
230
|
+
(_e = brand.website) != null ? _e : "",
|
|
231
|
+
(_f = brand.description) != null ? _f : "",
|
|
232
|
+
String((_g = brand.isActive) != null ? _g : "")
|
|
223
233
|
];
|
|
224
234
|
return values.map((v) => this.formatCsvValue(v)).join(",");
|
|
225
235
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -200,6 +200,7 @@ interface ContraindicationDynamic {
|
|
|
200
200
|
* @property manufacturer - Naziv proizvođača
|
|
201
201
|
* @property description - Detaljan opis brenda i njegovih proizvoda
|
|
202
202
|
* @property website - Web stranica brenda
|
|
203
|
+
* @property category - Kategorija brenda (npr. "laser", "peeling", "injectables") - za filtriranje
|
|
203
204
|
* @property isActive - Da li je brend aktivan u sistemu
|
|
204
205
|
* @property createdAt - Datum kreiranja
|
|
205
206
|
* @property updatedAt - Datum poslednjeg ažuriranja
|
|
@@ -214,6 +215,7 @@ interface Brand {
|
|
|
214
215
|
isActive: boolean;
|
|
215
216
|
website?: string;
|
|
216
217
|
description?: string;
|
|
218
|
+
category?: string;
|
|
217
219
|
}
|
|
218
220
|
|
|
219
221
|
/**
|
|
@@ -1164,23 +1166,26 @@ declare class BrandService extends BaseService {
|
|
|
1164
1166
|
name_lowercase: string;
|
|
1165
1167
|
manufacturer: string;
|
|
1166
1168
|
website?: string | undefined;
|
|
1169
|
+
category?: string | undefined;
|
|
1167
1170
|
id: string;
|
|
1168
1171
|
}>;
|
|
1169
1172
|
/**
|
|
1170
|
-
* Gets a paginated list of active brands, optionally filtered by name.
|
|
1173
|
+
* Gets a paginated list of active brands, optionally filtered by name and category.
|
|
1171
1174
|
* @param rowsPerPage - The number of brands to fetch.
|
|
1172
1175
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
1173
1176
|
* @param lastVisible - An optional document snapshot to use as a cursor for pagination.
|
|
1177
|
+
* @param category - An optional category to filter brands by.
|
|
1174
1178
|
*/
|
|
1175
|
-
getAll(rowsPerPage: number, searchTerm?: string, lastVisible?: any): Promise<{
|
|
1179
|
+
getAll(rowsPerPage: number, searchTerm?: string, lastVisible?: any, category?: string): Promise<{
|
|
1176
1180
|
brands: Brand[];
|
|
1177
1181
|
lastVisible: _firebase_firestore.QueryDocumentSnapshot<DocumentData, DocumentData>;
|
|
1178
1182
|
}>;
|
|
1179
1183
|
/**
|
|
1180
|
-
* Gets the total count of active brands, optionally filtered by name.
|
|
1184
|
+
* Gets the total count of active brands, optionally filtered by name and category.
|
|
1181
1185
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
1186
|
+
* @param category - An optional category to filter brands by.
|
|
1182
1187
|
*/
|
|
1183
|
-
getBrandsCount(searchTerm?: string): Promise<number>;
|
|
1188
|
+
getBrandsCount(searchTerm?: string, category?: string): Promise<number>;
|
|
1184
1189
|
/**
|
|
1185
1190
|
* Gets all active brands for filter dropdowns (not paginated).
|
|
1186
1191
|
*/
|
|
@@ -6992,9 +6997,10 @@ declare class PractitionerService extends BaseService {
|
|
|
6992
6997
|
/**
|
|
6993
6998
|
* Gets active tokens for a practitioner
|
|
6994
6999
|
* @param practitionerId ID of the practitioner
|
|
7000
|
+
* @param clinicId Optional clinic ID to filter tokens by. If provided, only returns tokens for this clinic.
|
|
6995
7001
|
* @returns Array of active tokens
|
|
6996
7002
|
*/
|
|
6997
|
-
getPractitionerActiveTokens(practitionerId: string): Promise<PractitionerToken[]>;
|
|
7003
|
+
getPractitionerActiveTokens(practitionerId: string, clinicId?: string): Promise<PractitionerToken[]>;
|
|
6998
7004
|
/**
|
|
6999
7005
|
* Gets a token by its string value and validates it
|
|
7000
7006
|
* @param tokenString The token string to find
|
|
@@ -7008,6 +7014,14 @@ declare class PractitionerService extends BaseService {
|
|
|
7008
7014
|
* @param userId ID of the user using the token
|
|
7009
7015
|
*/
|
|
7010
7016
|
markTokenAsUsed(tokenId: string, practitionerId: string, userId: string): Promise<void>;
|
|
7017
|
+
/**
|
|
7018
|
+
* Revokes a token by setting its status to REVOKED
|
|
7019
|
+
* @param tokenId ID of the token
|
|
7020
|
+
* @param practitionerId ID of the practitioner
|
|
7021
|
+
* @param clinicId ID of the clinic that owns the token. Used to verify ownership before revoking.
|
|
7022
|
+
* @throws Error if token doesn't exist or doesn't belong to the specified clinic
|
|
7023
|
+
*/
|
|
7024
|
+
revokeToken(tokenId: string, practitionerId: string, clinicId: string): Promise<void>;
|
|
7011
7025
|
/**
|
|
7012
7026
|
* Dohvata zdravstvenog radnika po ID-u
|
|
7013
7027
|
*/
|
|
@@ -8323,19 +8337,7 @@ declare class AuthService extends BaseService {
|
|
|
8323
8337
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp, userService: UserService);
|
|
8324
8338
|
/**
|
|
8325
8339
|
* Waits for Firebase Auth state to settle after sign-in.
|
|
8326
|
-
*
|
|
8327
|
-
* In React Native with AsyncStorage persistence, there's a critical issue:
|
|
8328
|
-
* 1. signInWithCredential() sets auth.currentUser in memory immediately
|
|
8329
|
-
* 2. But AsyncStorage persistence happens asynchronously
|
|
8330
|
-
* 3. If AsyncStorage reads an old NULL value, it can OVERWRITE the current auth state
|
|
8331
|
-
* 4. This causes auth.currentUser to become NULL even after it was set
|
|
8332
|
-
*
|
|
8333
|
-
* This method uses onAuthStateChanged to wait for the auth state to be SET and STABLE.
|
|
8334
|
-
* It ensures the auth state persists through AsyncStorage operations.
|
|
8335
|
-
*
|
|
8336
|
-
* @param expectedUid - The UID we expect to see in auth.currentUser
|
|
8337
|
-
* @param timeoutMs - Maximum time to wait (default 5 seconds)
|
|
8338
|
-
* @returns Promise that resolves when auth state is ready and stable
|
|
8340
|
+
* In React Native with AsyncStorage persistence, auth state may not be immediately available.
|
|
8339
8341
|
*/
|
|
8340
8342
|
private waitForAuthStateToSettle;
|
|
8341
8343
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -200,6 +200,7 @@ interface ContraindicationDynamic {
|
|
|
200
200
|
* @property manufacturer - Naziv proizvođača
|
|
201
201
|
* @property description - Detaljan opis brenda i njegovih proizvoda
|
|
202
202
|
* @property website - Web stranica brenda
|
|
203
|
+
* @property category - Kategorija brenda (npr. "laser", "peeling", "injectables") - za filtriranje
|
|
203
204
|
* @property isActive - Da li je brend aktivan u sistemu
|
|
204
205
|
* @property createdAt - Datum kreiranja
|
|
205
206
|
* @property updatedAt - Datum poslednjeg ažuriranja
|
|
@@ -214,6 +215,7 @@ interface Brand {
|
|
|
214
215
|
isActive: boolean;
|
|
215
216
|
website?: string;
|
|
216
217
|
description?: string;
|
|
218
|
+
category?: string;
|
|
217
219
|
}
|
|
218
220
|
|
|
219
221
|
/**
|
|
@@ -1164,23 +1166,26 @@ declare class BrandService extends BaseService {
|
|
|
1164
1166
|
name_lowercase: string;
|
|
1165
1167
|
manufacturer: string;
|
|
1166
1168
|
website?: string | undefined;
|
|
1169
|
+
category?: string | undefined;
|
|
1167
1170
|
id: string;
|
|
1168
1171
|
}>;
|
|
1169
1172
|
/**
|
|
1170
|
-
* Gets a paginated list of active brands, optionally filtered by name.
|
|
1173
|
+
* Gets a paginated list of active brands, optionally filtered by name and category.
|
|
1171
1174
|
* @param rowsPerPage - The number of brands to fetch.
|
|
1172
1175
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
1173
1176
|
* @param lastVisible - An optional document snapshot to use as a cursor for pagination.
|
|
1177
|
+
* @param category - An optional category to filter brands by.
|
|
1174
1178
|
*/
|
|
1175
|
-
getAll(rowsPerPage: number, searchTerm?: string, lastVisible?: any): Promise<{
|
|
1179
|
+
getAll(rowsPerPage: number, searchTerm?: string, lastVisible?: any, category?: string): Promise<{
|
|
1176
1180
|
brands: Brand[];
|
|
1177
1181
|
lastVisible: _firebase_firestore.QueryDocumentSnapshot<DocumentData, DocumentData>;
|
|
1178
1182
|
}>;
|
|
1179
1183
|
/**
|
|
1180
|
-
* Gets the total count of active brands, optionally filtered by name.
|
|
1184
|
+
* Gets the total count of active brands, optionally filtered by name and category.
|
|
1181
1185
|
* @param searchTerm - An optional string to filter brand names by (starts-with search).
|
|
1186
|
+
* @param category - An optional category to filter brands by.
|
|
1182
1187
|
*/
|
|
1183
|
-
getBrandsCount(searchTerm?: string): Promise<number>;
|
|
1188
|
+
getBrandsCount(searchTerm?: string, category?: string): Promise<number>;
|
|
1184
1189
|
/**
|
|
1185
1190
|
* Gets all active brands for filter dropdowns (not paginated).
|
|
1186
1191
|
*/
|
|
@@ -6992,9 +6997,10 @@ declare class PractitionerService extends BaseService {
|
|
|
6992
6997
|
/**
|
|
6993
6998
|
* Gets active tokens for a practitioner
|
|
6994
6999
|
* @param practitionerId ID of the practitioner
|
|
7000
|
+
* @param clinicId Optional clinic ID to filter tokens by. If provided, only returns tokens for this clinic.
|
|
6995
7001
|
* @returns Array of active tokens
|
|
6996
7002
|
*/
|
|
6997
|
-
getPractitionerActiveTokens(practitionerId: string): Promise<PractitionerToken[]>;
|
|
7003
|
+
getPractitionerActiveTokens(practitionerId: string, clinicId?: string): Promise<PractitionerToken[]>;
|
|
6998
7004
|
/**
|
|
6999
7005
|
* Gets a token by its string value and validates it
|
|
7000
7006
|
* @param tokenString The token string to find
|
|
@@ -7008,6 +7014,14 @@ declare class PractitionerService extends BaseService {
|
|
|
7008
7014
|
* @param userId ID of the user using the token
|
|
7009
7015
|
*/
|
|
7010
7016
|
markTokenAsUsed(tokenId: string, practitionerId: string, userId: string): Promise<void>;
|
|
7017
|
+
/**
|
|
7018
|
+
* Revokes a token by setting its status to REVOKED
|
|
7019
|
+
* @param tokenId ID of the token
|
|
7020
|
+
* @param practitionerId ID of the practitioner
|
|
7021
|
+
* @param clinicId ID of the clinic that owns the token. Used to verify ownership before revoking.
|
|
7022
|
+
* @throws Error if token doesn't exist or doesn't belong to the specified clinic
|
|
7023
|
+
*/
|
|
7024
|
+
revokeToken(tokenId: string, practitionerId: string, clinicId: string): Promise<void>;
|
|
7011
7025
|
/**
|
|
7012
7026
|
* Dohvata zdravstvenog radnika po ID-u
|
|
7013
7027
|
*/
|
|
@@ -8323,19 +8337,7 @@ declare class AuthService extends BaseService {
|
|
|
8323
8337
|
constructor(db: Firestore, auth: Auth, app: FirebaseApp, userService: UserService);
|
|
8324
8338
|
/**
|
|
8325
8339
|
* Waits for Firebase Auth state to settle after sign-in.
|
|
8326
|
-
*
|
|
8327
|
-
* In React Native with AsyncStorage persistence, there's a critical issue:
|
|
8328
|
-
* 1. signInWithCredential() sets auth.currentUser in memory immediately
|
|
8329
|
-
* 2. But AsyncStorage persistence happens asynchronously
|
|
8330
|
-
* 3. If AsyncStorage reads an old NULL value, it can OVERWRITE the current auth state
|
|
8331
|
-
* 4. This causes auth.currentUser to become NULL even after it was set
|
|
8332
|
-
*
|
|
8333
|
-
* This method uses onAuthStateChanged to wait for the auth state to be SET and STABLE.
|
|
8334
|
-
* It ensures the auth state persists through AsyncStorage operations.
|
|
8335
|
-
*
|
|
8336
|
-
* @param expectedUid - The UID we expect to see in auth.currentUser
|
|
8337
|
-
* @param timeoutMs - Maximum time to wait (default 5 seconds)
|
|
8338
|
-
* @returns Promise that resolves when auth state is ready and stable
|
|
8340
|
+
* In React Native with AsyncStorage persistence, auth state may not be immediately available.
|
|
8339
8341
|
*/
|
|
8340
8342
|
private waitForAuthStateToSettle;
|
|
8341
8343
|
/**
|