@loyal-ix/loyalix-shared-types
v1.3.0
Published
Shared TypeScript types for Loyalix frontend and backend
Maintainers
Readme
@loyalix/shared-types
Shared TypeScript types, enums, and DTOs for the Loyalix loyalty program platform.
Installation
npm install @loyalix/shared-types
# or
pnpm add @loyalix/shared-types
# or
yarn add @loyalix/shared-typesUsage
import { Role, Permission, BusinessStatus } from '@loyalix/shared-types';
import type { LoginResponseDto, PaginatedResult } from '@loyalix/shared-types';
// Use enums
if (user.role === Role.BUSINESS_OWNER) {
// ...
}
// Use types
const response: LoginResponseDto = await login(credentials);Available Exports
Enums
Role- User roles (USER, ADMIN, BUSINESS_OWNER, BUSINESS_STAFF, CUSTOMER, SUPER_ADMIN)Permission- Granular permissions for RBACBusinessStatus- Business status (ACTIVE, INACTIVE, PENDING, SUSPENDED)
DTOs
- Auth:
LoginDto,RegisterDto,RefreshTokenDto,LoginResponseDto,LoggedInUserDto - User:
CreateUserDto,UpdateUserDto,UserDto - Business:
CreateBusinessDto,UpdateBusinessDto,BusinessDto - Customer:
CreateCustomerDto,UpdateCustomerDto,CustomerDto - Loyalty Program:
CreateLoyaltyProgramDto,UpdateLoyaltyProgramDto,LoyaltyProgramDto - Pagination:
PaginationMeta,PaginatedResult,PaginationQuery - API Response:
SuccessResponse,ErrorResponse,ErrorDetail,ApiResponse
License
MIT
