@blackcode_sa/metaestetics-api 1.12.1 → 1.12.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/dist/backoffice/index.d.mts +64 -14
- package/dist/backoffice/index.d.ts +64 -14
- package/dist/backoffice/index.js +72 -53
- package/dist/backoffice/index.mjs +72 -53
- package/dist/index.d.mts +131 -19
- package/dist/index.d.ts +131 -19
- package/dist/index.js +141 -261
- package/dist/index.mjs +141 -261
- package/package.json +1 -1
- package/src/backoffice/services/FIXES_README.md +102 -0
- package/src/backoffice/services/category.service.ts +46 -27
- package/src/backoffice/services/product.service.ts +52 -74
- package/src/backoffice/services/technology.service.ts +99 -116
- package/src/backoffice/types/category.types.ts +28 -2
- package/src/backoffice/types/product.types.ts +10 -9
- package/src/backoffice/types/technology.types.ts +31 -59
- package/src/services/procedure/procedure.service.ts +275 -472
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Requirement } from
|
|
2
|
-
import { BlockingCondition } from
|
|
3
|
-
import { CertificationRequirement } from
|
|
4
|
-
import { DocumentTemplate } from
|
|
5
|
-
import { ProcedureFamily } from
|
|
6
|
-
import { ContraindicationDynamic } from
|
|
7
|
-
import { TreatmentBenefitDynamic } from
|
|
1
|
+
import { Requirement } from './requirement.types';
|
|
2
|
+
import { BlockingCondition } from './static/blocking-condition.types';
|
|
3
|
+
import { CertificationRequirement } from './static/certification.types';
|
|
4
|
+
import { DocumentTemplate } from '../../types/documentation-templates';
|
|
5
|
+
import { ProcedureFamily } from './static/procedure-family.types';
|
|
6
|
+
import { ContraindicationDynamic } from './admin-constants.types';
|
|
7
|
+
import { TreatmentBenefitDynamic } from './admin-constants.types';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Reference to a documentation template with metadata
|
|
@@ -77,19 +77,15 @@ export interface Technology {
|
|
|
77
77
|
/**
|
|
78
78
|
* Collection in Firestore database where technologies are stored
|
|
79
79
|
*/
|
|
80
|
-
export const TECHNOLOGIES_COLLECTION =
|
|
80
|
+
export const TECHNOLOGIES_COLLECTION = 'technologies';
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Interface for the TechnologyService class
|
|
84
84
|
*/
|
|
85
85
|
export interface ITechnologyService {
|
|
86
|
-
create(
|
|
87
|
-
technology: Omit<Technology, "id" | "createdAt" | "updatedAt">
|
|
88
|
-
): Promise<Technology>;
|
|
86
|
+
create(technology: Omit<Technology, 'id' | 'createdAt' | 'updatedAt'>): Promise<Technology>;
|
|
89
87
|
getTechnologyCounts(active?: boolean): Promise<Record<string, number>>;
|
|
90
|
-
getTechnologyCountsByCategory(
|
|
91
|
-
active?: boolean
|
|
92
|
-
): Promise<Record<string, number>>;
|
|
88
|
+
getTechnologyCountsByCategory(active?: boolean): Promise<Record<string, number>>;
|
|
93
89
|
getAll(options?: {
|
|
94
90
|
active?: boolean;
|
|
95
91
|
limit?: number;
|
|
@@ -97,83 +93,61 @@ export interface ITechnologyService {
|
|
|
97
93
|
}): Promise<{ technologies: Technology[]; lastVisible: any }>;
|
|
98
94
|
getAllByCategoryId(
|
|
99
95
|
categoryId: string,
|
|
100
|
-
options?: { active?: boolean; limit?: number; lastVisible?: any }
|
|
96
|
+
options?: { active?: boolean; limit?: number; lastVisible?: any },
|
|
101
97
|
): Promise<{ technologies: Technology[]; lastVisible: any }>;
|
|
102
98
|
getAllBySubcategoryId(
|
|
103
99
|
subcategoryId: string,
|
|
104
|
-
options?: { active?: boolean; limit?: number; lastVisible?: any }
|
|
100
|
+
options?: { active?: boolean; limit?: number; lastVisible?: any },
|
|
105
101
|
): Promise<{ technologies: Technology[]; lastVisible: any }>;
|
|
106
102
|
update(
|
|
107
103
|
id: string,
|
|
108
|
-
technology: Partial<Omit<Technology,
|
|
104
|
+
technology: Partial<Omit<Technology, 'id' | 'createdAt'>>,
|
|
109
105
|
): Promise<Technology | null>;
|
|
110
106
|
delete(id: string): Promise<void>;
|
|
111
107
|
reactivate(id: string): Promise<void>;
|
|
112
108
|
getById(id: string): Promise<Technology | null>;
|
|
113
|
-
addRequirement(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
): Promise<Technology | null>;
|
|
117
|
-
removeRequirement(
|
|
118
|
-
technologyId: string,
|
|
119
|
-
requirement: Requirement
|
|
120
|
-
): Promise<Technology | null>;
|
|
121
|
-
getRequirements(
|
|
122
|
-
technologyId: string,
|
|
123
|
-
type?: "pre" | "post"
|
|
124
|
-
): Promise<Requirement[]>;
|
|
109
|
+
addRequirement(technologyId: string, requirement: Requirement): Promise<Technology | null>;
|
|
110
|
+
removeRequirement(technologyId: string, requirement: Requirement): Promise<Technology | null>;
|
|
111
|
+
getRequirements(technologyId: string, type?: 'pre' | 'post'): Promise<Requirement[]>;
|
|
125
112
|
updateRequirement(
|
|
126
113
|
technologyId: string,
|
|
127
114
|
oldRequirement: Requirement,
|
|
128
|
-
newRequirement: Requirement
|
|
115
|
+
newRequirement: Requirement,
|
|
129
116
|
): Promise<Technology | null>;
|
|
130
117
|
addBlockingCondition(
|
|
131
118
|
technologyId: string,
|
|
132
|
-
condition: BlockingCondition
|
|
119
|
+
condition: BlockingCondition,
|
|
133
120
|
): Promise<Technology | null>;
|
|
134
121
|
removeBlockingCondition(
|
|
135
122
|
technologyId: string,
|
|
136
|
-
condition: BlockingCondition
|
|
123
|
+
condition: BlockingCondition,
|
|
137
124
|
): Promise<Technology | null>;
|
|
138
125
|
addContraindication(
|
|
139
126
|
technologyId: string,
|
|
140
|
-
contraindication: ContraindicationDynamic
|
|
127
|
+
contraindication: ContraindicationDynamic,
|
|
141
128
|
): Promise<Technology | null>;
|
|
142
129
|
removeContraindication(
|
|
143
130
|
technologyId: string,
|
|
144
|
-
contraindication: ContraindicationDynamic
|
|
131
|
+
contraindication: ContraindicationDynamic,
|
|
145
132
|
): Promise<Technology | null>;
|
|
146
133
|
updateContraindication(
|
|
147
134
|
technologyId: string,
|
|
148
|
-
contraindication: ContraindicationDynamic
|
|
149
|
-
): Promise<Technology | null>;
|
|
150
|
-
addBenefit(
|
|
151
|
-
technologyId: string,
|
|
152
|
-
benefit: TreatmentBenefitDynamic
|
|
153
|
-
): Promise<Technology | null>;
|
|
154
|
-
removeBenefit(
|
|
155
|
-
technologyId: string,
|
|
156
|
-
benefit: TreatmentBenefitDynamic
|
|
157
|
-
): Promise<Technology | null>;
|
|
158
|
-
updateBenefit(
|
|
159
|
-
technologyId: string,
|
|
160
|
-
benefit: TreatmentBenefitDynamic
|
|
135
|
+
contraindication: ContraindicationDynamic,
|
|
161
136
|
): Promise<Technology | null>;
|
|
137
|
+
addBenefit(technologyId: string, benefit: TreatmentBenefitDynamic): Promise<Technology | null>;
|
|
138
|
+
removeBenefit(technologyId: string, benefit: TreatmentBenefitDynamic): Promise<Technology | null>;
|
|
139
|
+
updateBenefit(technologyId: string, benefit: TreatmentBenefitDynamic): Promise<Technology | null>;
|
|
162
140
|
getBlockingConditions(technologyId: string): Promise<BlockingCondition[]>;
|
|
163
|
-
getContraindications(
|
|
164
|
-
technologyId: string
|
|
165
|
-
): Promise<ContraindicationDynamic[]>;
|
|
141
|
+
getContraindications(technologyId: string): Promise<ContraindicationDynamic[]>;
|
|
166
142
|
getBenefits(technologyId: string): Promise<TreatmentBenefitDynamic[]>;
|
|
167
143
|
updateCertificationRequirement(
|
|
168
144
|
technologyId: string,
|
|
169
|
-
certificationRequirement: CertificationRequirement
|
|
145
|
+
certificationRequirement: CertificationRequirement,
|
|
170
146
|
): Promise<Technology | null>;
|
|
171
|
-
getCertificationRequirement(
|
|
172
|
-
technologyId: string
|
|
173
|
-
): Promise<CertificationRequirement | null>;
|
|
147
|
+
getCertificationRequirement(technologyId: string): Promise<CertificationRequirement | null>;
|
|
174
148
|
validateCertification(
|
|
175
149
|
requiredCertification: CertificationRequirement,
|
|
176
|
-
practitionerCertification: any
|
|
150
|
+
practitionerCertification: any,
|
|
177
151
|
): boolean;
|
|
178
152
|
getAllowedTechnologies(practitioner: any): Promise<{
|
|
179
153
|
technologies: Technology[];
|
|
@@ -181,9 +155,7 @@ export interface ITechnologyService {
|
|
|
181
155
|
categories: string[];
|
|
182
156
|
subcategories: string[];
|
|
183
157
|
}>;
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
subcategoryId: string
|
|
187
|
-
): Promise<Technology[]>;
|
|
158
|
+
getAllForFilterBySubcategory(subcategoryId: string): Promise<Technology[]>;
|
|
159
|
+
getAllForFilterBySubcategoryId(categoryId: string, subcategoryId: string): Promise<Technology[]>;
|
|
188
160
|
getAllForFilter(): Promise<Technology[]>;
|
|
189
161
|
}
|