Taryana
Subscription-Tied FeaturesTenant Personalization
TESTER READY • LIVE ENGINE

Property Content Management

Dynamic Hotel Welcome Screens & Subscription-Tied Entitlements

Pengelolaan materi tayangan hotel (video sambutan kamar, menu amenities digital, banner promo) yang divalidasi dinamis terhadap paket kontrak aktif.

Diagram Alur Data & Arsitektur Sistem

Visual Interaktif

Alur Entitlement Konten TV Terikat Kontrak

Memastikan fitur branding hotel sesuai dengan paket kontrak aktif

client
Tenant

Property Manager

Update Template Konten

PUT /contents
guard
Entitlement

Feature Guard

Check Contract Features

Feature confirmed
db
property_contents

MongoDB Contents

Upsert Template JSON

Invalidate cache
cache
Fast Sync

Redis / CDN Cache

Invalidate TV Template

Sync layout to room
device
TV Screen

In-Room STB TV

Display Welcome Screen

Problem & Latar Belakang Kebutuhan

Setiap properti memiliki identitas merek sendiri. Namun tidak semua properti berhak menggunakan fitur premium (seperti custom video branding 4K atau direktori room service interaktif) jika paket kontrak yang disepakati hanya paket Silver standar. Hak kelola konten harus dikunci secara otomatis berdasarkan active subscription features.

Implementasi Rekayasa Backend NestJS

Koleksi property_contents di MongoDB menyimpan template dan aset visual tiap properti secara terpisah. SubscriptionFeatureGuard memeriksa array features pada sub-dokumen subscription properti sebelum mengizinkan Manager menyimpan perubahan template. Admin IPTV juga dapat mengelola seluruh konten properti terdaftar untuk keperluan asistensi teknis.

Aspek Model Database MongoDB

Menggunakan skema fleksibel MongoDB untuk menyimpan payload JSON layout TV: { welcomeGreeting: string, videoUrl: string, diningMenuEnabled: boolean, tickers: string[] }. Perubahan layout tidak memerlukan migrasi DDL tabel.

Keamanan, Idempotensi & Kepatuhan SLA

Validasi entitlement di level backend memastikan klien frontend tidak dapat melakukan bypass pembatasan UI untuk mengaktifkan fitur di luar kontrak.

NestJS SubscriptionFeatureGuard & Content DecoratorNestJS (TypeScript)
// SubscriptionFeatureGuard: Pengecekan Fitur Terikat Kontrak
@Injectable()
export class SubscriptionFeatureGuard implements CanActivate {
  constructor(private readonly reflector: Reflector) {}

  async canActivate(context: ExecutionContext): Promise<boolean> {
    const requiredFeature = this.reflector.get<string>('feature', context.getHandler());
    const { property } = context.switchToHttp().getRequest();

    if (!property.subscription || property.subscription.status !== 'ACTIVE') {
      throw new PaymentRequiredException('Kontrak langganan properti tidak aktif.');
    }

    if (!property.subscription.features.includes(requiredFeature)) {
      throw new ForbiddenException(`Fitur '${requiredFeature}' tidak tercakup dalam paket kontrak Anda.`);
    }

    return true;
  }
}

Live Simulator & Execution Sandbox

Interactive State Tester
Entitlements Terikat Langganan:
Execution Telemetry Console
HTTP 201 Created
POST/api/v1/properties/contracts
> Guard Evaluation Trace:

RolesGuard verified caller is 'admin'. Idempotency Key verified in Redis. MongoDB document updated.

> Database & State Result:

Contract for 'Grand Horizon Hotel & Resort' persisted into Property document with 1-Year validity.

Audit Trail MongoDB (2 events)Auto-Appended
[10:14:02]ADMIN(Rian (Platform Admin))•PROPERTY_CONTRACT_PROVISIONED

Provisioned 1-Year Platinum Contract #PKS-2026-042 via manual B2B order.

SUCCESS
[10:22:15]MANAGER(Ahmad (IT Manager))•WELCOME_CONTENT_MUTATED

Updated welcome video banner and personalized TV dining directory.

SUCCESS