# WidgetBookingSummaryTodayComponent

**Kind:** Class

**Source:** `Frontend/src/app/components/dashboard/dashboard-libary/widgets/widget-booking-summary-today/widget-booking-summary-today.component.ts` (line 36)

**Part of:** [Frontend](subsystem-frontend-src-app)

`WidgetBookingSummaryTodayComponent` is an Angular dashboard widget that loads and displays booking summary data for the current view. It checks feature subscription access, synchronizes branch-specific views, formats pricing values, and manages chart initialization and planned-visit interactions.

**Extends:** `BaseWidgetComponent`

**Implements:** `OnInit`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `checkFeatureSubscription` | `checkFeatureSubscription()` | `boolean` |
| `ngOnInit` | `ngOnInit()` | `void` |
| `getDashboardData` | `getDashboardData()` | `void` |
| `displayDashboardData` | `displayDashboardData()` | `void` |
| `syncWithSeparateBranchesViews` | `syncWithSeparateBranchesViews()` | `void` |
| `getpriceFormatted` | `getpriceFormatted(x: undefined)` | `string` |
| `onChartInit` | `onChartInit(e: any)` | `void` |
| `onPlannedVisitsChartClick` | `onPlannedVisitsChartClick(e: undefined)` | `void` |
| `setValue` | `setValue(value: number)` | `void` |

## Properties

| Property | Type |
|---|---|
| `_widget` | `Widget` |
| `todayWidgetsEnum` | `any` |
| `allData` | `MonthData[]` |
| `data` | `Data[]` |
| `tempData` | `Data` |
| `separateBranchesViews` | `boolean` |
| `initOpts` | `any` |
| `series` | `any[]` |
| `headerData` | `any` |
| `echartsIntance` | `any` |
| `options` | `any` |
| `TargetBooking` | `number` |
| `AchievedBooking` | `number` |
| `ForecastBooking` | `number` |
| `BlindForecastBooking` | `number` |
| `TargetBookingFormatted` | `any` |
| `AchievedBookingFormatted` | `any` |
| `ForecastBookingFormatted` | `any` |
| `BlindForecastFormatted` | `any` |
| `branchTendency` | `number` |
| `branchCurrency` | `any` |
| `currenFeature` | `number` |

## Where it refuses work

- `WidgetBookingSummaryTodayComponent` stops the work with an early return when `this.dashboardLibraryService.checkFeatureSubscription(this.widget.chartEnumId)`.

## Diagram

```mermaid
graph LR
  Init[ngOnInit] --> Subscription[checkFeatureSubscription]
  Subscription --> Data[getDashboardData]
  Data --> Display[displayDashboardData]
  Display --> Branches[syncWithSeparateBranchesViews]
  Display --> Price[getpriceFormatted]
  Display --> Chart[onChartInit]
  Chart --> Click[onPlannedVisitsChartClick]
  Click --> Value[setValue]
```

## Usage

```ts
import { Component, ViewChild } from '@angular/core';
import { WidgetBookingSummaryTodayComponent } from './widget-booking-summary-today.component';

@Component({
  selector: 'app-dashboard-page',
  template: `
    <app-widget-booking-summary-today
      #bookingSummary>
    </app-widget-booking-summary-today>

    <button type="button" (click)="refreshBookingSummary()">
      Refresh
    </button>
  `
})
export class DashboardPageComponent {
  @ViewChild('bookingSummary')
  bookingSummary!: WidgetBookingSummaryTodayComponent;

  refreshBookingSummary(): void {
    if (this.bookingSummary.checkFeatureSubscription()) {
      this.bookingSummary.getDashboardData();
    }
  }

  get formattedPrice(): string {
    return this.bookingSummary.getpriceFormatted();
  }
}
```

## AI Coding Instructions

- Check `checkFeatureSubscription()` before requesting or displaying booking summary data.
- Keep data retrieval in `getDashboardData()` and presentation updates in `displayDashboardData()`.
- Call `syncWithSeparateBranchesViews()` when branch selection or branch-scoped dashboard data changes.
- Initialize chart behavior through `onChartInit()` and route planned-visit selections through `onPlannedVisitsChartClick()`.
- Keep price display formatting inside `getpriceFormatted()` rather than formatting values in templates.

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (1)

- `DashboardWidgetsModule` — `Frontend/src/app/components/dashboard/dashboard-widgets.module.ts`:1
