Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<img src="https://img.shields.io/badge/NestJS-framework-E0234E?logo=nestjs&logoColor=white" alt="NestJS" />
<img src="https://img.shields.io/badge/PostgreSQL-database-4169E1?logo=postgresql&logoColor=white" alt="PostgreSQL" />
<img src="https://img.shields.io/badge/License-Apache%202.0-blue" alt="Apache 2.0 License" />
<img src="https://img.shields.io/badge/Tests-2245%20passing-brightgreen" alt="2245 Tests Passing" /> <img src="https://img.shields.io/badge/AI%20Agents-12%20built--in-blueviolet" alt="12 AI Agents" />
<img src="https://img.shields.io/badge/Tests-2249%20passing-brightgreen" alt="2249 Tests Passing" /> <img src="https://img.shields.io/badge/AI%20Agents-12%20built--in-blueviolet" alt="12 AI Agents" />
</p>

<p align="center">
Expand Down Expand Up @@ -510,7 +510,7 @@ Operator notes for activating existing adapters, metasearch landings on the dire
| OTA Channels | Booking.com + Expedia (EQC) + SiteMinder + DerbySoft | Direct + aggregated OTA connectivity (ARI + content) |
| XML Processing | fast-xml-parser | Booking.com OTA XML protocol |
| Package Manager | pnpm workspaces | Monorepo management |
| Testing | Vitest (2245 passing tests across 268 files with passing tests) | Unit and integration tests |
| Testing | Vitest (2249 passing tests across 269 files with passing tests) | Unit and integration tests |
| Build | tsup (packages) + Vite (dashboard) + nest build (API) | Fast builds |
| Containers | Docker + docker-compose | Local dev and production deployment |
| CI/CD | GitHub Actions | Automated testing, builds, and releases |
Expand Down Expand Up @@ -648,7 +648,7 @@ Before going live, verify the items in [`docs/deployment.md`](./docs/deployment.
### Run tests

```bash
# Passing-test count: 2245 test cases across 268 files (skipped excluded)
# Passing-test count: 2249 test cases across 269 files (skipped excluded)

# API tests only
pnpm --filter @telivityhaip/api test
Expand Down Expand Up @@ -1197,7 +1197,7 @@ HAIP is built in public and contributions are welcome.
pnpm install # Install dependencies
pnpm build # Build all workspace packages
pnpm dev # Start API in dev mode (hot reload)
pnpm test # Run all tests (2245 passing, 268 files with passes; skipped excluded)
pnpm test # Run all tests (2249 passing, 269 files with passes; skipped excluded)
pnpm lint # ESLint
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
IsNotEmpty,
IsOptional,
IsUUID,
IsEnum,
IsIn,
MaxLength,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
Expand All @@ -15,7 +15,7 @@ export class CreateAccountingCodeDto {
propertyId!: string;

@ApiProperty({ enum: ['transaction', 'gl'], description: 'Code kind (KB 5)' })
@IsEnum(['transaction', 'gl'])
@IsIn(['transaction', 'gl'])
kind!: string;

@ApiProperty({ example: 'ROOM-REV', description: 'Code' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsOptional, IsUUID, IsEnum, IsBoolean, IsInt, Min, Max } from 'class-validator';
import { IsOptional, IsUUID, IsIn, IsBoolean, IsInt, Min, Max } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';

Expand All @@ -9,7 +9,7 @@ export class ListAccountingCodesDto {

@ApiPropertyOptional({ enum: ['transaction', 'gl'] })
@IsOptional()
@IsEnum(['transaction', 'gl'])
@IsIn(['transaction', 'gl'])
kind?: string;

@ApiPropertyOptional({ description: 'Include archived codes', default: false })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/accounting/dto/list-ar-ledgers.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsOptional, IsUUID, IsEnum, IsInt, Min, Max } from 'class-validator';
import { IsOptional, IsUUID, IsIn, IsInt, Min, Max } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';

Expand All @@ -9,7 +9,7 @@ export class ListArLedgersDto {

@ApiPropertyOptional({ enum: ['open', 'closed'] })
@IsOptional()
@IsEnum(['open', 'closed'])
@IsIn(['open', 'closed'])
status?: string;

@ApiPropertyOptional({ default: 1 })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/accounting/dto/list-deposits.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsOptional, IsUUID, IsEnum, IsInt, Min, Max } from 'class-validator';
import { IsOptional, IsUUID, IsIn, IsInt, Min, Max } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';

Expand All @@ -14,7 +14,7 @@ export class ListDepositsDto {

@ApiPropertyOptional({ enum: ['held', 'applied', 'refunded', 'forfeited'] })
@IsOptional()
@IsEnum(['held', 'applied', 'refunded', 'forfeited'])
@IsIn(['held', 'applied', 'refunded', 'forfeited'])
status?: string;

@ApiPropertyOptional({ default: 1 })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/admin/dto/create-user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
IsNotEmpty,
IsOptional,
IsEmail,
IsEnum,
IsIn,
IsArray,
MaxLength,
} from 'class-validator';
Expand All @@ -30,7 +30,7 @@ export class CreateUserDto {

@ApiPropertyOptional({ enum: USER_STATUSES, default: 'active' })
@IsOptional()
@IsEnum(USER_STATUSES)
@IsIn(USER_STATUSES)
status?: (typeof USER_STATUSES)[number];

@ApiPropertyOptional({ format: 'uuid', description: 'Keycloak subject (link real login — LATER)' })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/admin/dto/update-user.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsString, IsOptional, IsEnum, MaxLength } from 'class-validator';
import { IsString, IsOptional, IsIn, MaxLength } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';
import { USER_STATUSES } from './create-user.dto';

Expand All @@ -11,6 +11,6 @@ export class UpdateUserDto {

@ApiPropertyOptional({ enum: USER_STATUSES })
@IsOptional()
@IsEnum(USER_STATUSES)
@IsIn(USER_STATUSES)
status?: (typeof USER_STATUSES)[number];
}
6 changes: 3 additions & 3 deletions apps/api/src/modules/ancillary/dto/create-service.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
IsOptional,
IsUUID,
IsBoolean,
IsEnum,
IsIn,
IsArray,
IsInt,
Min,
Expand Down Expand Up @@ -58,7 +58,7 @@ export class CreateServiceDto {
description?: string;

@ApiProperty({ enum: SERVICE_CHARGE_TYPES })
@IsEnum(SERVICE_CHARGE_TYPES)
@IsIn(SERVICE_CHARGE_TYPES)
chargeType!: (typeof SERVICE_CHARGE_TYPES)[number];

@ApiProperty({ example: '25.00' })
Expand All @@ -78,7 +78,7 @@ export class CreateServiceDto {
taxCode?: string;

@ApiProperty({ enum: SERVICE_POSTING_RULES })
@IsEnum(SERVICE_POSTING_RULES)
@IsIn(SERVICE_POSTING_RULES)
postingRule!: (typeof SERVICE_POSTING_RULES)[number];

@ApiPropertyOptional({
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/cashier/dto/record-movement.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
IsNotEmpty,
IsOptional,
IsUUID,
IsEnum,
IsIn,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

Expand All @@ -17,7 +17,7 @@ export class RecordMovementDto {
propertyId!: string;

@ApiProperty({ enum: ['payment', 'refund', 'paid_out', 'drop'], description: 'Movement type (KB 12.3)' })
@IsEnum(['payment', 'refund', 'paid_out', 'drop'])
@IsIn(['payment', 'refund', 'paid_out', 'drop'])
type!: string;

@ApiProperty({ example: '50.00', description: 'Movement amount' })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsUUID, IsString, IsOptional, IsArray, ValidateNested, IsEnum } from 'class-validator';
import { IsUUID, IsString, IsOptional, IsArray, ValidateNested, IsIn } from 'class-validator';
import { Type } from 'class-transformer';

export class RatePlanMappingDto {
Expand Down Expand Up @@ -31,7 +31,7 @@ export class CreateChannelConnectionDto {
adapterType!: string;

@IsOptional()
@IsEnum(['push', 'pull', 'bidirectional'])
@IsIn(['push', 'pull', 'bidirectional'])
syncDirection?: string;

@IsOptional()
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/channel/dto/inbound-reservation.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsUUID, IsString, IsOptional, IsNumber, IsDateString, IsEnum, ValidateNested } from 'class-validator';
import { IsUUID, IsString, IsOptional, IsNumber, IsDateString, IsIn, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';

export class ChannelReservationDto {
Expand Down Expand Up @@ -51,7 +51,7 @@ export class ChannelReservationDto {
@IsString()
specialRequests?: string;

@IsEnum(['new', 'modified', 'cancelled'])
@IsIn(['new', 'modified', 'cancelled'])
status!: 'new' | 'modified' | 'cancelled';
}

Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/channel/dto/set-rate-override.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
IsUUID,
IsEnum,
IsIn,
IsNumber,
IsOptional,
IsDateString,
Expand All @@ -24,7 +24,7 @@ export class SetRateOverrideDto {
ratePlanId!: string;

@ApiProperty({ enum: ['percentage', 'fixed'] })
@IsEnum(['percentage', 'fixed'])
@IsIn(['percentage', 'fixed'])
adjustmentType!: 'percentage' | 'fixed';

@ApiProperty({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsString, IsOptional, IsArray, ValidateNested, IsEnum } from 'class-validator';
import { IsString, IsOptional, IsArray, ValidateNested, IsIn } from 'class-validator';
import { Type } from 'class-transformer';
import { RatePlanMappingDto, RoomTypeMappingDto } from './create-channel-connection.dto';

Expand All @@ -8,11 +8,11 @@ export class UpdateChannelConnectionDto {
channelName?: string;

@IsOptional()
@IsEnum(['active', 'inactive', 'pending_setup'])
@IsIn(['active', 'inactive', 'pending_setup'])
status?: string;

@IsOptional()
@IsEnum(['push', 'pull', 'bidirectional'])
@IsIn(['push', 'pull', 'bidirectional'])
syncDirection?: string;

@IsOptional()
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/connect/dto/agent-book.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IsNumber,
IsOptional,
IsEmail,
IsEnum,
IsIn,
Min,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
Expand Down Expand Up @@ -75,7 +75,7 @@ export class AgentBookDto {
// Payment
@ApiPropertyOptional({ enum: ['pay_at_property', 'prepaid', 'virtual_card'] })
@IsOptional()
@IsEnum(['pay_at_property', 'prepaid', 'virtual_card'])
@IsIn(['pay_at_property', 'prepaid', 'virtual_card'])
paymentMethod?: 'pay_at_property' | 'prepaid' | 'virtual_card';

@ApiPropertyOptional()
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/door-lock/dto/list-credentials.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsEnum, IsOptional, IsUUID, IsInt, Min, Max } from 'class-validator';
import { IsIn, IsOptional, IsUUID, IsInt, Min, Max } from 'class-validator';
import { Type } from 'class-transformer';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

Expand All @@ -9,7 +9,7 @@ export class ListDoorLockCredentialsDto {

@ApiPropertyOptional({ enum: ['active', 'revoked'] })
@IsOptional()
@IsEnum(['active', 'revoked'])
@IsIn(['active', 'revoked'])
status?: 'active' | 'revoked';

@ApiPropertyOptional({ default: 1 })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
IsDateString,
IsEnum,
IsIn,
IsNotEmpty,
IsOptional,
IsString,
Expand Down Expand Up @@ -30,7 +30,7 @@ export class PostFolioInboundChargeDto {
roomNumber!: string;

@ApiProperty({ enum: INBOUND_CHARGE_TYPES, example: 'minibar' })
@IsEnum(INBOUND_CHARGE_TYPES)
@IsIn(INBOUND_CHARGE_TYPES)
type!: (typeof INBOUND_CHARGE_TYPES)[number];

@ApiProperty({ example: '18.50' })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/folio/dto/create-charge.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
IsNotEmpty,
IsOptional,
IsUUID,
IsEnum,
IsIn,
IsBoolean,
IsDateString,
MaxLength,
Expand All @@ -20,7 +20,7 @@ export class CreateChargeDto {
@ApiProperty({
enum: ['room', 'tax', 'food_beverage', 'minibar', 'phone', 'laundry', 'parking', 'spa', 'incidental', 'fee', 'adjustment', 'package'],
})
@IsEnum(['room', 'tax', 'food_beverage', 'minibar', 'phone', 'laundry', 'parking', 'spa', 'incidental', 'fee', 'adjustment', 'package'])
@IsIn(['room', 'tax', 'food_beverage', 'minibar', 'phone', 'laundry', 'parking', 'spa', 'incidental', 'fee', 'adjustment', 'package'])
type!: string;

@ApiProperty({ example: 'Room charge - Standard King' })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/folio/dto/create-folio.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
IsNotEmpty,
IsOptional,
IsUUID,
IsEnum,
IsIn,
MaxLength,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
Expand All @@ -30,7 +30,7 @@ export class CreateFolioDto {
guestId!: string;

@ApiProperty({ enum: ['guest', 'master', 'city_ledger'], default: 'guest' })
@IsEnum(['guest', 'master', 'city_ledger'])
@IsIn(['guest', 'master', 'city_ledger'])
type!: string;

@ApiProperty({ example: 'USD', description: 'ISO 4217 currency code' })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/folio/dto/create-routing-rule.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
IsNotEmpty,
IsOptional,
IsUUID,
IsEnum,
IsIn,
IsInt,
} from 'class-validator';
import { Type } from 'class-transformer';
Expand Down Expand Up @@ -38,7 +38,7 @@ export class CreateRoutingRuleDto {
reservationId!: string;

@ApiProperty({ enum: CHARGE_TYPES })
@IsEnum(CHARGE_TYPES)
@IsIn(CHARGE_TYPES)
chargeType!: string;

@ApiProperty({ description: 'Folio that charges of this type post to' })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/folio/dto/list-charges.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsOptional, IsUUID, IsEnum, IsDateString, IsInt, Min, Max } from 'class-validator';
import { IsOptional, IsUUID, IsIn, IsDateString, IsInt, Min, Max } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';

Expand All @@ -11,7 +11,7 @@ export class ListChargesDto {
enum: ['room', 'tax', 'food_beverage', 'minibar', 'phone', 'laundry', 'parking', 'spa', 'incidental', 'fee', 'adjustment', 'package'],
})
@IsOptional()
@IsEnum(['room', 'tax', 'food_beverage', 'minibar', 'phone', 'laundry', 'parking', 'spa', 'incidental', 'fee', 'adjustment', 'package'])
@IsIn(['room', 'tax', 'food_beverage', 'minibar', 'phone', 'laundry', 'parking', 'spa', 'incidental', 'fee', 'adjustment', 'package'])
type?: string;

@ApiPropertyOptional()
Expand Down
6 changes: 3 additions & 3 deletions apps/api/src/modules/folio/dto/list-folios.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsOptional, IsUUID, IsEnum, IsInt, Min, Max } from 'class-validator';
import { IsOptional, IsUUID, IsIn, IsInt, Min, Max } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';

Expand All @@ -19,12 +19,12 @@ export class ListFoliosDto {

@ApiPropertyOptional({ enum: ['guest', 'master', 'city_ledger'] })
@IsOptional()
@IsEnum(['guest', 'master', 'city_ledger'])
@IsIn(['guest', 'master', 'city_ledger'])
type?: string;

@ApiPropertyOptional({ enum: ['open', 'settled', 'closed'] })
@IsOptional()
@IsEnum(['open', 'settled', 'closed'])
@IsIn(['open', 'settled', 'closed'])
status?: string;

@ApiPropertyOptional({ default: 1 })
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/modules/folio/dto/move-transactions.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
IsNotEmpty,
IsOptional,
IsUUID,
IsEnum,
IsIn,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

Expand Down Expand Up @@ -42,6 +42,6 @@ export class MoveTransactionsDto {

@ApiPropertyOptional({ enum: CHARGE_TYPES, description: 'Move all charges of this type' })
@IsOptional()
@IsEnum(CHARGE_TYPES)
@IsIn(CHARGE_TYPES)
chargeType?: string;
}
Loading
Loading