insach-shared-model
v1.0.6
Published
Shared data models, interfaces, and enums for Insach food delivery platform
Maintainers
Readme
Insach Shared Model
A comprehensive TypeScript package containing all shared data models, interfaces, enums, and types for the Insach food delivery platform.
📦 Installation
npm install insach-shared-model🚀 Usage
Basic Import
import {
User,
Order,
OrderStatus,
PaymentMethod,
COLLECTIONS
} from 'insach-shared-model';Specific Imports
// Import specific interfaces
import { User, Order, Kitchen } from 'insach-shared-model';
// Import specific enums
import { OrderStatus, DeliveryStatus, PaymentMethod } from 'insach-shared-model';
// Import constants
import { COLLECTIONS } from 'insach-shared-model';
// Import types
import { Timestamp, BaseAddress, DietaryPreferences } from 'insach-shared-model';📋 Contents
🏗️ Core Interfaces
- User - User profile and authentication data
- Order - Order management and tracking
- Kitchen - Kitchen/restaurant information
- Dish - Menu items and food products
- Delivery - Delivery tracking and logistics
- Payment - Payment processing and transactions
- Review - Customer reviews and ratings
- Support - Customer support and tickets
🔢 Enums
- OrderStatus - Order lifecycle states
- DeliveryStatus - Delivery tracking states
- PaymentMethod - Payment options
- PaymentStatus - Payment processing states
- RoleType - User roles and permissions
- CuisineType - Food cuisine categories
- KitchenType - Kitchen business types
- VerificationStatus - Document verification states
📊 Types
- Timestamp - Firebase Timestamp type
- BaseAddress - Standardized address structure
- BasePrice - Pricing information
- DietaryPreferences - Food preferences and restrictions
- OperatingHours - Business hours structure
- NutritionalInfo - Food nutritional data
🗄️ Constants
- COLLECTIONS - Firebase Firestore collection names
- Database Collections - Standardized collection references
🛠️ Helpers
- Enum Options - Helper functions for enum handling
- Form Utilities - Form-related helper functions
🎯 Use Cases
Food Delivery Platform
import { Order, OrderStatus, DeliveryStatus } from 'insach-shared-model';
// Create a new order
const newOrder: Order = {
id: 'order_123',
userId: 'user_456',
kitchenId: 'kitchen_789',
items: [/* order items */],
status: OrderStatus.Pending,
totalAmount: 250,
createdAt: new Date(),
};
// Update order status
newOrder.status = OrderStatus.Confirmed;User Management
import { User, RoleType, VerificationStatus } from 'insach-shared-model';
const user: User = {
id: 'user_123',
name: 'John Doe',
email: '[email protected]',
role: RoleType.Customer,
isVerified: true,
kycStatus: VerificationStatus.Verified,
};Kitchen Management
import { Kitchen, KitchenType, CuisineType } from 'insach-shared-model';
const kitchen: Kitchen = {
id: 'kitchen_123',
name: 'Spice Garden',
kitchenType: KitchenType.Restaurant,
cuisines: [CuisineType.NorthIndian, CuisineType.SouthIndian],
isActive: true,
rating: 4.5,
};🔧 Development
Building the Package
npm run buildWatching for Changes
npm run build:watchPublishing to NPM
npm publish📝 License
MIT License - see LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📞 Support
For support and questions, please open an issue on the GitHub repository.
🔄 Version History
- 1.0.0 - Initial release with all core models and interfaces
