@placeshakr/config 10.16.0 → 10.17.2-alpha.0

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.
package/src/types.ts CHANGED
@@ -42,7 +42,11 @@ export type ResourceType =
42
42
  | UserNotification
43
43
  | ReceptionVoucher
44
44
  | Provider
45
- | Category;
45
+ | Category
46
+ | OperationCatalog
47
+ | Nomenclature
48
+ | Operation
49
+ | OperationV2
46
50
 
47
51
  /**
48
52
  * Add timestampable behavior to any resource
@@ -172,13 +176,13 @@ export interface Enterprise extends Resource {
172
176
  * Current subscription status
173
177
  */
174
178
  status:
175
- | 'incomplete'
176
- | 'incomplete_expired'
177
- | 'trialing'
178
- | 'active'
179
- | 'past_due'
180
- | 'canceled'
181
- | 'unpaid';
179
+ | 'incomplete'
180
+ | 'incomplete_expired'
181
+ | 'trialing'
182
+ | 'active'
183
+ | 'past_due'
184
+ | 'canceled'
185
+ | 'unpaid';
182
186
 
183
187
  /**
184
188
  * Kind of forfait
@@ -264,13 +268,13 @@ export interface Enterprise extends Resource {
264
268
  * state of subscription
265
269
  */
266
270
  status:
267
- | 'incomplete'
268
- | 'incomplete_expired'
269
- | 'trialing'
270
- | 'active'
271
- | 'past_due'
272
- | 'canceled'
273
- | 'unpaid';
271
+ | 'incomplete'
272
+ | 'incomplete_expired'
273
+ | 'trialing'
274
+ | 'active'
275
+ | 'past_due'
276
+ | 'canceled'
277
+ | 'unpaid';
274
278
  };
275
279
 
276
280
  insurance?: string;
@@ -1659,6 +1663,8 @@ export type BillIssued = Bill & {
1659
1663
  TVA: number;
1660
1664
  // discount value is calculated using: finalHT - HT
1661
1665
  discount?: number;
1666
+ // this value is calculated using adjustments in each element
1667
+ adjustments?: number;
1662
1668
  };
1663
1669
  };
1664
1670
 
@@ -2447,5 +2453,160 @@ export interface Category extends Resource {
2447
2453
 
2448
2454
  export enum CategoryEntityEnum {
2449
2455
  MATERIAL = 'MATERIAL',
2450
- OPERATION = 'OPERATION',
2456
+ OPERATION = 'OPERATION'
2457
+ }
2458
+
2459
+ export interface OperationCatalog extends Resource {
2460
+ name: string,
2461
+ status: boolean,
2462
+ sectors?: Array<{
2463
+ objectID: string,
2464
+ name: string,
2465
+ value: number
2466
+ }>;
2467
+ description?: string;
2468
+ materialsProvider?: Array<string>,
2469
+ image?: File | null
2470
+ }
2471
+
2472
+ export interface Nomenclature extends Resource {
2473
+ name: string,
2474
+ status: boolean,
2475
+ identifier: NomenclaturesIdentifier,
2476
+ color?: string
2477
+ }
2478
+
2479
+ export enum NomenclaturesIdentifier {
2480
+ OPERATIONS_SECTOR = "OPERATIONS_SECTOR",
2481
+ OPERATIONS_PIECE = "OPERATIONS_PIECE",
2482
+ OPERATIONS_LOT = "OPERATIONS_LOT",
2483
+ }
2484
+
2485
+
2486
+ /**
2487
+ * New version of operations with more advanced config
2488
+ */
2489
+ export interface OperationV2 extends Resource {
2490
+ /**
2491
+ * The operation id
2492
+ */
2493
+ objectID?: string;
2494
+
2495
+ /**
2496
+ * The operation name
2497
+ */
2498
+ name: string;
2499
+
2500
+ /**
2501
+ * The operation surface
2502
+ */
2503
+ lot: string;
2504
+
2505
+ /**
2506
+ * The operation unit price
2507
+ */
2508
+ price: number;
2509
+
2510
+ /**
2511
+ * The operation unit
2512
+ */
2513
+ unit: string;
2514
+
2515
+ /**
2516
+ * The operation description
2517
+ */
2518
+ description?: string;
2519
+
2520
+ /**
2521
+ * The materials added by default to the operation
2522
+ */
2523
+ materials?: Material[] | [];
2524
+
2525
+ /**
2526
+ * Number of materials assigned to the operation
2527
+ */
2528
+ numberOfMaterials?: number;
2529
+
2530
+ /**
2531
+ * Used at the moment of copy catalogs from system-operations to the enterprise
2532
+ * to create the relation between operations and system-operations-materials
2533
+ */
2534
+ systemId?: string
2535
+
2536
+ /**
2537
+ *
2538
+ */
2539
+ tva?: number | null
2540
+
2541
+ /**
2542
+ * Used to create relation between operations and his catalog
2543
+ */
2544
+ catalogId: string
2545
+
2546
+ /**
2547
+ * Used in operations page to assign categories
2548
+ */
2549
+ category: string;
2550
+
2551
+ /**
2552
+ * Used to restrict modification in devis page
2553
+ */
2554
+ blockPrice?: boolean;
2555
+
2556
+ /**
2557
+ * Used to restrict modification in devis page
2558
+ */
2559
+ blockTVA?: boolean;
2560
+
2561
+ /**
2562
+ * Quantity
2563
+ */
2564
+ quantity?: OperationQuantityEnum;
2565
+
2566
+ /**
2567
+ * List of rules used to re-calculate the price
2568
+ */
2569
+ adjustments?: Array<OperationAdjustment>
2570
+
2571
+ reserves?: string
2451
2572
  }
2573
+
2574
+ export interface OperationAdjustment {
2575
+ rule: OperationRulesEnum
2576
+ bigger?: number
2577
+ lower?: number
2578
+ equal?: number
2579
+ complement?: string
2580
+ percent: number
2581
+ }
2582
+
2583
+ export enum OperationQuantityEnum {
2584
+ NOT_DEFINED = "NOT_DEFINED",
2585
+ PERIMETER = "PERIMETER",
2586
+ GROUND_CEILING_SURFACE = "GROUND_CEILING_SURFACE",
2587
+ WALL_SURFACE = "WALL_SURFACE",
2588
+ }
2589
+
2590
+ export enum OperationRulesEnum {
2591
+ BIGGER_THAN = "BIGGER_THAN",
2592
+ LOWER_THAN = "LOWER_THAN",
2593
+ EQUAL_TO = "EQUAL_TO",
2594
+ BETWEEN = "BETWEEN"
2595
+ }
2596
+
2597
+ export interface OperationV2Material extends Material {
2598
+ quantity: number
2599
+ loss: number
2600
+ rounded: boolean
2601
+ responsible: string
2602
+ fixed: boolean
2603
+ optId: string
2604
+ }
2605
+
2606
+ export enum MaterialResponsible {
2607
+ CLIENT = "CLIENT",
2608
+ PRO = "PRO",
2609
+ AGENT = "AGENT",
2610
+ SELLER = "SELLER",
2611
+ ENTERPRISE = "ENTERPRISE",
2612
+ }