@cbm-common/cbm-types 0.0.287 → 0.0.289

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ import { AfterViewInit, ElementRef, OnChanges, Renderer2, SimpleChanges } from '@angular/core';
2
+ export declare class DropdownMenuDirective implements OnChanges, AfterViewInit {
3
+ private element;
4
+ private renderer2;
5
+ hiddenMenu: import("@angular/core").InputSignal<boolean>;
6
+ hiddenMenuOp: import("@angular/core").WritableSignal<boolean>;
7
+ constructor(element: ElementRef, renderer2: Renderer2);
8
+ ngAfterViewInit(): void;
9
+ ngOnChanges(changes: SimpleChanges): void;
10
+ toggle(event: Event): void;
11
+ private toggleMenu;
12
+ initStyle(): void;
13
+ }
@@ -0,0 +1,10 @@
1
+ import { AfterViewInit, ElementRef, Renderer2 } from '@angular/core';
2
+ export declare class DropdownDirective implements AfterViewInit {
3
+ private elementRef;
4
+ private renderer;
5
+ private isOpen;
6
+ constructor(elementRef: ElementRef, renderer: Renderer2);
7
+ ngAfterViewInit(): void;
8
+ toggleDropdown(event: MouseEvent): void;
9
+ closeDropdown(event: MouseEvent): void;
10
+ }
@@ -0,0 +1,13 @@
1
+ import { WritableSignal } from '@angular/core';
2
+ import { Router, ActivatedRoute, Params } from '@angular/router';
3
+ import { CbmRecordDetailMetadataModel } from "../../types";
4
+ export declare class OptionsComponent {
5
+ private router;
6
+ private route;
7
+ constructor(router: Router, route: ActivatedRoute);
8
+ metadata: import("@angular/core").InputSignal<CbmRecordDetailMetadataModel.metadata | null>;
9
+ options: import("@angular/core").InputSignal<CbmRecordDetailMetadataModel.options[] | undefined>;
10
+ optionInSignals: WritableSignal<WritableSignal<CbmRecordDetailMetadataModel.options>[]>;
11
+ executeFunction(option: WritableSignal<CbmRecordDetailMetadataModel.options>): void;
12
+ navigate(routerLink?: string, queryParams?: Params): void;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { AfterViewInit, ElementRef, OnChanges, Renderer2, SimpleChanges } from '@angular/core';
2
+ export declare class DropdownMenuDirective implements OnChanges, AfterViewInit {
3
+ private element;
4
+ private renderer2;
5
+ hiddenMenu: import("@angular/core").InputSignal<boolean>;
6
+ hiddenMenuOp: import("@angular/core").WritableSignal<boolean>;
7
+ constructor(element: ElementRef, renderer2: Renderer2);
8
+ ngAfterViewInit(): void;
9
+ ngOnChanges(changes: SimpleChanges): void;
10
+ toggle(event: Event): void;
11
+ private toggleMenu;
12
+ initStyle(): void;
13
+ }
@@ -0,0 +1,9 @@
1
+ import { ElementRef, Renderer2 } from '@angular/core';
2
+ export declare class DropdownDirective {
3
+ private elementRef;
4
+ private renderer;
5
+ private isOpen;
6
+ constructor(elementRef: ElementRef, renderer: Renderer2);
7
+ toggleDropdown(event: MouseEvent): void;
8
+ closeDropdown(event: MouseEvent): void;
9
+ }
@@ -0,0 +1,91 @@
1
+ export declare namespace CbmSalesPendingDocumentModel {
2
+ type TTypeEstablishment = 'matrix' | 'branch';
3
+ export interface ListParams {
4
+ page: number;
5
+ size: number;
6
+ document_number?: string;
7
+ date_end?: number;
8
+ date_begin?: number;
9
+ client_id?: string;
10
+ client_branch_id?: string;
11
+ type?: string;
12
+ }
13
+ export interface ListResponse {
14
+ success: boolean;
15
+ pageNum: number;
16
+ pageSize: number;
17
+ pages: number;
18
+ total: number;
19
+ totales: ListResponse.totales;
20
+ items: ListResponse.Item[];
21
+ }
22
+ export namespace ListResponse {
23
+ interface Item {
24
+ _id: string;
25
+ created_at: number;
26
+ document_nomenclature: string;
27
+ document_emission_point_number: string;
28
+ document_sequence: string;
29
+ balance: number;
30
+ client_id: string;
31
+ client_payment_deadline?: number;
32
+ client_credit_limit?: number;
33
+ client_business_name: string;
34
+ client_trade_name: string;
35
+ client_document_number: string;
36
+ client_credit_application: boolean;
37
+ client_price_list_id: string;
38
+ client_price_list_code: string;
39
+ client_price_list_name: string;
40
+ client_document_type_id: string;
41
+ client_document_type_name: string;
42
+ client_document_type_code: string;
43
+ client_category_id: string;
44
+ client_category_name: string;
45
+ client_branch_id: string;
46
+ client_branch_code: string;
47
+ client_branch_name: string;
48
+ client_branch_address: string;
49
+ client_branch_email: string[];
50
+ client_branch_phone_code?: string;
51
+ client_branch_phone?: string;
52
+ client_branch_cellphone?: string;
53
+ client_branch_type_establishment: `${TTypeEstablishment}`;
54
+ client_branch_province_id?: string;
55
+ client_branch_province_code?: string;
56
+ client_branch_province_name?: string;
57
+ client_branch_canton_id?: string;
58
+ client_branch_canton_code?: string;
59
+ client_branch_canton_name?: string;
60
+ client_branch_parish_id?: string;
61
+ client_branch_parish_code?: string;
62
+ client_branch_parish_name?: string;
63
+ client_branch_longitude?: number;
64
+ client_branch_latitude?: number;
65
+ client_branch_seller_id: string;
66
+ client_branch_seller_identification_number: string;
67
+ client_branch_seller_full_name: string;
68
+ client_branch_seller_address: string;
69
+ client_branch_seller_email: string[];
70
+ client_branch_seller_cellphone: string;
71
+ client_branch_contact_id?: string;
72
+ client_branch_contact_identification_number?: string;
73
+ client_branch_contact_full_name?: string;
74
+ client_branch_contact_cellphone?: string;
75
+ client_branch_contact_email?: string[];
76
+ new_document_number: string;
77
+ date: number;
78
+ type: string;
79
+ checked?: boolean;
80
+ }
81
+ interface totales {
82
+ total_retention?: number;
83
+ total_down_payment?: number;
84
+ total_credit_note?: number;
85
+ total_initial_balance_retention?: number;
86
+ total_initial_balance_down_payment?: number;
87
+ total_initial_balance_credit_note?: number;
88
+ }
89
+ }
90
+ export {};
91
+ }
@@ -0,0 +1,8 @@
1
+ import { Observable } from 'rxjs';
2
+ import { CbmSalesPendingDocumentModel } from '../models/sales-pending-document.domain.model';
3
+ import { ICbmSalesPendingDocumentRepository } from '../../infrastructure/repositories/sales-pending-document.infrastructure.repository';
4
+ export declare class CbmSalesPendingDocumentRepository implements ICbmSalesPendingDocumentRepository {
5
+ private service;
6
+ constructor(service: ICbmSalesPendingDocumentRepository);
7
+ list(params: CbmSalesPendingDocumentModel.ListParams): Observable<CbmSalesPendingDocumentModel.ListResponse>;
8
+ }
@@ -0,0 +1,18 @@
1
+ interface scheduleModel {
2
+ begin_time: string;
3
+ end_time: string;
4
+ all_day: boolean;
5
+ day_code: number;
6
+ day_name: string;
7
+ enabled: boolean;
8
+ }
9
+ export declare class LocalStorageControlService {
10
+ set setTheme(theme: 'dark' | 'light' | 'auto');
11
+ get theme(): 'dark' | 'light' | 'auto';
12
+ set setSchedule(schedule: scheduleModel);
13
+ get schedule(): scheduleModel | null;
14
+ get hasToken(): {
15
+ userToken: boolean;
16
+ };
17
+ }
18
+ export {};
@@ -1,138 +1,25 @@
1
- import { OnDestroy } from "@angular/core";
2
- import { Observable, Subject } from "rxjs";
3
1
  import { Router } from "@angular/router";
4
- import { UserCalendarModel } from "../models/user-calendar.domain.model";
2
+ import { BehaviorSubject } from "rxjs";
5
3
  import { UserCalendarDomainRepository } from "../repositories/user-calendar.domain.repository";
6
4
  import { CbmAuthReactiveService } from "./auth-reactive.domain.service";
7
- export interface AccessControlResult {
5
+ import { LocalStorageControlService } from "./local-storage-control.domain.service";
6
+ import { CbmNotificationService } from "./notification/notification.service";
7
+ import { UserCalendarModel } from "../models/user-calendar.domain.model";
8
+ interface AccessControlResult {
8
9
  hasAccess: boolean;
9
- message: string;
10
- scheduleInfo?: UserCalendarModel.ListResponse.Data;
11
- }
12
- export interface ScheduleExpiryWarning {
13
- endTime: string;
14
- minutesRemaining: number;
15
- remainingSeconds: number;
16
10
  schedule: UserCalendarModel.ListResponse.Data;
17
11
  }
18
- export declare class RefreshSchedulesDomainService implements OnDestroy {
19
- private userModel;
20
- private router;
21
- private authService;
22
- private readonly STORAGE_KEY;
23
- private readonly LAST_CHECK_KEY;
24
- private readonly CHECK_INTERVAL_MS;
25
- private accessCheckSubscription;
26
- private isMonitoring;
27
- closeInterval$: Subject<void>;
28
- private readonly scheduleExpiryWarningSubject;
29
- private notifiedEndTime;
30
- onAccessDenied: () => void;
31
- onAccessGranted: (() => void) | null;
32
- onAccessStatusChange: ((result: AccessControlResult) => void) | null;
33
- get scheduleExpiryWarning$(): Observable<ScheduleExpiryWarning>;
34
- constructor(userModel: UserCalendarDomainRepository, router: Router, authService: CbmAuthReactiveService);
35
- ngOnDestroy(): void;
36
- initUsershecudles(): void;
37
- /**
38
- * Inicia la verificación periódica del acceso del usuario
39
- * @param intervalMs Intervalo en milisegundos (por defecto 60000 = 1 minuto)
40
- */
41
- startPeriodicAccessCheck(intervalMs?: number): void;
42
- /**
43
- * Detiene la verificación periódica del acceso
44
- */
45
- stopPeriodicAccessCheck(): void;
46
- /**
47
- * Realiza la verificación de acceso y ejecuta las acciones correspondientes
48
- */
49
- private performAccessCheck;
50
- /**
51
- * Obtiene el estado actual del monitoreo
52
- */
53
- isAccessMonitoring(): boolean;
54
- /**
55
- * Cambia el intervalo de verificación
56
- * Nota: Se aplica en la próxima ronda de verificación
57
- */
58
- setCheckInterval(intervalMs: number): void;
59
- /**
60
- * Verifica si el usuario tiene acceso en la hora actual
61
- * Compara la hora actual con los horarios permitidos del día
62
- * @param schedules Lista de horarios configurados
63
- * @returns Resultado indicando si tiene acceso o debe ser sacado del sistema
64
- */
65
- checkAccessByCurrentTime(schedules: UserCalendarModel.ListResponse.Data[]): AccessControlResult;
66
- /**
67
- * Verifica y aplica control de acceso iterando sobre múltiples horarios
68
- * Útil para verificar si un usuario debe ser expulsado del sistema
69
- * @param schedules Lista de horarios a verificar
70
- * @param userCurrentTime Hora actual del usuario (opcional, usa hora del servidor si no se proporciona)
71
- * @returns Array de resultados de acceso por cada horario verificado
72
- */
73
- validateSchedulesAndApplyControl(schedules: UserCalendarModel.ListResponse.Data[], userCurrentTime?: Date): AccessControlResult[];
74
- /**
75
- * Verifica si existe acceso activo en la hora actual
76
- * Retorna true si el usuario tiene acceso ahora mismo
77
- */
78
- hasActiveAccess(schedules: UserCalendarModel.ListResponse.Data[]): boolean;
79
- /**
80
- * Obtiene el próximo horario de expulsión del sistema
81
- * Útil para programar la expulsión automática
82
- */
83
- getNextLogoutTime(schedules: UserCalendarModel.ListResponse.Data[]): Date | null;
84
- private checkAndNotifyExpiry;
85
- /**
86
- * Guarda los horarios en localStorage
87
- * @param schedules Lista de horarios a guardar
88
- */
89
- saveSchedulesToStorage(schedules: UserCalendarModel.ListResponse.Data[]): void;
90
- /**
91
- * Obtiene los horarios desde localStorage
92
- * @returns Array de horarios o array vacío si no existen
93
- */
94
- getSchedulesFromStorage(): UserCalendarModel.ListResponse.Data[];
95
- /**
96
- * Verifica si existen horarios guardados en localStorage
97
- */
98
- hasSchedulesInStorage(): boolean;
99
- /**
100
- * Elimina los horarios de localStorage
101
- */
102
- clearSchedulesFromStorage(): void;
103
- /**
104
- * Actualiza un horario específico en localStorage
105
- * @param dayName Nombre del día a actualizar
106
- * @param updatedSchedule Nuevo horario
107
- */
108
- updateScheduleInStorage(dayName: string, updatedSchedule: UserCalendarModel.ListResponse.Data): void;
109
- /**
110
- * Verifica acceso usando los horarios guardados en localStorage
111
- * @returns Resultado del control de acceso
112
- */
113
- checkAccessFromStorage(): AccessControlResult;
114
- /**
115
- * Registra la última vez que se verificó el acceso en localStorage
116
- */
117
- recordLastAccessCheck(): void;
118
- /**
119
- * Obtiene la última vez que se verificó el acceso
120
- */
121
- getLastAccessCheck(): Date | null;
122
- /**
123
- * Convierte un número de día (0-6) a nombre del día en español
124
- */
125
- private getDayName;
126
- /**
127
- * Formatea la hora actual en formato HH:mm
128
- */
129
- private formatTime;
130
- /**
131
- * Verifica si una hora está dentro de un rango de tiempo
132
- */
133
- private isTimeWithinRange;
134
- /**
135
- * Genera un mensaje descriptivo sobre el acceso
136
- */
137
- private generateAccessMessage;
12
+ export declare class RefreshSchedulesDomainService {
13
+ private readonly router;
14
+ private readonly userCalendarRepository;
15
+ private readonly localStorageControlService;
16
+ private readonly authReactiveService;
17
+ private readonly notificationService;
18
+ constructor(router: Router, userCalendarRepository: UserCalendarDomainRepository, localStorageControlService: LocalStorageControlService, authReactiveService: CbmAuthReactiveService, notificationService: CbmNotificationService);
19
+ running$: BehaviorSubject<boolean>;
20
+ onAccessStatusChange: (result: AccessControlResult) => void;
21
+ getSchedule(): void;
22
+ verifySchedule(): void;
23
+ isNowInTimeRange(startTime: string, endTime: string): boolean;
138
24
  }
25
+ export {};
@@ -0,0 +1,14 @@
1
+ import { BehaviorSubject } from "rxjs";
2
+ import { LocalStorageControlService } from "./local-storage-control.domain.service";
3
+ type ThemeType = 'dark' | 'light';
4
+ interface BehaviorSubjectModel {
5
+ preferenceAuto: boolean;
6
+ theme: ThemeType;
7
+ }
8
+ export declare class ThemeService {
9
+ private readonly localStorageControlService;
10
+ constructor(localStorageControlService: LocalStorageControlService);
11
+ readonly theme$: BehaviorSubject<BehaviorSubjectModel>;
12
+ private systemTheme;
13
+ }
14
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Observable } from "rxjs";
2
+ import { CbmBlanketAgreementCategoryServiceModel } from "../../domain/models/blanket-agreement-category-service.domain.model";
3
+ export interface ICbmBlanketAgreementCategoryServiceRepository {
4
+ list(params: CbmBlanketAgreementCategoryServiceModel.ListParams): Observable<CbmBlanketAgreementCategoryServiceModel.ListResponse>;
5
+ save(data: CbmBlanketAgreementCategoryServiceModel.SaveBody): Observable<CbmBlanketAgreementCategoryServiceModel.ConfirmResponse>;
6
+ delete(id: string): Observable<CbmBlanketAgreementCategoryServiceModel.ConfirmResponse>;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { Observable } from 'rxjs';
2
+ import { CbmSalesPendingDocumentModel } from '../../domain/models/sales-pending-document.domain.model';
3
+ export interface ICbmSalesPendingDocumentRepository {
4
+ list(params: CbmSalesPendingDocumentModel.ListParams): Observable<CbmSalesPendingDocumentModel.ListResponse>;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { CbmSalesPendingDocumentModel } from '../../domain/models/sales-pending-document.domain.model';
4
+ export declare class CbmSalesPendingDocumentService {
5
+ private http;
6
+ constructor(http: HttpClient);
7
+ private readonly url;
8
+ list(params: CbmSalesPendingDocumentModel.ListParams): Observable<CbmSalesPendingDocumentModel.ListResponse>;
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cbm-common/cbm-types",
3
- "version": "0.0.287",
3
+ "version": "0.0.289",
4
4
  "main": "index.js",
5
5
  "types": "public-api.d.ts",
6
6
  "exports": {