open-index/open-npm huggingface dataset:
npm package: @pandc/shared
Description: Shared interfaces and utilities for microservices
Latest version: 1.0.8

# @pandc/shared

Shared TypeScript interfaces and utilities for the PandC microservices architecture.

## Installation

To install this package in other microservices:

```bash
npm install ../shared
```

Or add it to your package.json:

```json
"dependencies": {
  "@pandc/shared": "^1.0.7"
}
```

## Usage

```typescript
// Import shared interfaces
import { IUser, IOrganization, ISubscription } from '@pandc/shared';

// Use interfaces in your code
const user: IUser = {
  _id: '123',
  email: 'user@example.com',
  isActive: true,
  roles: ['user'],
  createdAt: new Date(),
  updatedAt: new Date()
};
```

## Available Interfaces

### User-related
- `IUser`
- `INotificationPreferences`
- `ILocalePreferences`
- `IDecodedToken`

### Organization-related
- `IOrganization`
- `IOrganizationMember`
- `IOrganizationSettings`
- `IDepartment`
- `IPosition`
- `IAddress`

### Subscription-related
- `ISubscription`
- `IPlan`
- `IPayment`
- `SubscriptionStatus` (type)
- `PaymentStatus` (type)

### Service-related
- `IServiceConfig`
- `IServiceError`
- `IHealthStatus`

## Express Extensions

This package also extends the Express `Request` interface to include commonly used properties:

```typescript
// These properties are available on req in your Express handlers
req.user?: IUser;
req.token?: string;
req.decodedToken?: IDecodedToken;
req.organization?: IOrganization;
req.subscription?: ISubscription;
```