tiryaq-shared 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # @tiryaq/shared
2
+
3
+ [![npm version](https://badge.fury.io/js/%40tiryaq%2Fshared.svg)](https://badge.fury.io/js/%40tiryaq%2Fshared)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ Shared TypeScript types, interfaces, and message patterns for Tiryaq healthcare microservices platform.
7
+
8
+ ## 🚀 Installation
9
+
10
+ ```bash
11
+ npm install @tiryaq/shared
12
+ ```
13
+
14
+ ## 📖 Usage
15
+
16
+ ### Import Types and Interfaces
17
+
18
+ ```typescript
19
+ import {
20
+ User,
21
+ Pharmacy,
22
+ Appointment,
23
+ ApiResponse
24
+ } from '@tiryaq/shared';
25
+
26
+ const user: User = {
27
+ id: '123',
28
+ email: 'patient@example.com',
29
+ firstName: 'John',
30
+ lastName: 'Doe',
31
+ // ... other properties
32
+ };
33
+ ```
34
+
35
+ ### Import Kafka Message Patterns
36
+
37
+ ```typescript
38
+ import { AUTH_PATTERNS, PHARMACY_PATTERNS } from '@tiryaq/shared';
39
+
40
+ // In your NestJS microservice
41
+ @MessagePattern(AUTH_PATTERNS.USER_REGISTER)
42
+ async handleUserRegister(@Payload() data: RegisterUserDto) {
43
+ // Handle user registration
44
+ }
45
+ ```
46
+
47
+ ### Import Event Types
48
+
49
+ ```typescript
50
+ import {
51
+ UserRegisteredEvent,
52
+ OrderCreatedEvent,
53
+ EVENT_PATTERNS
54
+ } from '@tiryaq/shared';
55
+
56
+ // Emit events
57
+ const event: UserRegisteredEvent = {
58
+ userId: user.id,
59
+ email: user.email,
60
+ firstName: user.firstName,
61
+ lastName: user.lastName,
62
+ timestamp: new Date()
63
+ };
64
+ ```
65
+
66
+ ## 📋 Available Exports
67
+
68
+ ### Core Entities
69
+ - `User`, `UserAddress`
70
+ - `Pharmacy`, `Medicine`, `PharmacyOrder`
71
+ - `Doctor`, `Appointment`, `Prescription`
72
+ - `Lab`, `LabTest`, `LabReport`
73
+ - `Wallet`, `Transaction`, `PaymentCard`
74
+
75
+ ### DTOs
76
+ - `RegisterUserDto`, `LoginDto`
77
+ - `CreateAddressDto`
78
+ - `SearchQuery`, `SearchFilters`
79
+
80
+ ### Message Patterns
81
+ - `AUTH_PATTERNS` - Authentication service patterns
82
+ - `PHARMACY_PATTERNS` - Pharmacy service patterns
83
+ - `CONSULTATION_PATTERNS` - Consultation service patterns
84
+ - `PAYMENT_PATTERNS` - Payment service patterns
85
+ - `NOTIFICATION_PATTERNS` - Notification service patterns
86
+
87
+ ### Event Types
88
+ - `UserRegisteredEvent`
89
+ - `OrderCreatedEvent`
90
+ - `AppointmentBookedEvent`
91
+ - `PaymentProcessedEvent`
92
+
93
+ ### Utilities
94
+ - `ApiResponse<T>` - Standard API response wrapper
95
+ - `PaginatedResponse<T>` - Paginated response wrapper
96
+ - `KAFKA_CONFIG` - Default Kafka configuration
97
+ - `SERVICE_PORTS` - Service port mappings
98
+
99
+ ## 🏗️ Architecture
100
+
101
+ This package is designed for event-driven microservices architecture using:
102
+
103
+ - **NestJS** - Node.js framework
104
+ - **Kafka** - Event streaming platform
105
+ - **TypeScript** - Type safety
106
+ - **TypeORM** - Database ORM
107
+
108
+ ## 🔄 Versioning
109
+
110
+ We follow [Semantic Versioning](https://semver.org/):
111
+
112
+ - `MAJOR.MINOR.PATCH`
113
+ - Breaking changes increment MAJOR
114
+ - New features increment MINOR
115
+ - Bug fixes increment PATCH
116
+
117
+ ## 📄 License
118
+
119
+ This project is licensed under the MIT License.
120
+
121
+ ## 🆘 Support
122
+
123
+ - 📧 Email: team@tiryaq.com
124
+ - 🐛 Issues: [GitHub Issues](https://github.com/tiryaq/shared/issues)
125
+ - 📖 Docs: [Documentation](https://docs.tiryaq.com)
@@ -0,0 +1,5 @@
1
+ export * from './interfaces';
2
+ export * from './message-patterns';
3
+ export { User, UserAddress, RegisterUserDto, LoginDto, UserSettings, SearchQuery, SearchFilters, SortOptions, Pharmacy, Medicine, PharmacyOrder, OrderItem, OpeningHours, Location, Doctor, TimeSlot, Appointment, Prescription, TeleMedicineSession, ChatMessage, LabTest, Lab, LabAppointment, LabReport, Wallet, PaymentCard, Transaction, Notification, NotificationSettings, ApiResponse, PaginatedResponse } from './interfaces';
4
+ export { AUTH_PATTERNS, SETTINGS_PATTERNS, SEARCH_PATTERNS, PHARMACY_PATTERNS, CONSULTATION_PATTERNS, TELEMEDICINE_PATTERNS, LAB_PATTERNS, PAYMENT_PATTERNS, NOTIFICATION_PATTERNS, EVENT_PATTERNS, UserRegisteredEvent, OrderCreatedEvent, AppointmentBookedEvent, PaymentProcessedEvent, NotificationEvent, KAFKA_CONFIG, SERVICE_PORTS } from './message-patterns';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAEL,IAAI,EACJ,WAAW,EACX,eAAe,EACf,QAAQ,EAGR,YAAY,EAGZ,WAAW,EACX,aAAa,EACb,WAAW,EAGX,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EAGR,MAAM,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EAGZ,mBAAmB,EACnB,WAAW,EAGX,OAAO,EACP,GAAG,EACH,cAAc,EACd,SAAS,EAGT,MAAM,EACN,WAAW,EACX,WAAW,EAGX,YAAY,EACZ,oBAAoB,EAGpB,WAAW,EACX,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAEL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EAGd,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EAGjB,YAAY,EACZ,aAAa,EACd,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.SERVICE_PORTS = exports.KAFKA_CONFIG = exports.EVENT_PATTERNS = exports.NOTIFICATION_PATTERNS = exports.PAYMENT_PATTERNS = exports.LAB_PATTERNS = exports.TELEMEDICINE_PATTERNS = exports.CONSULTATION_PATTERNS = exports.PHARMACY_PATTERNS = exports.SEARCH_PATTERNS = exports.SETTINGS_PATTERNS = exports.AUTH_PATTERNS = void 0;
18
+ // Export all interfaces and types
19
+ __exportStar(require("./interfaces"), exports);
20
+ __exportStar(require("./message-patterns"), exports);
21
+ var message_patterns_1 = require("./message-patterns");
22
+ // Message patterns
23
+ Object.defineProperty(exports, "AUTH_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.AUTH_PATTERNS; } });
24
+ Object.defineProperty(exports, "SETTINGS_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.SETTINGS_PATTERNS; } });
25
+ Object.defineProperty(exports, "SEARCH_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.SEARCH_PATTERNS; } });
26
+ Object.defineProperty(exports, "PHARMACY_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.PHARMACY_PATTERNS; } });
27
+ Object.defineProperty(exports, "CONSULTATION_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.CONSULTATION_PATTERNS; } });
28
+ Object.defineProperty(exports, "TELEMEDICINE_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.TELEMEDICINE_PATTERNS; } });
29
+ Object.defineProperty(exports, "LAB_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.LAB_PATTERNS; } });
30
+ Object.defineProperty(exports, "PAYMENT_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.PAYMENT_PATTERNS; } });
31
+ Object.defineProperty(exports, "NOTIFICATION_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.NOTIFICATION_PATTERNS; } });
32
+ Object.defineProperty(exports, "EVENT_PATTERNS", { enumerable: true, get: function () { return message_patterns_1.EVENT_PATTERNS; } });
33
+ // Configuration
34
+ Object.defineProperty(exports, "KAFKA_CONFIG", { enumerable: true, get: function () { return message_patterns_1.KAFKA_CONFIG; } });
35
+ Object.defineProperty(exports, "SERVICE_PORTS", { enumerable: true, get: function () { return message_patterns_1.SERVICE_PORTS; } });
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAkC;AAClC,+CAA6B;AAC7B,qDAAmC;AAwDnC,uDAuB4B;AAtB1B,mBAAmB;AACnB,iHAAA,aAAa,OAAA;AACb,qHAAA,iBAAiB,OAAA;AACjB,mHAAA,eAAe,OAAA;AACf,qHAAA,iBAAiB,OAAA;AACjB,yHAAA,qBAAqB,OAAA;AACrB,yHAAA,qBAAqB,OAAA;AACrB,gHAAA,YAAY,OAAA;AACZ,oHAAA,gBAAgB,OAAA;AAChB,yHAAA,qBAAqB,OAAA;AACrB,kHAAA,cAAc,OAAA;AASd,gBAAgB;AAChB,gHAAA,YAAY,OAAA;AACZ,iHAAA,aAAa,OAAA"}
@@ -0,0 +1,275 @@
1
+ export interface User {
2
+ id: string;
3
+ email: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ phone: string;
7
+ dateOfBirth?: Date;
8
+ gender?: 'male' | 'female' | 'other';
9
+ loyaltyPoints: number;
10
+ addresses: UserAddress[];
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ }
14
+ export interface UserAddress {
15
+ id: string;
16
+ label: string;
17
+ addressLine1: string;
18
+ addressLine2?: string;
19
+ city: string;
20
+ state: string;
21
+ zipCode: string;
22
+ country: string;
23
+ isDefault: boolean;
24
+ }
25
+ export interface RegisterUserDto {
26
+ email: string;
27
+ password: string;
28
+ firstName: string;
29
+ lastName: string;
30
+ phone: string;
31
+ dateOfBirth?: Date;
32
+ gender?: 'male' | 'female' | 'other';
33
+ }
34
+ export interface LoginDto {
35
+ email: string;
36
+ password: string;
37
+ }
38
+ export interface UserSettings {
39
+ userId: string;
40
+ language: string;
41
+ theme: 'light' | 'dark';
42
+ notifications: {
43
+ push: boolean;
44
+ email: boolean;
45
+ sms: boolean;
46
+ };
47
+ privacy: {
48
+ profileVisibility: 'public' | 'private';
49
+ dataSharing: boolean;
50
+ };
51
+ }
52
+ export interface SearchQuery {
53
+ query: string;
54
+ type?: 'pharmacy' | 'doctor' | 'medicine' | 'lab';
55
+ filters?: SearchFilters;
56
+ sort?: SortOptions;
57
+ page?: number;
58
+ limit?: number;
59
+ }
60
+ export interface SearchFilters {
61
+ location?: string;
62
+ priceRange?: {
63
+ min: number;
64
+ max: number;
65
+ };
66
+ rating?: number;
67
+ availability?: boolean;
68
+ specialty?: string;
69
+ }
70
+ export interface SortOptions {
71
+ field: 'name' | 'price' | 'rating' | 'distance';
72
+ order: 'asc' | 'desc';
73
+ }
74
+ export interface Pharmacy {
75
+ id: string;
76
+ name: string;
77
+ address: string;
78
+ phone: string;
79
+ email: string;
80
+ rating: number;
81
+ isOpen: boolean;
82
+ openingHours: OpeningHours[];
83
+ location: Location;
84
+ }
85
+ export interface OpeningHours {
86
+ day: string;
87
+ openTime: string;
88
+ closeTime: string;
89
+ }
90
+ export interface Location {
91
+ latitude: number;
92
+ longitude: number;
93
+ }
94
+ export interface Medicine {
95
+ id: string;
96
+ name: string;
97
+ genericName: string;
98
+ manufacturer: string;
99
+ price: number;
100
+ description: string;
101
+ prescriptionRequired: boolean;
102
+ availability: boolean;
103
+ pharmacyId: string;
104
+ }
105
+ export interface PharmacyOrder {
106
+ id: string;
107
+ userId: string;
108
+ pharmacyId: string;
109
+ items: OrderItem[];
110
+ prescription?: string;
111
+ totalAmount: number;
112
+ status: 'pending' | 'confirmed' | 'preparing' | 'ready' | 'delivered' | 'cancelled';
113
+ deliveryAddress: UserAddress;
114
+ createdAt: Date;
115
+ updatedAt: Date;
116
+ }
117
+ export interface OrderItem {
118
+ medicineId: string;
119
+ quantity: number;
120
+ price: number;
121
+ }
122
+ export interface Doctor {
123
+ id: string;
124
+ firstName: string;
125
+ lastName: string;
126
+ specialty: string;
127
+ qualifications: string[];
128
+ experience: number;
129
+ rating: number;
130
+ consultationFee: number;
131
+ availableSlots: TimeSlot[];
132
+ profileImage?: string;
133
+ }
134
+ export interface TimeSlot {
135
+ date: Date;
136
+ startTime: string;
137
+ endTime: string;
138
+ isAvailable: boolean;
139
+ }
140
+ export interface Appointment {
141
+ id: string;
142
+ userId: string;
143
+ doctorId: string;
144
+ date: Date;
145
+ startTime: string;
146
+ endTime: string;
147
+ type: 'video' | 'chat' | 'phone';
148
+ status: 'scheduled' | 'ongoing' | 'completed' | 'cancelled';
149
+ notes?: string;
150
+ prescription?: Prescription[];
151
+ attachments?: string[];
152
+ amount: number;
153
+ createdAt: Date;
154
+ }
155
+ export interface Prescription {
156
+ medicine: string;
157
+ dosage: string;
158
+ frequency: string;
159
+ duration: string;
160
+ instructions: string;
161
+ }
162
+ export interface TeleMedicineSession {
163
+ id: string;
164
+ appointmentId: string;
165
+ sessionToken: string;
166
+ roomId: string;
167
+ status: 'waiting' | 'ongoing' | 'ended';
168
+ startTime?: Date;
169
+ endTime?: Date;
170
+ recordings?: string[];
171
+ }
172
+ export interface ChatMessage {
173
+ id: string;
174
+ sessionId: string;
175
+ senderId: string;
176
+ message: string;
177
+ timestamp: Date;
178
+ attachments?: string[];
179
+ }
180
+ export interface LabTest {
181
+ id: string;
182
+ name: string;
183
+ description: string;
184
+ price: number;
185
+ preparationInstructions: string;
186
+ reportDeliveryTime: string;
187
+ }
188
+ export interface Lab {
189
+ id: string;
190
+ name: string;
191
+ address: string;
192
+ phone: string;
193
+ email: string;
194
+ rating: number;
195
+ availableTests: LabTest[];
196
+ location: Location;
197
+ }
198
+ export interface LabAppointment {
199
+ id: string;
200
+ userId: string;
201
+ labId: string;
202
+ tests: LabTest[];
203
+ date: Date;
204
+ timeSlot: string;
205
+ status: 'scheduled' | 'completed' | 'cancelled';
206
+ totalAmount: number;
207
+ createdAt: Date;
208
+ }
209
+ export interface LabReport {
210
+ id: string;
211
+ appointmentId: string;
212
+ reportUrl: string;
213
+ uploadedAt: Date;
214
+ doctorNotes?: string;
215
+ }
216
+ export interface Wallet {
217
+ userId: string;
218
+ balance: number;
219
+ linkedCards: PaymentCard[];
220
+ transactions: Transaction[];
221
+ }
222
+ export interface PaymentCard {
223
+ id: string;
224
+ cardType: 'credit' | 'debit';
225
+ lastFourDigits: string;
226
+ expiryMonth: number;
227
+ expiryYear: number;
228
+ isDefault: boolean;
229
+ }
230
+ export interface Transaction {
231
+ id: string;
232
+ userId: string;
233
+ type: 'credit' | 'debit';
234
+ amount: number;
235
+ description: string;
236
+ status: 'pending' | 'completed' | 'failed';
237
+ paymentMethod: 'wallet' | 'card' | 'upi';
238
+ relatedService: 'pharmacy' | 'consultation' | 'lab';
239
+ relatedOrderId?: string;
240
+ createdAt: Date;
241
+ }
242
+ export interface Notification {
243
+ id: string;
244
+ userId: string;
245
+ title: string;
246
+ message: string;
247
+ type: 'appointment' | 'order' | 'prescription' | 'general';
248
+ priority: 'low' | 'medium' | 'high';
249
+ isRead: boolean;
250
+ scheduledFor?: Date;
251
+ createdAt: Date;
252
+ }
253
+ export interface NotificationSettings {
254
+ userId: string;
255
+ pushEnabled: boolean;
256
+ emailEnabled: boolean;
257
+ smsEnabled: boolean;
258
+ appointmentReminders: boolean;
259
+ orderUpdates: boolean;
260
+ prescriptionAlerts: boolean;
261
+ }
262
+ export interface ApiResponse<T> {
263
+ success: boolean;
264
+ data?: T;
265
+ message: string;
266
+ statusCode: number;
267
+ }
268
+ export interface PaginatedResponse<T> {
269
+ data: T[];
270
+ total: number;
271
+ page: number;
272
+ limit: number;
273
+ totalPages: number;
274
+ }
275
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,E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ports, "__esModule", { value: true });
4
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA,0CAA0C"}
@@ -0,0 +1,173 @@
1
+ export declare const AUTH_PATTERNS: {
2
+ readonly USER_REGISTER: "user.register";
3
+ readonly USER_LOGIN: "user.login";
4
+ readonly USER_LOGOUT: "user.logout";
5
+ readonly USER_PROFILE_UPDATE: "user.profile.update";
6
+ readonly USER_ADDRESS_ADD: "user.address.add";
7
+ readonly USER_ADDRESS_UPDATE: "user.address.update";
8
+ readonly USER_ADDRESS_DELETE: "user.address.delete";
9
+ readonly USER_LOYALTY_POINTS_UPDATE: "user.loyalty.points.update";
10
+ readonly GET_USER_PROFILE: "user.profile.get";
11
+ readonly GET_USER_ADDRESSES: "user.addresses.get";
12
+ readonly VALIDATE_TOKEN: "auth.token.validate";
13
+ };
14
+ export declare const SETTINGS_PATTERNS: {
15
+ readonly GET_USER_SETTINGS: "settings.user.get";
16
+ readonly UPDATE_USER_SETTINGS: "settings.user.update";
17
+ readonly UPDATE_NOTIFICATION_SETTINGS: "settings.notifications.update";
18
+ readonly UPDATE_PRIVACY_SETTINGS: "settings.privacy.update";
19
+ readonly GET_NOTIFICATION_SETTINGS: "settings.notifications.get";
20
+ };
21
+ export declare const SEARCH_PATTERNS: {
22
+ readonly GLOBAL_SEARCH: "search.global";
23
+ readonly SEARCH_PHARMACIES: "search.pharmacies";
24
+ readonly SEARCH_DOCTORS: "search.doctors";
25
+ readonly SEARCH_MEDICINES: "search.medicines";
26
+ readonly SEARCH_LABS: "search.labs";
27
+ readonly GET_SEARCH_SUGGESTIONS: "search.suggestions.get";
28
+ };
29
+ export declare const PHARMACY_PATTERNS: {
30
+ readonly GET_PHARMACIES: "pharmacy.get.all";
31
+ readonly GET_PHARMACY_BY_ID: "pharmacy.get.by.id";
32
+ readonly GET_PHARMACY_MEDICINES: "pharmacy.medicines.get";
33
+ readonly SEARCH_MEDICINES: "pharmacy.medicines.search";
34
+ readonly CREATE_ORDER: "pharmacy.order.create";
35
+ readonly UPDATE_ORDER_STATUS: "pharmacy.order.status.update";
36
+ readonly GET_ORDER_HISTORY: "pharmacy.order.history.get";
37
+ readonly GET_ORDER_BY_ID: "pharmacy.order.get.by.id";
38
+ readonly UPLOAD_PRESCRIPTION: "pharmacy.prescription.upload";
39
+ readonly CANCEL_ORDER: "pharmacy.order.cancel";
40
+ };
41
+ export declare const CONSULTATION_PATTERNS: {
42
+ readonly GET_DOCTORS: "consultation.doctors.get";
43
+ readonly GET_DOCTOR_BY_ID: "consultation.doctor.get.by.id";
44
+ readonly GET_DOCTOR_SLOTS: "consultation.doctor.slots.get";
45
+ readonly BOOK_APPOINTMENT: "consultation.appointment.book";
46
+ readonly GET_APPOINTMENTS: "consultation.appointments.get";
47
+ readonly GET_APPOINTMENT_BY_ID: "consultation.appointment.get.by.id";
48
+ readonly CANCEL_APPOINTMENT: "consultation.appointment.cancel";
49
+ readonly UPDATE_APPOINTMENT_STATUS: "consultation.appointment.status.update";
50
+ readonly GET_UPCOMING_APPOINTMENTS: "consultation.appointments.upcoming.get";
51
+ };
52
+ export declare const TELEMEDICINE_PATTERNS: {
53
+ readonly CREATE_SESSION: "telemedicine.session.create";
54
+ readonly JOIN_SESSION: "telemedicine.session.join";
55
+ readonly END_SESSION: "telemedicine.session.end";
56
+ readonly SEND_CHAT_MESSAGE: "telemedicine.chat.message.send";
57
+ readonly GET_CHAT_HISTORY: "telemedicine.chat.history.get";
58
+ readonly UPLOAD_DOCUMENT: "telemedicine.document.upload";
59
+ readonly UPDATE_PRESCRIPTION: "telemedicine.prescription.update";
60
+ readonly GET_SESSION_RECORDINGS: "telemedicine.session.recordings.get";
61
+ };
62
+ export declare const LAB_PATTERNS: {
63
+ readonly GET_LABS: "lab.get.all";
64
+ readonly GET_LAB_BY_ID: "lab.get.by.id";
65
+ readonly GET_LAB_TESTS: "lab.tests.get";
66
+ readonly BOOK_LAB_APPOINTMENT: "lab.appointment.book";
67
+ readonly GET_LAB_APPOINTMENTS: "lab.appointments.get";
68
+ readonly CANCEL_LAB_APPOINTMENT: "lab.appointment.cancel";
69
+ readonly UPLOAD_LAB_REPORT: "lab.report.upload";
70
+ readonly GET_LAB_REPORTS: "lab.reports.get";
71
+ readonly GET_LAB_REPORT_BY_ID: "lab.report.get.by.id";
72
+ };
73
+ export declare const PAYMENT_PATTERNS: {
74
+ readonly GET_WALLET: "payment.wallet.get";
75
+ readonly ADD_MONEY_TO_WALLET: "payment.wallet.add.money";
76
+ readonly LINK_PAYMENT_CARD: "payment.card.link";
77
+ readonly REMOVE_PAYMENT_CARD: "payment.card.remove";
78
+ readonly PROCESS_PAYMENT: "payment.process";
79
+ readonly GET_TRANSACTION_HISTORY: "payment.transactions.get";
80
+ readonly GET_TRANSACTION_BY_ID: "payment.transaction.get.by.id";
81
+ readonly REFUND_PAYMENT: "payment.refund";
82
+ readonly UPDATE_TRANSACTION_STATUS: "payment.transaction.status.update";
83
+ };
84
+ export declare const NOTIFICATION_PATTERNS: {
85
+ readonly SEND_NOTIFICATION: "notification.send";
86
+ readonly SEND_PUSH_NOTIFICATION: "notification.push.send";
87
+ readonly SEND_EMAIL_NOTIFICATION: "notification.email.send";
88
+ readonly SEND_SMS_NOTIFICATION: "notification.sms.send";
89
+ readonly GET_USER_NOTIFICATIONS: "notification.user.get";
90
+ readonly MARK_NOTIFICATION_READ: "notification.mark.read";
91
+ readonly SCHEDULE_NOTIFICATION: "notification.schedule";
92
+ readonly GET_NOTIFICATION_SETTINGS: "notification.settings.get";
93
+ readonly UPDATE_NOTIFICATION_SETTINGS: "notification.settings.update";
94
+ };
95
+ export declare const EVENT_PATTERNS: {
96
+ readonly USER_REGISTERED: "event.user.registered";
97
+ readonly USER_UPDATED: "event.user.updated";
98
+ readonly USER_LOYALTY_POINTS_EARNED: "event.user.loyalty.points.earned";
99
+ readonly ORDER_CREATED: "event.order.created";
100
+ readonly ORDER_CONFIRMED: "event.order.confirmed";
101
+ readonly ORDER_CANCELLED: "event.order.cancelled";
102
+ readonly ORDER_DELIVERED: "event.order.delivered";
103
+ readonly APPOINTMENT_BOOKED: "event.appointment.booked";
104
+ readonly APPOINTMENT_CANCELLED: "event.appointment.cancelled";
105
+ readonly APPOINTMENT_COMPLETED: "event.appointment.completed";
106
+ readonly APPOINTMENT_REMINDER: "event.appointment.reminder";
107
+ readonly PAYMENT_PROCESSED: "event.payment.processed";
108
+ readonly PAYMENT_FAILED: "event.payment.failed";
109
+ readonly REFUND_PROCESSED: "event.refund.processed";
110
+ readonly LAB_APPOINTMENT_BOOKED: "event.lab.appointment.booked";
111
+ readonly LAB_REPORT_UPLOADED: "event.lab.report.uploaded";
112
+ readonly PRESCRIPTION_UPLOADED: "event.prescription.uploaded";
113
+ readonly PRESCRIPTION_READY: "event.prescription.ready";
114
+ };
115
+ export interface UserRegisteredEvent {
116
+ userId: string;
117
+ email: string;
118
+ firstName: string;
119
+ lastName: string;
120
+ timestamp: Date;
121
+ }
122
+ export interface OrderCreatedEvent {
123
+ orderId: string;
124
+ userId: string;
125
+ pharmacyId: string;
126
+ totalAmount: number;
127
+ timestamp: Date;
128
+ }
129
+ export interface AppointmentBookedEvent {
130
+ appointmentId: string;
131
+ userId: string;
132
+ doctorId: string;
133
+ date: Date;
134
+ startTime: string;
135
+ type: 'video' | 'chat' | 'phone';
136
+ timestamp: Date;
137
+ }
138
+ export interface PaymentProcessedEvent {
139
+ transactionId: string;
140
+ userId: string;
141
+ amount: number;
142
+ paymentMethod: string;
143
+ relatedService: string;
144
+ relatedOrderId?: string;
145
+ timestamp: Date;
146
+ }
147
+ export interface NotificationEvent {
148
+ userId: string;
149
+ title: string;
150
+ message: string;
151
+ type: 'appointment' | 'order' | 'prescription' | 'general';
152
+ priority: 'low' | 'medium' | 'high';
153
+ scheduledFor?: Date;
154
+ timestamp: Date;
155
+ }
156
+ export declare const KAFKA_CONFIG: {
157
+ readonly clientId: "tiryaq-microservices";
158
+ readonly brokers: readonly ["localhost:9092"];
159
+ readonly groupId: "tiryaq-consumer-group";
160
+ };
161
+ export declare const SERVICE_PORTS: {
162
+ readonly API_GATEWAY: 3000;
163
+ readonly AUTH_SERVICE: 3001;
164
+ readonly SETTINGS_SERVICE: 3002;
165
+ readonly SEARCH_SERVICE: 3003;
166
+ readonly PHARMACY_SERVICE: 3004;
167
+ readonly CONSULTATION_SERVICE: 3005;
168
+ readonly TELEMEDICINE_SERVICE: 3006;
169
+ readonly LAB_SERVICE: 3007;
170
+ readonly PAYMENT_SERVICE: 3008;
171
+ readonly NOTIFICATION_SERVICE: 3009;
172
+ };
173
+ //# sourceMappingURL=message-patterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-patterns.d.ts","sourceRoot":"","sources":["../src/message-patterns.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;;;;;;;;;;;CAYhB,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;;;;;;;CAWpB,CAAC;AAGX,eAAO,MAAM,qBAAqB;;;;;;;;;;CAUxB,CAAC;AAGX,eAAO,MAAM,qBAAqB;;;;;;;;;CASxB,CAAC;AAGX,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,CAAC;AAGX,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUnB,CAAC;AAGX,eAAO,MAAM,qBAAqB;;;;;;;;;;CAUxB,CAAC;AAGX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;CA8BjB,CAAC;AAGX,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,GAAG,OAAO,GAAG,cAAc,GAAG,SAAS,CAAC;IAC3D,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACpC,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;CACjB;AAGD,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;;;;;;CAWhB,CAAC"}
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ // Kafka message patterns for event-driven architecture
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SERVICE_PORTS = exports.KAFKA_CONFIG = exports.EVENT_PATTERNS = exports.NOTIFICATION_PATTERNS = exports.PAYMENT_PATTERNS = exports.LAB_PATTERNS = exports.TELEMEDICINE_PATTERNS = exports.CONSULTATION_PATTERNS = exports.PHARMACY_PATTERNS = exports.SEARCH_PATTERNS = exports.SETTINGS_PATTERNS = exports.AUTH_PATTERNS = void 0;
5
+ // Auth Service Message Patterns
6
+ exports.AUTH_PATTERNS = {
7
+ USER_REGISTER: 'user.register',
8
+ USER_LOGIN: 'user.login',
9
+ USER_LOGOUT: 'user.logout',
10
+ USER_PROFILE_UPDATE: 'user.profile.update',
11
+ USER_ADDRESS_ADD: 'user.address.add',
12
+ USER_ADDRESS_UPDATE: 'user.address.update',
13
+ USER_ADDRESS_DELETE: 'user.address.delete',
14
+ USER_LOYALTY_POINTS_UPDATE: 'user.loyalty.points.update',
15
+ GET_USER_PROFILE: 'user.profile.get',
16
+ GET_USER_ADDRESSES: 'user.addresses.get',
17
+ VALIDATE_TOKEN: 'auth.token.validate',
18
+ };
19
+ // Settings Service Message Patterns
20
+ exports.SETTINGS_PATTERNS = {
21
+ GET_USER_SETTINGS: 'settings.user.get',
22
+ UPDATE_USER_SETTINGS: 'settings.user.update',
23
+ UPDATE_NOTIFICATION_SETTINGS: 'settings.notifications.update',
24
+ UPDATE_PRIVACY_SETTINGS: 'settings.privacy.update',
25
+ GET_NOTIFICATION_SETTINGS: 'settings.notifications.get',
26
+ };
27
+ // Search Service Message Patterns
28
+ exports.SEARCH_PATTERNS = {
29
+ GLOBAL_SEARCH: 'search.global',
30
+ SEARCH_PHARMACIES: 'search.pharmacies',
31
+ SEARCH_DOCTORS: 'search.doctors',
32
+ SEARCH_MEDICINES: 'search.medicines',
33
+ SEARCH_LABS: 'search.labs',
34
+ GET_SEARCH_SUGGESTIONS: 'search.suggestions.get',
35
+ };
36
+ // Pharmacy Service Message Patterns
37
+ exports.PHARMACY_PATTERNS = {
38
+ GET_PHARMACIES: 'pharmacy.get.all',
39
+ GET_PHARMACY_BY_ID: 'pharmacy.get.by.id',
40
+ GET_PHARMACY_MEDICINES: 'pharmacy.medicines.get',
41
+ SEARCH_MEDICINES: 'pharmacy.medicines.search',
42
+ CREATE_ORDER: 'pharmacy.order.create',
43
+ UPDATE_ORDER_STATUS: 'pharmacy.order.status.update',
44
+ GET_ORDER_HISTORY: 'pharmacy.order.history.get',
45
+ GET_ORDER_BY_ID: 'pharmacy.order.get.by.id',
46
+ UPLOAD_PRESCRIPTION: 'pharmacy.prescription.upload',
47
+ CANCEL_ORDER: 'pharmacy.order.cancel',
48
+ };
49
+ // Consultation Service Message Patterns
50
+ exports.CONSULTATION_PATTERNS = {
51
+ GET_DOCTORS: 'consultation.doctors.get',
52
+ GET_DOCTOR_BY_ID: 'consultation.doctor.get.by.id',
53
+ GET_DOCTOR_SLOTS: 'consultation.doctor.slots.get',
54
+ BOOK_APPOINTMENT: 'consultation.appointment.book',
55
+ GET_APPOINTMENTS: 'consultation.appointments.get',
56
+ GET_APPOINTMENT_BY_ID: 'consultation.appointment.get.by.id',
57
+ CANCEL_APPOINTMENT: 'consultation.appointment.cancel',
58
+ UPDATE_APPOINTMENT_STATUS: 'consultation.appointment.status.update',
59
+ GET_UPCOMING_APPOINTMENTS: 'consultation.appointments.upcoming.get',
60
+ };
61
+ // Telemedicine Service Message Patterns
62
+ exports.TELEMEDICINE_PATTERNS = {
63
+ CREATE_SESSION: 'telemedicine.session.create',
64
+ JOIN_SESSION: 'telemedicine.session.join',
65
+ END_SESSION: 'telemedicine.session.end',
66
+ SEND_CHAT_MESSAGE: 'telemedicine.chat.message.send',
67
+ GET_CHAT_HISTORY: 'telemedicine.chat.history.get',
68
+ UPLOAD_DOCUMENT: 'telemedicine.document.upload',
69
+ UPDATE_PRESCRIPTION: 'telemedicine.prescription.update',
70
+ GET_SESSION_RECORDINGS: 'telemedicine.session.recordings.get',
71
+ };
72
+ // Lab Service Message Patterns
73
+ exports.LAB_PATTERNS = {
74
+ GET_LABS: 'lab.get.all',
75
+ GET_LAB_BY_ID: 'lab.get.by.id',
76
+ GET_LAB_TESTS: 'lab.tests.get',
77
+ BOOK_LAB_APPOINTMENT: 'lab.appointment.book',
78
+ GET_LAB_APPOINTMENTS: 'lab.appointments.get',
79
+ CANCEL_LAB_APPOINTMENT: 'lab.appointment.cancel',
80
+ UPLOAD_LAB_REPORT: 'lab.report.upload',
81
+ GET_LAB_REPORTS: 'lab.reports.get',
82
+ GET_LAB_REPORT_BY_ID: 'lab.report.get.by.id',
83
+ };
84
+ // Payment Service Message Patterns
85
+ exports.PAYMENT_PATTERNS = {
86
+ GET_WALLET: 'payment.wallet.get',
87
+ ADD_MONEY_TO_WALLET: 'payment.wallet.add.money',
88
+ LINK_PAYMENT_CARD: 'payment.card.link',
89
+ REMOVE_PAYMENT_CARD: 'payment.card.remove',
90
+ PROCESS_PAYMENT: 'payment.process',
91
+ GET_TRANSACTION_HISTORY: 'payment.transactions.get',
92
+ GET_TRANSACTION_BY_ID: 'payment.transaction.get.by.id',
93
+ REFUND_PAYMENT: 'payment.refund',
94
+ UPDATE_TRANSACTION_STATUS: 'payment.transaction.status.update',
95
+ };
96
+ // Notification Service Message Patterns
97
+ exports.NOTIFICATION_PATTERNS = {
98
+ SEND_NOTIFICATION: 'notification.send',
99
+ SEND_PUSH_NOTIFICATION: 'notification.push.send',
100
+ SEND_EMAIL_NOTIFICATION: 'notification.email.send',
101
+ SEND_SMS_NOTIFICATION: 'notification.sms.send',
102
+ GET_USER_NOTIFICATIONS: 'notification.user.get',
103
+ MARK_NOTIFICATION_READ: 'notification.mark.read',
104
+ SCHEDULE_NOTIFICATION: 'notification.schedule',
105
+ GET_NOTIFICATION_SETTINGS: 'notification.settings.get',
106
+ UPDATE_NOTIFICATION_SETTINGS: 'notification.settings.update',
107
+ };
108
+ // Event patterns for cross-service communication
109
+ exports.EVENT_PATTERNS = {
110
+ // User events
111
+ USER_REGISTERED: 'event.user.registered',
112
+ USER_UPDATED: 'event.user.updated',
113
+ USER_LOYALTY_POINTS_EARNED: 'event.user.loyalty.points.earned',
114
+ // Order events
115
+ ORDER_CREATED: 'event.order.created',
116
+ ORDER_CONFIRMED: 'event.order.confirmed',
117
+ ORDER_CANCELLED: 'event.order.cancelled',
118
+ ORDER_DELIVERED: 'event.order.delivered',
119
+ // Appointment events
120
+ APPOINTMENT_BOOKED: 'event.appointment.booked',
121
+ APPOINTMENT_CANCELLED: 'event.appointment.cancelled',
122
+ APPOINTMENT_COMPLETED: 'event.appointment.completed',
123
+ APPOINTMENT_REMINDER: 'event.appointment.reminder',
124
+ // Payment events
125
+ PAYMENT_PROCESSED: 'event.payment.processed',
126
+ PAYMENT_FAILED: 'event.payment.failed',
127
+ REFUND_PROCESSED: 'event.refund.processed',
128
+ // Lab events
129
+ LAB_APPOINTMENT_BOOKED: 'event.lab.appointment.booked',
130
+ LAB_REPORT_UPLOADED: 'event.lab.report.uploaded',
131
+ // Prescription events
132
+ PRESCRIPTION_UPLOADED: 'event.prescription.uploaded',
133
+ PRESCRIPTION_READY: 'event.prescription.ready',
134
+ };
135
+ // Kafka configuration
136
+ exports.KAFKA_CONFIG = {
137
+ clientId: 'tiryaq-microservices',
138
+ brokers: ['localhost:9092'],
139
+ groupId: 'tiryaq-consumer-group',
140
+ };
141
+ // Service ports configuration
142
+ exports.SERVICE_PORTS = {
143
+ API_GATEWAY: 3000,
144
+ AUTH_SERVICE: 3001,
145
+ SETTINGS_SERVICE: 3002,
146
+ SEARCH_SERVICE: 3003,
147
+ PHARMACY_SERVICE: 3004,
148
+ CONSULTATION_SERVICE: 3005,
149
+ TELEMEDICINE_SERVICE: 3006,
150
+ LAB_SERVICE: 3007,
151
+ PAYMENT_SERVICE: 3008,
152
+ NOTIFICATION_SERVICE: 3009,
153
+ };
154
+ //# sourceMappingURL=message-patterns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-patterns.js","sourceRoot":"","sources":["../src/message-patterns.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;AAEvD,gCAAgC;AACnB,QAAA,aAAa,GAAG;IAC3B,aAAa,EAAE,e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@
1
+ {
2
+ "name": "tiryaq-shared",
3
+ "version": "1.0.0",
4
+ "description": "Shared types, interfaces, and message patterns for Tiryaq healthcare microservices",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "clean": "rm -rf dist",
10
+ "dev": "tsc --watch",
11
+ "prepublishOnly": "npm run clean && npm run build"
12
+ },
13
+ "keywords": [
14
+ "tiryaq",
15
+ "healthcare",
16
+ "microservices",
17
+ "types",
18
+ "interfaces",
19
+ "typescript",
20
+ "kafka",
21
+ "nestjs"
22
+ ],
23
+ "author": "Tiryaq Team",
24
+ "license": "MIT",
25
+ "files": [
26
+ "dist/**/*",
27
+ "README.md"
28
+ ],
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/tiryaq/shared.git"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^24.3.0",
35
+ "typescript": "^5.9.2"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ }
40
+ }