@ipetsadmin/contracts 1.2.1 → 1.3.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/CHANGELOG.md +27 -1
- package/README.md +42 -7
- package/dist/index.d.mts +228 -68
- package/dist/index.d.ts +228 -68
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
+
## [1.3.1] - 2026-05-15
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- **Pet model (expanded beyond 1.2.0)**
|
|
27
|
+
- Enums: **`PetStatus`**, **`WeightUnit`**.
|
|
28
|
+
- **`IPet`**: weight, microchip fields, **`allergies`** (**`IAllergy`**), **`vaccines`** (**`IVaccine`**), **`photos`**, **`status`**, timestamps; discriminated union by **`species`** (**`DogBreed`** / **`CatBreed`**).
|
|
29
|
+
- **Pet API contracts**
|
|
30
|
+
- **`IPetService`**: `getPetById`, `getPetsByUserId`, `createPet`, `updatePet` (optional **`RepositoryOperationOptions`**).
|
|
31
|
+
- **`PetResponse`**: type alias for **`IPet`**.
|
|
32
|
+
- **`IPetRepository`**: **`update`** with partial **`CreatePetInput`**.
|
|
33
|
+
- **Treatment domain**
|
|
34
|
+
- Entity **`ITreatment`**; enums **`TreatmentStatus`**, **`TreatmentType`**.
|
|
35
|
+
- **`CreateTreatmentInput`**, **`TreatmentResponse`** (= **`ITreatment`**).
|
|
36
|
+
- **`ITreatmentRepository`**: `create`, `update`, `findById`, `findByPetId`, `delete`.
|
|
37
|
+
- **Dose domain**
|
|
38
|
+
- Entity **`IDose`** (scheduled vs administered dates, **`DoseStatus`**, optional notes).
|
|
39
|
+
- **`CreateDoseInput`**, **`DoseResponse`** (= **`IDose`**).
|
|
40
|
+
- **`IDoseRepository`**: `create`, `findById`, `findByTreatmentId`, `delete`, `deleteByTreatmentId`.
|
|
41
|
+
- **Treatment service**
|
|
42
|
+
- **`ITreatmentService`**: `createTreatment`, `updateTreatment`, `updateTreatmentStatus`, `getTreatmentById` (returns treatment **and nested `doses`**), `getTreatmentsByPetId`, `deleteTreatment`, **`getDosesByTreatmentId`**, **`createDose`**.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- **CHANGELOG [1.2.0]**: **`CreatePetInput`** lives under **`src/types/pet/CreatePetInput.ts`**, not `src/types/auth/`.
|
|
47
|
+
|
|
22
48
|
## [1.2.0] - 2026-05-12
|
|
23
49
|
|
|
24
50
|
### Added
|
|
@@ -26,7 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
26
52
|
- **Pet domain**:
|
|
27
53
|
- **`IPet`** entity: `name`, **`birthDate`**, **`breed`** (dog or cat), **`species`**, **`gender`**, **`ownerId`**, **`photos`**, and timestamps.
|
|
28
54
|
- **`IPetRepository`** port: `create`, **`findById`**, **`findByOwnerId`** (Mongo implementation in **`api-main`**; adapters can reuse the contract).
|
|
29
|
-
- **`CreatePetInput`**: payload for **`create`** (`src/types/
|
|
55
|
+
- **`CreatePetInput`**: payload for **`create`** (`src/types/pet/CreatePetInput.ts`).
|
|
30
56
|
- **Pet enums** (**`Gender`**, **`Species`**, **`DogBreed`**, **`CatBreed`**) under **`src/enums/`**, used by **`IPet`** and **`CreatePetInput`**.
|
|
31
57
|
|
|
32
58
|
## [1.1.9] - 2026-04-25
|
package/README.md
CHANGED
|
@@ -44,10 +44,10 @@ import {
|
|
|
44
44
|
IServerInit,
|
|
45
45
|
OAuthProvider,
|
|
46
46
|
type AuthSessionResponse,
|
|
47
|
+
type IUser,
|
|
47
48
|
type LoginRequest,
|
|
48
49
|
type RegisterRequest,
|
|
49
50
|
type TokenPair,
|
|
50
|
-
type User,
|
|
51
51
|
BaseError,
|
|
52
52
|
BusinessError,
|
|
53
53
|
ForbiddenError,
|
|
@@ -69,7 +69,7 @@ const health: IApiResponse<HealthCheck> = {
|
|
|
69
69
|
The package defines **shared contracts** for email/password and OAuth (Google via Auth0 on the server), **API-issued JWTs** (access) and **opaque refresh tokens** (server-side storage only—hashes are not part of the public types):
|
|
70
70
|
|
|
71
71
|
- **Enums:** `AuthMethod` (`password` | `oauth`), `OAuthProvider` (e.g. `GOOGLE`, extensible later).
|
|
72
|
-
- **Entities / DTOs:**
|
|
72
|
+
- **Entities / DTOs:** **`IUser`**, `TokenPair`, `AuthUserResponse`, `AuthSessionResponse`, `RegisterRequest`, `LoginRequest`, `RefreshRequest`, `LogoutRequest`, OAuth Google start/callback types, `CreateUserInput`.
|
|
73
73
|
- **Repository ports (implementations live in services):** `IUserRepository`, `IRefreshTokenRepository`, `IOAuthStateRepository` — keep domain types free of MongoDB/Passport imports so SQL or other adapters can implement the same interfaces later.
|
|
74
74
|
- **Service ports** (`interfaces/services/`): `IAuthService`, `IJwtTokensService`, `IAuth0GoogleOAuthService` — implemented by the API’s concrete classes for DI, testing, and clear boundaries.
|
|
75
75
|
- **Auth0/OIDC helpers:** `Auth0UserProfile`, `Auth0AuthorizationParams`, `OAuthAccessTokenResult`.
|
|
@@ -78,6 +78,36 @@ The package defines **shared contracts** for email/password and OAuth (Google vi
|
|
|
78
78
|
|
|
79
79
|
Path aliases (`@/…`) apply only inside this package’s source; consumers import from `@ipetsadmin/contracts` as above.
|
|
80
80
|
|
|
81
|
+
### Pets, treatments, and doses
|
|
82
|
+
|
|
83
|
+
Shared model for veterinary **pets**, **medication/surgery treatments**, and scheduled **doses** (consumers: **`@ipetsadmin/api-main`**, **`@ipetsadmin/api-client`**, etc.):
|
|
84
|
+
|
|
85
|
+
| Area | Highlights |
|
|
86
|
+
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
87
|
+
| **Pet** | **`IPet`**: discriminated **`species`** (dog vs cat) with matching **`breed`**, demographics, **`PetStatus`**, **`WeightUnit`**, allergies, vaccines, microchip fields, **`photos`**, timestamps. **`PetResponse`** is an alias for **`IPet`**. **`CreatePetInput`** is used for **`IPetRepository.create`** / **`IPetService`**. **`IPetRepository`**: **`create`**, **`findById`**, **`findByOwnerId`**, **`update`** (partial input). **`IPetService`**: **`getPetById`**, **`getPetsByUserId`**, **`createPet`**, **`updatePet`**. |
|
|
88
|
+
| **Treatment** | **`ITreatment`** (medication line, dosing schedule, **`TreatmentStatus`** / **`TreatmentType`**, optional start/end dates). **`CreateTreatmentInput`**, **`TreatmentResponse`**. **`ITreatmentRepository`**: **`create`**, **`update`**, **`findById`**, **`findByPetId`**, **`delete`**. |
|
|
89
|
+
| **Dose** | **`IDose`** links **`treatmentId`**, **`petId`**, **`ownerId`**; **`doseNumber`**, **`scheduledDate`**, optional **`actualAdministeredDate`**, **`DoseStatus`**, optional **`notes`**. **`CreateDoseInput`**, **`DoseResponse`**. **`IDoseRepository`**: **`create`**, **`findById`**, **`findByTreatmentId`**, **`delete`**, **`deleteByTreatmentId`**. |
|
|
90
|
+
| **Treatment application service** | **`ITreatmentService`**: **`createTreatment`**, **`updateTreatment`**, **`updateTreatmentStatus`**, **`getTreatmentById`** (treatment plus nested **`doses`**), **`getTreatmentsByPetId`**, **`deleteTreatment`**, **`getDosesByTreatmentId`**, **`createDose`**. All methods optionally accept **`RepositoryOperationOptions`** (e.g. Mongo session for transactions). |
|
|
91
|
+
|
|
92
|
+
Related enums (**`Species`**, **`DogBreed`**, **`CatBreed`**, **`Gender`**, **`PetStatus`**, **`WeightUnit`**, **`TreatmentStatus`**, **`TreatmentType`**, **`DoseStatus`**) live under **`src/enums/`** and are re-exported from the package root.
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import {
|
|
96
|
+
type CreatePetInput,
|
|
97
|
+
type CreateTreatmentInput,
|
|
98
|
+
type CreateDoseInput,
|
|
99
|
+
type IPet,
|
|
100
|
+
type ITreatment,
|
|
101
|
+
type IDose,
|
|
102
|
+
type IPetService,
|
|
103
|
+
type ITreatmentService,
|
|
104
|
+
PetStatus,
|
|
105
|
+
TreatmentType,
|
|
106
|
+
TreatmentStatus,
|
|
107
|
+
DoseStatus,
|
|
108
|
+
} from '@ipetsadmin/contracts';
|
|
109
|
+
```
|
|
110
|
+
|
|
81
111
|
The published package is **dual CJS + ESM** (`exports.require` → `dist/index.js`, `exports.import` → `dist/index.mjs`).
|
|
82
112
|
That way **`import { BaseError, BusinessError } from '@ipetsadmin/contracts'`** works in ESM projects (`"type": "module"`,
|
|
83
113
|
Vite, etc.), and **`require('@ipetsadmin/contracts')`** still works in CommonJS. Use TypeScript
|
|
@@ -126,14 +156,15 @@ pnpm install
|
|
|
126
156
|
|
|
127
157
|
Source lives under `src/`:
|
|
128
158
|
|
|
129
|
-
- `enums/` — shared enums (
|
|
159
|
+
- `enums/` — shared enums (`Errors`, `HealthStatus`, `AuthMethod`, `OAuthProvider`, `Species`, `PetStatus`, `TreatmentStatus`, `TreatmentType`, `DoseStatus`, …)
|
|
130
160
|
- `errors/` — error classes (`BaseError`, domain errors, …)
|
|
161
|
+
- `interfaces/entities/` — domain entities (`IUser`, `IPet`, `ITreatment`, `IDose`; nested types such as **`IAllergy`**, **`IVaccine`** on **`IPet`**)
|
|
131
162
|
- `interfaces/general/` — cross-cutting interfaces (`IConfig`, pagination, API responses, server bootstrap types, …)
|
|
132
|
-
- `interfaces/
|
|
133
|
-
- `interfaces/services/` — service ports (`IAuthService`, `IJwtTokensService`, `IAuth0GoogleOAuthService`)
|
|
134
|
-
- `types/` —
|
|
163
|
+
- `interfaces/repositories/` — persistence ports (`IUserRepository`, `IPetRepository`, `ITreatmentRepository`, `IDoseRepository`, …) plus **`repositories/auth/`** for refresh/oauth tokens
|
|
164
|
+
- `interfaces/services/` — application service ports (`IAuthService`, `IJwtTokensService`, `IAuth0GoogleOAuthService`, `IUserService`, `IPetService`, `ITreatmentService`, email subfolder, …)
|
|
165
|
+
- `types/` — DTOs and aliases (`types/auth/`, `types/pet/`, `types/treatment/`, `types/dose/`, `types/user/`, `types/email/`, `HealthCheck`, `RepositoryOperationOptions`, …)
|
|
135
166
|
|
|
136
|
-
The public API is whatever `src/index.ts` re-exports. Additional
|
|
167
|
+
The public API is whatever `src/index.ts` re-exports. Additional definitions under `src/` only appear for consumers when listed there.
|
|
137
168
|
|
|
138
169
|
## Serverless / private registry notes
|
|
139
170
|
|
|
@@ -153,6 +184,10 @@ package:
|
|
|
153
184
|
|
|
154
185
|
Dependencies resolve at build time; ensure registry or Git access is configured for private packages.
|
|
155
186
|
|
|
187
|
+
## Changelog
|
|
188
|
+
|
|
189
|
+
Release notes live in [CHANGELOG.md](./CHANGELOG.md) (Keep a Changelog).
|
|
190
|
+
|
|
156
191
|
## License
|
|
157
192
|
|
|
158
193
|
See [LICENSE](./LICENSE) (MIT).
|
package/dist/index.d.mts
CHANGED
|
@@ -115,6 +115,12 @@ interface IAllergy {
|
|
|
115
115
|
name: string;
|
|
116
116
|
severity: number;
|
|
117
117
|
}
|
|
118
|
+
interface IVaccine {
|
|
119
|
+
name: string;
|
|
120
|
+
laboratory: string;
|
|
121
|
+
lotNumber: string;
|
|
122
|
+
date: Date;
|
|
123
|
+
}
|
|
118
124
|
interface IBasePet {
|
|
119
125
|
id: string;
|
|
120
126
|
name: string;
|
|
@@ -132,6 +138,7 @@ interface IBasePet {
|
|
|
132
138
|
description: string;
|
|
133
139
|
status: PetStatus;
|
|
134
140
|
ownerId: string;
|
|
141
|
+
vaccines: IVaccine[];
|
|
135
142
|
photos: string[];
|
|
136
143
|
createdAt: Date;
|
|
137
144
|
updatedAt: Date;
|
|
@@ -146,6 +153,64 @@ interface ICatPet extends IBasePet {
|
|
|
146
153
|
}
|
|
147
154
|
type IPet = IDogPet | ICatPet;
|
|
148
155
|
|
|
156
|
+
declare enum TreatmentStatus {
|
|
157
|
+
WAITING_START = "waiting_start",
|
|
158
|
+
PENDING = "pending",
|
|
159
|
+
IN_PROGRESS = "in_progress",
|
|
160
|
+
COMPLETED = "completed",
|
|
161
|
+
CANCELLED = "cancelled"
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare enum TreatmentType {
|
|
165
|
+
MEDICATION = "medication",
|
|
166
|
+
SURGERY = "surgery",
|
|
167
|
+
DIAGNOSIS = "diagnosis",
|
|
168
|
+
DESPARASITIZATION = "desparasitization",
|
|
169
|
+
VACCINATION = "vaccination",
|
|
170
|
+
EXAM = "exam",
|
|
171
|
+
DENTAL = "dental",
|
|
172
|
+
OTHER = "other"
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface ITreatment {
|
|
176
|
+
id: string;
|
|
177
|
+
petId: string;
|
|
178
|
+
ownerId: string;
|
|
179
|
+
medicationName: string;
|
|
180
|
+
dosage: string;
|
|
181
|
+
instructions?: string;
|
|
182
|
+
frequencyHours: number;
|
|
183
|
+
durationDays: number;
|
|
184
|
+
totalDoses: number;
|
|
185
|
+
status: TreatmentStatus;
|
|
186
|
+
treatmentType: TreatmentType;
|
|
187
|
+
startDate?: Date;
|
|
188
|
+
endDate?: Date;
|
|
189
|
+
createdAt: Date;
|
|
190
|
+
updatedAt: Date;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
declare enum DoseStatus {
|
|
194
|
+
PENDING = "pending",
|
|
195
|
+
ADMINISTERED = "administered",
|
|
196
|
+
SKIPPED = "skipped",
|
|
197
|
+
SNOOZED = "snoozed"
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
interface IDose {
|
|
201
|
+
id: string;
|
|
202
|
+
treatmentId: string;
|
|
203
|
+
petId: string;
|
|
204
|
+
ownerId: string;
|
|
205
|
+
doseNumber: number;
|
|
206
|
+
scheduledDate: Date;
|
|
207
|
+
actualAdministeredDate?: Date;
|
|
208
|
+
status: DoseStatus;
|
|
209
|
+
notes?: string;
|
|
210
|
+
createdAt: Date;
|
|
211
|
+
updatedAt: Date;
|
|
212
|
+
}
|
|
213
|
+
|
|
149
214
|
declare enum HealthStatus {
|
|
150
215
|
HEALTHY = "healthy",
|
|
151
216
|
UNHEALTHY = "unhealthy"
|
|
@@ -163,6 +228,38 @@ type TokenPair = {
|
|
|
163
228
|
readonly tokenType: 'Bearer';
|
|
164
229
|
};
|
|
165
230
|
|
|
231
|
+
type RepositoryOperationOptions = {
|
|
232
|
+
readonly transactionContext?: unknown;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
type Auth0UserProfile = {
|
|
236
|
+
readonly sub: string;
|
|
237
|
+
readonly email?: string;
|
|
238
|
+
readonly email_verified?: boolean;
|
|
239
|
+
readonly name?: string;
|
|
240
|
+
readonly given_name?: string;
|
|
241
|
+
readonly family_name?: string;
|
|
242
|
+
readonly picture?: string;
|
|
243
|
+
readonly nickname?: string;
|
|
244
|
+
readonly locale?: string;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
type EmailAddress = {
|
|
248
|
+
email: string;
|
|
249
|
+
name?: string;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
type OAuthGoogleStartQuery = {
|
|
253
|
+
readonly redirectUri: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
type Auth0AuthorizationParams = {
|
|
257
|
+
readonly state: string;
|
|
258
|
+
readonly nonce: string;
|
|
259
|
+
readonly redirectUri: string;
|
|
260
|
+
readonly connection?: string;
|
|
261
|
+
};
|
|
262
|
+
|
|
166
263
|
type RegisterRequest = {
|
|
167
264
|
readonly email: string;
|
|
168
265
|
readonly password: string;
|
|
@@ -181,27 +278,16 @@ type LogoutRequest = {
|
|
|
181
278
|
readonly refreshToken: string;
|
|
182
279
|
};
|
|
183
280
|
|
|
184
|
-
type AuthUserResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'authMethod' | 'oauth'>;
|
|
185
|
-
|
|
186
|
-
type AuthSessionResponse = TokenPair & {
|
|
187
|
-
readonly user: AuthUserResponse;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
type OAuthGoogleStartQuery = {
|
|
191
|
-
readonly redirectUri: string;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
type OAuthGoogleStartResponse = {
|
|
195
|
-
readonly authorizationUrl: string;
|
|
196
|
-
readonly state: string;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
281
|
type OAuthGoogleCallbackRequest = {
|
|
200
282
|
readonly code: string;
|
|
201
283
|
readonly state: string;
|
|
202
284
|
readonly redirectUri: string;
|
|
203
285
|
};
|
|
204
286
|
|
|
287
|
+
type VerifyEmailRequest = {
|
|
288
|
+
readonly token: string;
|
|
289
|
+
};
|
|
290
|
+
|
|
205
291
|
type CreateUserInput = {
|
|
206
292
|
readonly email: string;
|
|
207
293
|
readonly emailVerified: boolean;
|
|
@@ -237,58 +323,6 @@ type CreatePetInput = {
|
|
|
237
323
|
updatedAt: Date;
|
|
238
324
|
};
|
|
239
325
|
|
|
240
|
-
type Auth0UserProfile = {
|
|
241
|
-
readonly sub: string;
|
|
242
|
-
readonly email?: string;
|
|
243
|
-
readonly email_verified?: boolean;
|
|
244
|
-
readonly name?: string;
|
|
245
|
-
readonly given_name?: string;
|
|
246
|
-
readonly family_name?: string;
|
|
247
|
-
readonly picture?: string;
|
|
248
|
-
readonly nickname?: string;
|
|
249
|
-
readonly locale?: string;
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
type Auth0AuthorizationParams = {
|
|
253
|
-
readonly state: string;
|
|
254
|
-
readonly nonce: string;
|
|
255
|
-
readonly redirectUri: string;
|
|
256
|
-
readonly connection?: string;
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
type OAuthAccessTokenResult = {
|
|
260
|
-
readonly accessToken: string;
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
type RepositoryOperationOptions = {
|
|
264
|
-
readonly transactionContext?: unknown;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
type EmailAddress = {
|
|
268
|
-
email: string;
|
|
269
|
-
name?: string;
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
type SendEmailInput = {
|
|
273
|
-
from?: EmailAddress;
|
|
274
|
-
to: EmailAddress[];
|
|
275
|
-
subject: string;
|
|
276
|
-
html?: string;
|
|
277
|
-
text?: string;
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
type SendEmailResult = {
|
|
281
|
-
provider: string;
|
|
282
|
-
messageId: string;
|
|
283
|
-
accepted: boolean;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
type VerifyEmailRequest = {
|
|
287
|
-
readonly token: string;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
type UserProfileResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'role' | 'isActive' | 'profile'>;
|
|
291
|
-
|
|
292
326
|
type PatchUserProfileInput = {
|
|
293
327
|
readonly firstName?: string;
|
|
294
328
|
readonly lastName?: string;
|
|
@@ -309,8 +343,69 @@ type PatchUserProfileInput = {
|
|
|
309
343
|
};
|
|
310
344
|
};
|
|
311
345
|
|
|
346
|
+
type SendEmailInput = {
|
|
347
|
+
from?: EmailAddress;
|
|
348
|
+
to: EmailAddress[];
|
|
349
|
+
subject: string;
|
|
350
|
+
html?: string;
|
|
351
|
+
text?: string;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
type CreateTreatmentInput = {
|
|
355
|
+
petId: string;
|
|
356
|
+
ownerId: string;
|
|
357
|
+
medicationName: string;
|
|
358
|
+
dosage: string;
|
|
359
|
+
instructions?: string;
|
|
360
|
+
frequencyHours: number;
|
|
361
|
+
durationDays: number;
|
|
362
|
+
totalDoses: number;
|
|
363
|
+
status: TreatmentStatus;
|
|
364
|
+
treatmentType: TreatmentType;
|
|
365
|
+
startDate?: Date;
|
|
366
|
+
endDate?: Date;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
type CreateDoseInput = {
|
|
370
|
+
treatmentId: string;
|
|
371
|
+
petId: string;
|
|
372
|
+
ownerId: string;
|
|
373
|
+
doseNumber: number;
|
|
374
|
+
scheduledDate: Date;
|
|
375
|
+
actualAdministeredDate?: Date;
|
|
376
|
+
status: DoseStatus;
|
|
377
|
+
notes?: string;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
type OAuthAccessTokenResult = {
|
|
381
|
+
readonly accessToken: string;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
type SendEmailResult = {
|
|
385
|
+
provider: string;
|
|
386
|
+
messageId: string;
|
|
387
|
+
accepted: boolean;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
type UserProfileResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'role' | 'isActive' | 'profile'>;
|
|
391
|
+
|
|
312
392
|
type PetResponse = IPet;
|
|
313
393
|
|
|
394
|
+
type TreatmentResponse = ITreatment;
|
|
395
|
+
|
|
396
|
+
type DoseResponse = IDose;
|
|
397
|
+
|
|
398
|
+
type OAuthGoogleStartResponse = {
|
|
399
|
+
readonly authorizationUrl: string;
|
|
400
|
+
readonly state: string;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
type AuthUserResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'authMethod' | 'oauth'>;
|
|
404
|
+
|
|
405
|
+
type AuthSessionResponse = TokenPair & {
|
|
406
|
+
readonly user: AuthUserResponse;
|
|
407
|
+
};
|
|
408
|
+
|
|
314
409
|
interface IConfig {
|
|
315
410
|
port: number;
|
|
316
411
|
cors: {
|
|
@@ -384,6 +479,10 @@ interface IPetRepository {
|
|
|
384
479
|
create(input: CreatePetInput, options?: RepositoryOperationOptions): Promise<IPet>;
|
|
385
480
|
findById(id: string, options?: RepositoryOperationOptions): Promise<IPet | null>;
|
|
386
481
|
findByOwnerId(ownerId: string, options?: RepositoryOperationOptions): Promise<IPet[]>;
|
|
482
|
+
update(params: {
|
|
483
|
+
id: string;
|
|
484
|
+
input: Partial<CreatePetInput>;
|
|
485
|
+
}, options?: RepositoryOperationOptions): Promise<IPet | null>;
|
|
387
486
|
}
|
|
388
487
|
|
|
389
488
|
type RefreshTokenRecord = {
|
|
@@ -422,6 +521,25 @@ interface IEmailVerificationTokenRepository {
|
|
|
422
521
|
consumeByHash(tokenHash: string, options?: RepositoryOperationOptions): Promise<EmailVerificationTokenRecord | null>;
|
|
423
522
|
}
|
|
424
523
|
|
|
524
|
+
interface ITreatmentRepository {
|
|
525
|
+
create(input: CreateTreatmentInput, options?: RepositoryOperationOptions): Promise<ITreatment>;
|
|
526
|
+
update(params: {
|
|
527
|
+
id: string;
|
|
528
|
+
patch: Partial<CreateTreatmentInput>;
|
|
529
|
+
}, options?: RepositoryOperationOptions): Promise<void>;
|
|
530
|
+
findById(id: string, options?: RepositoryOperationOptions): Promise<ITreatment | null>;
|
|
531
|
+
findByPetId(petId: string, options?: RepositoryOperationOptions): Promise<ITreatment[]>;
|
|
532
|
+
delete(id: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
interface IDoseRepository {
|
|
536
|
+
create(input: CreateDoseInput, options?: RepositoryOperationOptions): Promise<IDose>;
|
|
537
|
+
findById(id: string, options?: RepositoryOperationOptions): Promise<IDose | null>;
|
|
538
|
+
findByTreatmentId(treatmentId: string, options?: RepositoryOperationOptions): Promise<IDose[]>;
|
|
539
|
+
delete(id: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
540
|
+
deleteByTreatmentId(treatmentId: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
541
|
+
}
|
|
542
|
+
|
|
425
543
|
interface IAuthService {
|
|
426
544
|
register(email: string, password: string, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
427
545
|
loginWithUser(user: IUser, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
@@ -474,8 +592,50 @@ interface IUserService {
|
|
|
474
592
|
}
|
|
475
593
|
|
|
476
594
|
interface IPetService {
|
|
595
|
+
getPetById(id: string, options?: RepositoryOperationOptions): Promise<PetResponse>;
|
|
477
596
|
getPetsByUserId(userId: string, options?: RepositoryOperationOptions): Promise<PetResponse[]>;
|
|
478
597
|
createPet(input: CreatePetInput, options?: RepositoryOperationOptions): Promise<PetResponse>;
|
|
598
|
+
updatePet(params: {
|
|
599
|
+
id: string;
|
|
600
|
+
ownerId: string;
|
|
601
|
+
input: Partial<CreatePetInput>;
|
|
602
|
+
}, options?: RepositoryOperationOptions): Promise<PetResponse>;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
interface ITreatmentService {
|
|
606
|
+
createTreatment(input: CreateTreatmentInput, options?: RepositoryOperationOptions): Promise<ITreatment>;
|
|
607
|
+
updateTreatment(params: {
|
|
608
|
+
id: string;
|
|
609
|
+
petId: string;
|
|
610
|
+
ownerId: string;
|
|
611
|
+
input: Partial<CreateTreatmentInput>;
|
|
612
|
+
}, options?: RepositoryOperationOptions): Promise<ITreatment>;
|
|
613
|
+
updateTreatmentStatus(params: {
|
|
614
|
+
id: string;
|
|
615
|
+
petId: string;
|
|
616
|
+
ownerId: string;
|
|
617
|
+
status: TreatmentStatus;
|
|
618
|
+
}, options?: RepositoryOperationOptions): Promise<ITreatment>;
|
|
619
|
+
getTreatmentById(params: {
|
|
620
|
+
id: string;
|
|
621
|
+
petId: string;
|
|
622
|
+
ownerId: string;
|
|
623
|
+
}, options?: RepositoryOperationOptions): Promise<ITreatment & {
|
|
624
|
+
doses: IDose[];
|
|
625
|
+
}>;
|
|
626
|
+
getTreatmentsByPetId(petId: string, options?: RepositoryOperationOptions): Promise<ITreatment[]>;
|
|
627
|
+
deleteTreatment(id: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
628
|
+
getDosesByTreatmentId(params: {
|
|
629
|
+
treatmentId: string;
|
|
630
|
+
petId: string;
|
|
631
|
+
ownerId: string;
|
|
632
|
+
}, options?: RepositoryOperationOptions): Promise<IDose[]>;
|
|
633
|
+
createDose(params: {
|
|
634
|
+
treatmentId: string;
|
|
635
|
+
petId: string;
|
|
636
|
+
ownerId: string;
|
|
637
|
+
input: CreateDoseInput;
|
|
638
|
+
}, options?: RepositoryOperationOptions): Promise<IDose>;
|
|
479
639
|
}
|
|
480
640
|
|
|
481
641
|
declare enum Errors {
|
|
@@ -528,4 +688,4 @@ declare class UnauthorizedError extends BaseError {
|
|
|
528
688
|
constructor(message: string, details?: Record<string, unknown>);
|
|
529
689
|
}
|
|
530
690
|
|
|
531
|
-
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, CatBreed, type CreatePetInput, type CreateUserInput, DogBreed, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, Gender, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IPet, type IPetRepository, type IPetService, type IRefreshTokenRepository, type IServerInit, type IUser, type IUserRepository, type IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type PetResponse, PetStatus, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, Species, type TokenPair, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest, WeightUnit };
|
|
691
|
+
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, CatBreed, type CreateDoseInput, type CreatePetInput, type CreateTreatmentInput, type CreateUserInput, DogBreed, type DoseResponse, DoseStatus, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, Gender, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IDose, type IDoseRepository, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IPet, type IPetRepository, type IPetService, type IRefreshTokenRepository, type IServerInit, type ITreatment, type ITreatmentRepository, type ITreatmentService, type IUser, type IUserRepository, type IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type PetResponse, PetStatus, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, Species, type TokenPair, type TreatmentResponse, TreatmentStatus, TreatmentType, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest, WeightUnit };
|
package/dist/index.d.ts
CHANGED
|
@@ -115,6 +115,12 @@ interface IAllergy {
|
|
|
115
115
|
name: string;
|
|
116
116
|
severity: number;
|
|
117
117
|
}
|
|
118
|
+
interface IVaccine {
|
|
119
|
+
name: string;
|
|
120
|
+
laboratory: string;
|
|
121
|
+
lotNumber: string;
|
|
122
|
+
date: Date;
|
|
123
|
+
}
|
|
118
124
|
interface IBasePet {
|
|
119
125
|
id: string;
|
|
120
126
|
name: string;
|
|
@@ -132,6 +138,7 @@ interface IBasePet {
|
|
|
132
138
|
description: string;
|
|
133
139
|
status: PetStatus;
|
|
134
140
|
ownerId: string;
|
|
141
|
+
vaccines: IVaccine[];
|
|
135
142
|
photos: string[];
|
|
136
143
|
createdAt: Date;
|
|
137
144
|
updatedAt: Date;
|
|
@@ -146,6 +153,64 @@ interface ICatPet extends IBasePet {
|
|
|
146
153
|
}
|
|
147
154
|
type IPet = IDogPet | ICatPet;
|
|
148
155
|
|
|
156
|
+
declare enum TreatmentStatus {
|
|
157
|
+
WAITING_START = "waiting_start",
|
|
158
|
+
PENDING = "pending",
|
|
159
|
+
IN_PROGRESS = "in_progress",
|
|
160
|
+
COMPLETED = "completed",
|
|
161
|
+
CANCELLED = "cancelled"
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare enum TreatmentType {
|
|
165
|
+
MEDICATION = "medication",
|
|
166
|
+
SURGERY = "surgery",
|
|
167
|
+
DIAGNOSIS = "diagnosis",
|
|
168
|
+
DESPARASITIZATION = "desparasitization",
|
|
169
|
+
VACCINATION = "vaccination",
|
|
170
|
+
EXAM = "exam",
|
|
171
|
+
DENTAL = "dental",
|
|
172
|
+
OTHER = "other"
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface ITreatment {
|
|
176
|
+
id: string;
|
|
177
|
+
petId: string;
|
|
178
|
+
ownerId: string;
|
|
179
|
+
medicationName: string;
|
|
180
|
+
dosage: string;
|
|
181
|
+
instructions?: string;
|
|
182
|
+
frequencyHours: number;
|
|
183
|
+
durationDays: number;
|
|
184
|
+
totalDoses: number;
|
|
185
|
+
status: TreatmentStatus;
|
|
186
|
+
treatmentType: TreatmentType;
|
|
187
|
+
startDate?: Date;
|
|
188
|
+
endDate?: Date;
|
|
189
|
+
createdAt: Date;
|
|
190
|
+
updatedAt: Date;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
declare enum DoseStatus {
|
|
194
|
+
PENDING = "pending",
|
|
195
|
+
ADMINISTERED = "administered",
|
|
196
|
+
SKIPPED = "skipped",
|
|
197
|
+
SNOOZED = "snoozed"
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
interface IDose {
|
|
201
|
+
id: string;
|
|
202
|
+
treatmentId: string;
|
|
203
|
+
petId: string;
|
|
204
|
+
ownerId: string;
|
|
205
|
+
doseNumber: number;
|
|
206
|
+
scheduledDate: Date;
|
|
207
|
+
actualAdministeredDate?: Date;
|
|
208
|
+
status: DoseStatus;
|
|
209
|
+
notes?: string;
|
|
210
|
+
createdAt: Date;
|
|
211
|
+
updatedAt: Date;
|
|
212
|
+
}
|
|
213
|
+
|
|
149
214
|
declare enum HealthStatus {
|
|
150
215
|
HEALTHY = "healthy",
|
|
151
216
|
UNHEALTHY = "unhealthy"
|
|
@@ -163,6 +228,38 @@ type TokenPair = {
|
|
|
163
228
|
readonly tokenType: 'Bearer';
|
|
164
229
|
};
|
|
165
230
|
|
|
231
|
+
type RepositoryOperationOptions = {
|
|
232
|
+
readonly transactionContext?: unknown;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
type Auth0UserProfile = {
|
|
236
|
+
readonly sub: string;
|
|
237
|
+
readonly email?: string;
|
|
238
|
+
readonly email_verified?: boolean;
|
|
239
|
+
readonly name?: string;
|
|
240
|
+
readonly given_name?: string;
|
|
241
|
+
readonly family_name?: string;
|
|
242
|
+
readonly picture?: string;
|
|
243
|
+
readonly nickname?: string;
|
|
244
|
+
readonly locale?: string;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
type EmailAddress = {
|
|
248
|
+
email: string;
|
|
249
|
+
name?: string;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
type OAuthGoogleStartQuery = {
|
|
253
|
+
readonly redirectUri: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
type Auth0AuthorizationParams = {
|
|
257
|
+
readonly state: string;
|
|
258
|
+
readonly nonce: string;
|
|
259
|
+
readonly redirectUri: string;
|
|
260
|
+
readonly connection?: string;
|
|
261
|
+
};
|
|
262
|
+
|
|
166
263
|
type RegisterRequest = {
|
|
167
264
|
readonly email: string;
|
|
168
265
|
readonly password: string;
|
|
@@ -181,27 +278,16 @@ type LogoutRequest = {
|
|
|
181
278
|
readonly refreshToken: string;
|
|
182
279
|
};
|
|
183
280
|
|
|
184
|
-
type AuthUserResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'authMethod' | 'oauth'>;
|
|
185
|
-
|
|
186
|
-
type AuthSessionResponse = TokenPair & {
|
|
187
|
-
readonly user: AuthUserResponse;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
type OAuthGoogleStartQuery = {
|
|
191
|
-
readonly redirectUri: string;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
type OAuthGoogleStartResponse = {
|
|
195
|
-
readonly authorizationUrl: string;
|
|
196
|
-
readonly state: string;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
281
|
type OAuthGoogleCallbackRequest = {
|
|
200
282
|
readonly code: string;
|
|
201
283
|
readonly state: string;
|
|
202
284
|
readonly redirectUri: string;
|
|
203
285
|
};
|
|
204
286
|
|
|
287
|
+
type VerifyEmailRequest = {
|
|
288
|
+
readonly token: string;
|
|
289
|
+
};
|
|
290
|
+
|
|
205
291
|
type CreateUserInput = {
|
|
206
292
|
readonly email: string;
|
|
207
293
|
readonly emailVerified: boolean;
|
|
@@ -237,58 +323,6 @@ type CreatePetInput = {
|
|
|
237
323
|
updatedAt: Date;
|
|
238
324
|
};
|
|
239
325
|
|
|
240
|
-
type Auth0UserProfile = {
|
|
241
|
-
readonly sub: string;
|
|
242
|
-
readonly email?: string;
|
|
243
|
-
readonly email_verified?: boolean;
|
|
244
|
-
readonly name?: string;
|
|
245
|
-
readonly given_name?: string;
|
|
246
|
-
readonly family_name?: string;
|
|
247
|
-
readonly picture?: string;
|
|
248
|
-
readonly nickname?: string;
|
|
249
|
-
readonly locale?: string;
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
type Auth0AuthorizationParams = {
|
|
253
|
-
readonly state: string;
|
|
254
|
-
readonly nonce: string;
|
|
255
|
-
readonly redirectUri: string;
|
|
256
|
-
readonly connection?: string;
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
type OAuthAccessTokenResult = {
|
|
260
|
-
readonly accessToken: string;
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
type RepositoryOperationOptions = {
|
|
264
|
-
readonly transactionContext?: unknown;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
type EmailAddress = {
|
|
268
|
-
email: string;
|
|
269
|
-
name?: string;
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
type SendEmailInput = {
|
|
273
|
-
from?: EmailAddress;
|
|
274
|
-
to: EmailAddress[];
|
|
275
|
-
subject: string;
|
|
276
|
-
html?: string;
|
|
277
|
-
text?: string;
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
type SendEmailResult = {
|
|
281
|
-
provider: string;
|
|
282
|
-
messageId: string;
|
|
283
|
-
accepted: boolean;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
type VerifyEmailRequest = {
|
|
287
|
-
readonly token: string;
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
type UserProfileResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'role' | 'isActive' | 'profile'>;
|
|
291
|
-
|
|
292
326
|
type PatchUserProfileInput = {
|
|
293
327
|
readonly firstName?: string;
|
|
294
328
|
readonly lastName?: string;
|
|
@@ -309,8 +343,69 @@ type PatchUserProfileInput = {
|
|
|
309
343
|
};
|
|
310
344
|
};
|
|
311
345
|
|
|
346
|
+
type SendEmailInput = {
|
|
347
|
+
from?: EmailAddress;
|
|
348
|
+
to: EmailAddress[];
|
|
349
|
+
subject: string;
|
|
350
|
+
html?: string;
|
|
351
|
+
text?: string;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
type CreateTreatmentInput = {
|
|
355
|
+
petId: string;
|
|
356
|
+
ownerId: string;
|
|
357
|
+
medicationName: string;
|
|
358
|
+
dosage: string;
|
|
359
|
+
instructions?: string;
|
|
360
|
+
frequencyHours: number;
|
|
361
|
+
durationDays: number;
|
|
362
|
+
totalDoses: number;
|
|
363
|
+
status: TreatmentStatus;
|
|
364
|
+
treatmentType: TreatmentType;
|
|
365
|
+
startDate?: Date;
|
|
366
|
+
endDate?: Date;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
type CreateDoseInput = {
|
|
370
|
+
treatmentId: string;
|
|
371
|
+
petId: string;
|
|
372
|
+
ownerId: string;
|
|
373
|
+
doseNumber: number;
|
|
374
|
+
scheduledDate: Date;
|
|
375
|
+
actualAdministeredDate?: Date;
|
|
376
|
+
status: DoseStatus;
|
|
377
|
+
notes?: string;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
type OAuthAccessTokenResult = {
|
|
381
|
+
readonly accessToken: string;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
type SendEmailResult = {
|
|
385
|
+
provider: string;
|
|
386
|
+
messageId: string;
|
|
387
|
+
accepted: boolean;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
type UserProfileResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'role' | 'isActive' | 'profile'>;
|
|
391
|
+
|
|
312
392
|
type PetResponse = IPet;
|
|
313
393
|
|
|
394
|
+
type TreatmentResponse = ITreatment;
|
|
395
|
+
|
|
396
|
+
type DoseResponse = IDose;
|
|
397
|
+
|
|
398
|
+
type OAuthGoogleStartResponse = {
|
|
399
|
+
readonly authorizationUrl: string;
|
|
400
|
+
readonly state: string;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
type AuthUserResponse = Pick<IUser, 'id' | 'email' | 'emailVerified' | 'authMethod' | 'oauth'>;
|
|
404
|
+
|
|
405
|
+
type AuthSessionResponse = TokenPair & {
|
|
406
|
+
readonly user: AuthUserResponse;
|
|
407
|
+
};
|
|
408
|
+
|
|
314
409
|
interface IConfig {
|
|
315
410
|
port: number;
|
|
316
411
|
cors: {
|
|
@@ -384,6 +479,10 @@ interface IPetRepository {
|
|
|
384
479
|
create(input: CreatePetInput, options?: RepositoryOperationOptions): Promise<IPet>;
|
|
385
480
|
findById(id: string, options?: RepositoryOperationOptions): Promise<IPet | null>;
|
|
386
481
|
findByOwnerId(ownerId: string, options?: RepositoryOperationOptions): Promise<IPet[]>;
|
|
482
|
+
update(params: {
|
|
483
|
+
id: string;
|
|
484
|
+
input: Partial<CreatePetInput>;
|
|
485
|
+
}, options?: RepositoryOperationOptions): Promise<IPet | null>;
|
|
387
486
|
}
|
|
388
487
|
|
|
389
488
|
type RefreshTokenRecord = {
|
|
@@ -422,6 +521,25 @@ interface IEmailVerificationTokenRepository {
|
|
|
422
521
|
consumeByHash(tokenHash: string, options?: RepositoryOperationOptions): Promise<EmailVerificationTokenRecord | null>;
|
|
423
522
|
}
|
|
424
523
|
|
|
524
|
+
interface ITreatmentRepository {
|
|
525
|
+
create(input: CreateTreatmentInput, options?: RepositoryOperationOptions): Promise<ITreatment>;
|
|
526
|
+
update(params: {
|
|
527
|
+
id: string;
|
|
528
|
+
patch: Partial<CreateTreatmentInput>;
|
|
529
|
+
}, options?: RepositoryOperationOptions): Promise<void>;
|
|
530
|
+
findById(id: string, options?: RepositoryOperationOptions): Promise<ITreatment | null>;
|
|
531
|
+
findByPetId(petId: string, options?: RepositoryOperationOptions): Promise<ITreatment[]>;
|
|
532
|
+
delete(id: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
interface IDoseRepository {
|
|
536
|
+
create(input: CreateDoseInput, options?: RepositoryOperationOptions): Promise<IDose>;
|
|
537
|
+
findById(id: string, options?: RepositoryOperationOptions): Promise<IDose | null>;
|
|
538
|
+
findByTreatmentId(treatmentId: string, options?: RepositoryOperationOptions): Promise<IDose[]>;
|
|
539
|
+
delete(id: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
540
|
+
deleteByTreatmentId(treatmentId: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
541
|
+
}
|
|
542
|
+
|
|
425
543
|
interface IAuthService {
|
|
426
544
|
register(email: string, password: string, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
427
545
|
loginWithUser(user: IUser, options?: RepositoryOperationOptions): Promise<AuthSessionResponse>;
|
|
@@ -474,8 +592,50 @@ interface IUserService {
|
|
|
474
592
|
}
|
|
475
593
|
|
|
476
594
|
interface IPetService {
|
|
595
|
+
getPetById(id: string, options?: RepositoryOperationOptions): Promise<PetResponse>;
|
|
477
596
|
getPetsByUserId(userId: string, options?: RepositoryOperationOptions): Promise<PetResponse[]>;
|
|
478
597
|
createPet(input: CreatePetInput, options?: RepositoryOperationOptions): Promise<PetResponse>;
|
|
598
|
+
updatePet(params: {
|
|
599
|
+
id: string;
|
|
600
|
+
ownerId: string;
|
|
601
|
+
input: Partial<CreatePetInput>;
|
|
602
|
+
}, options?: RepositoryOperationOptions): Promise<PetResponse>;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
interface ITreatmentService {
|
|
606
|
+
createTreatment(input: CreateTreatmentInput, options?: RepositoryOperationOptions): Promise<ITreatment>;
|
|
607
|
+
updateTreatment(params: {
|
|
608
|
+
id: string;
|
|
609
|
+
petId: string;
|
|
610
|
+
ownerId: string;
|
|
611
|
+
input: Partial<CreateTreatmentInput>;
|
|
612
|
+
}, options?: RepositoryOperationOptions): Promise<ITreatment>;
|
|
613
|
+
updateTreatmentStatus(params: {
|
|
614
|
+
id: string;
|
|
615
|
+
petId: string;
|
|
616
|
+
ownerId: string;
|
|
617
|
+
status: TreatmentStatus;
|
|
618
|
+
}, options?: RepositoryOperationOptions): Promise<ITreatment>;
|
|
619
|
+
getTreatmentById(params: {
|
|
620
|
+
id: string;
|
|
621
|
+
petId: string;
|
|
622
|
+
ownerId: string;
|
|
623
|
+
}, options?: RepositoryOperationOptions): Promise<ITreatment & {
|
|
624
|
+
doses: IDose[];
|
|
625
|
+
}>;
|
|
626
|
+
getTreatmentsByPetId(petId: string, options?: RepositoryOperationOptions): Promise<ITreatment[]>;
|
|
627
|
+
deleteTreatment(id: string, options?: RepositoryOperationOptions): Promise<void>;
|
|
628
|
+
getDosesByTreatmentId(params: {
|
|
629
|
+
treatmentId: string;
|
|
630
|
+
petId: string;
|
|
631
|
+
ownerId: string;
|
|
632
|
+
}, options?: RepositoryOperationOptions): Promise<IDose[]>;
|
|
633
|
+
createDose(params: {
|
|
634
|
+
treatmentId: string;
|
|
635
|
+
petId: string;
|
|
636
|
+
ownerId: string;
|
|
637
|
+
input: CreateDoseInput;
|
|
638
|
+
}, options?: RepositoryOperationOptions): Promise<IDose>;
|
|
479
639
|
}
|
|
480
640
|
|
|
481
641
|
declare enum Errors {
|
|
@@ -528,4 +688,4 @@ declare class UnauthorizedError extends BaseError {
|
|
|
528
688
|
constructor(message: string, details?: Record<string, unknown>);
|
|
529
689
|
}
|
|
530
690
|
|
|
531
|
-
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, CatBreed, type CreatePetInput, type CreateUserInput, DogBreed, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, Gender, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IPet, type IPetRepository, type IPetService, type IRefreshTokenRepository, type IServerInit, type IUser, type IUserRepository, type IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type PetResponse, PetStatus, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, Species, type TokenPair, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest, WeightUnit };
|
|
691
|
+
export { type Auth0AuthorizationParams, type Auth0UserProfile, AuthMethod, type AuthSessionResponse, type AuthUserResponse, BaseError, BusinessError, CatBreed, type CreateDoseInput, type CreatePetInput, type CreateTreatmentInput, type CreateUserInput, DogBreed, type DoseResponse, DoseStatus, type EmailAddress, EmailProvider, type EmailVerificationTokenRecord, Errors, ForbiddenError, Gender, type HealthCheck, HealthStatus, type IApiResponse, type IAuth0GoogleOAuthService, type IAuthService, type IConfig, type IDose, type IDoseRepository, type IEmailConfig, type IEmailProviderAdapter, type IEmailService, type IEmailVerificationConfig, type IEmailVerificationTokenRepository, type IJwtTokensService, type IOAuthStateRepository, type IPaginatedResponse, type IPet, type IPetRepository, type IPetService, type IRefreshTokenRepository, type IServerInit, type ITreatment, type ITreatmentRepository, type ITreatmentService, type IUser, type IUserRepository, type IUserService, type LoginRequest, type LogoutRequest, NotFoundError, type OAuthAccessTokenResult, type OAuthGoogleCallbackRequest, type OAuthGoogleStartQuery, type OAuthGoogleStartResponse, OAuthProvider, type OAuthStateRecord, type PatchUserProfileInput, type PetResponse, PetStatus, type RefreshRequest, type RefreshTokenRecord, type RegisterRequest, type RepositoryOperationOptions, type SendEmailInput, type SendEmailResult, ServerError, Species, type TokenPair, type TreatmentResponse, TreatmentStatus, TreatmentType, UnauthorizedError, type UserProfileResponse, UserRole, type VerifyEmailRequest, WeightUnit };
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,38 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
|
124
124
|
return WeightUnit2;
|
|
125
125
|
})(WeightUnit || {});
|
|
126
126
|
|
|
127
|
+
// src/enums/treatment-status.ts
|
|
128
|
+
var TreatmentStatus = /* @__PURE__ */ ((TreatmentStatus2) => {
|
|
129
|
+
TreatmentStatus2["WAITING_START"] = "waiting_start";
|
|
130
|
+
TreatmentStatus2["PENDING"] = "pending";
|
|
131
|
+
TreatmentStatus2["IN_PROGRESS"] = "in_progress";
|
|
132
|
+
TreatmentStatus2["COMPLETED"] = "completed";
|
|
133
|
+
TreatmentStatus2["CANCELLED"] = "cancelled";
|
|
134
|
+
return TreatmentStatus2;
|
|
135
|
+
})(TreatmentStatus || {});
|
|
136
|
+
|
|
137
|
+
// src/enums/dose-status.ts
|
|
138
|
+
var DoseStatus = /* @__PURE__ */ ((DoseStatus2) => {
|
|
139
|
+
DoseStatus2["PENDING"] = "pending";
|
|
140
|
+
DoseStatus2["ADMINISTERED"] = "administered";
|
|
141
|
+
DoseStatus2["SKIPPED"] = "skipped";
|
|
142
|
+
DoseStatus2["SNOOZED"] = "snoozed";
|
|
143
|
+
return DoseStatus2;
|
|
144
|
+
})(DoseStatus || {});
|
|
145
|
+
|
|
146
|
+
// src/enums/treatment-type.ts
|
|
147
|
+
var TreatmentType = /* @__PURE__ */ ((TreatmentType2) => {
|
|
148
|
+
TreatmentType2["MEDICATION"] = "medication";
|
|
149
|
+
TreatmentType2["SURGERY"] = "surgery";
|
|
150
|
+
TreatmentType2["DIAGNOSIS"] = "diagnosis";
|
|
151
|
+
TreatmentType2["DESPARASITIZATION"] = "desparasitization";
|
|
152
|
+
TreatmentType2["VACCINATION"] = "vaccination";
|
|
153
|
+
TreatmentType2["EXAM"] = "exam";
|
|
154
|
+
TreatmentType2["DENTAL"] = "dental";
|
|
155
|
+
TreatmentType2["OTHER"] = "other";
|
|
156
|
+
return TreatmentType2;
|
|
157
|
+
})(TreatmentType || {});
|
|
158
|
+
|
|
127
159
|
// src/errors/BaseError.ts
|
|
128
160
|
var BaseError = class extends Error {
|
|
129
161
|
toErrorRecord() {
|
|
@@ -190,6 +222,7 @@ exports.BaseError = BaseError;
|
|
|
190
222
|
exports.BusinessError = BusinessError;
|
|
191
223
|
exports.CatBreed = CatBreed;
|
|
192
224
|
exports.DogBreed = DogBreed;
|
|
225
|
+
exports.DoseStatus = DoseStatus;
|
|
193
226
|
exports.EmailProvider = EmailProvider;
|
|
194
227
|
exports.Errors = Errors;
|
|
195
228
|
exports.ForbiddenError = ForbiddenError;
|
|
@@ -200,6 +233,8 @@ exports.OAuthProvider = OAuthProvider;
|
|
|
200
233
|
exports.PetStatus = PetStatus;
|
|
201
234
|
exports.ServerError = ServerError;
|
|
202
235
|
exports.Species = Species;
|
|
236
|
+
exports.TreatmentStatus = TreatmentStatus;
|
|
237
|
+
exports.TreatmentType = TreatmentType;
|
|
203
238
|
exports.UnauthorizedError = UnauthorizedError;
|
|
204
239
|
exports.UserRole = UserRole;
|
|
205
240
|
exports.WeightUnit = WeightUnit;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/enums/errors.ts","../src/enums/health-status.ts","../src/enums/roles.ts","../src/enums/auth-method.ts","../src/enums/oauth-provider.ts","../src/enums/email-providers.ts","../src/enums/species.ts","../src/enums/dog-breed.ts","../src/enums/cat-breed.ts","../src/enums/gender.ts","../src/enums/pet-status.ts","../src/enums/weight-unit.ts","../src/errors/BaseError.ts","../src/errors/BusinessError.ts","../src/errors/ForbiddenError.ts","../src/errors/NotFoundError.ts","../src/errors/ServerError.ts","../src/errors/UnauthorizedError.ts"],"names":["Errors","HealthStatus","UserRole","AuthMethod","OAuthProvider","EmailProvider","Species","DogBreed","CatBreed","Gender","PetStatus","WeightUnit"],"mappings":";;;AAAO,IAAK,MAAA,qBAAAA,OAAAA,KAAL;AACL,EAAAA,QAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,QAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,QAAA,iBAAA,CAAA,GAAkB,gBAAA;AAClB,EAAAA,QAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,QAAA,oBAAA,CAAA,GAAqB,mBAAA;AACrB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,4BAAA,CAAA,GAA6B,0BAAA;AAC7B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAC1B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,yBAAA,CA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;AAAA,EACnD;AACF;;;ACRO,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,SAAA,CAAU;AAAA,EAExC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,mBAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,kBAAA,CAAkB,SAAS,CAAA;AAAA,EACzD;AACF","file":"index.js","sourcesContent":["export enum Errors {\n NOT_FOUND_ERROR = 'NotFoundError',\n BUSINESS_ERROR = 'BusinessError',\n FORBIDDEN_ERROR = 'ForbiddenError',\n SERVER_ERROR = 'ServerError',\n UNAUTHORIZED_ERROR = 'UnauthorizedError',\n BAD_REQUEST_ERROR = 'BadRequestError',\n UNPROCESSABLE_ENTITY_ERROR = 'UnprocessableEntityError',\n TOO_MANY_REQUESTS_ERROR = 'TooManyRequestsError',\n INTERNAL_SERVER_ERROR = 'InternalServerError',\n SERVICE_UNAVAILABLE_ERROR = 'ServiceUnavailableError',\n GATEWAY_TIMEOUT_ERROR = 'GatewayTimeoutError',\n BAD_GATEWAY_ERROR = 'BadGatewayError',\n PRECONDITION_FAILED_ERROR = 'PreconditionFailedError',\n PAYLOAD_TOO_LARGE_ERROR = 'PayloadTooLargeError',\n}\n","export enum HealthStatus {\n HEALTHY = 'healthy',\n UNHEALTHY = 'unhealthy',\n}\n","export enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n}\n","/**\n * How the user primarily authenticates. Switching methods is admin-only (future).\n */\nexport enum AuthMethod {\n PASSWORD = 'password',\n OAUTH = 'oauth',\n}\n","/**\n * OAuth identity provider (Auth0 connection / social). MVP: Google only; extend for Microsoft, GitHub, etc.\n */\nexport enum OAuthProvider {\n GOOGLE = 'google',\n}\n","export enum EmailProvider {\n RESEND = 'resend',\n}\n","/**\n * Enum of the animal species admitted.\n */\nexport enum Species {\n DOG = 'Dog',\n CAT = 'Cat',\n}\n","/**\n * Enum of the most common dog breeds.\n */\nexport enum DogBreed {\n LABRADOR_RETRIEVER = 'Labrador Retriever',\n GOLDEN_RETRIEVER = 'Golden Retriever',\n PASTOR_ALEMAN = 'Pastor Alemán',\n BULLDOG_FRANCES = 'Bulldog Francés',\n BULLDOG_INGLES = 'Bulldog Inglés',\n CANICHE = 'Caniche',\n BEAGLE = 'Beagle',\n ROTTWEILER = 'Rottweiler',\n CHIHUAHUA = 'Chihuahua',\n PUG = 'Pug',\n HUSKY_SIBERIANO = 'Husky Siberiano',\n BOXER = 'Bóxer',\n YORKSHIRE_TERRIER = 'Yorkshire Terrier',\n DALMATA = 'Dálmata',\n MESTIZO = 'Mestizo', // Option for common or mixed dogs\n}\n","/**\n * Enum of the most common cat breeds.\n */\nexport enum CatBreed {\n PERSA = 'Persa',\n MAINE_COON = 'Maine Coon',\n SIAMES = 'Siamés',\n RAGDOLL = 'Ragdoll',\n BENGALI = 'Bengalí',\n ESFINGE = 'Esfinge (Sphynx)',\n BRITISH_SHORTHAIR = 'Británico de pelo corto',\n ABISINIO = 'Abisinio',\n SCOTTISH_FOLD = 'Scottish Fold',\n AZUL_RUSO = 'Azul Ruso',\n ANGORA_TURCO = 'Angora Turco',\n BOSQUE_DE_NORUEGA = 'Bosque de Noruega',\n EUROPEO_COMUN = 'Europeo Común',\n MESTIZO = 'Mestizo', // Option for common or mixed cats\n}\n","/**\n * Enum of the animal gender.\n */\nexport enum Gender {\n MALE = 'Male',\n FEMALE = 'Female',\n}\n","export enum PetStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SOLD = 'sold',\n ADOPTED = 'adopted',\n LOST = 'lost',\n FOUND = 'found',\n DECEASED = 'deceased',\n}\n","export enum WeightUnit {\n KG = 'KG',\n LB = 'LB',\n}\n","export class BaseError extends Error {\n public details?: Record<string, unknown>;\n public toErrorRecord(): { error: string; details?: unknown } {\n const obj: { error: string; details?: unknown } = { error: this.message };\n if (this.details) {\n obj.details = this.details;\n }\n return obj;\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class BusinessError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.BUSINESS_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, BusinessError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ForbiddenError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.FORBIDDEN_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class NotFoundError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.NOT_FOUND_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ServerError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.SERVER_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class UnauthorizedError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.UNAUTHORIZED_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/enums/errors.ts","../src/enums/health-status.ts","../src/enums/roles.ts","../src/enums/auth-method.ts","../src/enums/oauth-provider.ts","../src/enums/email-providers.ts","../src/enums/species.ts","../src/enums/dog-breed.ts","../src/enums/cat-breed.ts","../src/enums/gender.ts","../src/enums/pet-status.ts","../src/enums/weight-unit.ts","../src/enums/treatment-status.ts","../src/enums/dose-status.ts","../src/enums/treatment-type.ts","../src/errors/BaseError.ts","../src/errors/BusinessError.ts","../src/errors/ForbiddenError.ts","../src/errors/NotFoundError.ts","../src/errors/ServerError.ts","../src/errors/UnauthorizedError.ts"],"names":["Errors","HealthStatus","UserRole","AuthMethod","OAuthProvider","EmailProvider","Species","DogBreed","CatBreed","Gender","PetStatus","WeightUnit","TreatmentStatus","DoseStatus","TreatmentType"],"mappings":";;;AAAO,IAAK,MAAA,qBAAAA,OAAAA,KAAL;AACL,EAAAA,QAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,QAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,QAAA,iBAAA,CAAA,GAAkB,gBAAA;AAClB,EAAAA,QAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,QAAA,oBAAA,CAAA,GAAqB,mBAAA;AACrB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,4BAAA,CAAA,GAA6B,0BAAA;AAC7B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAC1B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,uBAAA,CAAA,GAAwB,qBAAA;AACxB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,2BAAA,CAAA,GAA4B,yBAAA;AAC5B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAdhB,EAAA,OAAAA,OAAAA;AAAA,CAAA,EAAA,MAAA,IAAA,EAAA;;;ACAL,IAAK,YAAA,qBAAAC,aAAAA,KAAL;AACL,EAAAA,cAAA,SAAA,CAAA,GAAU,SAAA;AAC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Content":["export enum Errors {\n NOT_FOUND_ERROR = 'NotFoundError',\n BUSINESS_ERROR = 'BusinessError',\n FORBIDDEN_ERROR = 'ForbiddenError',\n SERVER_ERROR = 'ServerError',\n UNAUTHORIZED_ERROR = 'UnauthorizedError',\n BAD_REQUEST_ERROR = 'BadRequestError',\n UNPROCESSABLE_ENTITY_ERROR = 'UnprocessableEntityError',\n TOO_MANY_REQUESTS_ERROR = 'TooManyRequestsError',\n INTERNAL_SERVER_ERROR = 'InternalServerError',\n SERVICE_UNAVAILABLE_ERROR = 'ServiceUnavailableError',\n GATEWAY_TIMEOUT_ERROR = 'GatewayTimeoutError',\n BAD_GATEWAY_ERROR = 'BadGatewayError',\n PRECONDITION_FAILED_ERROR = 'PreconditionFailedError',\n PAYLOAD_TOO_LARGE_ERROR = 'PayloadTooLargeError',\n}\n","export enum HealthStatus {\n HEALTHY = 'healthy',\n UNHEALTHY = 'unhealthy',\n}\n","export enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n}\n","/**\n * How the user primarily authenticates. Switching methods is admin-only (future).\n */\nexport enum AuthMethod {\n PASSWORD = 'password',\n OAUTH = 'oauth',\n}\n","/**\n * OAuth identity provider (Auth0 connection / social). MVP: Google only; extend for Microsoft, GitHub, etc.\n */\nexport enum OAuthProvider {\n GOOGLE = 'google',\n}\n","export enum EmailProvider {\n RESEND = 'resend',\n}\n","/**\n * Enum of the animal species admitted.\n */\nexport enum Species {\n DOG = 'Dog',\n CAT = 'Cat',\n}\n","/**\n * Enum of the most common dog breeds.\n */\nexport enum DogBreed {\n LABRADOR_RETRIEVER = 'Labrador Retriever',\n GOLDEN_RETRIEVER = 'Golden Retriever',\n PASTOR_ALEMAN = 'Pastor Alemán',\n BULLDOG_FRANCES = 'Bulldog Francés',\n BULLDOG_INGLES = 'Bulldog Inglés',\n CANICHE = 'Caniche',\n BEAGLE = 'Beagle',\n ROTTWEILER = 'Rottweiler',\n CHIHUAHUA = 'Chihuahua',\n PUG = 'Pug',\n HUSKY_SIBERIANO = 'Husky Siberiano',\n BOXER = 'Bóxer',\n YORKSHIRE_TERRIER = 'Yorkshire Terrier',\n DALMATA = 'Dálmata',\n MESTIZO = 'Mestizo', // Option for common or mixed dogs\n}\n","/**\n * Enum of the most common cat breeds.\n */\nexport enum CatBreed {\n PERSA = 'Persa',\n MAINE_COON = 'Maine Coon',\n SIAMES = 'Siamés',\n RAGDOLL = 'Ragdoll',\n BENGALI = 'Bengalí',\n ESFINGE = 'Esfinge (Sphynx)',\n BRITISH_SHORTHAIR = 'Británico de pelo corto',\n ABISINIO = 'Abisinio',\n SCOTTISH_FOLD = 'Scottish Fold',\n AZUL_RUSO = 'Azul Ruso',\n ANGORA_TURCO = 'Angora Turco',\n BOSQUE_DE_NORUEGA = 'Bosque de Noruega',\n EUROPEO_COMUN = 'Europeo Común',\n MESTIZO = 'Mestizo', // Option for common or mixed cats\n}\n","/**\n * Enum of the animal gender.\n */\nexport enum Gender {\n MALE = 'Male',\n FEMALE = 'Female',\n}\n","export enum PetStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SOLD = 'sold',\n ADOPTED = 'adopted',\n LOST = 'lost',\n FOUND = 'found',\n DECEASED = 'deceased',\n}\n","export enum WeightUnit {\n KG = 'KG',\n LB = 'LB',\n}\n","export enum TreatmentStatus {\n WAITING_START = 'waiting_start',\n PENDING = 'pending',\n IN_PROGRESS = 'in_progress',\n COMPLETED = 'completed',\n CANCELLED = 'cancelled',\n}\n","export enum DoseStatus {\n PENDING = 'pending',\n ADMINISTERED = 'administered',\n SKIPPED = 'skipped',\n SNOOZED = 'snoozed',\n}\n","export enum TreatmentType {\n MEDICATION = 'medication',\n SURGERY = 'surgery',\n DIAGNOSIS = 'diagnosis',\n DESPARASITIZATION = 'desparasitization',\n VACCINATION = 'vaccination',\n EXAM = 'exam',\n DENTAL = 'dental',\n OTHER = 'other',\n}\n","export class BaseError extends Error {\n public details?: Record<string, unknown>;\n public toErrorRecord(): { error: string; details?: unknown } {\n const obj: { error: string; details?: unknown } = { error: this.message };\n if (this.details) {\n obj.details = this.details;\n }\n return obj;\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class BusinessError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.BUSINESS_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, BusinessError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ForbiddenError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.FORBIDDEN_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class NotFoundError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.NOT_FOUND_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ServerError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.SERVER_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class UnauthorizedError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.UNAUTHORIZED_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -122,6 +122,38 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
|
122
122
|
return WeightUnit2;
|
|
123
123
|
})(WeightUnit || {});
|
|
124
124
|
|
|
125
|
+
// src/enums/treatment-status.ts
|
|
126
|
+
var TreatmentStatus = /* @__PURE__ */ ((TreatmentStatus2) => {
|
|
127
|
+
TreatmentStatus2["WAITING_START"] = "waiting_start";
|
|
128
|
+
TreatmentStatus2["PENDING"] = "pending";
|
|
129
|
+
TreatmentStatus2["IN_PROGRESS"] = "in_progress";
|
|
130
|
+
TreatmentStatus2["COMPLETED"] = "completed";
|
|
131
|
+
TreatmentStatus2["CANCELLED"] = "cancelled";
|
|
132
|
+
return TreatmentStatus2;
|
|
133
|
+
})(TreatmentStatus || {});
|
|
134
|
+
|
|
135
|
+
// src/enums/dose-status.ts
|
|
136
|
+
var DoseStatus = /* @__PURE__ */ ((DoseStatus2) => {
|
|
137
|
+
DoseStatus2["PENDING"] = "pending";
|
|
138
|
+
DoseStatus2["ADMINISTERED"] = "administered";
|
|
139
|
+
DoseStatus2["SKIPPED"] = "skipped";
|
|
140
|
+
DoseStatus2["SNOOZED"] = "snoozed";
|
|
141
|
+
return DoseStatus2;
|
|
142
|
+
})(DoseStatus || {});
|
|
143
|
+
|
|
144
|
+
// src/enums/treatment-type.ts
|
|
145
|
+
var TreatmentType = /* @__PURE__ */ ((TreatmentType2) => {
|
|
146
|
+
TreatmentType2["MEDICATION"] = "medication";
|
|
147
|
+
TreatmentType2["SURGERY"] = "surgery";
|
|
148
|
+
TreatmentType2["DIAGNOSIS"] = "diagnosis";
|
|
149
|
+
TreatmentType2["DESPARASITIZATION"] = "desparasitization";
|
|
150
|
+
TreatmentType2["VACCINATION"] = "vaccination";
|
|
151
|
+
TreatmentType2["EXAM"] = "exam";
|
|
152
|
+
TreatmentType2["DENTAL"] = "dental";
|
|
153
|
+
TreatmentType2["OTHER"] = "other";
|
|
154
|
+
return TreatmentType2;
|
|
155
|
+
})(TreatmentType || {});
|
|
156
|
+
|
|
125
157
|
// src/errors/BaseError.ts
|
|
126
158
|
var BaseError = class extends Error {
|
|
127
159
|
toErrorRecord() {
|
|
@@ -183,6 +215,6 @@ var UnauthorizedError = class _UnauthorizedError extends BaseError {
|
|
|
183
215
|
}
|
|
184
216
|
};
|
|
185
217
|
|
|
186
|
-
export { AuthMethod, BaseError, BusinessError, CatBreed, DogBreed, EmailProvider, Errors, ForbiddenError, Gender, HealthStatus, NotFoundError, OAuthProvider, PetStatus, ServerError, Species, UnauthorizedError, UserRole, WeightUnit };
|
|
218
|
+
export { AuthMethod, BaseError, BusinessError, CatBreed, DogBreed, DoseStatus, EmailProvider, Errors, ForbiddenError, Gender, HealthStatus, NotFoundError, OAuthProvider, PetStatus, ServerError, Species, TreatmentStatus, TreatmentType, UnauthorizedError, UserRole, WeightUnit };
|
|
187
219
|
//# sourceMappingURL=index.mjs.map
|
|
188
220
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/enums/errors.ts","../src/enums/health-status.ts","../src/enums/roles.ts","../src/enums/auth-method.ts","../src/enums/oauth-provider.ts","../src/enums/email-providers.ts","../src/enums/species.ts","../src/enums/dog-breed.ts","../src/enums/cat-breed.ts","../src/enums/gender.ts","../src/enums/pet-status.ts","../src/enums/weight-unit.ts","../src/errors/BaseError.ts","../src/errors/BusinessError.ts","../src/errors/ForbiddenError.ts","../src/errors/NotFoundError.ts","../src/errors/ServerError.ts","../src/errors/UnauthorizedError.ts"],"names":["Errors","HealthStatus","UserRole","AuthMethod","OAuthProvider","EmailProvider","Species","DogBreed","CatBreed","Gender","PetStatus","WeightUnit"],"mappings":";AAAO,IAAK,MAAA,qBAAAA,OAAAA,KAAL;AACL,EAAAA,QAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,QAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,QAAA,iBAAA,CAAA,GAAkB,gBAAA;AAClB,EAAAA,QAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,QAAA,oBAAA,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AAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,cAAA,CAAc,SAAS,CAAA;AAAA,EACrD;AACF;;;ACRO,IAAM,WAAA,GAAN,MAAM,YAAA,SAAoB,SAAA,CAAU;AAAA,EAElC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,aAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,YAAA,CAAY,SAAS,CAAA;AAAA,EACnD;AACF;;;ACRO,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,SAAA,CAAU;AAAA,EAExC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,mBAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,kBAAA,CAAkB,SAAS,CAAA;AAAA,EACzD;AACF","file":"index.mjs","sourcesContent":["export enum Errors {\n NOT_FOUND_ERROR = 'NotFoundError',\n BUSINESS_ERROR = 'BusinessError',\n FORBIDDEN_ERROR = 'ForbiddenError',\n SERVER_ERROR = 'ServerError',\n UNAUTHORIZED_ERROR = 'UnauthorizedError',\n BAD_REQUEST_ERROR = 'BadRequestError',\n UNPROCESSABLE_ENTITY_ERROR = 'UnprocessableEntityError',\n TOO_MANY_REQUESTS_ERROR = 'TooManyRequestsError',\n INTERNAL_SERVER_ERROR = 'InternalServerError',\n SERVICE_UNAVAILABLE_ERROR = 'ServiceUnavailableError',\n GATEWAY_TIMEOUT_ERROR = 'GatewayTimeoutError',\n BAD_GATEWAY_ERROR = 'BadGatewayError',\n PRECONDITION_FAILED_ERROR = 'PreconditionFailedError',\n PAYLOAD_TOO_LARGE_ERROR = 'PayloadTooLargeError',\n}\n","export enum HealthStatus {\n HEALTHY = 'healthy',\n UNHEALTHY = 'unhealthy',\n}\n","export enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n}\n","/**\n * How the user primarily authenticates. Switching methods is admin-only (future).\n */\nexport enum AuthMethod {\n PASSWORD = 'password',\n OAUTH = 'oauth',\n}\n","/**\n * OAuth identity provider (Auth0 connection / social). MVP: Google only; extend for Microsoft, GitHub, etc.\n */\nexport enum OAuthProvider {\n GOOGLE = 'google',\n}\n","export enum EmailProvider {\n RESEND = 'resend',\n}\n","/**\n * Enum of the animal species admitted.\n */\nexport enum Species {\n DOG = 'Dog',\n CAT = 'Cat',\n}\n","/**\n * Enum of the most common dog breeds.\n */\nexport enum DogBreed {\n LABRADOR_RETRIEVER = 'Labrador Retriever',\n GOLDEN_RETRIEVER = 'Golden Retriever',\n PASTOR_ALEMAN = 'Pastor Alemán',\n BULLDOG_FRANCES = 'Bulldog Francés',\n BULLDOG_INGLES = 'Bulldog Inglés',\n CANICHE = 'Caniche',\n BEAGLE = 'Beagle',\n ROTTWEILER = 'Rottweiler',\n CHIHUAHUA = 'Chihuahua',\n PUG = 'Pug',\n HUSKY_SIBERIANO = 'Husky Siberiano',\n BOXER = 'Bóxer',\n YORKSHIRE_TERRIER = 'Yorkshire Terrier',\n DALMATA = 'Dálmata',\n MESTIZO = 'Mestizo', // Option for common or mixed dogs\n}\n","/**\n * Enum of the most common cat breeds.\n */\nexport enum CatBreed {\n PERSA = 'Persa',\n MAINE_COON = 'Maine Coon',\n SIAMES = 'Siamés',\n RAGDOLL = 'Ragdoll',\n BENGALI = 'Bengalí',\n ESFINGE = 'Esfinge (Sphynx)',\n BRITISH_SHORTHAIR = 'Británico de pelo corto',\n ABISINIO = 'Abisinio',\n SCOTTISH_FOLD = 'Scottish Fold',\n AZUL_RUSO = 'Azul Ruso',\n ANGORA_TURCO = 'Angora Turco',\n BOSQUE_DE_NORUEGA = 'Bosque de Noruega',\n EUROPEO_COMUN = 'Europeo Común',\n MESTIZO = 'Mestizo', // Option for common or mixed cats\n}\n","/**\n * Enum of the animal gender.\n */\nexport enum Gender {\n MALE = 'Male',\n FEMALE = 'Female',\n}\n","export enum PetStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SOLD = 'sold',\n ADOPTED = 'adopted',\n LOST = 'lost',\n FOUND = 'found',\n DECEASED = 'deceased',\n}\n","export enum WeightUnit {\n KG = 'KG',\n LB = 'LB',\n}\n","export class BaseError extends Error {\n public details?: Record<string, unknown>;\n public toErrorRecord(): { error: string; details?: unknown } {\n const obj: { error: string; details?: unknown } = { error: this.message };\n if (this.details) {\n obj.details = this.details;\n }\n return obj;\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class BusinessError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.BUSINESS_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, BusinessError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ForbiddenError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.FORBIDDEN_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class NotFoundError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.NOT_FOUND_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ServerError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.SERVER_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class UnauthorizedError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.UNAUTHORIZED_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/enums/errors.ts","../src/enums/health-status.ts","../src/enums/roles.ts","../src/enums/auth-method.ts","../src/enums/oauth-provider.ts","../src/enums/email-providers.ts","../src/enums/species.ts","../src/enums/dog-breed.ts","../src/enums/cat-breed.ts","../src/enums/gender.ts","../src/enums/pet-status.ts","../src/enums/weight-unit.ts","../src/enums/treatment-status.ts","../src/enums/dose-status.ts","../src/enums/treatment-type.ts","../src/errors/BaseError.ts","../src/errors/BusinessError.ts","../src/errors/ForbiddenError.ts","../src/errors/NotFoundError.ts","../src/errors/ServerError.ts","../src/errors/UnauthorizedError.ts"],"names":["Errors","HealthStatus","UserRole","AuthMethod","OAuthProvider","EmailProvider","Species","DogBreed","CatBreed","Gender","PetStatus","WeightUnit","TreatmentStatus","DoseStatus","TreatmentType"],"mappings":";AAAO,IAAK,MAAA,qBAAAA,OAAAA,KAAL;AACL,EAAAA,QAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,QAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,QAAA,iBAAA,CAAA,GAAkB,gBAAA;AAClB,EAAAA,QAAA,cAAA,CAAA,GAAe,aAAA;AACf,EAAAA,QAAA,oBAAA,CAAA,GAAqB,mBAAA;AACrB,EAAAA,QAAA,mBAAA,CAAA,GAAoB,iBAAA;AACpB,EAAAA,QAAA,4BAAA,CAAA,GAA6B,0BAAA;AAC7B,EAAAA,QAAA,yBAAA,CAAA,GAA0B,sBAAA;AAC1B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AC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,YAAA,CAAY,SAAS,CAAA;AAAA,EACnD;AACF;;;ACRO,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,SAAA,CAAU;AAAA,EAExC,WAAA,CAAY,SAAiB,OAAA,EAAmC;AACrE,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAA,mBAAA;AACL,IAAA,IAAA,CAAK,OAAA,GAAU,WAAW,EAAC;AAC3B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,kBAAA,CAAkB,SAAS,CAAA;AAAA,EACzD;AACF","file":"index.mjs","sourcesContent":["export enum Errors {\n NOT_FOUND_ERROR = 'NotFoundError',\n BUSINESS_ERROR = 'BusinessError',\n FORBIDDEN_ERROR = 'ForbiddenError',\n SERVER_ERROR = 'ServerError',\n UNAUTHORIZED_ERROR = 'UnauthorizedError',\n BAD_REQUEST_ERROR = 'BadRequestError',\n UNPROCESSABLE_ENTITY_ERROR = 'UnprocessableEntityError',\n TOO_MANY_REQUESTS_ERROR = 'TooManyRequestsError',\n INTERNAL_SERVER_ERROR = 'InternalServerError',\n SERVICE_UNAVAILABLE_ERROR = 'ServiceUnavailableError',\n GATEWAY_TIMEOUT_ERROR = 'GatewayTimeoutError',\n BAD_GATEWAY_ERROR = 'BadGatewayError',\n PRECONDITION_FAILED_ERROR = 'PreconditionFailedError',\n PAYLOAD_TOO_LARGE_ERROR = 'PayloadTooLargeError',\n}\n","export enum HealthStatus {\n HEALTHY = 'healthy',\n UNHEALTHY = 'unhealthy',\n}\n","export enum UserRole {\n ADMIN = 'admin',\n USER = 'user',\n}\n","/**\n * How the user primarily authenticates. Switching methods is admin-only (future).\n */\nexport enum AuthMethod {\n PASSWORD = 'password',\n OAUTH = 'oauth',\n}\n","/**\n * OAuth identity provider (Auth0 connection / social). MVP: Google only; extend for Microsoft, GitHub, etc.\n */\nexport enum OAuthProvider {\n GOOGLE = 'google',\n}\n","export enum EmailProvider {\n RESEND = 'resend',\n}\n","/**\n * Enum of the animal species admitted.\n */\nexport enum Species {\n DOG = 'Dog',\n CAT = 'Cat',\n}\n","/**\n * Enum of the most common dog breeds.\n */\nexport enum DogBreed {\n LABRADOR_RETRIEVER = 'Labrador Retriever',\n GOLDEN_RETRIEVER = 'Golden Retriever',\n PASTOR_ALEMAN = 'Pastor Alemán',\n BULLDOG_FRANCES = 'Bulldog Francés',\n BULLDOG_INGLES = 'Bulldog Inglés',\n CANICHE = 'Caniche',\n BEAGLE = 'Beagle',\n ROTTWEILER = 'Rottweiler',\n CHIHUAHUA = 'Chihuahua',\n PUG = 'Pug',\n HUSKY_SIBERIANO = 'Husky Siberiano',\n BOXER = 'Bóxer',\n YORKSHIRE_TERRIER = 'Yorkshire Terrier',\n DALMATA = 'Dálmata',\n MESTIZO = 'Mestizo', // Option for common or mixed dogs\n}\n","/**\n * Enum of the most common cat breeds.\n */\nexport enum CatBreed {\n PERSA = 'Persa',\n MAINE_COON = 'Maine Coon',\n SIAMES = 'Siamés',\n RAGDOLL = 'Ragdoll',\n BENGALI = 'Bengalí',\n ESFINGE = 'Esfinge (Sphynx)',\n BRITISH_SHORTHAIR = 'Británico de pelo corto',\n ABISINIO = 'Abisinio',\n SCOTTISH_FOLD = 'Scottish Fold',\n AZUL_RUSO = 'Azul Ruso',\n ANGORA_TURCO = 'Angora Turco',\n BOSQUE_DE_NORUEGA = 'Bosque de Noruega',\n EUROPEO_COMUN = 'Europeo Común',\n MESTIZO = 'Mestizo', // Option for common or mixed cats\n}\n","/**\n * Enum of the animal gender.\n */\nexport enum Gender {\n MALE = 'Male',\n FEMALE = 'Female',\n}\n","export enum PetStatus {\n ACTIVE = 'active',\n INACTIVE = 'inactive',\n SOLD = 'sold',\n ADOPTED = 'adopted',\n LOST = 'lost',\n FOUND = 'found',\n DECEASED = 'deceased',\n}\n","export enum WeightUnit {\n KG = 'KG',\n LB = 'LB',\n}\n","export enum TreatmentStatus {\n WAITING_START = 'waiting_start',\n PENDING = 'pending',\n IN_PROGRESS = 'in_progress',\n COMPLETED = 'completed',\n CANCELLED = 'cancelled',\n}\n","export enum DoseStatus {\n PENDING = 'pending',\n ADMINISTERED = 'administered',\n SKIPPED = 'skipped',\n SNOOZED = 'snoozed',\n}\n","export enum TreatmentType {\n MEDICATION = 'medication',\n SURGERY = 'surgery',\n DIAGNOSIS = 'diagnosis',\n DESPARASITIZATION = 'desparasitization',\n VACCINATION = 'vaccination',\n EXAM = 'exam',\n DENTAL = 'dental',\n OTHER = 'other',\n}\n","export class BaseError extends Error {\n public details?: Record<string, unknown>;\n public toErrorRecord(): { error: string; details?: unknown } {\n const obj: { error: string; details?: unknown } = { error: this.message };\n if (this.details) {\n obj.details = this.details;\n }\n return obj;\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class BusinessError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.BUSINESS_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, BusinessError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ForbiddenError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.FORBIDDEN_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class NotFoundError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.NOT_FOUND_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class ServerError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.SERVER_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n","import { BaseError } from '@/errors/BaseError';\nimport { Errors } from '@/enums/errors';\n\nexport class UnauthorizedError extends BaseError {\n public details?: Record<string, unknown>;\n public constructor(message: string, details?: Record<string, unknown>) {\n super(message);\n this.name = Errors.UNAUTHORIZED_ERROR;\n this.details = details || {};\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n"]}
|