@cbm-common/cbm-types 0.0.280 → 0.0.282

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.
@@ -1,11 +1,14 @@
1
1
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
2
- import { DestroyRef } from '@angular/core';
2
+ import { DestroyRef, OnInit } from '@angular/core';
3
3
  import { FormControl } from '@angular/forms';
4
4
  import { CbmDetailBySectionModel } from './detail-by-section.model';
5
+ import { CbmSalesAccountBillingGroupByOriginDomainRepository } from '../../domain/repositories/sales-account-billing-group-by-origin.domain.repository';
6
+ import { CbmNotificationService } from '../../domain/services/notification/notification.service';
5
7
  type TDetailCategory = 'all' | 'item' | 'service' | 'subcontracted';
6
8
  declare class DetailSectionControl {
7
9
  readonly id: `${string}-${string}-${string}-${string}-${string}`;
8
10
  readonly defaultTitle: string;
11
+ sectionId?: string;
9
12
  constructor(title: string);
10
13
  title: import("@angular/core").WritableSignal<string>;
11
14
  items: import("@angular/core").WritableSignal<CbmDetailBySectionModel.SectionDetail[]>;
@@ -20,10 +23,16 @@ declare class DetailSectionControl {
20
23
  resetTitleIfEmpty(value: string): void;
21
24
  toggleDetailVisibility(): void;
22
25
  }
23
- export declare class CbmDetailBySectionComponent {
26
+ export declare class CbmDetailBySectionComponent implements OnInit {
24
27
  private readonly destroyRef;
28
+ private readonly salesAccountBillingGroupByOriginRepository;
29
+ private readonly notificationService;
25
30
  EType: typeof CbmDetailBySectionModel.Type;
26
- constructor(destroyRef: DestroyRef);
31
+ private loadedConfig;
32
+ constructor(destroyRef: DestroyRef, salesAccountBillingGroupByOriginRepository: CbmSalesAccountBillingGroupByOriginDomainRepository, notificationService: CbmNotificationService);
33
+ 'collection-origin-id': import("@angular/core").InputSignal<string | null>;
34
+ 'collection-name': import("@angular/core").InputSignal<string | null>;
35
+ 'enable-loaded-settings': import("@angular/core").InputSignal<boolean>;
27
36
  labels: import("@angular/core").WritableSignal<{
28
37
  labelDetail: string;
29
38
  labelSection: string;
@@ -45,12 +54,13 @@ export declare class CbmDetailBySectionComponent {
45
54
  detailSectionAssignments: import("@angular/core").Signal<Map<string, string[]>>;
46
55
  dropListIds: import("@angular/core").Signal<string[]>;
47
56
  allSectionsConsolidated: import("@angular/core").Signal<boolean>;
57
+ ngOnInit(): void;
58
+ getConfig(): void;
48
59
  setLabels(labels: Partial<ReturnType<typeof this.labels>>): void;
49
60
  setDetail(input: Array<CbmDetailBySectionModel.InputDetail>): void;
50
61
  reset(): void;
51
62
  searchTerm(term: string): void;
52
63
  createSection(): void;
53
- distributeSections(): void;
54
64
  startEditSectionTitle(index: number): void;
55
65
  saveSectionTitle(index: number, value: string): void;
56
66
  removeSection(index: number): void;
@@ -69,6 +79,7 @@ export declare class CbmDetailBySectionComponent {
69
79
  private getSourceDetails;
70
80
  private getAvailableDetailsByType;
71
81
  private getSourceDetailsByType;
82
+ private applyLoadedConfig;
72
83
  private loadCategory;
73
84
  private getDetailKey;
74
85
  }
@@ -22,6 +22,7 @@ export declare namespace CbmDetailBySectionModel {
22
22
  }
23
23
  interface SectionSnapshot {
24
24
  id: string;
25
+ section_id?: string;
25
26
  title: string;
26
27
  isDetailHidden: boolean;
27
28
  subtotal: number;
@@ -0,0 +1,74 @@
1
+ export declare namespace CbmSalesAccountBillingGroupByOriginModel {
2
+ interface GetByOriginParams {
3
+ collection_origin_id: string;
4
+ collection_origin_name: string;
5
+ }
6
+ interface GetByOriginResponse {
7
+ success: boolean;
8
+ data: GetByOriginResponse.Data;
9
+ }
10
+ namespace GetByOriginResponse {
11
+ interface Data {
12
+ collection_origin_id: string;
13
+ collection_origin_name: string;
14
+ billing_group: Data.BillingGroup;
15
+ details: Data.Detail[];
16
+ }
17
+ namespace Data {
18
+ interface BillingGroup {
19
+ _id: string;
20
+ name: string;
21
+ document_number: string;
22
+ document_nomenclature: string;
23
+ document_complete: string;
24
+ }
25
+ interface Detail {
26
+ section_id: string;
27
+ section_name: string;
28
+ order: number;
29
+ sales_account_details: Detail.SalesAccountDetail[];
30
+ }
31
+ namespace Detail {
32
+ interface SalesAccountDetail {
33
+ _id: string;
34
+ company_id: string;
35
+ country_id: string;
36
+ sales_account_id: string;
37
+ item_id: string;
38
+ item_code: string;
39
+ item_name: string;
40
+ item_barcode: string;
41
+ type: string;
42
+ category_id: string;
43
+ category_name: string;
44
+ price_list_id: string;
45
+ price_list_name: string;
46
+ cost_center_id: string;
47
+ cost_center_code: string;
48
+ cost_center_name: string;
49
+ cost_center_father_code: string;
50
+ cost_center_father_name: string;
51
+ tax_iva_id: string;
52
+ tax_iva_rate: number;
53
+ unit_measure_id: string;
54
+ unit_measure_type: string;
55
+ unit_measure_abbreviation: string;
56
+ unit_measure_name: string;
57
+ unit_measure_quantity: number;
58
+ amount: number;
59
+ price_type_id: string;
60
+ price_type: string;
61
+ price_type_description: string;
62
+ price_base: number;
63
+ total_price: number;
64
+ discount_rate: number;
65
+ unit_discount: number;
66
+ total_discount: number;
67
+ created_user: string;
68
+ created_at: number;
69
+ kit_data: any[];
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
@@ -352,8 +352,6 @@ export declare namespace CbmSalesAccountModel {
352
352
  structured_document_number: string;
353
353
  provider_document_number: string;
354
354
  provider_business_name: string;
355
- collection_origin_name?: string;
356
- collection_origin_id?: string;
357
355
  cost: number;
358
356
  }
359
357
  interface Tax {
@@ -0,0 +1,8 @@
1
+ import { Observable } from 'rxjs';
2
+ import { CbmSalesAccountBillingGroupByOriginModel } from '../models/sales-account-billing-group-by-origin.domain.model';
3
+ import { ICbmSalesAccountBillingGroupByOriginInfrastructureRepository } from '../../infrastructure/repositories/sales-account-billing-group-by-origin.infrastructure.repository';
4
+ export declare class CbmSalesAccountBillingGroupByOriginDomainRepository implements ICbmSalesAccountBillingGroupByOriginInfrastructureRepository {
5
+ private readonly service;
6
+ constructor(service: ICbmSalesAccountBillingGroupByOriginInfrastructureRepository);
7
+ getByOrigin(params: CbmSalesAccountBillingGroupByOriginModel.GetByOriginParams): Observable<CbmSalesAccountBillingGroupByOriginModel.GetByOriginResponse>;
8
+ }
@@ -1,31 +1,37 @@
1
1
  import { OnDestroy } from "@angular/core";
2
- import { Subject } from "rxjs";
2
+ import { Observable, Subject } from "rxjs";
3
3
  import { Router } from "@angular/router";
4
4
  import { UserCalendarModel } from "../models/user-calendar.domain.model";
5
5
  import { UserCalendarDomainRepository } from "../repositories/user-calendar.domain.repository";
6
6
  import { CbmAuthReactiveService } from "./auth-reactive.domain.service";
7
- import { CbmNotificationService } from "./notification/notification.service";
8
7
  export interface AccessControlResult {
9
8
  hasAccess: boolean;
10
9
  message: string;
11
10
  scheduleInfo?: UserCalendarModel.ListResponse.Data;
12
11
  }
12
+ export interface ScheduleExpiryWarning {
13
+ endTime: string;
14
+ minutesRemaining: number;
15
+ remainingSeconds: number;
16
+ schedule: UserCalendarModel.ListResponse.Data;
17
+ }
13
18
  export declare class RefreshSchedulesDomainService implements OnDestroy {
14
19
  private userModel;
15
20
  private router;
16
21
  private authService;
17
- private notificationService;
18
22
  private readonly STORAGE_KEY;
19
23
  private readonly LAST_CHECK_KEY;
20
24
  private readonly CHECK_INTERVAL_MS;
21
25
  private accessCheckSubscription;
22
26
  private isMonitoring;
23
27
  closeInterval$: Subject<void>;
28
+ private readonly scheduleExpiryWarningSubject;
24
29
  private notifiedEndTime;
25
30
  onAccessDenied: () => void;
26
31
  onAccessGranted: (() => void) | null;
27
32
  onAccessStatusChange: ((result: AccessControlResult) => void) | null;
28
- constructor(userModel: UserCalendarDomainRepository, router: Router, authService: CbmAuthReactiveService, notificationService: CbmNotificationService);
33
+ get scheduleExpiryWarning$(): Observable<ScheduleExpiryWarning>;
34
+ constructor(userModel: UserCalendarDomainRepository, router: Router, authService: CbmAuthReactiveService);
29
35
  ngOnDestroy(): void;
30
36
  initUsershecudles(): void;
31
37
  /**
@@ -0,0 +1,5 @@
1
+ import { Observable } from 'rxjs';
2
+ import { CbmSalesAccountBillingGroupByOriginModel } from '../../domain/models/sales-account-billing-group-by-origin.domain.model';
3
+ export interface ICbmSalesAccountBillingGroupByOriginInfrastructureRepository {
4
+ getByOrigin(params: CbmSalesAccountBillingGroupByOriginModel.GetByOriginParams): Observable<CbmSalesAccountBillingGroupByOriginModel.GetByOriginResponse>;
5
+ }
@@ -0,0 +1,10 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { CbmSalesAccountBillingGroupByOriginModel } from '../../domain/models/sales-account-billing-group-by-origin.domain.model';
4
+ import { ICbmSalesAccountBillingGroupByOriginInfrastructureRepository } from '../repositories/sales-account-billing-group-by-origin.infrastructure.repository';
5
+ export declare class CbmSalesAccountBillingGroupByOriginInfrastructureService implements ICbmSalesAccountBillingGroupByOriginInfrastructureRepository {
6
+ private readonly http;
7
+ constructor(http: HttpClient);
8
+ private readonly url;
9
+ getByOrigin(params: CbmSalesAccountBillingGroupByOriginModel.GetByOriginParams): Observable<CbmSalesAccountBillingGroupByOriginModel.GetByOriginResponse>;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cbm-common/cbm-types",
3
- "version": "0.0.280",
3
+ "version": "0.0.282",
4
4
  "main": "index.js",
5
5
  "types": "public-api.d.ts",
6
6
  "exports": {