@3asoftwares/types
v1.0.6
Published
TypeScript type definitions for 3A Softwares E-Commerce
Maintainers
Readme
Types Package
Overview
Shared TypeScript type definitions used across all frontend and backend applications in the 3asoftwares platform.
Tech Stack
- TypeScript 5 - Type definitions
- Vitest - Testing
Installation
This package is consumed as a workspace dependency:
{
"dependencies": {
"@3asoftwares/types": "^1.0.0"
}
}Type Categories
User Types
User- User entityUserRole- Role enumeration (ADMIN, SELLER, CUSTOMER)AuthTokens- JWT token structureLoginCredentials- Login requestRegisterData- Registration request
Product Types
Product- Product entityProductFilter- Filter optionsProductSort- Sort optionsProductImage- Image structure
Order Types
Order- Order entityOrderItem- Order line itemOrderStatus- Status enumerationPaymentStatus- Payment status
Category Types
Category- Category entity
Coupon Types
Coupon- Coupon entityCouponType- PERCENTAGE | FIXEDDiscountResult- Applied discount
Address Types
Address- Shipping/billing address
Review Types
Review- Product review
API Types
ApiResponse<T>- Standard API response wrapperPaginatedResponse<T>- Paginated list responseErrorResponse- Error structure
Utility Types
LogLevel- Logging levels (DEBUG, INFO, WARN, ERROR)
Usage
import { User, Product, Order, ApiResponse } from '@3asoftwares/types';
const user: User = {
id: '123',
email: '[email protected]',
name: 'John Doe',
role: 'CUSTOMER',
};Project Structure
src/
├── index.ts # Main exports
├── user.ts # User types
├── product.ts # Product types
├── order.ts # Order types
├── category.ts # Category types
├── coupon.ts # Coupon types
├── address.ts # Address types
├── review.ts # Review types
└── api.ts # API response typesScripts
yarn test # Run tests
yarn test:coverage # Run tests with coverage