From 89c6f1d550c6012b5b40b0a6a3445c98623b752e Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 13 Nov 2025 17:14:01 +0100 Subject: [PATCH 001/127] added modalnavbar --- src/app/app.css | 74 ++++++++++++++++------- src/app/app.html | 12 +++- src/app/app.ts | 3 +- src/app/components/modalNav/modalNav.css | 0 src/app/components/modalNav/modalNav.html | 18 ++++++ src/app/components/modalNav/modalNav.ts | 34 +++++++++++ src/app/pages/welcome/welcome.html | 2 +- src/app/pages/welcome/welcome.ts | 7 ++- 8 files changed, 121 insertions(+), 29 deletions(-) create mode 100644 src/app/components/modalNav/modalNav.css create mode 100644 src/app/components/modalNav/modalNav.html create mode 100644 src/app/components/modalNav/modalNav.ts diff --git a/src/app/app.css b/src/app/app.css index 73a1c7e..2c96a5f 100644 --- a/src/app/app.css +++ b/src/app/app.css @@ -1,46 +1,74 @@ :host { - display: flex; + display: flex; } .app-layout { - height: 100vh; + height: 100vh; } .top-nav { - line-height: 64px; + line-height: 64px; } .logo { - float: left; - height: 64px; - padding-right: 24px; - line-height: 64px; - background: #001529; + float: left; + height: 64px; + padding-right: 24px; + line-height: 64px; } .logo img { - display: inline-block; - height: 32px; - width: 32px; - vertical-align: middle; + display: inline-block; + height: 32px; + width: 32px; + vertical-align: middle; } .logo h1 { - display: inline-block; - margin: 0 0 0 15px; - color: #fff; - font-weight: 600; - font-size: 20px; - font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif; - vertical-align: middle; + display: inline-block; + margin: 0 0 0 15px; + color: #fff; + font-weight: 600; + font-size: 20px; + font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif; + vertical-align: middle; } nz-content { - padding: 24px 50px; + padding: 24px 50px; } .inner-content { - padding: 24px; - background: #fff; - height: 100%; + padding: 24px; + background: #fff; + height: 100%; } + +.header-container { + display: flex; + align-items: center; + justify-content: space-between; +} + +.logo { + display: flex; + align-items: center; +} + +.top-nav { + flex: 1; + margin-left: 40px; +} + +.right-icons { + display: flex; + align-items: center; + gap: 20px; + color: #fff; + font-size: 18px; + cursor: pointer; +} + +.right-icons nz-icon:hover { + color: #40a9ff; +} \ No newline at end of file diff --git a/src/app/app.html b/src/app/app.html index 8f2b8dc..8c565bd 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -57,9 +57,15 @@ Utilisateur -
  • -
  • -
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • diff --git a/src/app/app.ts b/src/app/app.ts index fa98bea..555fbd8 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -4,10 +4,11 @@ import { NzLayoutModule } from 'ng-zorro-antd/layout'; import { NzMenuModule } from 'ng-zorro-antd/menu'; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzIconDirective} from "ng-zorro-antd/icon"; +import {ModalNav} from "./components/modalNav/modalNav"; @Component({ selector: 'app-root', - imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzFlexDirective, NzIconDirective, RouterLinkActive, RouterLink], + imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzFlexDirective, NzIconDirective, RouterLinkActive, RouterLink, ModalNav], templateUrl: './app.html', styleUrl: './app.css' }) diff --git a/src/app/components/modalNav/modalNav.css b/src/app/components/modalNav/modalNav.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/modalNav/modalNav.html b/src/app/components/modalNav/modalNav.html new file mode 100644 index 0000000..102ad5c --- /dev/null +++ b/src/app/components/modalNav/modalNav.html @@ -0,0 +1,18 @@ +
    + +
    + + + + + + + + diff --git a/src/app/components/modalNav/modalNav.ts b/src/app/components/modalNav/modalNav.ts new file mode 100644 index 0000000..cb149f5 --- /dev/null +++ b/src/app/components/modalNav/modalNav.ts @@ -0,0 +1,34 @@ +import {Component, Input, input} from '@angular/core'; +import { NzButtonModule } from 'ng-zorro-antd/button'; +import { NzModalModule } from 'ng-zorro-antd/modal'; +import {NzIconDirective} from "ng-zorro-antd/icon"; + +@Component({ + selector: 'app-modalNav', + imports: [NzButtonModule, NzModalModule, NzIconDirective], + templateUrl: 'modalNav.html', + styleUrls: ['./modalNav.css'], +}) +export class ModalNav { + @Input() nameIcon: string = ''; + @Input() name: string = ''; + + isVisible = false; + isOkLoading = false; + + showModal(): void { + this.isVisible = true; + } + + handleOk(): void { + this.isOkLoading = true; + setTimeout(() => { + this.isVisible = false; + this.isOkLoading = false; + }, 1000); + } + + handleCancel(): void { + this.isVisible = false; + } +} diff --git a/src/app/pages/welcome/welcome.html b/src/app/pages/welcome/welcome.html index 608dfe6..12f389f 100644 --- a/src/app/pages/welcome/welcome.html +++ b/src/app/pages/welcome/welcome.html @@ -1 +1 @@ -

    welcome works!

    \ No newline at end of file +

    hello work

    \ No newline at end of file diff --git a/src/app/pages/welcome/welcome.ts b/src/app/pages/welcome/welcome.ts index 92e8bde..6ade90b 100644 --- a/src/app/pages/welcome/welcome.ts +++ b/src/app/pages/welcome/welcome.ts @@ -1,8 +1,13 @@ import { Component } from '@angular/core'; +import {ModalNav} from "../../components/modalNav/modalNav"; +import {NzIconDirective} from "ng-zorro-antd/icon"; @Component({ selector: 'app-welcome', - imports: [], + imports: [ + ModalNav, + NzIconDirective + ], templateUrl: './welcome.html', styleUrl: './welcome.css' }) From c75199b2362806494e9b8be58f1d4a6cc65bb13a Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 13 Nov 2025 18:01:21 +0100 Subject: [PATCH 002/127] first commit --- src/app/pages/stock/stock.html | 5 +++- src/app/pages/stock/stock.ts | 44 ++++++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index a46e7f2..94ddb77 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1 +1,4 @@ -

    stock works!

    + + + + \ No newline at end of file diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 2ab1ba4..0b463bb 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,11 +1,51 @@ import { Component } from '@angular/core'; +import {NzTableComponent} from "ng-zorro-antd/table"; @Component({ selector: 'app-stock', - imports: [], + imports: [ + NzTableComponent + ], templateUrl: './stock.html', styleUrl: './stock.css', }) -export class Stock { +class StockInfo { + id: number; + name: string; + Duration: string; + Caliber: string; + Quantity: number; + Weight: number; + Nec: string; + MinimalQuantity: number; +} + + +export class Stock { + listOfData: StockInfo[] = [ + { + id: 1, + name: 'Stock 1', + Duration: '10 days', + Caliber: '100g', + Quantity: 100, + Weight: 1000, + Nec: '5kg', + MinimalQuantity: 5 + }, + { + id: 2, + name: 'Stock 2', + Duration: '20 days', + Caliber: '200g', + Quantity: 200, + Weight: 2000, + Nec: '10kg', + MinimalQuantity: 10 + } + ]; + delete(){ + return + } } From 3ec512f396690e4d7efada31f2f1195d5ddcdc13 Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 13 Nov 2025 18:08:52 +0100 Subject: [PATCH 003/127] first commit --- src/app/pages/stock/stock.html | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index 94ddb77..3c3eb7b 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,4 +1,25 @@ - - \ No newline at end of file + + Nom + Duration + Caliber + quantity + Weight + Nec + MinimalQuantity + + + + @for (data of basicTable.data; track data) { + + {{data.name}} + {{data.duration}} + {{data.caliber}} + {{data.quantity}} + {{data.weight}} + {{data.nec}} + {{data.minimalQuantity}} + + + \ No newline at end of file From 8d220d60f8865b6d2d22638e49c884c152da0b49 Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 13 Nov 2025 18:36:34 +0100 Subject: [PATCH 004/127] created stock page and stock-table component --- .../compontents/stock-table/stock-table.css | 85 +++++++++++++++++++ .../compontents/stock-table/stock-table.html | 30 +++++++ .../compontents/stock-table/stock-table.ts | 39 +++++++++ src/app/interfaces/stock.interface.ts | 9 ++ src/app/pages/stock/stock.html | 26 +----- src/app/pages/stock/stock.ts | 42 +-------- 6 files changed, 168 insertions(+), 63 deletions(-) create mode 100644 src/app/compontents/stock-table/stock-table.css create mode 100644 src/app/compontents/stock-table/stock-table.html create mode 100644 src/app/compontents/stock-table/stock-table.ts create mode 100644 src/app/interfaces/stock.interface.ts diff --git a/src/app/compontents/stock-table/stock-table.css b/src/app/compontents/stock-table/stock-table.css new file mode 100644 index 0000000..7ae664f --- /dev/null +++ b/src/app/compontents/stock-table/stock-table.css @@ -0,0 +1,85 @@ +/* Table globale */ +nz-table { + width: 100%; + border-collapse: separate; + border-spacing: 0 8px; /* espace entre les lignes */ + background: #fff; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0,0,0,0.1); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +/* En-tête */ +nz-table thead tr { + background-color: #f5f5f5; + text-align: left; + font-weight: 600; + color: #333; + border-bottom: 2px solid #e0e0e0; +} + +nz-table thead th { + padding: 12px 16px; +} + +/* Lignes du tableau */ +nz-table tbody tr { + background-color: #fff; + transition: background 0.2s ease; +} + +nz-table tbody tr:nth-child(even) { + background-color: #f9f9f9; +} + +nz-table tbody tr:hover { + background-color: #e6f7ff; /* survol */ +} + +/* Cellules */ +nz-table tbody td { + padding: 12px 16px; + vertical-align: middle; + color: #444; +} + +/* Boutons */ +nz-table button[nz-button] { + margin-right: 8px; +} + +/* Modals dans le tableau */ +nz-table app-modal { + margin-right: 8px; +} + +/* Dates (pour alignement et style) */ +nz-table tbody td p { + margin: 0; + font-size: 14px; + color: #555; +} + +/* Responsive */ +@media (max-width: 768px) { + nz-table thead { + display: none; + } + nz-table tbody tr { + display: block; + margin-bottom: 16px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + border-radius: 8px; + padding: 12px; + } + nz-table tbody td { + display: flex; + justify-content: space-between; + padding: 6px 12px; + } + nz-table tbody td::before { + content: attr(data-label); + font-weight: 600; + } +} diff --git a/src/app/compontents/stock-table/stock-table.html b/src/app/compontents/stock-table/stock-table.html new file mode 100644 index 0000000..60fd018 --- /dev/null +++ b/src/app/compontents/stock-table/stock-table.html @@ -0,0 +1,30 @@ + + + + Nom + Duration + Caliber + quantity + Weight + Nec + MinimalQuantity + + + + @for (data of basicTable.data; track data) { + + {{data.name}} + {{data.duration}} + {{data.caliber}} + {{data.quantity}} + {{data.weight}} + {{data.nec}} + {{data.minimalQuantity}} + + modifier + + + + } + + diff --git a/src/app/compontents/stock-table/stock-table.ts b/src/app/compontents/stock-table/stock-table.ts new file mode 100644 index 0000000..1cbfd60 --- /dev/null +++ b/src/app/compontents/stock-table/stock-table.ts @@ -0,0 +1,39 @@ +import { Component } from '@angular/core'; +import {StockInfo} from "../../interfaces/stock.interface"; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {NzButtonComponent} from "ng-zorro-antd/button"; + +@Component({ + selector: 'app-stock-table', + imports: [ + NzTableComponent, + NzButtonComponent + ], + templateUrl: './stock-table.html', + styleUrl: './stock-table.css', +}) +export class StockTable { + listOfData: StockInfo[] = [ + { + name: 'Stock 1', + duration: '10 days', + caliber: '100g', + quantity: 100, + weight: 1000, + nec: '5kg', + minimalQuantity: 5 + }, + { + name: 'Stock 2', + duration: '20 days', + caliber: '200g', + quantity: 200, + weight: 2000, + nec: '10kg', + minimalQuantity: 10 + } + ]; + delete(){ + return + } +} diff --git a/src/app/interfaces/stock.interface.ts b/src/app/interfaces/stock.interface.ts new file mode 100644 index 0000000..0a187e6 --- /dev/null +++ b/src/app/interfaces/stock.interface.ts @@ -0,0 +1,9 @@ +export interface StockInfo { + name: string; + duration: string; + caliber: string; + quantity: number; + weight: number; + nec: string; + minimalQuantity: number; +} \ No newline at end of file diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index 3c3eb7b..54ac09a 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,25 +1 @@ - - - - Nom - Duration - Caliber - quantity - Weight - Nec - MinimalQuantity - - - - @for (data of basicTable.data; track data) { - - {{data.name}} - {{data.duration}} - {{data.caliber}} - {{data.quantity}} - {{data.weight}} - {{data.nec}} - {{data.minimalQuantity}} - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 0b463bb..bf301b7 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,51 +1,17 @@ import { Component } from '@angular/core'; import {NzTableComponent} from "ng-zorro-antd/table"; +import {StockTable} from "../../compontents/stock-table/stock-table"; @Component({ selector: 'app-stock', imports: [ - NzTableComponent + NzTableComponent, + StockTable ], templateUrl: './stock.html', styleUrl: './stock.css', }) -class StockInfo { - id: number; - name: string; - Duration: string; - Caliber: string; - Quantity: number; - Weight: number; - Nec: string; - MinimalQuantity: number; -} - - export class Stock { - listOfData: StockInfo[] = [ - { - id: 1, - name: 'Stock 1', - Duration: '10 days', - Caliber: '100g', - Quantity: 100, - Weight: 1000, - Nec: '5kg', - MinimalQuantity: 5 - }, - { - id: 2, - name: 'Stock 2', - Duration: '20 days', - Caliber: '200g', - Quantity: 200, - Weight: 2000, - Nec: '10kg', - MinimalQuantity: 10 - } - ]; - delete(){ - return - } + } From 9f41207d9e3ed25483aee1bb66572aad8428f70a Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 13 Nov 2025 18:45:54 +0100 Subject: [PATCH 005/127] added modal into stock page --- src/app/compontents/stock-table/stock-table.html | 9 +++++++-- src/app/compontents/stock-table/stock-table.ts | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/compontents/stock-table/stock-table.html b/src/app/compontents/stock-table/stock-table.html index 60fd018..1f3da5f 100644 --- a/src/app/compontents/stock-table/stock-table.html +++ b/src/app/compontents/stock-table/stock-table.html @@ -8,6 +8,7 @@ Weight Nec MinimalQuantity + Action @@ -21,8 +22,12 @@ {{data.nec}} {{data.minimalQuantity}} - modifier - +
    + +
    + +
    +
    } diff --git a/src/app/compontents/stock-table/stock-table.ts b/src/app/compontents/stock-table/stock-table.ts index 1cbfd60..7a98249 100644 --- a/src/app/compontents/stock-table/stock-table.ts +++ b/src/app/compontents/stock-table/stock-table.ts @@ -2,12 +2,16 @@ import { Component } from '@angular/core'; import {StockInfo} from "../../interfaces/stock.interface"; import {NzTableComponent} from "ng-zorro-antd/table"; import {NzButtonComponent} from "ng-zorro-antd/button"; +import {ModalNav} from "../../components/modalNav/modalNav"; +import {NzIconDirective} from "ng-zorro-antd/icon"; @Component({ selector: 'app-stock-table', imports: [ NzTableComponent, - NzButtonComponent + NzButtonComponent, + ModalNav, + NzIconDirective ], templateUrl: './stock-table.html', styleUrl: './stock-table.css', From d388ff907dd96beb40175a204b0e61abf79bc869 Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 13 Nov 2025 18:47:33 +0100 Subject: [PATCH 006/127] fix error in all libraries --- src/app/app.ts | 3 +-- src/app/compontents/stock-table/stock-table.ts | 2 -- src/app/pages/stock/stock.ts | 2 -- src/app/pages/welcome/welcome.ts | 5 +---- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/app/app.ts b/src/app/app.ts index 555fbd8..fce0dad 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -2,13 +2,12 @@ import { Component } from '@angular/core'; import {RouterLink, RouterLinkActive, RouterOutlet} from '@angular/router'; import { NzLayoutModule } from 'ng-zorro-antd/layout'; import { NzMenuModule } from 'ng-zorro-antd/menu'; -import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {ModalNav} from "./components/modalNav/modalNav"; @Component({ selector: 'app-root', - imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzFlexDirective, NzIconDirective, RouterLinkActive, RouterLink, ModalNav], + imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav], templateUrl: './app.html', styleUrl: './app.css' }) diff --git a/src/app/compontents/stock-table/stock-table.ts b/src/app/compontents/stock-table/stock-table.ts index 7a98249..c7bc3dc 100644 --- a/src/app/compontents/stock-table/stock-table.ts +++ b/src/app/compontents/stock-table/stock-table.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import {StockInfo} from "../../interfaces/stock.interface"; import {NzTableComponent} from "ng-zorro-antd/table"; -import {NzButtonComponent} from "ng-zorro-antd/button"; import {ModalNav} from "../../components/modalNav/modalNav"; import {NzIconDirective} from "ng-zorro-antd/icon"; @@ -9,7 +8,6 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; selector: 'app-stock-table', imports: [ NzTableComponent, - NzButtonComponent, ModalNav, NzIconDirective ], diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index bf301b7..4e6ca6e 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,11 +1,9 @@ import { Component } from '@angular/core'; -import {NzTableComponent} from "ng-zorro-antd/table"; import {StockTable} from "../../compontents/stock-table/stock-table"; @Component({ selector: 'app-stock', imports: [ - NzTableComponent, StockTable ], templateUrl: './stock.html', diff --git a/src/app/pages/welcome/welcome.ts b/src/app/pages/welcome/welcome.ts index 6ade90b..16d279e 100644 --- a/src/app/pages/welcome/welcome.ts +++ b/src/app/pages/welcome/welcome.ts @@ -4,10 +4,7 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; @Component({ selector: 'app-welcome', - imports: [ - ModalNav, - NzIconDirective - ], + imports: [], templateUrl: './welcome.html', styleUrl: './welcome.css' }) From 0cc5d3b1f16d933df6175dbb1709a58f7a41236c Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 13 Nov 2025 18:40:38 +0100 Subject: [PATCH 007/127] first commit in my home --- package-lock.json | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6867ab2..8f157ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -485,6 +485,7 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -501,6 +502,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -514,6 +516,7 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -546,6 +549,7 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -571,6 +575,7 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -589,6 +594,7 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -611,6 +617,7 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -692,6 +699,7 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1624,6 +1632,7 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -3993,6 +4002,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -4832,6 +4842,7 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -5649,6 +5660,7 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -5936,6 +5948,7 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -7583,6 +7596,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -7621,6 +7635,7 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -8281,7 +8296,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/tuf-js": { "version": "3.1.0", @@ -8319,6 +8335,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8440,6 +8457,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -8810,6 +8828,7 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -8828,7 +8847,8 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT" + "license": "MIT", + "peer": true } } } From 8ef46ef1c8a28ebbdd36c213974cb0c6875cbb9d Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 13 Nov 2025 18:56:30 +0100 Subject: [PATCH 008/127] added stock-form for change minimale quantity --- src/app/components/stock-form/stock-form.css | 0 src/app/components/stock-form/stock-form.html | 12 ++++++ src/app/components/stock-form/stock-form.ts | 38 +++++++++++++++++++ .../stock-table/stock-table.css | 0 .../stock-table/stock-table.html | 4 +- .../stock-table/stock-table.ts | 6 ++- src/app/pages/stock/stock.ts | 4 +- 7 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 src/app/components/stock-form/stock-form.css create mode 100644 src/app/components/stock-form/stock-form.html create mode 100644 src/app/components/stock-form/stock-form.ts rename src/app/{compontents => components}/stock-table/stock-table.css (100%) rename src/app/{compontents => components}/stock-table/stock-table.html (88%) rename src/app/{compontents => components}/stock-table/stock-table.ts (86%) diff --git a/src/app/components/stock-form/stock-form.css b/src/app/components/stock-form/stock-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/stock-form/stock-form.html b/src/app/components/stock-form/stock-form.html new file mode 100644 index 0000000..d9bcb69 --- /dev/null +++ b/src/app/components/stock-form/stock-form.html @@ -0,0 +1,12 @@ +
    + + + + Quantité minimale du produit + + + + + + +
    \ No newline at end of file diff --git a/src/app/components/stock-form/stock-form.ts b/src/app/components/stock-form/stock-form.ts new file mode 100644 index 0000000..c378450 --- /dev/null +++ b/src/app/components/stock-form/stock-form.ts @@ -0,0 +1,38 @@ +import { Component } from '@angular/core'; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; + +@Component({ + selector: 'app-stock-form', + imports: [ + NzFormItemComponent, + NzFormLabelComponent, + NzFormControlComponent, + NzInputDirective, + NzColDirective, + NzFormDirective, + ReactiveFormsModule, + NzFlexDirective + ], + templateUrl: './stock-form.html', + styleUrl: './stock-form.css', +}) +export class StockForm { + stockForm = new FormGroup({ + minQuantity: new FormControl(null, [Validators.required]) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.stockForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.stockForm.getRawValue()) + + // Pour vider le formulaire + this.stockForm.reset() + } +} \ No newline at end of file diff --git a/src/app/compontents/stock-table/stock-table.css b/src/app/components/stock-table/stock-table.css similarity index 100% rename from src/app/compontents/stock-table/stock-table.css rename to src/app/components/stock-table/stock-table.css diff --git a/src/app/compontents/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html similarity index 88% rename from src/app/compontents/stock-table/stock-table.html rename to src/app/components/stock-table/stock-table.html index 1f3da5f..ab29132 100644 --- a/src/app/compontents/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -23,7 +23,9 @@ {{data.minimalQuantity}}
    - + + +
    diff --git a/src/app/compontents/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts similarity index 86% rename from src/app/compontents/stock-table/stock-table.ts rename to src/app/components/stock-table/stock-table.ts index c7bc3dc..2edec1b 100644 --- a/src/app/compontents/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -1,15 +1,17 @@ import { Component } from '@angular/core'; import {StockInfo} from "../../interfaces/stock.interface"; import {NzTableComponent} from "ng-zorro-antd/table"; -import {ModalNav} from "../../components/modalNav/modalNav"; +import {ModalNav} from "../modalNav/modalNav"; import {NzIconDirective} from "ng-zorro-antd/icon"; +import {StockForm} from "../stock-form/stock-form"; @Component({ selector: 'app-stock-table', imports: [ NzTableComponent, ModalNav, - NzIconDirective + NzIconDirective, + StockForm ], templateUrl: './stock-table.html', styleUrl: './stock-table.css', diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 4e6ca6e..829cc3b 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,10 +1,10 @@ import { Component } from '@angular/core'; -import {StockTable} from "../../compontents/stock-table/stock-table"; +import {StockTable} from "../../components/stock-table/stock-table"; @Component({ selector: 'app-stock', imports: [ - StockTable + StockTable, ], templateUrl: './stock.html', styleUrl: './stock.css', From b499b2b56029a45e43852a5575b307ea11ee0ff9 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 13 Nov 2025 19:02:17 +0100 Subject: [PATCH 009/127] fixed errors on stock-form --- src/app/app.ts | 2 +- .../{modalNav/modalNav.css => modal-nav/modal-nav.css} | 0 .../{modalNav/modalNav.html => modal-nav/modal-nav.html} | 0 .../{modalNav/modalNav.ts => modal-nav/modal-nav.ts} | 6 +++--- src/app/components/stock-table/stock-table.html | 4 ++-- src/app/components/stock-table/stock-table.ts | 2 +- src/app/pages/welcome/welcome.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) rename src/app/components/{modalNav/modalNav.css => modal-nav/modal-nav.css} (100%) rename src/app/components/{modalNav/modalNav.html => modal-nav/modal-nav.html} (100%) rename src/app/components/{modalNav/modalNav.ts => modal-nav/modal-nav.ts} (88%) diff --git a/src/app/app.ts b/src/app/app.ts index fce0dad..a71301c 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -3,7 +3,7 @@ import {RouterLink, RouterLinkActive, RouterOutlet} from '@angular/router'; import { NzLayoutModule } from 'ng-zorro-antd/layout'; import { NzMenuModule } from 'ng-zorro-antd/menu'; import {NzIconDirective} from "ng-zorro-antd/icon"; -import {ModalNav} from "./components/modalNav/modalNav"; +import {ModalNav} from "./components/modal-nav/modal-nav"; @Component({ selector: 'app-root', diff --git a/src/app/components/modalNav/modalNav.css b/src/app/components/modal-nav/modal-nav.css similarity index 100% rename from src/app/components/modalNav/modalNav.css rename to src/app/components/modal-nav/modal-nav.css diff --git a/src/app/components/modalNav/modalNav.html b/src/app/components/modal-nav/modal-nav.html similarity index 100% rename from src/app/components/modalNav/modalNav.html rename to src/app/components/modal-nav/modal-nav.html diff --git a/src/app/components/modalNav/modalNav.ts b/src/app/components/modal-nav/modal-nav.ts similarity index 88% rename from src/app/components/modalNav/modalNav.ts rename to src/app/components/modal-nav/modal-nav.ts index cb149f5..32f9d6d 100644 --- a/src/app/components/modalNav/modalNav.ts +++ b/src/app/components/modal-nav/modal-nav.ts @@ -4,10 +4,10 @@ import { NzModalModule } from 'ng-zorro-antd/modal'; import {NzIconDirective} from "ng-zorro-antd/icon"; @Component({ - selector: 'app-modalNav', + selector: 'app-modal-nav', imports: [NzButtonModule, NzModalModule, NzIconDirective], - templateUrl: 'modalNav.html', - styleUrls: ['./modalNav.css'], + templateUrl: 'modal-nav.html', + styleUrls: ['./modal-nav.css'], }) export class ModalNav { @Input() nameIcon: string = ''; diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index ab29132..2cf3c02 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -23,9 +23,9 @@ {{data.minimalQuantity}}
    - + - +
    diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index 2edec1b..ee6c0f6 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import {StockInfo} from "../../interfaces/stock.interface"; import {NzTableComponent} from "ng-zorro-antd/table"; -import {ModalNav} from "../modalNav/modalNav"; +import {ModalNav} from "../modal-nav/modal-nav"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {StockForm} from "../stock-form/stock-form"; diff --git a/src/app/pages/welcome/welcome.ts b/src/app/pages/welcome/welcome.ts index 16d279e..138646b 100644 --- a/src/app/pages/welcome/welcome.ts +++ b/src/app/pages/welcome/welcome.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import {ModalNav} from "../../components/modalNav/modalNav"; +import {ModalNav} from "../../components/modal-nav/modal-nav"; import {NzIconDirective} from "ng-zorro-antd/icon"; @Component({ From d875eab44682913f194c6320f27136136a66cbc1 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 13 Nov 2025 19:13:04 +0100 Subject: [PATCH 010/127] added new style from website --- src/app/app.css | 123 +++++++++++++++++++++++++++-------------- src/app/app.html | 140 +++++++++++++++++++++++++---------------------- 2 files changed, 155 insertions(+), 108 deletions(-) diff --git a/src/app/app.css b/src/app/app.css index 2c96a5f..a10b710 100644 --- a/src/app/app.css +++ b/src/app/app.css @@ -6,60 +6,83 @@ height: 100vh; } -.top-nav { - line-height: 64px; -} - -.logo { - float: left; - height: 64px; - padding-right: 24px; - line-height: 64px; -} - -.logo img { - display: inline-block; - height: 32px; - width: 32px; - vertical-align: middle; -} - -.logo h1 { - display: inline-block; - margin: 0 0 0 15px; - color: #fff; - font-weight: 600; - font-size: 20px; - font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif; - vertical-align: middle; -} - -nz-content { - padding: 24px 50px; -} - -.inner-content { - padding: 24px; - background: #fff; - height: 100%; +nz-header { + display: flex; + align-items: center; + background: #001529; + padding: 0 24px; } .header-container { display: flex; align-items: center; justify-content: space-between; + width: 100%; } +/* --- LOGO + TITRE --- */ .logo { display: flex; align-items: center; } -.top-nav { - flex: 1; - margin-left: 40px; +.logo a { + display: flex; + align-items: center; + text-decoration: none; } +.logo img { + height: 40px; + width: auto; +} + +.logo h1 { + margin: 0 0 0 10px; + color: #fff; + font-weight: 600; + font-size: 20px; + font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; +} + +/* --- MENU PRINCIPAL --- */ +.top-nav { + flex: 1; + margin: 0 40px; + line-height: 64px; + background: #001529; + border: none; +} + +/* Couleur grise par défaut + effet blanc et zoom au survol */ +.top-nav li { + transition: transform 0.2s ease, color 0.2s ease; +} + +.top-nav li a { + color: #bfbfbf !important; /* gris clair par défaut */ + transition: transform 0.2s ease, color 0.2s ease; +} + +/* Au survol → zoom + blanc pur */ +.top-nav li:hover { + transform: scale(1.08); + background: transparent !important; + color: #fff !important; +} + +.top-nav li:hover a { + color: #ffffff !important; +} + +/* Supprime toute coloration bleue ou fond par défaut NG-ZORRO */ +.top-nav li.ant-menu-item-active, +.top-nav li.ant-menu-item-selected { + background: transparent !important; + color: #fff !important; +} + +/* --- ICONES DROITES --- */ .right-icons { display: flex; align-items: center; @@ -69,6 +92,22 @@ nz-content { cursor: pointer; } -.right-icons nz-icon:hover { - color: #40a9ff; -} \ No newline at end of file +.right-icons app-modal-nav { + transition: transform 0.2s ease, color 0.2s ease; +} + +.right-icons app-modal-nav:hover { + color: #40a9ff; /* survol bleu clair uniquement pour les icônes */ + transform: scale(1.2); +} + +/* --- CONTENU --- */ +nz-content { + padding: 24px 50px; +} + +.inner-content { + padding: 24px; + background: #fff; + height: 100%; +} diff --git a/src/app/app.html b/src/app/app.html index 8c565bd..2136269 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -1,73 +1,81 @@ - -
    +
    {{ getInitial(data.name) }}
    -

    {{data.name}}

    -

    {{data.email}}

    -

    {{data.fonction}}

    +

    {{data.name}}

    +

    {{data.email}}

    +

    {{data.fonction}}

    diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 6b41a86..f1e1579 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -26,6 +26,7 @@ +
    diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index 8df7f6f..0b84e8c 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -4,6 +4,7 @@ import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalNav} from "../modal-nav/modal-nav"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {StockForm} from "../stock-form/stock-form"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; @Component({ selector: 'app-stock-table', @@ -11,7 +12,8 @@ import {StockForm} from "../stock-form/stock-form"; NzTableComponent, ModalNav, NzIconDirective, - StockForm + StockForm, + NzDividerComponent ], templateUrl: './stock-table.html', styleUrl: './stock-table.css', diff --git a/src/app/components/user-table/user-table.html b/src/app/components/user-table/user-table.html index fe6993c..d4107b9 100644 --- a/src/app/components/user-table/user-table.html +++ b/src/app/components/user-table/user-table.html @@ -18,6 +18,7 @@ +
    diff --git a/src/app/components/user-table/user-table.ts b/src/app/components/user-table/user-table.ts index 5bb28c4..a086c3f 100644 --- a/src/app/components/user-table/user-table.ts +++ b/src/app/components/user-table/user-table.ts @@ -5,6 +5,7 @@ import {NzTableComponent} from "ng-zorro-antd/table"; import {StockForm} from "../stock-form/stock-form"; import {UserInfo} from "../../interfaces/user.interface"; import {ProfilForm} from "../profil-form/profil-form"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; @Component({ selector: 'app-user-table', @@ -12,7 +13,8 @@ import {ProfilForm} from "../profil-form/profil-form"; ModalNav, NzIconDirective, NzTableComponent, - ProfilForm + ProfilForm, + NzDividerComponent ], templateUrl: './user-table.html', styleUrl: './user-table.css', diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index d52f26a..0ce699e 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -2,6 +2,6 @@ -
    +
    From e744a50923f019f6f3c3668317ec34763c9fa2b2 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 14 Nov 2025 11:19:16 +0100 Subject: [PATCH 015/127] added all interfaces necessary from project --- src/app/components/stock-table/stock-table.html | 4 ++-- src/app/components/user-table/user-table.html | 4 ++-- src/app/interfaces/deliverer.interface.ts | 6 ++++++ src/app/interfaces/delivery-note.interface.ts | 10 ++++++++++ src/app/interfaces/product-delivery.interface.ts | 6 ++++++ src/app/interfaces/product-order.interface.ts | 5 +++++ src/app/interfaces/product.interface.ts | 12 ++++++++++++ src/app/interfaces/purchase-order.interface.ts | 8 ++++++++ src/app/interfaces/quotation.interface.ts | 9 +++++++++ src/app/interfaces/supplier.interface.ts | 12 ++++++++++++ 10 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 src/app/interfaces/deliverer.interface.ts create mode 100644 src/app/interfaces/delivery-note.interface.ts create mode 100644 src/app/interfaces/product-delivery.interface.ts create mode 100644 src/app/interfaces/product-order.interface.ts create mode 100644 src/app/interfaces/product.interface.ts create mode 100644 src/app/interfaces/purchase-order.interface.ts create mode 100644 src/app/interfaces/quotation.interface.ts create mode 100644 src/app/interfaces/supplier.interface.ts diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index f1e1579..da042e9 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -8,7 +8,7 @@ Durée Quantité Limite - Action + Action @@ -22,7 +22,7 @@ {{data.quantity}} {{data.minimalQuantity}} -
    +
    diff --git a/src/app/components/user-table/user-table.html b/src/app/components/user-table/user-table.html index d4107b9..f977771 100644 --- a/src/app/components/user-table/user-table.html +++ b/src/app/components/user-table/user-table.html @@ -4,7 +4,7 @@ Nom Email Fonction - Action + Action @@ -14,7 +14,7 @@ {{data.email}} {{data.fonction}} -
    +
    diff --git a/src/app/interfaces/deliverer.interface.ts b/src/app/interfaces/deliverer.interface.ts new file mode 100644 index 0000000..d5222fd --- /dev/null +++ b/src/app/interfaces/deliverer.interface.ts @@ -0,0 +1,6 @@ +import {DeliveryNoteInfo} from "./delivery-note.interface"; + +export interface DelivererInfo { + transporter: string; + deliveryNote: DeliveryNoteInfo[]; +} \ No newline at end of file diff --git a/src/app/interfaces/delivery-note.interface.ts b/src/app/interfaces/delivery-note.interface.ts new file mode 100644 index 0000000..88610e0 --- /dev/null +++ b/src/app/interfaces/delivery-note.interface.ts @@ -0,0 +1,10 @@ +import {productDeliveryInfo} from "./product-delivery.interface"; + +export interface DeliveryNoteInfo { + trackingNumber: string; + deliverer: string; + estimateDeliveryDate: Date; + expeditionDate: Date; + realDeliveryDate: Date; + productDelivery: productDeliveryInfo[]; +} \ No newline at end of file diff --git a/src/app/interfaces/product-delivery.interface.ts b/src/app/interfaces/product-delivery.interface.ts new file mode 100644 index 0000000..7b0b2e4 --- /dev/null +++ b/src/app/interfaces/product-delivery.interface.ts @@ -0,0 +1,6 @@ +import {ProductInfo} from "./product.interface"; + +export interface productDeliveryInfo { + product: ProductInfo[]; + quantity: number; +} \ No newline at end of file diff --git a/src/app/interfaces/product-order.interface.ts b/src/app/interfaces/product-order.interface.ts new file mode 100644 index 0000000..fa1ad78 --- /dev/null +++ b/src/app/interfaces/product-order.interface.ts @@ -0,0 +1,5 @@ +export interface ProductOrderInfo { + product: string; + quantity: number; + price: number; +} \ No newline at end of file diff --git a/src/app/interfaces/product.interface.ts b/src/app/interfaces/product.interface.ts new file mode 100644 index 0000000..ddae39f --- /dev/null +++ b/src/app/interfaces/product.interface.ts @@ -0,0 +1,12 @@ +export interface ProductInfo { + reference: string; + name: string; + duration: number; + caliber: string; + approvalNumber: string; + weight: number; + nec: number; + image: string; + link: string; + minimalQuantity: number; +} \ No newline at end of file diff --git a/src/app/interfaces/purchase-order.interface.ts b/src/app/interfaces/purchase-order.interface.ts new file mode 100644 index 0000000..326ba11 --- /dev/null +++ b/src/app/interfaces/purchase-order.interface.ts @@ -0,0 +1,8 @@ +import {ProductOrderInfo} from "./product-order.interface"; +import {SupplierInfo} from "./supplier.interface"; + +export interface PurchaseOrderInfo { + purchaseCondition: string; + productOrder: ProductOrderInfo[]; + supplier: SupplierInfo[] +} \ No newline at end of file diff --git a/src/app/interfaces/quotation.interface.ts b/src/app/interfaces/quotation.interface.ts new file mode 100644 index 0000000..69b8ff2 --- /dev/null +++ b/src/app/interfaces/quotation.interface.ts @@ -0,0 +1,9 @@ +import {ProductOrderInfo} from "./product-order.interface"; +import {SupplierInfo} from "./supplier.interface"; + +export interface QuotationInfo { + saleCondition: string; + message: string; + productOrder: ProductOrderInfo[]; + supplier: SupplierInfo[] +} \ No newline at end of file diff --git a/src/app/interfaces/supplier.interface.ts b/src/app/interfaces/supplier.interface.ts new file mode 100644 index 0000000..e769a0c --- /dev/null +++ b/src/app/interfaces/supplier.interface.ts @@ -0,0 +1,12 @@ +import {ProductInfo} from "./product.interface"; + +export interface SupplierInfo { + name: string; + email: string; + phone: string; + address: string; + zipCode: string; + city: string; + deliveryDelay: number; + product: ProductInfo[]; +} \ No newline at end of file From 3b7f55f84cc251ca68c7c197d12eaa5ae52e3d71 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 13:25:37 +0100 Subject: [PATCH 016/127] first commit --- package-lock.json | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b312286..eb02be1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -499,6 +499,7 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -515,6 +516,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -528,6 +530,7 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -560,6 +563,7 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -585,6 +589,7 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -603,6 +608,7 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -625,6 +631,7 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -706,6 +713,7 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1638,6 +1646,7 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -4020,6 +4029,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -4859,6 +4869,7 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -5676,6 +5687,7 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -5963,6 +5975,7 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -7610,6 +7623,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -7648,6 +7662,7 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -8308,7 +8323,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/tuf-js": { "version": "3.1.0", @@ -8346,6 +8362,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8467,6 +8484,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -8837,6 +8855,7 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -8855,7 +8874,8 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT" + "license": "MIT", + "peer": true } } } From 0a7ffe70a0f803a8c4b7e176f4cd40150605bbe6 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 14:00:24 +0100 Subject: [PATCH 017/127] fix error on all interfaces --- src/app/interfaces/delivery-note.interface.ts | 1 + src/app/interfaces/product-delivery.interface.ts | 2 +- src/app/interfaces/product-order.interface.ts | 4 +++- src/app/interfaces/product.interface.ts | 1 + src/app/interfaces/purchase-order.interface.ts | 2 +- src/app/interfaces/quotation.interface.ts | 2 +- src/app/interfaces/stock.interface.ts | 9 +++------ src/app/interfaces/supplier.interface.ts | 2 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/app/interfaces/delivery-note.interface.ts b/src/app/interfaces/delivery-note.interface.ts index 88610e0..808567c 100644 --- a/src/app/interfaces/delivery-note.interface.ts +++ b/src/app/interfaces/delivery-note.interface.ts @@ -1,4 +1,5 @@ import {productDeliveryInfo} from "./product-delivery.interface"; +import {DelivererInfo} from "./deliverer.interface"; export interface DeliveryNoteInfo { trackingNumber: string; diff --git a/src/app/interfaces/product-delivery.interface.ts b/src/app/interfaces/product-delivery.interface.ts index 7b0b2e4..050a5b7 100644 --- a/src/app/interfaces/product-delivery.interface.ts +++ b/src/app/interfaces/product-delivery.interface.ts @@ -1,6 +1,6 @@ import {ProductInfo} from "./product.interface"; export interface productDeliveryInfo { - product: ProductInfo[]; + product: ProductInfo; quantity: number; } \ No newline at end of file diff --git a/src/app/interfaces/product-order.interface.ts b/src/app/interfaces/product-order.interface.ts index fa1ad78..13bcf8c 100644 --- a/src/app/interfaces/product-order.interface.ts +++ b/src/app/interfaces/product-order.interface.ts @@ -1,5 +1,7 @@ +import {ProductInfo} from "./product.interface"; + export interface ProductOrderInfo { - product: string; + product: ProductInfo; quantity: number; price: number; } \ No newline at end of file diff --git a/src/app/interfaces/product.interface.ts b/src/app/interfaces/product.interface.ts index ddae39f..99354ff 100644 --- a/src/app/interfaces/product.interface.ts +++ b/src/app/interfaces/product.interface.ts @@ -1,6 +1,7 @@ export interface ProductInfo { reference: string; name: string; + supplier: number[]; duration: number; caliber: string; approvalNumber: string; diff --git a/src/app/interfaces/purchase-order.interface.ts b/src/app/interfaces/purchase-order.interface.ts index 326ba11..bb9a995 100644 --- a/src/app/interfaces/purchase-order.interface.ts +++ b/src/app/interfaces/purchase-order.interface.ts @@ -4,5 +4,5 @@ import {SupplierInfo} from "./supplier.interface"; export interface PurchaseOrderInfo { purchaseCondition: string; productOrder: ProductOrderInfo[]; - supplier: SupplierInfo[] + supplier: SupplierInfo; } \ No newline at end of file diff --git a/src/app/interfaces/quotation.interface.ts b/src/app/interfaces/quotation.interface.ts index 69b8ff2..1d8c87e 100644 --- a/src/app/interfaces/quotation.interface.ts +++ b/src/app/interfaces/quotation.interface.ts @@ -5,5 +5,5 @@ export interface QuotationInfo { saleCondition: string; message: string; productOrder: ProductOrderInfo[]; - supplier: SupplierInfo[] + supplier: SupplierInfo; } \ No newline at end of file diff --git a/src/app/interfaces/stock.interface.ts b/src/app/interfaces/stock.interface.ts index 3e067fb..f21c99f 100644 --- a/src/app/interfaces/stock.interface.ts +++ b/src/app/interfaces/stock.interface.ts @@ -1,9 +1,6 @@ +import {ProductInfo} from "./product.interface"; + export interface StockInfo { - name: string; - nec: string; - caliber: string; - weight: number; - duration: string; + product: ProductInfo; quantity: number; - minimalQuantity: number; } \ No newline at end of file diff --git a/src/app/interfaces/supplier.interface.ts b/src/app/interfaces/supplier.interface.ts index e769a0c..1949a51 100644 --- a/src/app/interfaces/supplier.interface.ts +++ b/src/app/interfaces/supplier.interface.ts @@ -8,5 +8,5 @@ export interface SupplierInfo { zipCode: string; city: string; deliveryDelay: number; - product: ProductInfo[]; + products: ProductInfo[]; } \ No newline at end of file From 4037117ad33835c0753c2553d57bc9508968ac30 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 14:16:41 +0100 Subject: [PATCH 018/127] added static const for all informations of product in stock --- .../product-table/product-table.css | 0 .../product-table/product-table.html | 1 + .../components/product-table/product-table.ts | 43 +++++++++++++ .../components/stock-table/stock-table.html | 14 +++-- src/app/components/stock-table/stock-table.ts | 61 ++++++++++--------- 5 files changed, 83 insertions(+), 36 deletions(-) create mode 100644 src/app/components/product-table/product-table.css create mode 100644 src/app/components/product-table/product-table.html create mode 100644 src/app/components/product-table/product-table.ts diff --git a/src/app/components/product-table/product-table.css b/src/app/components/product-table/product-table.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/product-table/product-table.html b/src/app/components/product-table/product-table.html new file mode 100644 index 0000000..78cb7a1 --- /dev/null +++ b/src/app/components/product-table/product-table.html @@ -0,0 +1 @@ +

    product-table works!

    diff --git a/src/app/components/product-table/product-table.ts b/src/app/components/product-table/product-table.ts new file mode 100644 index 0000000..0068b3b --- /dev/null +++ b/src/app/components/product-table/product-table.ts @@ -0,0 +1,43 @@ +import { Component } from '@angular/core'; +import {ProductInfo} from "../../interfaces/product.interface"; + +@Component({ + selector: 'app-product-table', + imports: [], + templateUrl: './product-table.html', + styleUrl: './product-table.css', +}) +export class ProductTable { + static listOfProducts: ProductInfo[] = [ + { reference: 'REF-1000', name: 'Produit 1', supplier: [1,2], duration: 12, caliber: 'A', approvalNumber: 'APP-2000', weight: 10, nec: 5000, image: 'https://picsum.photos/200/200?random=1', link: 'https://example.com/product/1', minimalQuantity: 5 }, + { reference: 'REF-1001', name: 'Produit 2', supplier: [2,3], duration: 15, caliber: 'B', approvalNumber: 'APP-2001', weight: 12, nec: 5001, image: 'https://picsum.photos/200/200?random=2', link: 'https://example.com/product/2', minimalQuantity: 8 }, + { reference: 'REF-1002', name: 'Produit 3', supplier: [3,4], duration: 10, caliber: 'C', approvalNumber: 'APP-2002', weight: 8, nec: 5002, image: 'https://picsum.photos/200/200?random=3', link: 'https://example.com/product/3', minimalQuantity: 6 }, + { reference: 'REF-1003', name: 'Produit 4', supplier: [1,5], duration: 20, caliber: 'A', approvalNumber: 'APP-2003', weight: 15, nec: 5003, image: 'https://picsum.photos/200/200?random=4', link: 'https://example.com/product/4', minimalQuantity: 7 }, + { reference: 'REF-1004', name: 'Produit 5', supplier: [2,6], duration: 18, caliber: 'B', approvalNumber: 'APP-2004', weight: 14, nec: 5004, image: 'https://picsum.photos/200/200?random=5', link: 'https://example.com/product/5', minimalQuantity: 5 }, + { reference: 'REF-1005', name: 'Produit 6', supplier: [3,7], duration: 22, caliber: 'C', approvalNumber: 'APP-2005', weight: 16, nec: 5005, image: 'https://picsum.photos/200/200?random=6', link: 'https://example.com/product/6', minimalQuantity: 9 }, + { reference: 'REF-1006', name: 'Produit 7', supplier: [4,8], duration: 17, caliber: 'A', approvalNumber: 'APP-2006', weight: 13, nec: 5006, image: 'https://picsum.photos/200/200?random=7', link: 'https://example.com/product/7', minimalQuantity: 6 }, + { reference: 'REF-1007', name: 'Produit 8', supplier: [5,9], duration: 14, caliber: 'B', approvalNumber: 'APP-2007', weight: 11, nec: 5007, image: 'https://picsum.photos/200/200?random=8', link: 'https://example.com/product/8', minimalQuantity: 8 }, + { reference: 'REF-1008', name: 'Produit 9', supplier: [6,10], duration: 19, caliber: 'C', approvalNumber: 'APP-2008', weight: 17, nec: 5008, image: 'https://picsum.photos/200/200?random=9', link: 'https://example.com/product/9', minimalQuantity: 7 }, + { reference: 'REF-1009', name: 'Produit 10', supplier: [1,2], duration: 21, caliber: 'A', approvalNumber: 'APP-2009', weight: 18, nec: 5009, image: 'https://picsum.photos/200/200?random=10', link: 'https://example.com/product/10', minimalQuantity: 6 }, + { reference: 'REF-1010', name: 'Produit 11', supplier: [2,3], duration: 13, caliber: 'B', approvalNumber: 'APP-2010', weight: 12, nec: 5010, image: 'https://picsum.photos/200/200?random=11', link: 'https://example.com/product/11', minimalQuantity: 5 }, + { reference: 'REF-1011', name: 'Produit 12', supplier: [3,4], duration: 16, caliber: 'C', approvalNumber: 'APP-2011', weight: 14, nec: 5011, image: 'https://picsum.photos/200/200?random=12', link: 'https://example.com/product/12', minimalQuantity: 7 }, + { reference: 'REF-1012', name: 'Produit 13', supplier: [1,5], duration: 20, caliber: 'A', approvalNumber: 'APP-2012', weight: 15, nec: 5012, image: 'https://picsum.photos/200/200?random=13', link: 'https://example.com/product/13', minimalQuantity: 6 }, + { reference: 'REF-1013', name: 'Produit 14', supplier: [2,6], duration: 11, caliber: 'B', approvalNumber: 'APP-2013', weight: 10, nec: 5013, image: 'https://picsum.photos/200/200?random=14', link: 'https://example.com/product/14', minimalQuantity: 9 }, + { reference: 'REF-1014', name: 'Produit 15', supplier: [3,7], duration: 18, caliber: 'C', approvalNumber: 'APP-2014', weight: 16, nec: 5014, image: 'https://picsum.photos/200/200?random=15', link: 'https://example.com/product/15', minimalQuantity: 8 }, + { reference: 'REF-1015', name: 'Produit 16', supplier: [4,8], duration: 17, caliber: 'A', approvalNumber: 'APP-2015', weight: 13, nec: 5015, image: 'https://picsum.photos/200/200?random=16', link: 'https://example.com/product/16', minimalQuantity: 5 }, + { reference: 'REF-1016', name: 'Produit 17', supplier: [5,9], duration: 14, caliber: 'B', approvalNumber: 'APP-2016', weight: 11, nec: 5016, image: 'https://picsum.photos/200/200?random=17', link: 'https://example.com/product/17', minimalQuantity: 6 }, + { reference: 'REF-1017', name: 'Produit 18', supplier: [6,10], duration: 22, caliber: 'C', approvalNumber: 'APP-2017', weight: 17, nec: 5017, image: 'https://picsum.photos/200/200?random=18', link: 'https://example.com/product/18', minimalQuantity: 7 }, + { reference: 'REF-1018', name: 'Produit 19', supplier: [1,2], duration: 19, caliber: 'A', approvalNumber: 'APP-2018', weight: 15, nec: 5018, image: 'https://picsum.photos/200/200?random=19', link: 'https://example.com/product/19', minimalQuantity: 6 }, + { reference: 'REF-1019', name: 'Produit 20', supplier: [2,3], duration: 16, caliber: 'B', approvalNumber: 'APP-2019', weight: 14, nec: 5019, image: 'https://picsum.photos/200/200?random=20', link: 'https://example.com/product/20', minimalQuantity: 5 }, + { reference: 'REF-1020', name: 'Produit 21', supplier: [3,4], duration: 21, caliber: 'C', approvalNumber: 'APP-2020', weight: 18, nec: 5020, image: 'https://picsum.photos/200/200?random=21', link: 'https://example.com/product/21', minimalQuantity: 7 }, + { reference: 'REF-1021', name: 'Produit 22', supplier: [1,5], duration: 15, caliber: 'A', approvalNumber: 'APP-2021', weight: 12, nec: 5021, image: 'https://picsum.photos/200/200?random=22', link: 'https://example.com/product/22', minimalQuantity: 8 }, + { reference: 'REF-1022', name: 'Produit 23', supplier: [2,6], duration: 13, caliber: 'B', approvalNumber: 'APP-2022', weight: 11, nec: 5022, image: 'https://picsum.photos/200/200?random=23', link: 'https://example.com/product/23', minimalQuantity: 6 }, + { reference: 'REF-1023', name: 'Produit 24', supplier: [3,7], duration: 12, caliber: 'C', approvalNumber: 'APP-2023', weight: 10, nec: 5023, image: 'https://picsum.photos/200/200?random=24', link: 'https://example.com/product/24', minimalQuantity: 9 }, + { reference: 'REF-1024', name: 'Produit 25', supplier: [4,8], duration: 17, caliber: 'A', approvalNumber: 'APP-2024', weight: 13, nec: 5024, image: 'https://picsum.photos/200/200?random=25', link: 'https://example.com/product/25', minimalQuantity: 7 }, + { reference: 'REF-1025', name: 'Produit 26', supplier: [5,9], duration: 18, caliber: 'B', approvalNumber: 'APP-2025', weight: 14, nec: 5025, image: 'https://picsum.photos/200/200?random=26', link: 'https://example.com/product/26', minimalQuantity: 6 }, + { reference: 'REF-1026', name: 'Produit 27', supplier: [6,10], duration: 20, caliber: 'C', approvalNumber: 'APP-2026', weight: 16, nec: 5026, image: 'https://picsum.photos/200/200?random=27', link: 'https://example.com/product/27', minimalQuantity: 5 }, + { reference: 'REF-1027', name: 'Produit 28', supplier: [1,2], duration: 15, caliber: 'A', approvalNumber: 'APP-2027', weight: 12, nec: 5027, image: 'https://picsum.photos/200/200?random=28', link: 'https://example.com/product/28', minimalQuantity: 8 }, + { reference: 'REF-1028', name: 'Produit 29', supplier: [2,3], duration: 14, caliber: 'B', approvalNumber: 'APP-2028', weight: 11, nec: 5028, image: 'https://picsum.photos/200/200?random=29', link: 'https://example.com/product/29', minimalQuantity: 7 }, + { reference: 'REF-1029', name: 'Produit 30', supplier: [3,4], duration: 19, caliber: 'C', approvalNumber: 'APP-2029', weight: 17, nec: 5029, image: 'https://picsum.photos/200/200?random=30', link: 'https://example.com/product/30', minimalQuantity: 6 }, + ]; +} diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index da042e9..5fefbce 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -2,6 +2,7 @@ Nom + Réference Nec Calibre Poid @@ -14,13 +15,14 @@ @for (data of basicTable.data; track data) { - {{data.name}} - {{data.nec}} - {{data.caliber}} - {{data.weight}} - {{data.duration}} + {{data.product.name}} + {{data.product.reference}} + {{data.product.nec}} + {{data.product.caliber}} + {{data.product.weight}} + {{data.product.duration}} {{data.quantity}} - {{data.minimalQuantity}} + {{data.product.minimalQuantity}}
    diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index 0b84e8c..65bda28 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -5,6 +5,7 @@ import {ModalNav} from "../modal-nav/modal-nav"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {StockForm} from "../stock-form/stock-form"; import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {ProductTable} from "../product-table/product-table"; @Component({ selector: 'app-stock-table', @@ -20,36 +21,36 @@ import {NzDividerComponent} from "ng-zorro-antd/divider"; }) export class StockTable { listOfData: StockInfo[] = [ - { name: 'Stock 1', duration: '10 days', caliber: '100g', quantity: 100, weight: 1000, nec: '5kg', minimalQuantity: 5 }, - { name: 'Stock 2', duration: '20 days', caliber: '200g', quantity: 200, weight: 2000, nec: '10kg', minimalQuantity: 10 }, - { name: 'Stock 3', duration: '15 days', caliber: '150g', quantity: 150, weight: 1500, nec: '7.5kg', minimalQuantity: 7 }, - { name: 'Stock 4', duration: '12 days', caliber: '120g', quantity: 120, weight: 1200, nec: '6kg', minimalQuantity: 6 }, - { name: 'Stock 5', duration: '18 days', caliber: '180g', quantity: 180, weight: 1800, nec: '9kg', minimalQuantity: 9 }, - { name: 'Stock 6', duration: '22 days', caliber: '220g', quantity: 220, weight: 2200, nec: '11kg', minimalQuantity: 11 }, - { name: 'Stock 7', duration: '8 days', caliber: '80g', quantity: 80, weight: 800, nec: '4kg', minimalQuantity: 4 }, - { name: 'Stock 8', duration: '25 days', caliber: '250g', quantity: 250, weight: 2500, nec: '12.5kg', minimalQuantity: 12 }, - { name: 'Stock 9', duration: '14 days', caliber: '140g', quantity: 140, weight: 1400, nec: '7kg', minimalQuantity: 7 }, - { name: 'Stock 10', duration: '16 days', caliber: '160g', quantity: 160, weight: 1600, nec: '8kg', minimalQuantity: 8 }, - { name: 'Stock 11', duration: '11 days', caliber: '110g', quantity: 110, weight: 1100, nec: '5.5kg', minimalQuantity: 5 }, - { name: 'Stock 12', duration: '19 days', caliber: '190g', quantity: 190, weight: 1900, nec: '9.5kg', minimalQuantity: 9 }, - { name: 'Stock 13', duration: '13 days', caliber: '130g', quantity: 130, weight: 1300, nec: '6.5kg', minimalQuantity: 6 }, - { name: 'Stock 14', duration: '17 days', caliber: '170g', quantity: 170, weight: 1700, nec: '8.5kg', minimalQuantity: 8 }, - { name: 'Stock 15', duration: '21 days', caliber: '210g', quantity: 210, weight: 2100, nec: '10.5kg', minimalQuantity: 10 }, - { name: 'Stock 16', duration: '9 days', caliber: '90g', quantity: 90, weight: 900, nec: '4.5kg', minimalQuantity: 4 }, - { name: 'Stock 17', duration: '23 days', caliber: '230g', quantity: 230, weight: 2300, nec: '11.5kg', minimalQuantity: 11 }, - { name: 'Stock 18', duration: '7 days', caliber: '70g', quantity: 70, weight: 700, nec: '3.5kg', minimalQuantity: 3 }, - { name: 'Stock 19', duration: '24 days', caliber: '240g', quantity: 240, weight: 2400, nec: '12kg', minimalQuantity: 12 }, - { name: 'Stock 20', duration: '6 days', caliber: '60g', quantity: 60, weight: 600, nec: '3kg', minimalQuantity: 3 }, - { name: 'Stock 21', duration: '26 days', caliber: '260g', quantity: 260, weight: 2600, nec: '13kg', minimalQuantity: 13 }, - { name: 'Stock 22', duration: '5 days', caliber: '50g', quantity: 50, weight: 500, nec: '2.5kg', minimalQuantity: 2 }, - { name: 'Stock 23', duration: '27 days', caliber: '270g', quantity: 270, weight: 2700, nec: '13.5kg', minimalQuantity: 13 }, - { name: 'Stock 24', duration: '4 days', caliber: '40g', quantity: 40, weight: 400, nec: '2kg', minimalQuantity: 2 }, - { name: 'Stock 25', duration: '28 days', caliber: '280g', quantity: 280, weight: 2800, nec: '14kg', minimalQuantity: 14 }, - { name: 'Stock 26', duration: '3 days', caliber: '30g', quantity: 30, weight: 300, nec: '1.5kg', minimalQuantity: 1 }, - { name: 'Stock 27', duration: '29 days', caliber: '290g', quantity: 290, weight: 2900, nec: '14.5kg', minimalQuantity: 14 }, - { name: 'Stock 28', duration: '2 days', caliber: '20g', quantity: 20, weight: 200, nec: '1kg', minimalQuantity: 1 }, - { name: 'Stock 29', duration: '30 days', caliber: '300g', quantity: 300, weight: 3000, nec: '15kg', minimalQuantity: 15 }, - { name: 'Stock 30', duration: '1 day', caliber: '10g', quantity: 10, weight: 100, nec: '0.5kg', minimalQuantity: 1 }, + { product: ProductTable.listOfProducts[0], quantity: 10 }, + { product: ProductTable.listOfProducts[1], quantity: 5 }, + { product: ProductTable.listOfProducts[2], quantity: 8 }, + { product: ProductTable.listOfProducts[3], quantity: 12 }, + { product: ProductTable.listOfProducts[4], quantity: 7 }, + { product: ProductTable.listOfProducts[5], quantity: 15 }, + { product: ProductTable.listOfProducts[6], quantity: 9 }, + { product: ProductTable.listOfProducts[7], quantity: 6 }, + { product: ProductTable.listOfProducts[8], quantity: 11 }, + { product: ProductTable.listOfProducts[9], quantity: 14 }, + { product: ProductTable.listOfProducts[10], quantity: 7 }, + { product: ProductTable.listOfProducts[11], quantity: 13 }, + { product: ProductTable.listOfProducts[12], quantity: 10 }, + { product: ProductTable.listOfProducts[13], quantity: 5 }, + { product: ProductTable.listOfProducts[14], quantity: 8 }, + { product: ProductTable.listOfProducts[15], quantity: 12 }, + { product: ProductTable.listOfProducts[16], quantity: 9 }, + { product: ProductTable.listOfProducts[17], quantity: 6 }, + { product: ProductTable.listOfProducts[18], quantity: 11 }, + { product: ProductTable.listOfProducts[19], quantity: 14 }, + { product: ProductTable.listOfProducts[20], quantity: 7 }, + { product: ProductTable.listOfProducts[21], quantity: 13 }, + { product: ProductTable.listOfProducts[22], quantity: 10 }, + { product: ProductTable.listOfProducts[23], quantity: 5 }, + { product: ProductTable.listOfProducts[24], quantity: 8 }, + { product: ProductTable.listOfProducts[25], quantity: 12 }, + { product: ProductTable.listOfProducts[26], quantity: 9 }, + { product: ProductTable.listOfProducts[27], quantity: 6 }, + { product: ProductTable.listOfProducts[28], quantity: 11 }, + { product: ProductTable.listOfProducts[29], quantity: 14 }, ]; delete(){ From d43f46b906354aa27ecd4b6948546d0bd448ff04 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 15:12:53 +0100 Subject: [PATCH 019/127] added deliverer page with deliverer-form and deliverer-table --- .../deliverer-form/deliverer-form.css | 0 .../deliverer-form/deliverer-form.html | 11 + .../deliverer-form/deliverer-form.ts | 38 +++ .../deliverer-table/deliverer-table.css | 85 +++++ .../deliverer-table/deliverer-table.html | 53 ++++ .../deliverer-table/deliverer-table.ts | 300 ++++++++++++++++++ src/app/interfaces/delivery-note.interface.ts | 1 - src/app/pages/deliverer/deliverer.html | 8 +- src/app/pages/deliverer/deliverer.ts | 9 +- 9 files changed, 502 insertions(+), 3 deletions(-) create mode 100644 src/app/components/deliverer-form/deliverer-form.css create mode 100644 src/app/components/deliverer-form/deliverer-form.html create mode 100644 src/app/components/deliverer-form/deliverer-form.ts create mode 100644 src/app/components/deliverer-table/deliverer-table.css create mode 100644 src/app/components/deliverer-table/deliverer-table.html create mode 100644 src/app/components/deliverer-table/deliverer-table.ts diff --git a/src/app/components/deliverer-form/deliverer-form.css b/src/app/components/deliverer-form/deliverer-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/deliverer-form/deliverer-form.html b/src/app/components/deliverer-form/deliverer-form.html new file mode 100644 index 0000000..52d1834 --- /dev/null +++ b/src/app/components/deliverer-form/deliverer-form.html @@ -0,0 +1,11 @@ +
    + + + Transporteur + + + + + + +
    \ No newline at end of file diff --git a/src/app/components/deliverer-form/deliverer-form.ts b/src/app/components/deliverer-form/deliverer-form.ts new file mode 100644 index 0000000..0125282 --- /dev/null +++ b/src/app/components/deliverer-form/deliverer-form.ts @@ -0,0 +1,38 @@ +import { Component } from '@angular/core'; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; + +@Component({ + selector: 'app-deliverer-form', + imports: [ + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule + ], + templateUrl: './deliverer-form.html', + styleUrl: './deliverer-form.css', +}) +export class DelivererForm { + delivererForm: FormGroup = new FormGroup({ + transporter: new FormControl(null, [Validators.required]) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.delivererForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.delivererForm.getRawValue()) + + // Pour vider le formulaire + this.delivererForm.reset() + } +} diff --git a/src/app/components/deliverer-table/deliverer-table.css b/src/app/components/deliverer-table/deliverer-table.css new file mode 100644 index 0000000..7ae664f --- /dev/null +++ b/src/app/components/deliverer-table/deliverer-table.css @@ -0,0 +1,85 @@ +/* Table globale */ +nz-table { + width: 100%; + border-collapse: separate; + border-spacing: 0 8px; /* espace entre les lignes */ + background: #fff; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0,0,0,0.1); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +/* En-tête */ +nz-table thead tr { + background-color: #f5f5f5; + text-align: left; + font-weight: 600; + color: #333; + border-bottom: 2px solid #e0e0e0; +} + +nz-table thead th { + padding: 12px 16px; +} + +/* Lignes du tableau */ +nz-table tbody tr { + background-color: #fff; + transition: background 0.2s ease; +} + +nz-table tbody tr:nth-child(even) { + background-color: #f9f9f9; +} + +nz-table tbody tr:hover { + background-color: #e6f7ff; /* survol */ +} + +/* Cellules */ +nz-table tbody td { + padding: 12px 16px; + vertical-align: middle; + color: #444; +} + +/* Boutons */ +nz-table button[nz-button] { + margin-right: 8px; +} + +/* Modals dans le tableau */ +nz-table app-modal { + margin-right: 8px; +} + +/* Dates (pour alignement et style) */ +nz-table tbody td p { + margin: 0; + font-size: 14px; + color: #555; +} + +/* Responsive */ +@media (max-width: 768px) { + nz-table thead { + display: none; + } + nz-table tbody tr { + display: block; + margin-bottom: 16px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + border-radius: 8px; + padding: 12px; + } + nz-table tbody td { + display: flex; + justify-content: space-between; + padding: 6px 12px; + } + nz-table tbody td::before { + content: attr(data-label); + font-weight: 600; + } +} diff --git a/src/app/components/deliverer-table/deliverer-table.html b/src/app/components/deliverer-table/deliverer-table.html new file mode 100644 index 0000000..0c3184d --- /dev/null +++ b/src/app/components/deliverer-table/deliverer-table.html @@ -0,0 +1,53 @@ + + + + Transporteur + Bon de livraison + Action + + + + @for (data of basicTable.data; track data) { + + {{data.transporter}} + + +
    + + + + Numéro de livraison + Date d'expédition + Date de livraison estimée + Date de livraison finale + + + + @for (deliveryInfo of data.deliveryNote; track deliveryInfo) { + + {{deliveryInfo.trackingNumber}} + {{deliveryInfo.expeditionDate | date: 'dd/MM/yyyy'}} + {{deliveryInfo.estimateDeliveryDate | date: 'dd/MM/yyyy'}} + {{deliveryInfo.realDeliveryDate | date: 'dd/MM/yyyy'}} + + } + + +
    +
    + + +
    + + + + +
    + +
    +
    + + + } + +
    diff --git a/src/app/components/deliverer-table/deliverer-table.ts b/src/app/components/deliverer-table/deliverer-table.ts new file mode 100644 index 0000000..919c615 --- /dev/null +++ b/src/app/components/deliverer-table/deliverer-table.ts @@ -0,0 +1,300 @@ +import { Component } from '@angular/core'; +import {ProductTable} from "../product-table/product-table"; +import {DelivererInfo} from "../../interfaces/deliverer.interface"; +import {ModalNav} from "../modal-nav/modal-nav"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {ProfilForm} from "../profil-form/profil-form"; +import {ModalButton} from "../modal-button/modal-button"; +import {DatePipe} from "@angular/common"; +import {DelivererForm} from "../deliverer-form/deliverer-form"; + +@Component({ + selector: 'app-deliverer-table', + imports: [ + ModalNav, + NzDividerComponent, + NzIconDirective, + NzTableComponent, + ProfilForm, + ModalButton, + DatePipe, + DelivererForm + ], + templateUrl: './deliverer-table.html', + styleUrl: './deliverer-table.css', +}) +export class DelivererTable { + listOfDeliverers: DelivererInfo[] = [ + { + transporter: 'Transporteur 1', + deliveryNote: [ + { + trackingNumber: 'TRK-1000', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-20'), + expeditionDate: new Date('2025-11-15'), + realDeliveryDate: new Date('2025-11-19'), + productDelivery: [ + { product: ProductTable.listOfProducts[0], quantity: 5 }, + { product: ProductTable.listOfProducts[1], quantity: 3 }, + { product: ProductTable.listOfProducts[2], quantity: 7 }, + ], + }, + { + trackingNumber: 'TRK-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + { + trackingNumber: 'TRK-1000', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-20'), + expeditionDate: new Date('2025-11-15'), + realDeliveryDate: new Date('2025-11-19'), + productDelivery: [ + { product: ProductTable.listOfProducts[0], quantity: 5 }, + { product: ProductTable.listOfProducts[1], quantity: 3 }, + { product: ProductTable.listOfProducts[2], quantity: 7 }, + ], + }, + { + trackingNumber: 'TRK-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + { + trackingNumber: 'TRK-1000', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-20'), + expeditionDate: new Date('2025-11-15'), + realDeliveryDate: new Date('2025-11-19'), + productDelivery: [ + { product: ProductTable.listOfProducts[0], quantity: 5 }, + { product: ProductTable.listOfProducts[1], quantity: 3 }, + { product: ProductTable.listOfProducts[2], quantity: 7 }, + ], + }, + { + trackingNumber: 'TRK-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + { + trackingNumber: 'TRK-1000', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-20'), + expeditionDate: new Date('2025-11-15'), + realDeliveryDate: new Date('2025-11-19'), + productDelivery: [ + { product: ProductTable.listOfProducts[0], quantity: 5 }, + { product: ProductTable.listOfProducts[1], quantity: 3 }, + { product: ProductTable.listOfProducts[2], quantity: 7 }, + ], + }, + { + trackingNumber: 'TRK-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + { + trackingNumber: 'TRK-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + { + trackingNumber: 'TRK-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + { + trackingNumber: 'TRK-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + { + trackingNumber: 'TRK-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + ] + }, + { + transporter: 'Transporteur 2', + deliveryNote: [ + { + trackingNumber: 'TRK-1002', + deliverer: 'Transporteur 2', + estimateDeliveryDate: new Date('2025-11-23'), + expeditionDate: new Date('2025-11-17'), + realDeliveryDate: new Date('2025-11-22'), + productDelivery: [ + { product: ProductTable.listOfProducts[6], quantity: 3 }, + { product: ProductTable.listOfProducts[7], quantity: 8 }, + { product: ProductTable.listOfProducts[8], quantity: 5 }, + ], + }, + { + trackingNumber: 'TRK-1003', + deliverer: 'Transporteur 2', + estimateDeliveryDate: new Date('2025-11-24'), + expeditionDate: new Date('2025-11-18'), + realDeliveryDate: new Date('2025-11-23'), + productDelivery: [ + { product: ProductTable.listOfProducts[9], quantity: 4 }, + { product: ProductTable.listOfProducts[10], quantity: 6 }, + { product: ProductTable.listOfProducts[11], quantity: 7 }, + ], + } + ] + }, + { + transporter: 'Transporteur 3', + deliveryNote: [ + { + trackingNumber: 'TRK-1004', + deliverer: 'Transporteur 3', + estimateDeliveryDate: new Date('2025-11-25'), + expeditionDate: new Date('2025-11-19'), + realDeliveryDate: new Date('2025-11-24'), + productDelivery: [ + { product: ProductTable.listOfProducts[12], quantity: 2 }, + { product: ProductTable.listOfProducts[13], quantity: 5 }, + { product: ProductTable.listOfProducts[14], quantity: 6 }, + ], + }, + { + trackingNumber: 'TRK-1005', + deliverer: 'Transporteur 3', + estimateDeliveryDate: new Date('2025-11-26'), + expeditionDate: new Date('2025-11-20'), + realDeliveryDate: new Date('2025-11-25'), + productDelivery: [ + { product: ProductTable.listOfProducts[15], quantity: 3 }, + { product: ProductTable.listOfProducts[16], quantity: 7 }, + { product: ProductTable.listOfProducts[17], quantity: 4 }, + ], + } + ] + }, + { + transporter: 'Transporteur 4', + deliveryNote: [ + { + trackingNumber: 'TRK-1006', + deliverer: 'Transporteur 4', + estimateDeliveryDate: new Date('2025-11-27'), + expeditionDate: new Date('2025-11-21'), + realDeliveryDate: new Date('2025-11-26'), + productDelivery: [ + { product: ProductTable.listOfProducts[18], quantity: 5 }, + { product: ProductTable.listOfProducts[19], quantity: 6 }, + { product: ProductTable.listOfProducts[20], quantity: 7 }, + ], + }, + { + trackingNumber: 'TRK-1007', + deliverer: 'Transporteur 4', + estimateDeliveryDate: new Date('2025-11-28'), + expeditionDate: new Date('2025-11-22'), + realDeliveryDate: new Date('2025-11-27'), + productDelivery: [ + { product: ProductTable.listOfProducts[21], quantity: 3 }, + { product: ProductTable.listOfProducts[22], quantity: 5 }, + { product: ProductTable.listOfProducts[23], quantity: 4 }, + ], + } + ] + }, + { + transporter: 'Transporteur 5', + deliveryNote: [ + { + trackingNumber: 'TRK-1008', + deliverer: 'Transporteur 5', + estimateDeliveryDate: new Date('2025-11-29'), + expeditionDate: new Date('2025-11-23'), + realDeliveryDate: new Date('2025-11-28'), + productDelivery: [ + { product: ProductTable.listOfProducts[24], quantity: 6 }, + { product: ProductTable.listOfProducts[25], quantity: 7 }, + { product: ProductTable.listOfProducts[26], quantity: 3 }, + ], + }, + { + trackingNumber: 'TRK-1009', + deliverer: 'Transporteur 5', + estimateDeliveryDate: new Date('2025-11-30'), + expeditionDate: new Date('2025-11-24'), + realDeliveryDate: new Date('2025-11-29'), + productDelivery: [ + { product: ProductTable.listOfProducts[27], quantity: 5 }, + { product: ProductTable.listOfProducts[28], quantity: 4 }, + { product: ProductTable.listOfProducts[29], quantity: 6 }, + ], + } + ] + }, + ]; + + delete(){ + return + } +} diff --git a/src/app/interfaces/delivery-note.interface.ts b/src/app/interfaces/delivery-note.interface.ts index 808567c..88610e0 100644 --- a/src/app/interfaces/delivery-note.interface.ts +++ b/src/app/interfaces/delivery-note.interface.ts @@ -1,5 +1,4 @@ import {productDeliveryInfo} from "./product-delivery.interface"; -import {DelivererInfo} from "./deliverer.interface"; export interface DeliveryNoteInfo { trackingNumber: string; diff --git a/src/app/pages/deliverer/deliverer.html b/src/app/pages/deliverer/deliverer.html index fd81883..3fe4500 100644 --- a/src/app/pages/deliverer/deliverer.html +++ b/src/app/pages/deliverer/deliverer.html @@ -1 +1,7 @@ -

    deliverer works!

    + + + + +
    + +
    diff --git a/src/app/pages/deliverer/deliverer.ts b/src/app/pages/deliverer/deliverer.ts index 9e36ced..766563c 100644 --- a/src/app/pages/deliverer/deliverer.ts +++ b/src/app/pages/deliverer/deliverer.ts @@ -1,8 +1,15 @@ import { Component } from '@angular/core'; +import {ModalButton} from "../../components/modal-button/modal-button"; +import {DelivererTable} from "../../components/deliverer-table/deliverer-table"; +import {DelivererForm} from "../../components/deliverer-form/deliverer-form"; @Component({ selector: 'app-deliverer', - imports: [], + imports: [ + ModalButton, + DelivererTable, + DelivererForm + ], templateUrl: './deliverer.html', styleUrl: './deliverer.css', }) From 5ab1ce4d5bbad210cc181c4658524a108bfce76f Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 16:25:22 +0100 Subject: [PATCH 020/127] added deliverery note page with deliverery-note-form and deliverert-note-table --- .../deliverer-form/deliverer-form.html | 2 +- .../deliverer-table/deliverer-table.html | 16 +- .../deliverer-table/deliverer-table.ts | 1 + .../deliverery-note-form.css | 0 .../deliverery-note-form.html | 51 ++++++ .../deliverery-note-form.ts | 44 ++++++ .../deliverery-note-table.css | 85 ++++++++++ .../deliverery-note-table.html | 59 +++++++ .../deliverery-note-table.ts | 149 ++++++++++++++++++ .../components/stock-table/stock-table.html | 24 +-- src/app/components/user-table/user-table.html | 6 +- .../pages/delivery-note/delivery-note.html | 7 +- src/app/pages/delivery-note/delivery-note.ts | 9 +- src/app/pages/welcome/welcome.html | 5 +- 14 files changed, 431 insertions(+), 27 deletions(-) create mode 100644 src/app/components/deliverery-note-form/deliverery-note-form.css create mode 100644 src/app/components/deliverery-note-form/deliverery-note-form.html create mode 100644 src/app/components/deliverery-note-form/deliverery-note-form.ts create mode 100644 src/app/components/deliverery-note-table/deliverery-note-table.css create mode 100644 src/app/components/deliverery-note-table/deliverery-note-table.html create mode 100644 src/app/components/deliverery-note-table/deliverery-note-table.ts diff --git a/src/app/components/deliverer-form/deliverer-form.html b/src/app/components/deliverer-form/deliverer-form.html index 52d1834..625096d 100644 --- a/src/app/components/deliverer-form/deliverer-form.html +++ b/src/app/components/deliverer-form/deliverer-form.html @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/src/app/components/deliverer-table/deliverer-table.html b/src/app/components/deliverer-table/deliverer-table.html index 0c3184d..2d19523 100644 --- a/src/app/components/deliverer-table/deliverer-table.html +++ b/src/app/components/deliverer-table/deliverer-table.html @@ -1,12 +1,12 @@ - + - + Transporteur Bon de livraison - Action + Action - + @for (data of basicTable.data; track data) { {{data.transporter}} @@ -15,14 +15,14 @@
    - + Numéro de livraison Date d'expédition Date de livraison estimée - Date de livraison finale + Date de livraison réelle - + @for (deliveryInfo of data.deliveryNote; track deliveryInfo) { {{deliveryInfo.trackingNumber}} @@ -38,7 +38,7 @@
    - + diff --git a/src/app/components/deliverer-table/deliverer-table.ts b/src/app/components/deliverer-table/deliverer-table.ts index 919c615..8100913 100644 --- a/src/app/components/deliverer-table/deliverer-table.ts +++ b/src/app/components/deliverer-table/deliverer-table.ts @@ -25,6 +25,7 @@ import {DelivererForm} from "../deliverer-form/deliverer-form"; templateUrl: './deliverer-table.html', styleUrl: './deliverer-table.css', }) + export class DelivererTable { listOfDeliverers: DelivererInfo[] = [ { diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.css b/src/app/components/deliverery-note-form/deliverery-note-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.html b/src/app/components/deliverery-note-form/deliverery-note-form.html new file mode 100644 index 0000000..5e9e63d --- /dev/null +++ b/src/app/components/deliverery-note-form/deliverery-note-form.html @@ -0,0 +1,51 @@ +
    + + + Numéro de livraison + + + + + + + + + + Transporteur + + + + + + + + + + Date d'expédition + + + + + + + + + + Date de livraison estimée + + + + + + + + + + Date de livraison réelle + + + + + + +
    \ No newline at end of file diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts new file mode 100644 index 0000000..d265263 --- /dev/null +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -0,0 +1,44 @@ +import { Component } from '@angular/core'; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; + +@Component({ + selector: 'app-deliverery-note-form', + imports: [ + NzFormItemComponent, + NzFormLabelComponent, + NzFormControlComponent, + NzInputDirective, + NzColDirective, + NzFlexDirective, + NzFormDirective, + ReactiveFormsModule, + NzDatePickerComponent + ], + templateUrl: './deliverery-note-form.html', + styleUrl: './deliverery-note-form.css', +}) +export class DelivereryNoteForm { + deliveryNoteForm: FormGroup = new FormGroup({ + trackingNumber: new FormControl(null,[Validators.required]), + deliverer: new FormControl(null,[Validators.required]), + expeditionDate: new FormControl(null,[Validators.required]), + estimatedDate: new FormControl(null), + realDate: new FormControl(null) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.deliveryNoteForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.deliveryNoteForm.getRawValue()) + + // Pour vider le formulaire + this.deliveryNoteForm.reset() + } +} diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.css b/src/app/components/deliverery-note-table/deliverery-note-table.css new file mode 100644 index 0000000..7ae664f --- /dev/null +++ b/src/app/components/deliverery-note-table/deliverery-note-table.css @@ -0,0 +1,85 @@ +/* Table globale */ +nz-table { + width: 100%; + border-collapse: separate; + border-spacing: 0 8px; /* espace entre les lignes */ + background: #fff; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0,0,0,0.1); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +/* En-tête */ +nz-table thead tr { + background-color: #f5f5f5; + text-align: left; + font-weight: 600; + color: #333; + border-bottom: 2px solid #e0e0e0; +} + +nz-table thead th { + padding: 12px 16px; +} + +/* Lignes du tableau */ +nz-table tbody tr { + background-color: #fff; + transition: background 0.2s ease; +} + +nz-table tbody tr:nth-child(even) { + background-color: #f9f9f9; +} + +nz-table tbody tr:hover { + background-color: #e6f7ff; /* survol */ +} + +/* Cellules */ +nz-table tbody td { + padding: 12px 16px; + vertical-align: middle; + color: #444; +} + +/* Boutons */ +nz-table button[nz-button] { + margin-right: 8px; +} + +/* Modals dans le tableau */ +nz-table app-modal { + margin-right: 8px; +} + +/* Dates (pour alignement et style) */ +nz-table tbody td p { + margin: 0; + font-size: 14px; + color: #555; +} + +/* Responsive */ +@media (max-width: 768px) { + nz-table thead { + display: none; + } + nz-table tbody tr { + display: block; + margin-bottom: 16px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + border-radius: 8px; + padding: 12px; + } + nz-table tbody td { + display: flex; + justify-content: space-between; + padding: 6px 12px; + } + nz-table tbody td::before { + content: attr(data-label); + font-weight: 600; + } +} diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html new file mode 100644 index 0000000..e738aaf --- /dev/null +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -0,0 +1,59 @@ + + + + Numéro de livraison + Transporteur + Date d'expédition + Date de livraison estimée + Date de livraison réelle + Produits + Action + + + + @for (data of basicTable.data; track data) { + + {{data.trackingNumber}} + {{data.deliverer}} + {{data.expeditionDate | date: 'dd/MM/yyyy'}} + {{data.estimateDeliveryDate | date: 'dd/MM/yyyy'}} + {{data.realDeliveryDate | date: 'dd/MM/yyyy'}} + + +
    + + + + Réference + Nom + Quantité + + + + @for (product of data.productDelivery; track product) { + + {{product.product.reference}} + {{product.product.name}} + {{product.quantity}} + + } + + +
    +
    + + +
    + + + + +
    + +
    +
    + + + } + +
    diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts new file mode 100644 index 0000000..08abecc --- /dev/null +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -0,0 +1,149 @@ +import { Component } from '@angular/core'; +import {DeliveryNoteInfo} from "../../interfaces/delivery-note.interface"; +import {ProductTable} from "../product-table/product-table"; +import {DatePipe} from "@angular/common"; +import {ModalButton} from "../modal-button/modal-button"; +import {ModalNav} from "../modal-nav/modal-nav"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form"; + +@Component({ + selector: 'app-deliverery-note-table', + imports: [ + ModalButton, + ModalNav, + NzDividerComponent, + NzIconDirective, + NzTableComponent, + DelivereryNoteForm, + DatePipe, + ], + templateUrl: './deliverery-note-table.html', + styleUrl: './deliverery-note-table.css', +}) +export class DelivereryNoteTable { + deliveryNotes: DeliveryNoteInfo[] = [ + { + trackingNumber: 'DLV-1000', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-20'), + expeditionDate: new Date('2025-11-15'), + realDeliveryDate: new Date('2025-11-19'), + productDelivery: [ + { product: ProductTable.listOfProducts[0], quantity: 5 }, + { product: ProductTable.listOfProducts[1], quantity: 3 }, + { product: ProductTable.listOfProducts[2], quantity: 7 }, + ], + }, + { + trackingNumber: 'DLV-1001', + deliverer: 'Transporteur 1', + estimateDeliveryDate: new Date('2025-11-22'), + expeditionDate: new Date('2025-11-16'), + realDeliveryDate: new Date('2025-11-21'), + productDelivery: [ + { product: ProductTable.listOfProducts[3], quantity: 2 }, + { product: ProductTable.listOfProducts[4], quantity: 4 }, + { product: ProductTable.listOfProducts[5], quantity: 6 }, + ], + }, + { + trackingNumber: 'DLV-1002', + deliverer: 'Transporteur 2', + estimateDeliveryDate: new Date('2025-11-23'), + expeditionDate: new Date('2025-11-17'), + realDeliveryDate: new Date('2025-11-22'), + productDelivery: [ + { product: ProductTable.listOfProducts[6], quantity: 3 }, + { product: ProductTable.listOfProducts[7], quantity: 8 }, + { product: ProductTable.listOfProducts[8], quantity: 5 }, + ], + }, + { + trackingNumber: 'DLV-1003', + deliverer: 'Transporteur 2', + estimateDeliveryDate: new Date('2025-11-24'), + expeditionDate: new Date('2025-11-18'), + realDeliveryDate: new Date('2025-11-23'), + productDelivery: [ + { product: ProductTable.listOfProducts[9], quantity: 4 }, + { product: ProductTable.listOfProducts[10], quantity: 6 }, + { product: ProductTable.listOfProducts[11], quantity: 7 }, + ], + }, + { + trackingNumber: 'DLV-1004', + deliverer: 'Transporteur 3', + estimateDeliveryDate: new Date('2025-11-25'), + expeditionDate: new Date('2025-11-19'), + realDeliveryDate: new Date('2025-11-24'), + productDelivery: [ + { product: ProductTable.listOfProducts[12], quantity: 2 }, + { product: ProductTable.listOfProducts[13], quantity: 5 }, + { product: ProductTable.listOfProducts[14], quantity: 6 }, + ], + }, + { + trackingNumber: 'DLV-1005', + deliverer: 'Transporteur 3', + estimateDeliveryDate: new Date('2025-11-26'), + expeditionDate: new Date('2025-11-20'), + realDeliveryDate: new Date('2025-11-25'), + productDelivery: [ + { product: ProductTable.listOfProducts[15], quantity: 3 }, + { product: ProductTable.listOfProducts[16], quantity: 7 }, + { product: ProductTable.listOfProducts[17], quantity: 4 }, + ], + }, + { + trackingNumber: 'DLV-1006', + deliverer: 'Transporteur 4', + estimateDeliveryDate: new Date('2025-11-27'), + expeditionDate: new Date('2025-11-21'), + realDeliveryDate: new Date('2025-11-26'), + productDelivery: [ + { product: ProductTable.listOfProducts[18], quantity: 5 }, + { product: ProductTable.listOfProducts[19], quantity: 6 }, + { product: ProductTable.listOfProducts[20], quantity: 7 }, + ], + }, + { + trackingNumber: 'DLV-1007', + deliverer: 'Transporteur 4', + estimateDeliveryDate: new Date('2025-11-28'), + expeditionDate: new Date('2025-11-22'), + realDeliveryDate: new Date('2025-11-27'), + productDelivery: [ + { product: ProductTable.listOfProducts[21], quantity: 3 }, + { product: ProductTable.listOfProducts[22], quantity: 5 }, + { product: ProductTable.listOfProducts[23], quantity: 4 }, + ], + }, + { + trackingNumber: 'DLV-1008', + deliverer: 'Transporteur 5', + estimateDeliveryDate: new Date('2025-11-29'), + expeditionDate: new Date('2025-11-23'), + realDeliveryDate: new Date('2025-11-28'), + productDelivery: [ + { product: ProductTable.listOfProducts[24], quantity: 6 }, + { product: ProductTable.listOfProducts[25], quantity: 7 }, + { product: ProductTable.listOfProducts[26], quantity: 3 }, + ], + }, + { + trackingNumber: 'DLV-1009', + deliverer: 'Transporteur 5', + estimateDeliveryDate: new Date('2025-11-30'), + expeditionDate: new Date('2025-11-24'), + realDeliveryDate: new Date('2025-11-29'), + productDelivery: [ + { product: ProductTable.listOfProducts[27], quantity: 5 }, + { product: ProductTable.listOfProducts[28], quantity: 4 }, + { product: ProductTable.listOfProducts[29], quantity: 6 }, + ], + }, + ]; +} diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 5fefbce..7c33279 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -1,18 +1,18 @@ - - Nom - Réference - Nec - Calibre - Poid - Durée - Quantité - Limite - Action - + + Nom + Réference + Nec + Calibre + Poid + Durée + Quantité + Limite + Action + - + @for (data of basicTable.data; track data) { {{data.product.name}} diff --git a/src/app/components/user-table/user-table.html b/src/app/components/user-table/user-table.html index f977771..fe895f1 100644 --- a/src/app/components/user-table/user-table.html +++ b/src/app/components/user-table/user-table.html @@ -1,13 +1,13 @@ - + Nom Email Fonction - Action + Action - + @for (data of basicTable.data; track data) { {{data.name}} diff --git a/src/app/pages/delivery-note/delivery-note.html b/src/app/pages/delivery-note/delivery-note.html index 736e266..0c90178 100644 --- a/src/app/pages/delivery-note/delivery-note.html +++ b/src/app/pages/delivery-note/delivery-note.html @@ -1 +1,6 @@ -

    delivery-note works!

    + + + +
    + +
    diff --git a/src/app/pages/delivery-note/delivery-note.ts b/src/app/pages/delivery-note/delivery-note.ts index cd3d99e..642b0fb 100644 --- a/src/app/pages/delivery-note/delivery-note.ts +++ b/src/app/pages/delivery-note/delivery-note.ts @@ -1,8 +1,15 @@ import { Component } from '@angular/core'; +import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; +import {ModalButton} from "../../components/modal-button/modal-button"; +import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form"; @Component({ selector: 'app-delivery-note', - imports: [], + imports: [ + DelivereryNoteTable, + ModalButton, + DelivereryNoteForm + ], templateUrl: './delivery-note.html', styleUrl: './delivery-note.css', }) diff --git a/src/app/pages/welcome/welcome.html b/src/app/pages/welcome/welcome.html index 12f389f..e62f14b 100644 --- a/src/app/pages/welcome/welcome.html +++ b/src/app/pages/welcome/welcome.html @@ -1 +1,4 @@ -

    hello work

    \ No newline at end of file +

    + faire dashboard ici + et faire la verif des livraisons ici aussi +

    \ No newline at end of file From a917c13d68f82ee7e3224c19061fe0695cd156c1 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 17:46:02 +0100 Subject: [PATCH 021/127] added notif section --- src/app/app.html | 4 +- src/app/app.ts | 3 +- .../deliverer-table/deliverer-table.ts | 2 - src/app/components/notif-list/notif-list.css | 0 src/app/components/notif-list/notif-list.html | 34 +++++++ src/app/components/notif-list/notif-list.ts | 92 +++++++++++++++++++ src/app/interfaces/notif.interface.ts | 5 + 7 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 src/app/components/notif-list/notif-list.css create mode 100644 src/app/components/notif-list/notif-list.html create mode 100644 src/app/components/notif-list/notif-list.ts create mode 100644 src/app/interfaces/notif.interface.ts diff --git a/src/app/app.html b/src/app/app.html index 3ddb212..298a3e2 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -69,7 +69,9 @@
    - + + + diff --git a/src/app/app.ts b/src/app/app.ts index 311370e..8747de2 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -5,10 +5,11 @@ import { NzMenuModule } from 'ng-zorro-antd/menu'; import {NzIconDirective} from "ng-zorro-antd/icon"; import {ModalNav} from "./components/modal-nav/modal-nav"; import {Profil} from "./components/profil/profil"; +import {NotifList} from "./components/notif-list/notif-list"; @Component({ selector: 'app-root', - imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav, Profil], + imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav, Profil, NotifList], templateUrl: './app.html', styleUrl: './app.css' }) diff --git a/src/app/components/deliverer-table/deliverer-table.ts b/src/app/components/deliverer-table/deliverer-table.ts index 8100913..9cb0b7d 100644 --- a/src/app/components/deliverer-table/deliverer-table.ts +++ b/src/app/components/deliverer-table/deliverer-table.ts @@ -5,7 +5,6 @@ import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; -import {ProfilForm} from "../profil-form/profil-form"; import {ModalButton} from "../modal-button/modal-button"; import {DatePipe} from "@angular/common"; import {DelivererForm} from "../deliverer-form/deliverer-form"; @@ -17,7 +16,6 @@ import {DelivererForm} from "../deliverer-form/deliverer-form"; NzDividerComponent, NzIconDirective, NzTableComponent, - ProfilForm, ModalButton, DatePipe, DelivererForm diff --git a/src/app/components/notif-list/notif-list.css b/src/app/components/notif-list/notif-list.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/notif-list/notif-list.html b/src/app/components/notif-list/notif-list.html new file mode 100644 index 0000000..d61b903 --- /dev/null +++ b/src/app/components/notif-list/notif-list.html @@ -0,0 +1,34 @@ +
    +

    + Tout supprimer +

    +
    + + + @for (item of notifList; track item) { + + + + + info + + + +

    {{item.title}}

    +

    {{item.author}}

    +
    + + +

    {{item.content}}

    +
    +
    + + + logo + + +
    + } +
    diff --git a/src/app/components/notif-list/notif-list.ts b/src/app/components/notif-list/notif-list.ts new file mode 100644 index 0000000..46ff877 --- /dev/null +++ b/src/app/components/notif-list/notif-list.ts @@ -0,0 +1,92 @@ +import { Component } from '@angular/core'; +import {NotifInfo} from "../../interfaces/notif.interface"; +import { + NzListComponent, + NzListItemComponent, + NzListItemExtraComponent, NzListItemMetaAvatarComponent, + NzListItemMetaComponent, NzListItemMetaDescriptionComponent, NzListItemMetaTitleComponent +} from "ng-zorro-antd/list"; +import {NzIconDirective} from "ng-zorro-antd/icon"; + +@Component({ + selector: 'app-notif-list', + imports: [ + NzListComponent, + NzListItemComponent, + NzListItemMetaComponent, + NzListItemExtraComponent, + NzListItemMetaDescriptionComponent, + NzListItemMetaAvatarComponent, + NzListItemMetaTitleComponent, + NzIconDirective + ], + templateUrl: './notif-list.html', + styleUrl: './notif-list.css', +}) +export class NotifList { + notifList: NotifInfo[] = [ + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + }, + { + author: 'Admin', + title: 'Information system', + content: 'L\'utilisateur à bien été crée.' + } + ]; + + delete() { + this.notifList = []; + } + + addContent(author: string, title: string, content: string) { + this.notifList.push({ author, title, content }); + } +} diff --git a/src/app/interfaces/notif.interface.ts b/src/app/interfaces/notif.interface.ts new file mode 100644 index 0000000..ff5ce4f --- /dev/null +++ b/src/app/interfaces/notif.interface.ts @@ -0,0 +1,5 @@ +export interface NotifInfo { + author: string; + title: string; + content: string; +} \ No newline at end of file From 8866c8461897a66f686e362d4a38f832285267e7 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 19:01:47 +0100 Subject: [PATCH 022/127] added setting section --- src/app/app.html | 4 +- src/app/app.ts | 3 +- .../components/setting-form/setting-form.css | 36 +++++++++++++++ .../components/setting-form/setting-form.html | 35 ++++++++++++++ .../components/setting-form/setting-form.ts | 46 +++++++++++++++++++ src/app/interfaces/setting.interface.ts | 4 ++ 6 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 src/app/components/setting-form/setting-form.css create mode 100644 src/app/components/setting-form/setting-form.html create mode 100644 src/app/components/setting-form/setting-form.ts create mode 100644 src/app/interfaces/setting.interface.ts diff --git a/src/app/app.html b/src/app/app.html index 298a3e2..413ed55 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -75,7 +75,9 @@ - + + +
    diff --git a/src/app/app.ts b/src/app/app.ts index 8747de2..376bcc3 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -6,10 +6,11 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; import {ModalNav} from "./components/modal-nav/modal-nav"; import {Profil} from "./components/profil/profil"; import {NotifList} from "./components/notif-list/notif-list"; +import {SettingForm} from "./components/setting-form/setting-form"; @Component({ selector: 'app-root', - imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav, Profil, NotifList], + imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav, Profil, NotifList, SettingForm], templateUrl: './app.html', styleUrl: './app.css' }) diff --git a/src/app/components/setting-form/setting-form.css b/src/app/components/setting-form/setting-form.css new file mode 100644 index 0000000..4b77112 --- /dev/null +++ b/src/app/components/setting-form/setting-form.css @@ -0,0 +1,36 @@ +/* Container de chaque ligne */ +.row { + display: flex; + align-items: center; /* centre verticalement les images et champs */ + gap: 24px; /* espace entre preview et champ */ + margin-bottom: 20px; +} + +/* Colonne gauche : preview */ +.row-left { + width: 180px; /* fixe la largeur pour aligner toutes les images */ + display: flex; + justify-content: center; +} + +/* Image de preview */ +.row-left img { + max-width: 100%; + max-height: 80px; + object-fit: contain; + border: 1px solid #e6e6e6; + border-radius: 6px; + background-color: #fafafa; + padding: 4px; +} + +/* Colonne droite : input */ +.row-right { + flex: 1; /* prend le reste de l'espace */ +} + +/* Retire la largeur forcée du nz-form-label et nz-form-control */ +.row-right nz-form-item nz-form-label, +.row-right nz-form-item nz-form-control { + width: auto !important; +} diff --git a/src/app/components/setting-form/setting-form.html b/src/app/components/setting-form/setting-form.html new file mode 100644 index 0000000..5b9e2fa --- /dev/null +++ b/src/app/components/setting-form/setting-form.html @@ -0,0 +1,35 @@ +
    + + +
    +
    + logo +
    + +
    + + Logo + + + + +
    +
    + + +
    +
    + logo +
    + +
    + + Signature + + + + +
    +
    + +
    diff --git a/src/app/components/setting-form/setting-form.ts b/src/app/components/setting-form/setting-form.ts new file mode 100644 index 0000000..0553e72 --- /dev/null +++ b/src/app/components/setting-form/setting-form.ts @@ -0,0 +1,46 @@ +import { Component } from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {SettingInfo} from "../../interfaces/setting.interface"; + +@Component({ + selector: 'app-setting-form', + imports: [ + FormsModule, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule + ], + templateUrl: './setting-form.html', + styleUrl: './setting-form.css', +}) +export class SettingForm { + settingForm: FormGroup = new FormGroup({ + logo: new FormControl(null), + signature: new FormControl(null) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.settingForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.settingForm.getRawValue()) + + // Pour vider le formulaire + this.settingForm.reset() + } + + setting: SettingInfo = { + logo: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png', + signature: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png' + } +} diff --git a/src/app/interfaces/setting.interface.ts b/src/app/interfaces/setting.interface.ts new file mode 100644 index 0000000..4882359 --- /dev/null +++ b/src/app/interfaces/setting.interface.ts @@ -0,0 +1,4 @@ +export interface SettingInfo { + logo: string; + signature: string; +} \ No newline at end of file From c42b8d82e442f8c24eb0ed258ae0cbf411a1f3ad Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 19:15:16 +0100 Subject: [PATCH 023/127] updated modal-button for choice between all types of button at the initialization of the modal --- src/app/components/deliverer-table/deliverer-table.html | 2 +- .../components/deliverery-note-table/deliverery-note-table.html | 2 +- src/app/components/modal-button/modal-button.html | 2 +- src/app/components/modal-button/modal-button.ts | 2 +- src/app/pages/deliverer/deliverer.html | 2 +- src/app/pages/delivery-note/delivery-note.html | 2 +- src/app/pages/user/user.html | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/components/deliverer-table/deliverer-table.html b/src/app/components/deliverer-table/deliverer-table.html index 2d19523..b7d3b68 100644 --- a/src/app/components/deliverer-table/deliverer-table.html +++ b/src/app/components/deliverer-table/deliverer-table.html @@ -11,7 +11,7 @@ {{data.transporter}} - +
    diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index e738aaf..b0932a1 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -19,7 +19,7 @@ {{data.estimateDeliveryDate | date: 'dd/MM/yyyy'}} {{data.realDeliveryDate | date: 'dd/MM/yyyy'}} - +
    diff --git a/src/app/components/modal-button/modal-button.html b/src/app/components/modal-button/modal-button.html index 97e1450..cf8186c 100644 --- a/src/app/components/modal-button/modal-button.html +++ b/src/app/components/modal-button/modal-button.html @@ -1,4 +1,4 @@ - + diff --git a/src/app/components/modal-button/modal-button.ts b/src/app/components/modal-button/modal-button.ts index 3bcf6da..b1ed57a 100644 --- a/src/app/components/modal-button/modal-button.ts +++ b/src/app/components/modal-button/modal-button.ts @@ -1,5 +1,4 @@ import {Component, input, Input} from '@angular/core'; -import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzModalComponent} from "ng-zorro-antd/modal"; import {NzButtonComponent} from "ng-zorro-antd/button"; @@ -15,6 +14,7 @@ import {NzButtonComponent} from "ng-zorro-antd/button"; export class ModalButton { name = input.required() + type = input<"primary" | "default" | "dashed" | "link" | "text">() isVisible = false; isOkLoading = false; diff --git a/src/app/pages/deliverer/deliverer.html b/src/app/pages/deliverer/deliverer.html index 3fe4500..3707ef0 100644 --- a/src/app/pages/deliverer/deliverer.html +++ b/src/app/pages/deliverer/deliverer.html @@ -1,4 +1,4 @@ - + diff --git a/src/app/pages/delivery-note/delivery-note.html b/src/app/pages/delivery-note/delivery-note.html index 0c90178..b689eff 100644 --- a/src/app/pages/delivery-note/delivery-note.html +++ b/src/app/pages/delivery-note/delivery-note.html @@ -1,4 +1,4 @@ - +
    diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index 0ce699e..02a9d55 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -1,4 +1,4 @@ - + From 96a861feb5d76c6a8c1da1507ece7f10156064c2 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 19:41:39 +0100 Subject: [PATCH 024/127] fix errors --- src/app/components/setting-form/setting-form.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/components/setting-form/setting-form.ts b/src/app/components/setting-form/setting-form.ts index 0553e72..0dd1608 100644 --- a/src/app/components/setting-form/setting-form.ts +++ b/src/app/components/setting-form/setting-form.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms"; import {NzColDirective} from "ng-zorro-antd/grid"; -import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {SettingInfo} from "../../interfaces/setting.interface"; @@ -11,7 +10,6 @@ import {SettingInfo} from "../../interfaces/setting.interface"; imports: [ FormsModule, NzColDirective, - NzFlexDirective, NzFormControlComponent, NzFormDirective, NzFormItemComponent, From 7593eb372ef87adc85769d5f1a51fdf7808e181b Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 15 Nov 2025 19:43:25 +0100 Subject: [PATCH 025/127] fix errors --- src/app/pages/delivery-note/delivery-note.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/delivery-note/delivery-note.html b/src/app/pages/delivery-note/delivery-note.html index b689eff..9d8e979 100644 --- a/src/app/pages/delivery-note/delivery-note.html +++ b/src/app/pages/delivery-note/delivery-note.html @@ -1,4 +1,4 @@ - +
    From 3ba843af6ae0d31676365616352966a8f4d9e152 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 16 Nov 2025 11:03:52 +0100 Subject: [PATCH 026/127] added export icon in delivery-note --- .../deliverery-note-table/deliverery-note-table.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index b0932a1..ba7b371 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -51,6 +51,10 @@
    + +
    + +
    From 19afeb6369e859d478366be5956cd9458b727af5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 16 Nov 2025 12:06:54 +0100 Subject: [PATCH 027/127] added search component from all pages --- src/app/components/search/search.css | 36 ++++++++++++++++++ src/app/components/search/search.html | 10 +++++ src/app/components/search/search.ts | 37 +++++++++++++++++++ src/app/pages/deliverer/deliverer.html | 14 +++++-- src/app/pages/deliverer/deliverer.ts | 4 +- .../pages/delivery-note/delivery-note.html | 15 ++++++-- src/app/pages/delivery-note/delivery-note.ts | 4 +- .../pages/purchase-order/purchase-order.html | 9 ++++- .../pages/purchase-order/purchase-order.ts | 7 +++- src/app/pages/quotation/quotation.html | 10 ++++- src/app/pages/quotation/quotation.ts | 5 ++- src/app/pages/stock/stock.html | 8 +++- src/app/pages/stock/stock.ts | 2 + src/app/pages/supplier/supplier.html | 10 ++++- src/app/pages/supplier/supplier.ts | 5 ++- src/app/pages/user/user.html | 14 +++++-- src/app/pages/user/user.ts | 4 +- 17 files changed, 172 insertions(+), 22 deletions(-) create mode 100644 src/app/components/search/search.css create mode 100644 src/app/components/search/search.html create mode 100644 src/app/components/search/search.ts diff --git a/src/app/components/search/search.css b/src/app/components/search/search.css new file mode 100644 index 0000000..da8a92a --- /dev/null +++ b/src/app/components/search/search.css @@ -0,0 +1,36 @@ +/* From Uiverse.io by LightAndy1 */ +.group { + box-shadow: 0 1px 2px 1px #001529; + border-radius: 15px; + padding: 0.1rem 0.5rem 0.1rem 1rem; + display: flex; + line-height: 28px; + align-items: center; + position: relative; + max-width: 400px; +} + +.input { + width: 100%; + height: 32px; + line-height: 28px; + padding: 0 1rem; + border: 2px solid transparent; + border-radius: 8px; + outline: none; + background-color: #f3f3f4; + color: #0d0c22; + transition: 0.3s ease; +} + +.input::placeholder { + color: #9e9ea7; +} + +.input:focus, +input:hover { + outline: none; + border-color: #40A9FF; + background-color: #fff; + box-shadow: 0 0 0 4px rgba(199, 199, 197, 0.1); +} diff --git a/src/app/components/search/search.html b/src/app/components/search/search.html new file mode 100644 index 0000000..592bbb8 --- /dev/null +++ b/src/app/components/search/search.html @@ -0,0 +1,10 @@ +
    + + +
    + + +
    +
    +
    +
    diff --git a/src/app/components/search/search.ts b/src/app/components/search/search.ts new file mode 100644 index 0000000..138e854 --- /dev/null +++ b/src/app/components/search/search.ts @@ -0,0 +1,37 @@ +import { Component } from '@angular/core'; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent} from "ng-zorro-antd/form"; +import {FormControl, FormGroup, ReactiveFormsModule} from "@angular/forms"; + +@Component({ + selector: 'app-search', + imports: [ + NzIconDirective, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + ReactiveFormsModule + ], + templateUrl: './search.html', + styleUrl: './search.css', +}) +export class Search { + searchForm: FormGroup = new FormGroup({ + searchValue: new FormControl(null) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.searchForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.searchForm.getRawValue()) + + // Pour vider le formulaire + this.searchForm.reset() + } +} diff --git a/src/app/pages/deliverer/deliverer.html b/src/app/pages/deliverer/deliverer.html index 3707ef0..b06a07a 100644 --- a/src/app/pages/deliverer/deliverer.html +++ b/src/app/pages/deliverer/deliverer.html @@ -1,7 +1,13 @@ - - - +
    + + + -
    +
    + +
    +
    + +
    diff --git a/src/app/pages/deliverer/deliverer.ts b/src/app/pages/deliverer/deliverer.ts index 766563c..3d5ca1b 100644 --- a/src/app/pages/deliverer/deliverer.ts +++ b/src/app/pages/deliverer/deliverer.ts @@ -2,13 +2,15 @@ import { Component } from '@angular/core'; import {ModalButton} from "../../components/modal-button/modal-button"; import {DelivererTable} from "../../components/deliverer-table/deliverer-table"; import {DelivererForm} from "../../components/deliverer-form/deliverer-form"; +import {Search} from "../../components/search/search"; @Component({ selector: 'app-deliverer', imports: [ ModalButton, DelivererTable, - DelivererForm + DelivererForm, + Search ], templateUrl: './deliverer.html', styleUrl: './deliverer.css', diff --git a/src/app/pages/delivery-note/delivery-note.html b/src/app/pages/delivery-note/delivery-note.html index 9d8e979..bf3ae8f 100644 --- a/src/app/pages/delivery-note/delivery-note.html +++ b/src/app/pages/delivery-note/delivery-note.html @@ -1,6 +1,13 @@ - - - -
    +
    + + + + +
    + +
    +
    + +
    diff --git a/src/app/pages/delivery-note/delivery-note.ts b/src/app/pages/delivery-note/delivery-note.ts index 642b0fb..2183f24 100644 --- a/src/app/pages/delivery-note/delivery-note.ts +++ b/src/app/pages/delivery-note/delivery-note.ts @@ -2,13 +2,15 @@ import { Component } from '@angular/core'; import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; import {ModalButton} from "../../components/modal-button/modal-button"; import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form"; +import {Search} from "../../components/search/search"; @Component({ selector: 'app-delivery-note', imports: [ DelivereryNoteTable, ModalButton, - DelivereryNoteForm + DelivereryNoteForm, + Search ], templateUrl: './delivery-note.html', styleUrl: './delivery-note.css', diff --git a/src/app/pages/purchase-order/purchase-order.html b/src/app/pages/purchase-order/purchase-order.html index f6376c5..90c59af 100644 --- a/src/app/pages/purchase-order/purchase-order.html +++ b/src/app/pages/purchase-order/purchase-order.html @@ -1 +1,8 @@ -

    purchase-order works!

    +
    +
    + +
    +
    +
    +

    purchase-order works!

    +
    diff --git a/src/app/pages/purchase-order/purchase-order.ts b/src/app/pages/purchase-order/purchase-order.ts index 574ce64..a9dcc5c 100644 --- a/src/app/pages/purchase-order/purchase-order.ts +++ b/src/app/pages/purchase-order/purchase-order.ts @@ -1,8 +1,13 @@ import { Component } from '@angular/core'; +import {Search} from "../../components/search/search"; +import {ModalButton} from "../../components/modal-button/modal-button"; @Component({ selector: 'app-purchase-order', - imports: [], + imports: [ + Search, + ModalButton + ], templateUrl: './purchase-order.html', styleUrl: './purchase-order.css', }) diff --git a/src/app/pages/quotation/quotation.html b/src/app/pages/quotation/quotation.html index e7b7112..a2444b7 100644 --- a/src/app/pages/quotation/quotation.html +++ b/src/app/pages/quotation/quotation.html @@ -1 +1,9 @@ -

    quotation works!

    +
    +
    + +
    +
    + +
    +

    quotation works!

    +
    diff --git a/src/app/pages/quotation/quotation.ts b/src/app/pages/quotation/quotation.ts index 2a2136d..586f94b 100644 --- a/src/app/pages/quotation/quotation.ts +++ b/src/app/pages/quotation/quotation.ts @@ -1,8 +1,11 @@ import { Component } from '@angular/core'; +import {Search} from "../../components/search/search"; @Component({ selector: 'app-quotation', - imports: [], + imports: [ + Search + ], templateUrl: './quotation.html', styleUrl: './quotation.css', }) diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index 54ac09a..3bb6f5f 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1 +1,7 @@ - \ No newline at end of file +
    + +
    + +
    + +
    \ No newline at end of file diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 829cc3b..5b07d92 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,10 +1,12 @@ import { Component } from '@angular/core'; import {StockTable} from "../../components/stock-table/stock-table"; +import {Search} from "../../components/search/search"; @Component({ selector: 'app-stock', imports: [ StockTable, + Search, ], templateUrl: './stock.html', styleUrl: './stock.css', diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 572d871..58666c3 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -1 +1,9 @@ -

    supplier works!

    +
    +
    + +
    +
    + +
    +

    supplier works!

    +
    diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 744f113..610e14d 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -1,8 +1,11 @@ import { Component } from '@angular/core'; +import {Search} from "../../components/search/search"; @Component({ selector: 'app-supplier', - imports: [], + imports: [ + Search + ], templateUrl: './supplier.html', styleUrl: './supplier.css', }) diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index 02a9d55..81039bd 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -1,7 +1,13 @@ - - - +
    + + + -
    +
    + +
    +
    + +
    diff --git a/src/app/pages/user/user.ts b/src/app/pages/user/user.ts index 73456ba..ef69d5f 100644 --- a/src/app/pages/user/user.ts +++ b/src/app/pages/user/user.ts @@ -2,13 +2,15 @@ import { Component } from '@angular/core'; import {UserTable} from "../../components/user-table/user-table"; import {ModalButton} from "../../components/modal-button/modal-button"; import {ProfilForm} from "../../components/profil-form/profil-form"; +import {Search} from "../../components/search/search"; @Component({ selector: 'app-user', imports: [ UserTable, ModalButton, - ProfilForm + ProfilForm, + Search ], templateUrl: './user.html', styleUrl: './user.css', From 678fb80599f6816bd7f4abcbf918c8c5ddfa72c4 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 17 Nov 2025 10:20:20 +0100 Subject: [PATCH 028/127] first commit of the day --- package-lock.json | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb02be1..b312286 100644 --- a/package-lock.json +++ b/package-lock.json @@ -499,7 +499,6 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -516,7 +515,6 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -530,7 +528,6 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -563,7 +560,6 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -589,7 +585,6 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -608,7 +603,6 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -631,7 +625,6 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -713,7 +706,6 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1646,7 +1638,6 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -4029,7 +4020,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -4869,7 +4859,6 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -5687,7 +5676,6 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -5975,7 +5963,6 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -7623,7 +7610,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -7662,7 +7648,6 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -8323,8 +8308,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tuf-js": { "version": "3.1.0", @@ -8362,7 +8346,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8484,7 +8467,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -8855,7 +8837,6 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -8874,8 +8855,7 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT", - "peer": true + "license": "MIT" } } } From 0d9238d1a1462fadfd75fe4438681634b2d410df Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 17 Nov 2025 10:21:24 +0100 Subject: [PATCH 029/127] fix error with importation --- src/app/pages/purchase-order/purchase-order.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/pages/purchase-order/purchase-order.ts b/src/app/pages/purchase-order/purchase-order.ts index a9dcc5c..1bc1ac7 100644 --- a/src/app/pages/purchase-order/purchase-order.ts +++ b/src/app/pages/purchase-order/purchase-order.ts @@ -1,12 +1,10 @@ import { Component } from '@angular/core'; import {Search} from "../../components/search/search"; -import {ModalButton} from "../../components/modal-button/modal-button"; @Component({ selector: 'app-purchase-order', imports: [ Search, - ModalButton ], templateUrl: './purchase-order.html', styleUrl: './purchase-order.css', From b260caa8de4be3675005433b21625d2f8c8953a2 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 20 Nov 2025 14:21:05 +0100 Subject: [PATCH 030/127] fix audit error --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b312286..44d4250 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5138,9 +5138,9 @@ } }, "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "dev": true, "license": "ISC", "dependencies": { From 9c11058f71fc020d5b0ea414cc1a60d81086d020 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 20 Nov 2025 14:31:53 +0100 Subject: [PATCH 031/127] revert 0d9238d1a1462fadfd75fe4438681634b2d410df revert fix error with importation --- src/app/pages/purchase-order/purchase-order.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/pages/purchase-order/purchase-order.ts b/src/app/pages/purchase-order/purchase-order.ts index 1bc1ac7..a9dcc5c 100644 --- a/src/app/pages/purchase-order/purchase-order.ts +++ b/src/app/pages/purchase-order/purchase-order.ts @@ -1,10 +1,12 @@ import { Component } from '@angular/core'; import {Search} from "../../components/search/search"; +import {ModalButton} from "../../components/modal-button/modal-button"; @Component({ selector: 'app-purchase-order', imports: [ Search, + ModalButton ], templateUrl: './purchase-order.html', styleUrl: './purchase-order.css', From 193bed2b1ddaaac3e1bd6e1b3ea595e34d625bf4 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 20 Nov 2025 14:40:30 +0100 Subject: [PATCH 032/127] first commit of the day --- src/app/pages/purchase-order/purchase-order.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/pages/purchase-order/purchase-order.ts b/src/app/pages/purchase-order/purchase-order.ts index a9dcc5c..1bc1ac7 100644 --- a/src/app/pages/purchase-order/purchase-order.ts +++ b/src/app/pages/purchase-order/purchase-order.ts @@ -1,12 +1,10 @@ import { Component } from '@angular/core'; import {Search} from "../../components/search/search"; -import {ModalButton} from "../../components/modal-button/modal-button"; @Component({ selector: 'app-purchase-order', imports: [ Search, - ModalButton ], templateUrl: './purchase-order.html', styleUrl: './purchase-order.css', From e269848f82d4b4e503ac7114249641989eb105ee Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 20 Nov 2025 15:10:43 +0100 Subject: [PATCH 033/127] first of many --- .../quotation-form/quotation-form.css | 0 .../quotation-form/quotation-form.html | 152 ++++++++++++++++++ .../quotation-form/quotation-form.ts | 54 +++++++ .../quotation-table/quotation-table.css | 85 ++++++++++ .../quotation-table/quotation-table.html | 60 +++++++ .../quotation-table/quotation-table.ts | 96 +++++++++++ src/app/pages/quotation/quotation.html | 8 +- src/app/pages/quotation/quotation.ts | 16 +- 8 files changed, 466 insertions(+), 5 deletions(-) create mode 100644 src/app/components/quotation-form/quotation-form.css create mode 100644 src/app/components/quotation-form/quotation-form.html create mode 100644 src/app/components/quotation-form/quotation-form.ts create mode 100644 src/app/components/quotation-table/quotation-table.css create mode 100644 src/app/components/quotation-table/quotation-table.html create mode 100644 src/app/components/quotation-table/quotation-table.ts diff --git a/src/app/components/quotation-form/quotation-form.css b/src/app/components/quotation-form/quotation-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/quotation-form/quotation-form.html b/src/app/components/quotation-form/quotation-form.html new file mode 100644 index 0000000..f491c1d --- /dev/null +++ b/src/app/components/quotation-form/quotation-form.html @@ -0,0 +1,152 @@ +
    + + + Quantité + + + + + + + + + + ID Devis + + + + + + + + + + Message du devis + + + + + + + + + + Conditions de vente + + + + + + + + + + ID Produit + + + + + + + + + + Référence produit + + + + + + + + + + Nom du produit + + + + + + + + + + Durée produit + + + + + + + + + + Calibre produit + + + + + + + + + + Numéro d'approbation + + + + + + + + + + Poids produit + + + + + + + + + + NEC Produit + + + + + + + + + + Image produit + + + + + + + + + + Lien produit + + + + + + + + + + Quantité minimale + + + + + + +
    + diff --git a/src/app/components/quotation-form/quotation-form.ts b/src/app/components/quotation-form/quotation-form.ts new file mode 100644 index 0000000..234c0e3 --- /dev/null +++ b/src/app/components/quotation-form/quotation-form.ts @@ -0,0 +1,54 @@ +import { Component } from '@angular/core'; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; + +@Component({ + selector: 'app-quotation-form', + imports: [ + NzFormItemComponent, + NzFormLabelComponent, + NzFormControlComponent, + NzInputDirective, + NzColDirective, + NzFlexDirective, + NzFormDirective, + ReactiveFormsModule, + NzDatePickerComponent + ], + templateUrl: './quotation-form.html', + styleUrl: './quotation-form.css', +}) +export class QuotationForm { + QuotationForm: FormGroup = new FormGroup({ + quantity: new FormControl(null, [Validators.required]), + quotationId: new FormControl(null), + quotationMessage: new FormControl(null), + quotationConditionsSale: new FormControl(null), + productId: new FormControl(null), + productReferences: new FormControl(null), + productName: new FormControl(null), + productDuration: new FormControl(null), + productCaliber: new FormControl(null), + productApprovalNumber: new FormControl(null), + productWeight: new FormControl(null), + productNec: new FormControl(null), + productImage: new FormControl(null), + productLink: new FormControl(null), + productMinimalQuantity: new FormControl(null) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.QuotationForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.QuotationForm.getRawValue()) + + // Pour vider le formulaire + this.QuotationForm.reset() + } +} diff --git a/src/app/components/quotation-table/quotation-table.css b/src/app/components/quotation-table/quotation-table.css new file mode 100644 index 0000000..7ae664f --- /dev/null +++ b/src/app/components/quotation-table/quotation-table.css @@ -0,0 +1,85 @@ +/* Table globale */ +nz-table { + width: 100%; + border-collapse: separate; + border-spacing: 0 8px; /* espace entre les lignes */ + background: #fff; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0,0,0,0.1); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +/* En-tête */ +nz-table thead tr { + background-color: #f5f5f5; + text-align: left; + font-weight: 600; + color: #333; + border-bottom: 2px solid #e0e0e0; +} + +nz-table thead th { + padding: 12px 16px; +} + +/* Lignes du tableau */ +nz-table tbody tr { + background-color: #fff; + transition: background 0.2s ease; +} + +nz-table tbody tr:nth-child(even) { + background-color: #f9f9f9; +} + +nz-table tbody tr:hover { + background-color: #e6f7ff; /* survol */ +} + +/* Cellules */ +nz-table tbody td { + padding: 12px 16px; + vertical-align: middle; + color: #444; +} + +/* Boutons */ +nz-table button[nz-button] { + margin-right: 8px; +} + +/* Modals dans le tableau */ +nz-table app-modal { + margin-right: 8px; +} + +/* Dates (pour alignement et style) */ +nz-table tbody td p { + margin: 0; + font-size: 14px; + color: #555; +} + +/* Responsive */ +@media (max-width: 768px) { + nz-table thead { + display: none; + } + nz-table tbody tr { + display: block; + margin-bottom: 16px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + border-radius: 8px; + padding: 12px; + } + nz-table tbody td { + display: flex; + justify-content: space-between; + padding: 6px 12px; + } + nz-table tbody td::before { + content: attr(data-label); + font-weight: 600; + } +} diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html new file mode 100644 index 0000000..e6c4ef3 --- /dev/null +++ b/src/app/components/quotation-table/quotation-table.html @@ -0,0 +1,60 @@ + + + + ID Devis + Nom du produit + Quantité + Message + Conditions de vente + Détails produit + Action + + + + @for (data of basicTable.data; track data) { + + {{data.quotationId}} + {{data.productName}} + {{data.quantity}} + {{data.quotationMessage}} + {{data.quotationConditionsSale}} + + +
    + + + + + + + + + + + + + +
    ID Produit:{{data.productId}}
    Référence:{{data.productReferences}}
    Durée:{{data.productDuration}}
    Calibre:{{data.productCaliber}}
    Numéro d'approbation:{{data.productApprovalNumber}}
    Poids:{{data.productWeight}}
    NEC:{{data.productNec}}
    Quantité min:{{data.productMinimalQuantity}}
    Image:{{data.productImage}}
    Lien:{{data.productLink}}
    +
    +
    + + +
    + + + + +
    + +
    + +
    + +
    +
    + + + } + +
    + diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts new file mode 100644 index 0000000..73f4ef3 --- /dev/null +++ b/src/app/components/quotation-table/quotation-table.ts @@ -0,0 +1,96 @@ +import { Component } from '@angular/core'; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {ModalButton} from "../modal-button/modal-button"; +import {ModalNav} from "../modal-nav/modal-nav"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {QuotationForm} from "../quotation-form/quotation-form"; + +interface QuotationInfo { + quantity: number; + quotationId: number; + quotationMessage?: string; + quotationConditionsSale?: string; + productId: number; + productReferences: number; + productName?: string; + productDuration: number; + productCaliber: number; + productApprovalNumber: number; + productWeight: number; + productNec: number; + productImage?: string; + productLink?: string; + productMinimalQuantity: number; +} + +@Component({ + selector: 'app-quotation-table', + imports: [ + ModalButton, + ModalNav, + NzDividerComponent, + NzIconDirective, + NzTableComponent, + QuotationForm + ], + templateUrl: './quotation-table.html', + styleUrl: './quotation-table.css', +}) + +export class QuotationTable { + quotations: QuotationInfo[] = [ + { + quantity: 10, + quotationId: 101, + quotationMessage: 'Livraison urgente demandée', + quotationConditionsSale: 'Paiement à 30 jours', + productId: 5001, + productReferences: 123456, + productName: 'Feu d\'artifice A', + productDuration: 45.5, + productCaliber: 30, + productApprovalNumber: 998877, + productWeight: 1.5, + productNec: 0.5, + productImage: 'url_to_image_a', + productLink: 'http://example.com/product/a', + productMinimalQuantity: 5 + }, + { + quantity: 20, + quotationId: 102, + quotationMessage: 'Livraison standard', + quotationConditionsSale: 'Payé d\'avance', + productId: 5002, + productReferences: 654321, + productName: 'Feu d\'artifice B', + productDuration: 60.0, + productCaliber: 50, + productApprovalNumber: 112233, + productWeight: 2.0, + productNec: 0.8, + productImage: 'url_to_image_b', + productLink: 'http://example.com/product/b', + productMinimalQuantity: 10 + }, + { + quantity: 5, + quotationId: 103, + quotationMessage: null, + quotationConditionsSale: 'Paiement à 15 jours', + productId: 5003, + productReferences: 789012, + productName: 'Feu d\'artifice C', + productDuration: 30.0, + productCaliber: 25, + productApprovalNumber: 445566, + productWeight: 1.0, + productNec: 0.3, + productImage: null, + productLink: null, + productMinimalQuantity: 1 + } + ]; +} + diff --git a/src/app/pages/quotation/quotation.html b/src/app/pages/quotation/quotation.html index a2444b7..2edf3b6 100644 --- a/src/app/pages/quotation/quotation.html +++ b/src/app/pages/quotation/quotation.html @@ -1,9 +1,13 @@
    + + + +
    - +
    -

    quotation works!

    +
    diff --git a/src/app/pages/quotation/quotation.ts b/src/app/pages/quotation/quotation.ts index 586f94b..938dc1b 100644 --- a/src/app/pages/quotation/quotation.ts +++ b/src/app/pages/quotation/quotation.ts @@ -1,11 +1,21 @@ import { Component } from '@angular/core'; import {Search} from "../../components/search/search"; +import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; +import {ModalButton} from "../../components/modal-button/modal-button"; +import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form"; +import {QuotationForm} from "../../components/quotation-form/quotation-form"; +import {QuotationTable} from "../../components/quotation-table/quotation-table"; @Component({ selector: 'app-quotation', - imports: [ - Search - ], + imports: [ + DelivereryNoteTable, + ModalButton, + DelivereryNoteForm, + Search, + QuotationForm, + QuotationTable + ], templateUrl: './quotation.html', styleUrl: './quotation.css', }) From 49dea174c38deb743f786087374297dc6de3adb2 Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 20 Nov 2025 16:41:38 +0100 Subject: [PATCH 034/127] removed some unnecessary data --- .../quotation-form/quotation-form.html | 118 +----------------- .../quotation-form/quotation-form.ts | 15 +-- .../quotation-table/quotation-table.html | 43 ++++--- .../quotation-table/quotation-table.ts | 66 +++------- src/app/pages/quotation/quotation.ts | 2 - 5 files changed, 45 insertions(+), 199 deletions(-) diff --git a/src/app/components/quotation-form/quotation-form.html b/src/app/components/quotation-form/quotation-form.html index f491c1d..0aab894 100644 --- a/src/app/components/quotation-form/quotation-form.html +++ b/src/app/components/quotation-form/quotation-form.html @@ -1,16 +1,6 @@
    - Quantité - - - - - - - - - ID Devis @@ -30,7 +20,7 @@ - + Conditions de vente @@ -40,112 +30,12 @@ - - ID Produit + + Fournisseur - - - - - - - Référence produit - - - - - - - - - - Nom du produit - - - - - - - - - - Durée produit - - - - - - - - - - Calibre produit - - - - - - - - - - Numéro d'approbation - - - - - - - - - - Poids produit - - - - - - - - - - NEC Produit - - - - - - - - - - Image produit - - - - - - - - - - Lien produit - - - - - - - - - - Quantité minimale - - - - +
    diff --git a/src/app/components/quotation-form/quotation-form.ts b/src/app/components/quotation-form/quotation-form.ts index 234c0e3..b62a3fe 100644 --- a/src/app/components/quotation-form/quotation-form.ts +++ b/src/app/components/quotation-form/quotation-form.ts @@ -16,29 +16,16 @@ import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; NzColDirective, NzFlexDirective, NzFormDirective, - ReactiveFormsModule, - NzDatePickerComponent + ReactiveFormsModule ], templateUrl: './quotation-form.html', styleUrl: './quotation-form.css', }) export class QuotationForm { QuotationForm: FormGroup = new FormGroup({ - quantity: new FormControl(null, [Validators.required]), quotationId: new FormControl(null), quotationMessage: new FormControl(null), quotationConditionsSale: new FormControl(null), - productId: new FormControl(null), - productReferences: new FormControl(null), - productName: new FormControl(null), - productDuration: new FormControl(null), - productCaliber: new FormControl(null), - productApprovalNumber: new FormControl(null), - productWeight: new FormControl(null), - productNec: new FormControl(null), - productImage: new FormControl(null), - productLink: new FormControl(null), - productMinimalQuantity: new FormControl(null) }) submitForm() { diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index e6c4ef3..17ff897 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -1,12 +1,11 @@ - ID Devis - Nom du produit - Quantité + Numéro de Devis Message Conditions de vente - Détails produit + Fournisseur + Produit Action @@ -14,27 +13,31 @@ @for (data of basicTable.data; track data) { {{data.quotationId}} - {{data.productName}} - {{data.quantity}} {{data.quotationMessage}} {{data.quotationConditionsSale}} + {{data.Supplier}} + + - +
    - - - - - - - - - - - - + + + + + + + + + + + + + + + -
    ID Produit:{{data.productId}}
    Référence:{{data.productReferences}}
    Durée:{{data.productDuration}}
    Calibre:{{data.productCaliber}}
    Numéro d'approbation:{{data.productApprovalNumber}}
    Poids:{{data.productWeight}}
    NEC:{{data.productNec}}
    Quantité min:{{data.productMinimalQuantity}}
    Image:{{data.productImage}}
    Lien:{{data.productLink}}
    RéferenceNomQuantité
    {{data.quotationProductReference}}{{data.quotationProductName}}{{data.quotationProductQuantity}}
    +
    diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 73f4ef3..1e9a96e 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -7,21 +7,13 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; import {QuotationForm} from "../quotation-form/quotation-form"; interface QuotationInfo { - quantity: number; quotationId: number; quotationMessage?: string; quotationConditionsSale?: string; - productId: number; - productReferences: number; - productName?: string; - productDuration: number; - productCaliber: number; - productApprovalNumber: number; - productWeight: number; - productNec: number; - productImage?: string; - productLink?: string; - productMinimalQuantity: number; + quotationProductReference: string; + quotationProductName: string; + quotationProductQuantity?: number; + Supplier?: string; } @Component({ @@ -41,55 +33,31 @@ interface QuotationInfo { export class QuotationTable { quotations: QuotationInfo[] = [ { - quantity: 10, quotationId: 101, quotationMessage: 'Livraison urgente demandée', quotationConditionsSale: 'Paiement à 30 jours', - productId: 5001, - productReferences: 123456, - productName: 'Feu d\'artifice A', - productDuration: 45.5, - productCaliber: 30, - productApprovalNumber: 998877, - productWeight: 1.5, - productNec: 0.5, - productImage: 'url_to_image_a', - productLink: 'http://example.com/product/a', - productMinimalQuantity: 5 + quotationProductReference: 'DLV-1000', + quotationProductName: 'Produit1', + quotationProductQuantity: 5, + Supplier: 'fireworkssupplier&Co' }, { - quantity: 20, quotationId: 102, quotationMessage: 'Livraison standard', quotationConditionsSale: 'Payé d\'avance', - productId: 5002, - productReferences: 654321, - productName: 'Feu d\'artifice B', - productDuration: 60.0, - productCaliber: 50, - productApprovalNumber: 112233, - productWeight: 2.0, - productNec: 0.8, - productImage: 'url_to_image_b', - productLink: 'http://example.com/product/b', - productMinimalQuantity: 10 + quotationProductReference: 'DLV-1001', + quotationProductName: 'Produit2', + quotationProductQuantity: 6, + Supplier: 'fireworkssupplier&Co' }, { - quantity: 5, quotationId: 103, - quotationMessage: null, + quotationMessage: 'Livraison rapide', quotationConditionsSale: 'Paiement à 15 jours', - productId: 5003, - productReferences: 789012, - productName: 'Feu d\'artifice C', - productDuration: 30.0, - productCaliber: 25, - productApprovalNumber: 445566, - productWeight: 1.0, - productNec: 0.3, - productImage: null, - productLink: null, - productMinimalQuantity: 1 + quotationProductReference: 'DLV-1002', + quotationProductName: 'Produit3', + quotationProductQuantity: 7, + Supplier: 'fireworkssupplier&Co' } ]; } diff --git a/src/app/pages/quotation/quotation.ts b/src/app/pages/quotation/quotation.ts index 938dc1b..c22b8c2 100644 --- a/src/app/pages/quotation/quotation.ts +++ b/src/app/pages/quotation/quotation.ts @@ -9,9 +9,7 @@ import {QuotationTable} from "../../components/quotation-table/quotation-table"; @Component({ selector: 'app-quotation', imports: [ - DelivereryNoteTable, ModalButton, - DelivereryNoteForm, Search, QuotationForm, QuotationTable From 43362c8f771fe08e25e303c97f397c66a91d2538 Mon Sep 17 00:00:00 2001 From: Enzo Date: Thu, 20 Nov 2025 16:54:46 +0100 Subject: [PATCH 035/127] Creating Supplier Page --- .../supplier-form/supplier-form.css | 0 .../supplier-form/supplier-form.html | 66 +++++++++ .../components/supplier-form/supplier-form.ts | 45 ++++++ .../supplier-table/supplier-table.css | 85 +++++++++++ .../supplier-table/supplier-table.html | 59 ++++++++ .../supplier-table/supplier-table.ts | 134 ++++++++++++++++++ src/app/pages/supplier/supplier.html | 8 +- src/app/pages/supplier/supplier.ts | 8 +- 8 files changed, 402 insertions(+), 3 deletions(-) create mode 100644 src/app/components/supplier-form/supplier-form.css create mode 100644 src/app/components/supplier-form/supplier-form.html create mode 100644 src/app/components/supplier-form/supplier-form.ts create mode 100644 src/app/components/supplier-table/supplier-table.css create mode 100644 src/app/components/supplier-table/supplier-table.html create mode 100644 src/app/components/supplier-table/supplier-table.ts diff --git a/src/app/components/supplier-form/supplier-form.css b/src/app/components/supplier-form/supplier-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/supplier-form/supplier-form.html b/src/app/components/supplier-form/supplier-form.html new file mode 100644 index 0000000..1b7e80d --- /dev/null +++ b/src/app/components/supplier-form/supplier-form.html @@ -0,0 +1,66 @@ +
    + + + + Fournisseur + + + + + + + + + Email + + + + + + + + + Téléphone + + + + + + + + + Adresse + + + + + + + + + Ville + + + + + + + + + Délai Moyen + + + + + + + + + Produits + + + + + + +
    diff --git a/src/app/components/supplier-form/supplier-form.ts b/src/app/components/supplier-form/supplier-form.ts new file mode 100644 index 0000000..87895f2 --- /dev/null +++ b/src/app/components/supplier-form/supplier-form.ts @@ -0,0 +1,45 @@ +import { Component } from '@angular/core'; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; + +@Component({ + selector: 'app-supplier-form', + imports: [ + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule + ], + templateUrl: './supplier-form.html', + styleUrl: './supplier-form.css', +}) +export class SupplierForm { + supplierForm: FormGroup = new FormGroup({ + name: new FormControl(null, [Validators.required]), + email: new FormControl(null, [Validators.required]), + phone: new FormControl(null, [Validators.required]), + address: new FormControl(null, [Validators.required]), + city: new FormControl(null, [Validators.required]), + deliveryDelay: new FormControl(null, [Validators.required]), + product: new FormControl(null, [Validators.required]), + + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.supplierForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.supplierForm.getRawValue()) + + // Pour vider le formulaire + this.supplierForm.reset() + } +} diff --git a/src/app/components/supplier-table/supplier-table.css b/src/app/components/supplier-table/supplier-table.css new file mode 100644 index 0000000..7ae664f --- /dev/null +++ b/src/app/components/supplier-table/supplier-table.css @@ -0,0 +1,85 @@ +/* Table globale */ +nz-table { + width: 100%; + border-collapse: separate; + border-spacing: 0 8px; /* espace entre les lignes */ + background: #fff; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0,0,0,0.1); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +/* En-tête */ +nz-table thead tr { + background-color: #f5f5f5; + text-align: left; + font-weight: 600; + color: #333; + border-bottom: 2px solid #e0e0e0; +} + +nz-table thead th { + padding: 12px 16px; +} + +/* Lignes du tableau */ +nz-table tbody tr { + background-color: #fff; + transition: background 0.2s ease; +} + +nz-table tbody tr:nth-child(even) { + background-color: #f9f9f9; +} + +nz-table tbody tr:hover { + background-color: #e6f7ff; /* survol */ +} + +/* Cellules */ +nz-table tbody td { + padding: 12px 16px; + vertical-align: middle; + color: #444; +} + +/* Boutons */ +nz-table button[nz-button] { + margin-right: 8px; +} + +/* Modals dans le tableau */ +nz-table app-modal { + margin-right: 8px; +} + +/* Dates (pour alignement et style) */ +nz-table tbody td p { + margin: 0; + font-size: 14px; + color: #555; +} + +/* Responsive */ +@media (max-width: 768px) { + nz-table thead { + display: none; + } + nz-table tbody tr { + display: block; + margin-bottom: 16px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + border-radius: 8px; + padding: 12px; + } + nz-table tbody td { + display: flex; + justify-content: space-between; + padding: 6px 12px; + } + nz-table tbody td::before { + content: attr(data-label); + font-weight: 600; + } +} diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html new file mode 100644 index 0000000..8724470 --- /dev/null +++ b/src/app/components/supplier-table/supplier-table.html @@ -0,0 +1,59 @@ + + + + Nom + email + Téléphone + Adresse + Ville + Délai Moyen + Produits + Action + + + + @for (data of basicTable.data; track data) { + + {{data.name}} + {{data.email}} + {{data.phone}} + {{data.address}}, {{data.zipCode}} + {{data.city}} + {{data.deliveryDelay}} + + +
    + + + + Nom + Référence + + + + @for (product of data.products; track product) { + + {{product.name}} + {{product.reference}} + + } + + +
    +
    + + +
    + + + + +
    + +
    +
    + + + } + +
    diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts new file mode 100644 index 0000000..e6f9d25 --- /dev/null +++ b/src/app/components/supplier-table/supplier-table.ts @@ -0,0 +1,134 @@ +import { Component } from '@angular/core'; +import {ModalNav} from "../modal-nav/modal-nav"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {ModalButton} from "../modal-button/modal-button"; +import {DatePipe} from "@angular/common"; +import {SupplierForm} from "../supplier-form/supplier-form"; +import {SupplierInfo} from "../../interfaces/supplier.interface"; +import {DelivererForm} from "../deliverer-form/deliverer-form"; + +@Component({ + selector: 'app-supplier-table', + imports: [ + ModalNav, + NzDividerComponent, + NzIconDirective, + NzTableComponent, + ModalButton, + SupplierForm, + ], + templateUrl: './supplier-table.html', + styleUrl: './supplier-table.css', +}) + +export class SupplierTable { + listOfSupplier: SupplierInfo[] = [ + { + name: "PyroNova", + email: "contact@pyronova.com", + phone: "+33 1 45 23 67 89", + address: "12 Rue des Artisans", + zipCode: "69003", + city: "Lyon", + deliveryDelay: 4, + products: [] + }, + { + name: "FX Industries", + email: "sales@fxindus.com", + phone: "+33 2 41 22 90 10", + address: "118 Avenue Lumière", + zipCode: "49000", + city: "Angers", + deliveryDelay: 6, + products: [] + }, + { + name: "EuroFire", + email: "info@eurofire.eu", + phone: "+33 1 80 22 11 77", + address: "2 Avenue de l’Europe", + zipCode: "75012", + city: "Paris", + deliveryDelay: 3, + products: [] + }, + { + name: "FlashEffect", + email: "contact@flasheffect.fr", + phone: "+33 4 72 81 91 22", + address: "44 Rue Centrale", + zipCode: "69007", + city: "Lyon", + deliveryDelay: 5, + products: [] + }, + { + name: "StageLight FX", + email: "support@stagelightfx.com", + phone: "+33 5 55 74 99 31", + address: "99 Boulevard du Progrès", + zipCode: "31000", + city: "Toulouse", + deliveryDelay: 7, + products: [] + }, + { + name: "NovaSpark", + email: "hello@novaspark.fr", + phone: "+33 3 29 55 11 88", + address: "7 Rue de la Source", + zipCode: "54000", + city: "Nancy", + deliveryDelay: 4, + products: [] + }, + { + name: "FXWare", + email: "contact@fxware.eu", + phone: "+33 4 75 55 66 44", + address: "123 Route du Nord", + zipCode: "38000", + city: "Grenoble", + deliveryDelay: 6, + products: [] + }, + { + name: "PyroSet", + email: "info@pyroset.com", + phone: "+33 1 61 73 55 00", + address: "5 Chemin des Prés", + zipCode: "95000", + city: "Cergy", + deliveryDelay: 2, + products: [] + }, + { + name: "SkyFX", + email: "support@skyfx.fr", + phone: "+33 6 55 88 22 11", + address: "1 Rue du Ciel", + zipCode: "33000", + city: "Bordeaux", + deliveryDelay: 5, + products: [] + }, + { + name: "SparkLab", + email: "sales@sparklab.eu", + phone: "+33 2 33 55 77 12", + address: "33 Rue du Port", + zipCode: "14000", + city: "Caen", + deliveryDelay: 4, + products: [] + } + ]; + + delete() { + return + } +} + diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 58666c3..08f4baa 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -1,9 +1,13 @@
    + + + +
    - +
    -

    supplier works!

    +
    diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 610e14d..7f5c1ee 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -1,10 +1,16 @@ import { Component } from '@angular/core'; import {Search} from "../../components/search/search"; +import {ModalButton} from "../../components/modal-button/modal-button"; +import {SupplierTable} from "../../components/supplier-table/supplier-table"; +import {SupplierForm} from "../../components/supplier-form/supplier-form"; @Component({ selector: 'app-supplier', imports: [ - Search + Search, + SupplierForm, + SupplierTable, + ModalButton ], templateUrl: './supplier.html', styleUrl: './supplier.css', From a240f4268462cd0205756581d30eb3e0b122a789 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 20 Nov 2025 16:55:42 +0100 Subject: [PATCH 036/127] creating purchase order page --- .../deliverery-note-table.html | 4 +- .../deliverery-note-table.ts | 8 + .../components/product-form/product-form.css | 0 .../components/product-form/product-form.html | 21 ++ .../components/product-form/product-form.ts | 40 ++++ .../purchase-order-form.css | 0 .../purchase-order-form.html | 11 + .../purchase-order-form.ts | 41 ++++ .../purchase-order-table.css | 85 ++++++++ .../purchase-order-table.html | 75 +++++++ .../purchase-order-table.ts | 193 ++++++++++++++++++ .../pages/purchase-order/purchase-order.html | 4 +- .../pages/purchase-order/purchase-order.ts | 10 + src/app/pages/stock/stock.html | 1 + 14 files changed, 490 insertions(+), 3 deletions(-) create mode 100644 src/app/components/product-form/product-form.css create mode 100644 src/app/components/product-form/product-form.html create mode 100644 src/app/components/product-form/product-form.ts create mode 100644 src/app/components/purchase-order-form/purchase-order-form.css create mode 100644 src/app/components/purchase-order-form/purchase-order-form.html create mode 100644 src/app/components/purchase-order-form/purchase-order-form.ts create mode 100644 src/app/components/purchase-order-table/purchase-order-table.css create mode 100644 src/app/components/purchase-order-table/purchase-order-table.html create mode 100644 src/app/components/purchase-order-table/purchase-order-table.ts diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index ba7b371..72e73f9 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -49,11 +49,11 @@
    - +
    - +
    diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index 08abecc..6a1df24 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -146,4 +146,12 @@ export class DelivereryNoteTable { ], }, ]; + + delete() { + return + } + + export() { + return + } } diff --git a/src/app/components/product-form/product-form.css b/src/app/components/product-form/product-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/product-form/product-form.html b/src/app/components/product-form/product-form.html new file mode 100644 index 0000000..aa6c53c --- /dev/null +++ b/src/app/components/product-form/product-form.html @@ -0,0 +1,21 @@ +
    + + + Prix + + + + + + + + + + Quantité + + + + + + +
    \ No newline at end of file diff --git a/src/app/components/product-form/product-form.ts b/src/app/components/product-form/product-form.ts new file mode 100644 index 0000000..f3fca0a --- /dev/null +++ b/src/app/components/product-form/product-form.ts @@ -0,0 +1,40 @@ +import { Component } from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; + +@Component({ + selector: 'app-product-form', + imports: [ + FormsModule, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule + ], + templateUrl: './product-form.html', + styleUrl: './product-form.css', +}) +export class ProductForm { + productForm: FormGroup = new FormGroup({ + price: new FormControl(null, [Validators.required]), + quantity: new FormControl(null, [Validators.required]) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.productForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.productForm.getRawValue()) + + // Pour vider le formulaire + this.productForm.reset() + } +} diff --git a/src/app/components/purchase-order-form/purchase-order-form.css b/src/app/components/purchase-order-form/purchase-order-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/purchase-order-form/purchase-order-form.html b/src/app/components/purchase-order-form/purchase-order-form.html new file mode 100644 index 0000000..9e8e9e4 --- /dev/null +++ b/src/app/components/purchase-order-form/purchase-order-form.html @@ -0,0 +1,11 @@ +
    + + + Conditions générales de vente + + + + + + +
    \ No newline at end of file diff --git a/src/app/components/purchase-order-form/purchase-order-form.ts b/src/app/components/purchase-order-form/purchase-order-form.ts new file mode 100644 index 0000000..32d16c8 --- /dev/null +++ b/src/app/components/purchase-order-form/purchase-order-form.ts @@ -0,0 +1,41 @@ +import { Component } from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; + +@Component({ + selector: 'app-purchase-order-form', + imports: [ + FormsModule, + NzColDirective, + NzDatePickerComponent, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule + ], + templateUrl: './purchase-order-form.html', + styleUrl: './purchase-order-form.css', +}) +export class PurchaseOrderForm { + purchaseOrderForm: FormGroup = new FormGroup({ + purchaseCondition: new FormControl(null,[Validators.required]) + }) + + submitForm() { + // Pour annuler si le formulaire est invalide + if (this.purchaseOrderForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.purchaseOrderForm.getRawValue()) + + // Pour vider le formulaire + this.purchaseOrderForm.reset() + } +} diff --git a/src/app/components/purchase-order-table/purchase-order-table.css b/src/app/components/purchase-order-table/purchase-order-table.css new file mode 100644 index 0000000..7ae664f --- /dev/null +++ b/src/app/components/purchase-order-table/purchase-order-table.css @@ -0,0 +1,85 @@ +/* Table globale */ +nz-table { + width: 100%; + border-collapse: separate; + border-spacing: 0 8px; /* espace entre les lignes */ + background: #fff; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0,0,0,0.1); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + +/* En-tête */ +nz-table thead tr { + background-color: #f5f5f5; + text-align: left; + font-weight: 600; + color: #333; + border-bottom: 2px solid #e0e0e0; +} + +nz-table thead th { + padding: 12px 16px; +} + +/* Lignes du tableau */ +nz-table tbody tr { + background-color: #fff; + transition: background 0.2s ease; +} + +nz-table tbody tr:nth-child(even) { + background-color: #f9f9f9; +} + +nz-table tbody tr:hover { + background-color: #e6f7ff; /* survol */ +} + +/* Cellules */ +nz-table tbody td { + padding: 12px 16px; + vertical-align: middle; + color: #444; +} + +/* Boutons */ +nz-table button[nz-button] { + margin-right: 8px; +} + +/* Modals dans le tableau */ +nz-table app-modal { + margin-right: 8px; +} + +/* Dates (pour alignement et style) */ +nz-table tbody td p { + margin: 0; + font-size: 14px; + color: #555; +} + +/* Responsive */ +@media (max-width: 768px) { + nz-table thead { + display: none; + } + nz-table tbody tr { + display: block; + margin-bottom: 16px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + border-radius: 8px; + padding: 12px; + } + nz-table tbody td { + display: flex; + justify-content: space-between; + padding: 6px 12px; + } + nz-table tbody td::before { + content: attr(data-label); + font-weight: 600; + } +} diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html new file mode 100644 index 0000000..27b75c5 --- /dev/null +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -0,0 +1,75 @@ + + + + Numéro + Conditions de vente + Fournisseur + Produits + Action + + + + @for (data of basicTable.data; track data) { + + + + + + +
    + + + + Nom + Prix + Quantité + Action + + + + @for (product of data.productOrder; track product) { + + {{product.product.name}} + {{product.price}}€ + {{product.quantity}} + +
    + + + + +
    + +
    +
    + + + } + +
    +
    +
    + + +
    + + + + +
    + +
    + +
    + +
    + +
    + +
    +
    + + + } + +
    diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts new file mode 100644 index 0000000..ee9c5a3 --- /dev/null +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -0,0 +1,193 @@ +import { Component } from '@angular/core'; +import {ModalNav} from "../modal-nav/modal-nav"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {PurchaseOrderInfo} from "../../interfaces/purchase-order.interface"; +import {PurchaseOrderForm} from "../purchase-order-form/purchase-order-form"; +import {ModalButton} from "../modal-button/modal-button"; +import {ProductForm} from "../product-form/product-form"; + +@Component({ + selector: 'app-purchase-order-table', + imports: [ + ModalNav, + NzDividerComponent, + NzIconDirective, + NzTableComponent, + PurchaseOrderForm, + ModalButton, + ProductForm + ], + templateUrl: './purchase-order-table.html', + styleUrl: './purchase-order-table.css', +}) +export class PurchaseOrderTable { + purchaseOrders: PurchaseOrderInfo[] = [ + { + purchaseCondition: "Condition d'achat standard 1", + supplier: { + name: "Fournisseur 1", + email: "contact1@example.com", + phone: "0100000001", + address: "1 Rue de Paris", + zipCode: "75001", + city: "Paris", + deliveryDelay: 3, + products: [ + { + reference: "F1-P1", + name: "Produit 1A", + supplier: [], + duration: 0, + caliber: "", + approvalNumber: "", + weight: 1, + nec: 0, + image: "", + link: "", + minimalQuantity: 1 + }, + { + reference: "F1-P2", + name: "Produit 1B", + supplier: [], + duration: 0, + caliber: "", + approvalNumber: "", + weight: 2, + nec: 0, + image: "", + link: "", + minimalQuantity: 1 + } + ] + }, + productOrder: [ + { + product: { + reference: "F1-P1", + name: "Produit 1A", + supplier: [], + duration: 0, + caliber: "", + approvalNumber: "", + weight: 1, + nec: 0, + image: "", + link: "", + minimalQuantity: 1 + }, + quantity: 5, + price: 10 + }, + { + product: { + reference: "F1-P2", + name: "Produit 1B", + supplier: [], + duration: 0, + caliber: "", + approvalNumber: "", + weight: 2, + nec: 0, + image: "", + link: "", + minimalQuantity: 1 + }, + quantity: 3, + price: 15 + } + ] + }, + + { + purchaseCondition: "Condition d'achat standard 2", + supplier: { + name: "Fournisseur 2", + email: "contact2@example.com", + phone: "0100000002", + address: "2 Rue de Lyon", + zipCode: "75002", + city: "Paris", + deliveryDelay: 4, + products: [ + { + reference: "F2-P1", + name: "Produit 2A", + supplier: [], + duration: 0, + caliber: "", + approvalNumber: "", + weight: 1.5, + nec: 0, + image: "", + link: "", + minimalQuantity: 1 + }, + { + reference: "F2-P2", + name: "Produit 2B", + supplier: [], + duration: 0, + caliber: "", + approvalNumber: "", + weight: 2.5, + nec: 0, + image: "", + link: "", + minimalQuantity: 1 + } + ] + }, + productOrder: [ + { + product: { + reference: "F2-P1", + name: "Produit 2A", + supplier: [], + duration: 0, + caliber: "", + approvalNumber: "", + weight: 1.5, + nec: 0, + image: "", + link: "", + minimalQuantity: 1 + }, + quantity: 6, + price: 11 + }, + { + product: { + reference: "F2-P2", + name: "Produit 2B", + supplier: [], + duration: 0, + caliber: "", + approvalNumber: "", + weight: 2.5, + nec: 0, + image: "", + link: "", + minimalQuantity: 1 + }, + quantity: 4, + price: 16 + } + ] + }, + ]; + + delete() { + return + } + + export(){ + return + } + + transfert() { + return + } +} diff --git a/src/app/pages/purchase-order/purchase-order.html b/src/app/pages/purchase-order/purchase-order.html index 90c59af..9e67c89 100644 --- a/src/app/pages/purchase-order/purchase-order.html +++ b/src/app/pages/purchase-order/purchase-order.html @@ -3,6 +3,8 @@
    +
    -

    purchase-order works!

    +
    + diff --git a/src/app/pages/purchase-order/purchase-order.ts b/src/app/pages/purchase-order/purchase-order.ts index 1bc1ac7..fb3fd77 100644 --- a/src/app/pages/purchase-order/purchase-order.ts +++ b/src/app/pages/purchase-order/purchase-order.ts @@ -1,10 +1,20 @@ import { Component } from '@angular/core'; import {Search} from "../../components/search/search"; +import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form"; +import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; +import {ModalButton} from "../../components/modal-button/modal-button"; +import {PurchaseOrderTable} from "../../components/purchase-order-table/purchase-order-table"; +import {PurchaseOrderForm} from "../../components/purchase-order-form/purchase-order-form"; @Component({ selector: 'app-purchase-order', imports: [ Search, + DelivereryNoteForm, + DelivereryNoteTable, + ModalButton, + PurchaseOrderTable, + PurchaseOrderForm, ], templateUrl: './purchase-order.html', styleUrl: './purchase-order.css', diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index 3bb6f5f..e1edf81 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,6 +1,7 @@
    +faire ici la creation de bon de commande avec case a cocher
    From 1aecbcc0bbafe256ef019ae2fd08d9d6d8d90f13 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 20 Nov 2025 17:05:13 +0100 Subject: [PATCH 037/127] updated supplier.html --- src/app/pages/supplier/supplier.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 08f4baa..53cd6a6 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -7,7 +7,7 @@
    - +voir pour le prix dans le sous tableau produit
    From 0922bad1354cc4706ec5663941e0b141d832eb24 Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 20 Nov 2025 17:10:10 +0100 Subject: [PATCH 038/127] created quotation page --- .../quotation-table/quotation-table.html | 24 ++++++++++++----- .../quotation-table/quotation-table.ts | 27 ++++++++++++++++--- src/app/pages/quotation/quotation.html | 2 +- 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 17ff897..3ddfe1e 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -17,7 +17,6 @@ {{data.quotationConditionsSale}} {{data.Supplier}} -
    @@ -27,14 +26,27 @@ Réference Nom Quantité + Action - - {{data.quotationProductReference}} - {{data.quotationProductName}} - {{data.quotationProductQuantity}} - + + + {{data.quotationProductReference}} + {{data.quotationProductName}} + {{data.quotationProductQuantity}} + +
    + + + + +
    + +
    +
    + + diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 1e9a96e..6dcbfca 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -5,11 +5,17 @@ import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {QuotationForm} from "../quotation-form/quotation-form"; +import {ProductTable} from "../product-table/product-table"; interface QuotationInfo { quotationId: number; quotationMessage?: string; quotationConditionsSale?: string; + quotationProduct: [ + { quotationProductReference: string; }, + { quotationProductName: string; }, + { quotationProductQuantity?: number; }, + ], quotationProductReference: string; quotationProductName: string; quotationProductQuantity?: number; @@ -36,28 +42,43 @@ export class QuotationTable { quotationId: 101, quotationMessage: 'Livraison urgente demandée', quotationConditionsSale: 'Paiement à 30 jours', + quotationProduct: [ + { quotationProductReference: 'DLV-1000' }, + { quotationProductName: 'Produit1'}, + { quotationProductQuantity: 5 }, + ], quotationProductReference: 'DLV-1000', quotationProductName: 'Produit1', quotationProductQuantity: 5, - Supplier: 'fireworkssupplier&Co' + Supplier: 'Fireworkssupplier&Co' }, { quotationId: 102, quotationMessage: 'Livraison standard', quotationConditionsSale: 'Payé d\'avance', + quotationProduct: [ + { quotationProductReference: 'DLV-1001' }, + { quotationProductName: 'Produit2'}, + { quotationProductQuantity: 6 }, + ], quotationProductReference: 'DLV-1001', quotationProductName: 'Produit2', quotationProductQuantity: 6, - Supplier: 'fireworkssupplier&Co' + Supplier: 'Fireworkssupplier&Co' }, { quotationId: 103, quotationMessage: 'Livraison rapide', quotationConditionsSale: 'Paiement à 15 jours', + quotationProduct: [ + { quotationProductReference: 'DLV-1003' }, + { quotationProductName: 'Produit3'}, + { quotationProductQuantity: 7 }, + ], quotationProductReference: 'DLV-1002', quotationProductName: 'Produit3', quotationProductQuantity: 7, - Supplier: 'fireworkssupplier&Co' + Supplier: 'Fireworkssupplier&Co' } ]; } diff --git a/src/app/pages/quotation/quotation.html b/src/app/pages/quotation/quotation.html index 2edf3b6..307e87f 100644 --- a/src/app/pages/quotation/quotation.html +++ b/src/app/pages/quotation/quotation.html @@ -7,7 +7,7 @@
    - +voir prix dans les produits + suppr id devis dans form et dans bon de livraison form
    From c5f34ef6ad4e08f73bea5a7ae9940b2694f4ca26 Mon Sep 17 00:00:00 2001 From: ikuzenkuna Date: Thu, 20 Nov 2025 17:14:30 +0100 Subject: [PATCH 039/127] fixed purchase's importations --- .../components/purchase-order-form/purchase-order-form.ts | 2 -- src/app/pages/purchase-order/purchase-order.ts | 8 -------- 2 files changed, 10 deletions(-) diff --git a/src/app/components/purchase-order-form/purchase-order-form.ts b/src/app/components/purchase-order-form/purchase-order-form.ts index 32d16c8..f2e737c 100644 --- a/src/app/components/purchase-order-form/purchase-order-form.ts +++ b/src/app/components/purchase-order-form/purchase-order-form.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzColDirective} from "ng-zorro-antd/grid"; -import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; @@ -11,7 +10,6 @@ import {NzInputDirective} from "ng-zorro-antd/input"; imports: [ FormsModule, NzColDirective, - NzDatePickerComponent, NzFlexDirective, NzFormControlComponent, NzFormDirective, diff --git a/src/app/pages/purchase-order/purchase-order.ts b/src/app/pages/purchase-order/purchase-order.ts index fb3fd77..cdfd85b 100644 --- a/src/app/pages/purchase-order/purchase-order.ts +++ b/src/app/pages/purchase-order/purchase-order.ts @@ -1,20 +1,12 @@ import { Component } from '@angular/core'; import {Search} from "../../components/search/search"; -import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form"; -import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; -import {ModalButton} from "../../components/modal-button/modal-button"; import {PurchaseOrderTable} from "../../components/purchase-order-table/purchase-order-table"; -import {PurchaseOrderForm} from "../../components/purchase-order-form/purchase-order-form"; @Component({ selector: 'app-purchase-order', imports: [ Search, - DelivereryNoteForm, - DelivereryNoteTable, - ModalButton, PurchaseOrderTable, - PurchaseOrderForm, ], templateUrl: './purchase-order.html', styleUrl: './purchase-order.css', From 1ba9d0f8cad1a32437ec72b920e7df7ebaabbe26 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 20 Nov 2025 17:20:46 +0100 Subject: [PATCH 040/127] updated quotation-form.html --- src/app/components/product-form/product-form.html | 4 ++-- src/app/components/quotation-table/quotation-table.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/components/product-form/product-form.html b/src/app/components/product-form/product-form.html index aa6c53c..c4362c1 100644 --- a/src/app/components/product-form/product-form.html +++ b/src/app/components/product-form/product-form.html @@ -4,7 +4,7 @@ Prix - + @@ -14,7 +14,7 @@ Quantité - + diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 6dcbfca..db47810 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -6,6 +6,7 @@ import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {QuotationForm} from "../quotation-form/quotation-form"; import {ProductTable} from "../product-table/product-table"; +import {ProductForm} from "../product-form/product-form"; interface QuotationInfo { quotationId: number; @@ -30,7 +31,8 @@ interface QuotationInfo { NzDividerComponent, NzIconDirective, NzTableComponent, - QuotationForm + QuotationForm, + ProductForm ], templateUrl: './quotation-table.html', styleUrl: './quotation-table.css', From a1a73ec67dc4736d9e7c8e5f16c0e83a88db0338 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 20 Nov 2025 17:29:35 +0100 Subject: [PATCH 041/127] updated quotation and delivery note --- .../deliverery-note-form/deliverery-note-form.html | 10 ---------- .../deliverery-note-form/deliverery-note-form.ts | 1 - src/app/components/quotation-form/quotation-form.html | 10 ---------- src/app/components/quotation-form/quotation-form.ts | 1 - src/app/pages/quotation/quotation.html | 2 +- 5 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.html b/src/app/components/deliverery-note-form/deliverery-note-form.html index 5e9e63d..8f8a125 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.html +++ b/src/app/components/deliverery-note-form/deliverery-note-form.html @@ -1,14 +1,4 @@
    - - - Numéro de livraison - - - - - - - Transporteur diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index d265263..e65ba35 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -24,7 +24,6 @@ import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; }) export class DelivereryNoteForm { deliveryNoteForm: FormGroup = new FormGroup({ - trackingNumber: new FormControl(null,[Validators.required]), deliverer: new FormControl(null,[Validators.required]), expeditionDate: new FormControl(null,[Validators.required]), estimatedDate: new FormControl(null), diff --git a/src/app/components/quotation-form/quotation-form.html b/src/app/components/quotation-form/quotation-form.html index 0aab894..2716fab 100644 --- a/src/app/components/quotation-form/quotation-form.html +++ b/src/app/components/quotation-form/quotation-form.html @@ -1,14 +1,4 @@ - - - ID Devis - - - - - - - Message du devis diff --git a/src/app/components/quotation-form/quotation-form.ts b/src/app/components/quotation-form/quotation-form.ts index b62a3fe..6db611c 100644 --- a/src/app/components/quotation-form/quotation-form.ts +++ b/src/app/components/quotation-form/quotation-form.ts @@ -23,7 +23,6 @@ import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; }) export class QuotationForm { QuotationForm: FormGroup = new FormGroup({ - quotationId: new FormControl(null), quotationMessage: new FormControl(null), quotationConditionsSale: new FormControl(null), }) diff --git a/src/app/pages/quotation/quotation.html b/src/app/pages/quotation/quotation.html index 307e87f..6fa1e5b 100644 --- a/src/app/pages/quotation/quotation.html +++ b/src/app/pages/quotation/quotation.html @@ -7,7 +7,7 @@
    -voir prix dans les produits + suppr id devis dans form et dans bon de livraison form +voir prix dans les produits
    From 378c66df796c5f6105939d5018da9bd2ba67e684 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 24 Nov 2025 15:47:52 +0100 Subject: [PATCH 042/127] updated package-lock.json --- package-lock.json | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 44d4250..e261fed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -499,6 +499,7 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -515,6 +516,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -528,6 +530,7 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -560,6 +563,7 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -585,6 +589,7 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -603,6 +608,7 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -625,6 +631,7 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -706,6 +713,7 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1638,6 +1646,7 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -4020,6 +4029,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -4859,6 +4869,7 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -5676,6 +5687,7 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -5963,6 +5975,7 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -7610,6 +7623,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -7648,6 +7662,7 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -8308,7 +8323,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/tuf-js": { "version": "3.1.0", @@ -8346,6 +8362,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8467,6 +8484,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -8837,6 +8855,7 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -8855,7 +8874,8 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT" + "license": "MIT", + "peer": true } } } From 234e30c25cdb505b5e5e2da486cc396bc1940ada Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 24 Nov 2025 16:28:06 +0100 Subject: [PATCH 043/127] connected back to front --- openapi-generator.yaml | 3 + openapitools.json | 7 + package-lock.json | 1669 ++++++++++++++++- package.json | 5 +- src/app/services/api/.gitignore | 4 + .../services/api/.openapi-generator-ignore | 23 + src/app/services/api/.openapi-generator/FILES | 66 + .../services/api/.openapi-generator/VERSION | 1 + src/app/services/api/README.md | 185 ++ src/app/services/api/api.base.service.ts | 83 + src/app/services/api/api.module.ts | 30 + src/app/services/api/api/api.ts | 25 + .../services/api/api/deliverers.service.ts | 331 ++++ .../services/api/api/deliverynotes.service.ts | 278 +++ src/app/services/api/api/prices.service.ts | 235 +++ src/app/services/api/api/products.service.ts | 282 +++ .../api/api/purchaseorders.service.ts | 265 +++ .../api/api/purchaseproducts.service.ts | 235 +++ .../api/api/quotationproducts.service.ts | 235 +++ .../services/api/api/quotations.service.ts | 265 +++ src/app/services/api/api/settings.service.ts | 351 ++++ src/app/services/api/api/suppliers.service.ts | 401 ++++ src/app/services/api/api/users.service.ts | 469 +++++ .../api/api/warehouseproducts.service.ts | 168 ++ src/app/services/api/configuration.ts | 193 ++ src/app/services/api/encoder.ts | 20 + src/app/services/api/git_push.sh | 57 + src/app/services/api/index.ts | 7 + .../services/api/model/connect-user-dto.ts | 16 + .../api/model/create-deliverer-dto.ts | 15 + .../api/model/create-delivery-note-dto.ts | 19 + .../services/api/model/create-price-dto.ts | 34 + .../api/model/create-purchase-product-dto.ts | 18 + .../api/model/create-quotation-product-dto.ts | 29 + .../services/api/model/create-setting-dto.ts | 16 + .../services/api/model/create-supplier-dto.ts | 21 + src/app/services/api/model/create-user-dto.ts | 18 + .../services/api/model/get-deliverer-dto.ts | 18 + .../api/model/get-delivery-note-dto.ts | 23 + src/app/services/api/model/get-price-dto.ts | 35 + .../api/model/get-product-delivery-dto.ts | 33 + src/app/services/api/model/get-product-dto.ts | 25 + .../api/model/get-purchase-order-dto.ts | 18 + .../api/model/get-purchase-product-dto.ts | 28 + .../services/api/model/get-quotation-dto.ts | 19 + .../api/model/get-quotation-product-dto.ts | 29 + src/app/services/api/model/get-setting-dto.ts | 17 + .../services/api/model/get-supplier-dto.ts | 22 + src/app/services/api/model/get-token-dto.ts | 15 + .../api/model/get-total-quantity-dto.ts | 16 + src/app/services/api/model/get-user-dto.ts | 20 + .../api/model/get-ware-house-product-dto.ts | 17 + src/app/services/api/model/models.ts | 40 + ...ch-delivery-note-real-delivery-date-dto.ts | 15 + .../model/patch-price-selling-price-dto.ts | 15 + .../model/patch-product-minimal-stock-dto.ts | 15 + ...-purchase-order-purchase-conditions-dto.ts | 15 + .../patch-purchase-product-quantity-dto.ts | 15 + .../patch-quotation-conditions-sale-dto.ts | 15 + .../patch-quotation-product-quantity-dto.ts | 15 + .../patch-setting-electronic-signature-dto.ts | 15 + .../api/model/patch-setting-logo-dto.ts | 15 + .../patch-supplier-delivery-delay-dto.ts | 15 + .../api/model/patch-user-password-dto.ts | 15 + .../patch-ware-house-product-quantity-dto.ts | 15 + .../api/model/update-deliverer-dto.ts | 15 + .../services/api/model/update-product-dto.ts | 24 + .../services/api/model/update-supplier-dto.ts | 21 + src/app/services/api/model/update-user-dto.ts | 18 + src/app/services/api/param.ts | 69 + src/app/services/api/provide-api.ts | 15 + src/app/services/api/variables.ts | 9 + 72 files changed, 6733 insertions(+), 72 deletions(-) create mode 100644 openapi-generator.yaml create mode 100644 openapitools.json create mode 100644 src/app/services/api/.gitignore create mode 100644 src/app/services/api/.openapi-generator-ignore create mode 100644 src/app/services/api/.openapi-generator/FILES create mode 100644 src/app/services/api/.openapi-generator/VERSION create mode 100644 src/app/services/api/README.md create mode 100644 src/app/services/api/api.base.service.ts create mode 100644 src/app/services/api/api.module.ts create mode 100644 src/app/services/api/api/api.ts create mode 100644 src/app/services/api/api/deliverers.service.ts create mode 100644 src/app/services/api/api/deliverynotes.service.ts create mode 100644 src/app/services/api/api/prices.service.ts create mode 100644 src/app/services/api/api/products.service.ts create mode 100644 src/app/services/api/api/purchaseorders.service.ts create mode 100644 src/app/services/api/api/purchaseproducts.service.ts create mode 100644 src/app/services/api/api/quotationproducts.service.ts create mode 100644 src/app/services/api/api/quotations.service.ts create mode 100644 src/app/services/api/api/settings.service.ts create mode 100644 src/app/services/api/api/suppliers.service.ts create mode 100644 src/app/services/api/api/users.service.ts create mode 100644 src/app/services/api/api/warehouseproducts.service.ts create mode 100644 src/app/services/api/configuration.ts create mode 100644 src/app/services/api/encoder.ts create mode 100644 src/app/services/api/git_push.sh create mode 100644 src/app/services/api/index.ts create mode 100644 src/app/services/api/model/connect-user-dto.ts create mode 100644 src/app/services/api/model/create-deliverer-dto.ts create mode 100644 src/app/services/api/model/create-delivery-note-dto.ts create mode 100644 src/app/services/api/model/create-price-dto.ts create mode 100644 src/app/services/api/model/create-purchase-product-dto.ts create mode 100644 src/app/services/api/model/create-quotation-product-dto.ts create mode 100644 src/app/services/api/model/create-setting-dto.ts create mode 100644 src/app/services/api/model/create-supplier-dto.ts create mode 100644 src/app/services/api/model/create-user-dto.ts create mode 100644 src/app/services/api/model/get-deliverer-dto.ts create mode 100644 src/app/services/api/model/get-delivery-note-dto.ts create mode 100644 src/app/services/api/model/get-price-dto.ts create mode 100644 src/app/services/api/model/get-product-delivery-dto.ts create mode 100644 src/app/services/api/model/get-product-dto.ts create mode 100644 src/app/services/api/model/get-purchase-order-dto.ts create mode 100644 src/app/services/api/model/get-purchase-product-dto.ts create mode 100644 src/app/services/api/model/get-quotation-dto.ts create mode 100644 src/app/services/api/model/get-quotation-product-dto.ts create mode 100644 src/app/services/api/model/get-setting-dto.ts create mode 100644 src/app/services/api/model/get-supplier-dto.ts create mode 100644 src/app/services/api/model/get-token-dto.ts create mode 100644 src/app/services/api/model/get-total-quantity-dto.ts create mode 100644 src/app/services/api/model/get-user-dto.ts create mode 100644 src/app/services/api/model/get-ware-house-product-dto.ts create mode 100644 src/app/services/api/model/models.ts create mode 100644 src/app/services/api/model/patch-delivery-note-real-delivery-date-dto.ts create mode 100644 src/app/services/api/model/patch-price-selling-price-dto.ts create mode 100644 src/app/services/api/model/patch-product-minimal-stock-dto.ts create mode 100644 src/app/services/api/model/patch-purchase-order-purchase-conditions-dto.ts create mode 100644 src/app/services/api/model/patch-purchase-product-quantity-dto.ts create mode 100644 src/app/services/api/model/patch-quotation-conditions-sale-dto.ts create mode 100644 src/app/services/api/model/patch-quotation-product-quantity-dto.ts create mode 100644 src/app/services/api/model/patch-setting-electronic-signature-dto.ts create mode 100644 src/app/services/api/model/patch-setting-logo-dto.ts create mode 100644 src/app/services/api/model/patch-supplier-delivery-delay-dto.ts create mode 100644 src/app/services/api/model/patch-user-password-dto.ts create mode 100644 src/app/services/api/model/patch-ware-house-product-quantity-dto.ts create mode 100644 src/app/services/api/model/update-deliverer-dto.ts create mode 100644 src/app/services/api/model/update-product-dto.ts create mode 100644 src/app/services/api/model/update-supplier-dto.ts create mode 100644 src/app/services/api/model/update-user-dto.ts create mode 100644 src/app/services/api/param.ts create mode 100644 src/app/services/api/provide-api.ts create mode 100644 src/app/services/api/variables.ts diff --git a/openapi-generator.yaml b/openapi-generator.yaml new file mode 100644 index 0000000..0738df7 --- /dev/null +++ b/openapi-generator.yaml @@ -0,0 +1,3 @@ +additionalProperties: + fileNaming: kebab-case + modelPropertyNaming: camelCase \ No newline at end of file diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..f052220 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.17.0" + } +} diff --git a/package-lock.json b/package-lock.json index e261fed..488f3a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@angular/forms": "^20.3.0", "@angular/platform-browser": "^20.3.0", "@angular/router": "^20.3.0", + "@openapitools/openapi-generator-cli": "^2.25.2", "@tailwindcss/postcss": "^4.1.17", "@tailwindcss/vite": "^4.1.17", "ng-zorro-antd": "^20.4.0", @@ -985,6 +986,16 @@ "node": ">=6.9.0" } }, + "node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/@ctrl/tinycolor": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", @@ -1545,7 +1556,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.3.tgz", "integrity": "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==", - "dev": true, "license": "MIT", "dependencies": { "chardet": "^2.1.1", @@ -1765,7 +1775,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "dev": true, "license": "MIT", "engines": { "node": "20 || >=22" @@ -1775,7 +1784,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", - "dev": true, "license": "MIT", "dependencies": { "@isaacs/balanced-match": "^4.0.1" @@ -2028,6 +2036,15 @@ "win32" ] }, + "node_modules/@lukeed/csprng": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", + "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@modelcontextprotocol/sdk": { "version": "1.17.3", "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.17.3.tgz", @@ -2483,6 +2500,90 @@ "node": ">= 10" } }, + "node_modules/@nestjs/axios": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-4.0.1.tgz", + "integrity": "sha512-68pFJgu+/AZbWkGu65Z3r55bTsCPlgyKaV4BSG8yUAD72q1PPuyVRgUwFv6BxdnibTUHlyxm06FmYWNC+bjN7A==", + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "axios": "^1.3.1", + "rxjs": "^7.0.0" + } + }, + "node_modules/@nestjs/common": { + "version": "11.1.9", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", + "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "file-type": "21.1.0", + "iterare": "1.2.1", + "load-esm": "1.0.3", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "class-transformer": ">=0.4.1", + "class-validator": ">=0.13.2", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/core": { + "version": "11.1.9", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.9.tgz", + "integrity": "sha512-a00B0BM4X+9z+t3UxJqIZlemIwCQdYoPKrMcM+ky4z3pkqqG1eTWexjs+YXpGObnLnjtMPVKWlcZHp3adDYvUw==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@nuxt/opencollective": "0.4.1", + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "8.3.0", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "engines": { + "node": ">= 20" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^11.0.0", + "@nestjs/microservices": "^11.0.0", + "@nestjs/platform-express": "^11.0.0", + "@nestjs/websockets": "^11.0.0", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + }, + "@nestjs/websockets": { + "optional": true + } + } + }, "node_modules/@npmcli/agent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", @@ -2732,6 +2833,225 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/@nuxt/opencollective": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz", + "integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==", + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": "^14.18.0 || >=16.10.0", + "npm": ">=5.10.0" + } + }, + "node_modules/@nuxtjs/opencollective": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", + "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "consola": "^2.15.0", + "node-fetch": "^2.6.1" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/@nuxtjs/opencollective/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@nuxtjs/opencollective/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@nuxtjs/opencollective/node_modules/consola": { + "version": "2.15.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "license": "MIT" + }, + "node_modules/@nuxtjs/opencollective/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@openapitools/openapi-generator-cli": { + "version": "2.25.2", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.25.2.tgz", + "integrity": "sha512-TXElbW1NXCy0EECXiO5AD2ZzT1dmaCs41Z8t3pBUGaJf8zgF/Lm0P6GRhVEpw29iHBNjZcy8nrgQ1acUfuCdng==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@nestjs/axios": "4.0.1", + "@nestjs/common": "11.1.9", + "@nestjs/core": "11.1.9", + "@nuxtjs/opencollective": "0.3.2", + "axios": "1.13.2", + "chalk": "4.1.2", + "commander": "8.3.0", + "compare-versions": "6.1.1", + "concurrently": "9.2.1", + "console.table": "0.10.0", + "fs-extra": "11.3.2", + "glob": "13.0.0", + "inquirer": "8.2.7", + "proxy-agent": "6.5.0", + "reflect-metadata": "0.2.2", + "rxjs": "7.8.2", + "tslib": "2.8.1" + }, + "bin": { + "openapi-generator-cli": "main.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/openapi_generator" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/glob": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.0.tgz", + "integrity": "sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.1.1", + "minipass": "^7.1.2", + "path-scurry": "^2.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/lru-cache": { + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz", + "integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==", + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/minimatch": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", + "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/path-scurry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz", + "integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@parcel/watcher": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", @@ -3721,6 +4041,36 @@ "vite": "^5.2.0 || ^6 || ^7" } }, + "node_modules/@tokenizer/inflate": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.3.1.tgz", + "integrity": "sha512-4oeoZEBQdLdt5WmP/hx1KZ6D3/Oid/0cUb2nk4F0pTDAWy+KCH3/EnAkZF/bvckWo8I33EqBm01lIPgmgc8rCA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.1", + "fflate": "^0.8.2", + "token-types": "^6.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "license": "MIT" + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "license": "MIT" + }, "node_modules/@tufjs/canonical-json": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz", @@ -3799,7 +4149,6 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 14" @@ -3908,6 +4257,36 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "license": "MIT", + "peer": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3915,6 +4294,26 @@ "dev": true, "license": "MIT" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/baseline-browser-mapping": { "version": "2.8.27", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.27.tgz", @@ -3925,6 +4324,15 @@ "baseline-browser-mapping": "dist/cli.js" } }, + "node_modules/basic-ftp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/beasties": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/beasties/-/beasties-0.3.5.tgz", @@ -3945,6 +4353,17 @@ "node": ">=14.0.0" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/body-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", @@ -4044,6 +4463,30 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -4133,7 +4576,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -4198,7 +4640,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz", "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==", - "dev": true, "license": "MIT" }, "node_modules/chokidar": { @@ -4247,7 +4688,6 @@ "version": "2.9.2", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -4316,11 +4756,19 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -4333,7 +4781,6 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, "license": "MIT" }, "node_modules/colorette": { @@ -4343,6 +4790,229 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/compare-versions": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", + "license": "MIT" + }, + "node_modules/concurrently": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", + "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==", + "license": "MIT", + "dependencies": { + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.8.3", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/concurrently/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/console.table": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", + "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", + "license": "MIT", + "dependencies": { + "easy-table": "1.1.0" + }, + "engines": { + "node": "> 0.10" + } + }, "node_modules/content-disposition": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", @@ -4465,6 +5135,15 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -4485,7 +5164,6 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -4499,6 +5177,41 @@ } } }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -4581,7 +5294,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -4599,6 +5311,15 @@ "dev": true, "license": "MIT" }, + "node_modules/easy-table": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", + "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", + "license": "MIT", + "optionalDependencies": { + "wcwidth": ">=1.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -4630,31 +5351,6 @@ "node": ">= 0.8" } }, - "node_modules/encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, - "node_modules/encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/enhanced-resolve": { "version": "5.18.3", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", @@ -4729,7 +5425,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4739,7 +5434,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -4749,7 +5443,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -4758,6 +5451,21 @@ "node": ">= 0.4" } }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.25.9", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", @@ -4803,7 +5511,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -4816,6 +5523,77 @@ "dev": true, "license": "MIT" }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -4937,6 +5715,12 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "license": "MIT" + }, "node_modules/fast-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", @@ -4971,6 +5755,45 @@ } } }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/file-type": { + "version": "21.1.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.1.0.tgz", + "integrity": "sha512-boU4EHmP3JXkwDo4uhyBhTt5pPstxB6eEXKJBu2yu2l7aAMMm7QQYQEzssJmKReZYrFdFOJS8koVo6bXIBGDqA==", + "license": "MIT", + "dependencies": { + "@tokenizer/inflate": "^0.3.1", + "strtok3": "^10.3.1", + "token-types": "^6.0.0", + "uint8array-extras": "^1.4.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -5002,6 +5825,26 @@ "node": ">= 0.8" } }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/foreground-child": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", @@ -5019,6 +5862,43 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/form-data/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/form-data/node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -5039,6 +5919,20 @@ "node": ">= 0.8" } }, + "node_modules/fs-extra": { + "version": "11.3.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", + "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/fs-minipass": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", @@ -5070,7 +5964,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5090,7 +5983,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" @@ -5113,7 +6005,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", @@ -5138,7 +6029,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -5148,6 +6038,20 @@ "node": ">= 0.4" } }, + "node_modules/get-uri": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz", + "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==", + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/glob": { "version": "10.5.0", "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", @@ -5180,7 +6084,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5195,11 +6098,19 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -5208,11 +6119,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -5315,7 +6240,6 @@ "version": "7.0.2", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dev": true, "license": "MIT", "dependencies": { "agent-base": "^7.1.0", @@ -5329,7 +6253,6 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, "license": "MIT", "dependencies": { "agent-base": "^7.1.2", @@ -5343,7 +6266,6 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz", "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==", - "dev": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -5356,6 +6278,26 @@ "url": "https://opencollective.com/express" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore-walk": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-8.0.0.tgz", @@ -5420,7 +6362,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, "license": "ISC" }, "node_modules/ini": { @@ -5433,11 +6374,265 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/inquirer": { + "version": "8.2.7", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.7.tgz", + "integrity": "sha512-UjOaSel/iddGZJ5xP/Eixh6dY1XghiBw4XK13rCCIJcJfyhhoul/7KhLLUGtebEj6GDYM6Vnx/mVsjx2L/mFIA==", + "license": "MIT", + "dependencies": { + "@inquirer/external-editor": "^1.0.0", + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/inquirer/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/inquirer/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "license": "ISC" + }, + "node_modules/inquirer/node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/inquirer/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ip-address": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", - "dev": true, "license": "MIT", "engines": { "node": ">= 12" @@ -5589,6 +6784,15 @@ "node": ">=10" } }, + "node_modules/iterare": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", + "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==", + "license": "ISC", + "engines": { + "node": ">=6" + } + }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -5671,6 +6875,18 @@ "dev": true, "license": "MIT" }, + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -6034,6 +7250,31 @@ "@lmdb/lmdb-win32-x64": "3.4.2" } }, + "node_modules/load-esm": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/load-esm/-/load-esm-1.0.3.tgz", + "integrity": "sha512-v5xlu8eHD1+6r8EHTg6hfmO97LN8ugKtiXcy5e6oN72iD2r6u0RPfLl6fxM+7Wnh2ZRq15o0russMst44WauPA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + }, + { + "type": "buymeacoffee", + "url": "https://buymeacoffee.com/borewit" + } + ], + "license": "MIT", + "engines": { + "node": ">=13.2.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, "node_modules/log-symbols": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz", @@ -6208,7 +7449,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -6301,6 +7541,15 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/mimic-function": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", @@ -6334,7 +7583,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" @@ -6510,7 +7758,6 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, "license": "MIT" }, "node_modules/msgpackr": { @@ -6617,6 +7864,15 @@ "node": ">= 0.6" } }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/ng-zorro-antd": { "version": "20.4.0", "resolved": "https://registry.npmjs.org/ng-zorro-antd/-/ng-zorro-antd-20.4.0.tgz", @@ -6646,6 +7902,26 @@ "license": "MIT", "optional": true }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-gyp": { "version": "11.5.0", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.5.0.tgz", @@ -7077,6 +8353,38 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pac-proxy-agent": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", + "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/package-json-from-dist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", @@ -7282,7 +8590,6 @@ "version": "8.3.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", - "dev": true, "license": "MIT", "funding": { "type": "opencollective", @@ -7414,6 +8721,40 @@ "node": ">= 0.10" } }, + "node_modules/proxy-agent": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.1.0", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, "node_modules/prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -7474,6 +8815,20 @@ "node": ">= 0.10" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", @@ -7492,8 +8847,17 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, "node_modules/require-from-string": { "version": "2.0.2", @@ -7618,6 +8982,15 @@ "node": ">= 18" } }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/rxjs": { "version": "7.8.2", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", @@ -7632,7 +9005,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -7653,7 +9025,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, "license": "MIT" }, "node_modules/sass": { @@ -7768,6 +9139,18 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", @@ -7896,7 +9279,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 6.0.0", @@ -7907,7 +9289,6 @@ "version": "2.8.7", "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", - "dev": true, "license": "MIT", "dependencies": { "ip-address": "^10.0.1", @@ -7922,7 +9303,6 @@ "version": "8.0.5", "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", - "dev": true, "license": "MIT", "dependencies": { "agent-base": "^7.1.2", @@ -8045,6 +9425,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/string-width": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", @@ -8159,6 +9548,37 @@ "node": ">=8" } }, + "node_modules/strtok3": { + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz", + "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==", + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -8279,6 +9699,12 @@ "dev": true, "license": "ISC" }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" + }, "node_modules/tinyglobby": { "version": "0.2.14", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", @@ -8319,6 +9745,39 @@ "node": ">=0.6" } }, + "node_modules/token-types": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", + "license": "MIT", + "dependencies": { + "@borewit/text-codec": "^0.1.0", + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -8341,6 +9800,18 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/type-is": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", @@ -8371,6 +9842,30 @@ "node": ">=14.17" } }, + "node_modules/uid": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", + "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", + "license": "MIT", + "dependencies": { + "@lukeed/csprng": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/uint8array-extras": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/unique-filename": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", @@ -8397,6 +9892,15 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -8448,6 +9952,12 @@ "punycode": "^2.1.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -8584,6 +10094,15 @@ "node": ">=10.13.0" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/weak-lru-cache": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/weak-lru-cache/-/weak-lru-cache-1.2.2.tgz", @@ -8592,6 +10111,22 @@ "license": "MIT", "optional": true }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -8612,7 +10147,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -8717,7 +10251,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -8727,7 +10260,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -8743,14 +10275,12 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, "license": "MIT" }, "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -8760,7 +10290,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -8775,7 +10304,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -8795,7 +10323,6 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, "license": "ISC", "engines": { "node": ">=10" diff --git a/package.json b/package.json index e5a9ff1..8328499 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "ng": "ng", "start": "ng serve", "build": "ng build", - "watch": "ng build --watch --configuration development" + "watch": "ng build --watch --configuration development", + "openapi": "rm -rf src/app/services/api && openapi-generator-cli generate -i http://localhost:5298/swagger/v1/swagger.json -g typescript-angular -o src/app/services/api -c openapi-generator.yaml", + "openapiWin": "set JAVA_TOOL_OPTIONS=-Dcom.sun.net.ssl.checkRevocation=false -Djavax.net.ssl.trustStoreType=WINDOWS-ROOT && openapi-generator-cli generate -i https://localhost:44379/swagger/v1/swagger.json -g typescript-angular -o src/app/services/api -c openapi-generator.yaml\n" }, "prettier": { "printWidth": 100, @@ -27,6 +29,7 @@ "@angular/forms": "^20.3.0", "@angular/platform-browser": "^20.3.0", "@angular/router": "^20.3.0", + "@openapitools/openapi-generator-cli": "^2.25.2", "@tailwindcss/postcss": "^4.1.17", "@tailwindcss/vite": "^4.1.17", "ng-zorro-antd": "^20.4.0", diff --git a/src/app/services/api/.gitignore b/src/app/services/api/.gitignore new file mode 100644 index 0000000..149b576 --- /dev/null +++ b/src/app/services/api/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/src/app/services/api/.openapi-generator-ignore b/src/app/services/api/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/src/app/services/api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES new file mode 100644 index 0000000..3d6d1ae --- /dev/null +++ b/src/app/services/api/.openapi-generator/FILES @@ -0,0 +1,66 @@ +.gitignore +.openapi-generator-ignore +README.md +api.base.service.ts +api.module.ts +api/api.ts +api/deliverers.service.ts +api/deliverynotes.service.ts +api/prices.service.ts +api/products.service.ts +api/purchaseorders.service.ts +api/purchaseproducts.service.ts +api/quotationproducts.service.ts +api/quotations.service.ts +api/settings.service.ts +api/suppliers.service.ts +api/users.service.ts +api/warehouseproducts.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/connect-user-dto.ts +model/create-deliverer-dto.ts +model/create-delivery-note-dto.ts +model/create-price-dto.ts +model/create-purchase-product-dto.ts +model/create-quotation-product-dto.ts +model/create-setting-dto.ts +model/create-supplier-dto.ts +model/create-user-dto.ts +model/get-deliverer-dto.ts +model/get-delivery-note-dto.ts +model/get-price-dto.ts +model/get-product-delivery-dto.ts +model/get-product-dto.ts +model/get-purchase-order-dto.ts +model/get-purchase-product-dto.ts +model/get-quotation-dto.ts +model/get-quotation-product-dto.ts +model/get-setting-dto.ts +model/get-supplier-dto.ts +model/get-token-dto.ts +model/get-total-quantity-dto.ts +model/get-user-dto.ts +model/get-ware-house-product-dto.ts +model/models.ts +model/patch-delivery-note-real-delivery-date-dto.ts +model/patch-price-selling-price-dto.ts +model/patch-product-minimal-stock-dto.ts +model/patch-purchase-order-purchase-conditions-dto.ts +model/patch-purchase-product-quantity-dto.ts +model/patch-quotation-conditions-sale-dto.ts +model/patch-quotation-product-quantity-dto.ts +model/patch-setting-electronic-signature-dto.ts +model/patch-setting-logo-dto.ts +model/patch-supplier-delivery-delay-dto.ts +model/patch-user-password-dto.ts +model/patch-ware-house-product-quantity-dto.ts +model/update-deliverer-dto.ts +model/update-product-dto.ts +model/update-supplier-dto.ts +model/update-user-dto.ts +param.ts +provide-api.ts +variables.ts diff --git a/src/app/services/api/.openapi-generator/VERSION b/src/app/services/api/.openapi-generator/VERSION new file mode 100644 index 0000000..6328c54 --- /dev/null +++ b/src/app/services/api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.17.0 diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md new file mode 100644 index 0000000..c2ba935 --- /dev/null +++ b/src/app/services/api/README.md @@ -0,0 +1,185 @@ +# @ + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 1.0.0 + +## Building + +To install the required dependencies and to build the typescript sources run: + +```console +npm install +npm run build +``` + +## Publishing + +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) + +## Consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +```console +npm install @ --save +``` + +_without publishing (not recommended):_ + +```console +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: + +```console +npm link +``` + +In your project: + +```console +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue for a solution / workaround. +Published packages are not effected by this issue. + +### General usage + +In your Angular project: + +```typescript + +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi() + ], +}; +``` + +**NOTE** +If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: +```typescript +import { ApiModule } from ''; +``` + +If different from the generated base path, during app bootstrap, you can provide the base path to your service. + +```typescript +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi('http://localhost:9999') + ], +}; +``` + +```typescript +// with a custom configuration +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi({ + withCredentials: true, + username: 'user', + password: 'password' + }) + ], +}; +``` + +```typescript +// with factory building a custom configuration +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi, Configuration } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration({ + basePath: 'http://localhost:9999', + withCredentials: true, + username: authService.getUsername(), + password: authService.getPassword(), + }), + deps: [AuthService], + multi: false + } + ], +}; +``` + +### Using multiple OpenAPI files / APIs + +In order to use multiple APIs generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: + +```typescript +import { provideApi as provideUserApi } from 'my-user-api-path'; +import { provideApi as provideAdminApi } from 'my-admin-api-path'; +import { HttpClientModule } from '@angular/common/http'; +import { environment } from '../environments/environment'; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideUserApi(environment.basePath), + provideAdminApi(environment.basePath), + ], +}; +``` + +### Customizing path parameter encoding + +Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' +and Dates for format 'date-time' are encoded correctly. + +Other styles (e.g. "matrix") are not that easy to encode +and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). + +To implement your own parameter encoding (or call another library), +pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object +(see [General Usage](#general-usage) above). + +Example value for use in your Configuration-Provider: + +```typescript +new Configuration({ + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) +``` + +[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations +[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values +[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts new file mode 100644 index 0000000..34531a6 --- /dev/null +++ b/src/app/services/api/api.base.service.ts @@ -0,0 +1,83 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from './encoder'; +import { Configuration } from './configuration'; + +export class BaseService { + protected basePath = 'https://localhost:44379'; + public defaultHeaders = new HttpHeaders(); + public configuration: Configuration; + public encoder: HttpParameterCodec; + + constructor(basePath?: string|string[], configuration?: Configuration) { + this.configuration = configuration || new Configuration(); + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } + + protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); + } + return this.addToHttpParamsRecursive(httpParams, value, key); + } + + protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { + if (value === null || value === undefined) { + return httpParams; + } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach(k => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error("key may not be null if value is not object or array"); + } +} diff --git a/src/app/services/api/api.module.ts b/src/app/services/api/api.module.ts new file mode 100644 index 0000000..58d341f --- /dev/null +++ b/src/app/services/api/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/src/app/services/api/api/api.ts b/src/app/services/api/api/api.ts new file mode 100644 index 0000000..1fb6648 --- /dev/null +++ b/src/app/services/api/api/api.ts @@ -0,0 +1,25 @@ +export * from './deliverers.service'; +import { DeliverersService } from './deliverers.service'; +export * from './deliverynotes.service'; +import { DeliverynotesService } from './deliverynotes.service'; +export * from './prices.service'; +import { PricesService } from './prices.service'; +export * from './products.service'; +import { ProductsService } from './products.service'; +export * from './purchaseorders.service'; +import { PurchaseordersService } from './purchaseorders.service'; +export * from './purchaseproducts.service'; +import { PurchaseproductsService } from './purchaseproducts.service'; +export * from './quotationproducts.service'; +import { QuotationproductsService } from './quotationproducts.service'; +export * from './quotations.service'; +import { QuotationsService } from './quotations.service'; +export * from './settings.service'; +import { SettingsService } from './settings.service'; +export * from './suppliers.service'; +import { SuppliersService } from './suppliers.service'; +export * from './users.service'; +import { UsersService } from './users.service'; +export * from './warehouseproducts.service'; +import { WarehouseproductsService } from './warehouseproducts.service'; +export const APIS = [DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, PurchaseproductsService, QuotationproductsService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService]; diff --git a/src/app/services/api/api/deliverers.service.ts b/src/app/services/api/api/deliverers.service.ts new file mode 100644 index 0000000..aac5dfe --- /dev/null +++ b/src/app/services/api/api/deliverers.service.ts @@ -0,0 +1,331 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateDelivererDto } from '../model/create-deliverer-dto'; +// @ts-ignore +import { GetDelivererDto } from '../model/get-deliverer-dto'; +// @ts-ignore +import { UpdateDelivererDto } from '../model/update-deliverer-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class DeliverersService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/deliverers + * @param createDelivererDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createDelivererDto === null || createDelivererDto === undefined) { + throw new Error('Required parameter createDelivererDto was null or undefined when calling createDelivererEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliverers`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createDelivererDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/deliverers/{delivererId} + * @param delivererId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (delivererId === null || delivererId === undefined) { + throw new Error('Required parameter delivererId was null or undefined when calling deleteDelivererEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "delivererId", value: delivererId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/deliverers + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllDelivererEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllDelivererEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllDelivererEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllDelivererEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliverers`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/deliverers/{delivererId} + * @param delivererId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (delivererId === null || delivererId === undefined) { + throw new Error('Required parameter delivererId was null or undefined when calling getDelivererEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "delivererId", value: delivererId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/deliverers/{id} + * @param id + * @param updateDelivererDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateDelivererEndpoint.'); + } + if (updateDelivererDto === null || updateDelivererDto === undefined) { + throw new Error('Required parameter updateDelivererDto was null or undefined when calling updateDelivererEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateDelivererDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/deliverynotes.service.ts b/src/app/services/api/api/deliverynotes.service.ts new file mode 100644 index 0000000..8b73f81 --- /dev/null +++ b/src/app/services/api/api/deliverynotes.service.ts @@ -0,0 +1,278 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateDeliveryNoteDto } from '../model/create-delivery-note-dto'; +// @ts-ignore +import { GetDeliveryNoteDto } from '../model/get-delivery-note-dto'; +// @ts-ignore +import { PatchDeliveryNoteRealDeliveryDateDto } from '../model/patch-delivery-note-real-delivery-date-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class DeliverynotesService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/deliveryNotes + * @param createDeliveryNoteDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createDeliveryNoteDto === null || createDeliveryNoteDto === undefined) { + throw new Error('Required parameter createDeliveryNoteDto was null or undefined when calling createDeliveryNoteEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliveryNotes`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createDeliveryNoteDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/deliveryNotes + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllDeliveryNoteEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllDeliveryNoteEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllDeliveryNoteEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllDeliveryNoteEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliveryNotes`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/deliveryNotes/{deliveryNoteId} + * @param deliveryNoteId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDeliveryNoteEndpoint(deliveryNoteId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (deliveryNoteId === null || deliveryNoteId === undefined) { + throw new Error('Required parameter deliveryNoteId was null or undefined when calling getDeliveryNoteEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "deliveryNoteId", value: deliveryNoteId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/deliveryNotes/{id} + * @param id + * @param patchDeliveryNoteRealDeliveryDateDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchRealDeliveryDateEndpoint.'); + } + if (patchDeliveryNoteRealDeliveryDateDto === null || patchDeliveryNoteRealDeliveryDateDto === undefined) { + throw new Error('Required parameter patchDeliveryNoteRealDeliveryDateDto was null or undefined when calling patchRealDeliveryDateEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchDeliveryNoteRealDeliveryDateDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/prices.service.ts b/src/app/services/api/api/prices.service.ts new file mode 100644 index 0000000..619d887 --- /dev/null +++ b/src/app/services/api/api/prices.service.ts @@ -0,0 +1,235 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreatePriceDto } from '../model/create-price-dto'; +// @ts-ignore +import { GetPriceDto } from '../model/get-price-dto'; +// @ts-ignore +import { PatchPriceSellingPriceDto } from '../model/patch-price-selling-price-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PricesService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/prices + * @param createPriceDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createPriceEndpoint(createPriceDto: CreatePriceDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createPriceEndpoint(createPriceDto: CreatePriceDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createPriceEndpoint(createPriceDto: CreatePriceDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createPriceEndpoint(createPriceDto: CreatePriceDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createPriceDto === null || createPriceDto === undefined) { + throw new Error('Required parameter createPriceDto was null or undefined when calling createPriceEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/prices`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createPriceDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/prices/{productId}/{supplierId} + * @param productId + * @param supplierId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePriceEndpoint(productId: number, supplierId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deletePriceEndpoint(productId: number, supplierId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePriceEndpoint(productId: number, supplierId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePriceEndpoint(productId: number, supplierId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling deletePriceEndpoint.'); + } + if (supplierId === null || supplierId === undefined) { + throw new Error('Required parameter supplierId was null or undefined when calling deletePriceEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/prices/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "supplierId", value: supplierId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/prices/{productId}/{supplierId}/SellingPrice + * @param productId + * @param supplierId + * @param patchPriceSellingPriceDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling patchPriceEndpoint.'); + } + if (supplierId === null || supplierId === undefined) { + throw new Error('Required parameter supplierId was null or undefined when calling patchPriceEndpoint.'); + } + if (patchPriceSellingPriceDto === null || patchPriceSellingPriceDto === undefined) { + throw new Error('Required parameter patchPriceSellingPriceDto was null or undefined when calling patchPriceEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/prices/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "supplierId", value: supplierId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/SellingPrice`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchPriceSellingPriceDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/products.service.ts b/src/app/services/api/api/products.service.ts new file mode 100644 index 0000000..c6f3489 --- /dev/null +++ b/src/app/services/api/api/products.service.ts @@ -0,0 +1,282 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { GetProductDto } from '../model/get-product-dto'; +// @ts-ignore +import { PatchProductMinimalStockDto } from '../model/patch-product-minimal-stock-dto'; +// @ts-ignore +import { UpdateProductDto } from '../model/update-product-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ProductsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint get /API/products + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllProductsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllProductsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllProductsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllProductsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/products`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/products/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getProductEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getProductEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getProductEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getProductEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getProductEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/products/{id}/MinimalStock + * @param id + * @param patchProductMinimalStockDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchProductMinimalStockEndpoint.'); + } + if (patchProductMinimalStockDto === null || patchProductMinimalStockDto === undefined) { + throw new Error('Required parameter patchProductMinimalStockDto was null or undefined when calling patchProductMinimalStockEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/MinimalStock`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchProductMinimalStockDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/products/{id} + * @param id + * @param updateProductDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateProductEndpoint.'); + } + if (updateProductDto === null || updateProductDto === undefined) { + throw new Error('Required parameter updateProductDto was null or undefined when calling updateProductEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateProductDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/purchaseorders.service.ts b/src/app/services/api/api/purchaseorders.service.ts new file mode 100644 index 0000000..6aeaf5a --- /dev/null +++ b/src/app/services/api/api/purchaseorders.service.ts @@ -0,0 +1,265 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto'; +// @ts-ignore +import { PatchPurchaseOrderPurchaseConditionsDto } from '../model/patch-purchase-order-purchase-conditions-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PurchaseordersService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint delete /API/purchaseOrders/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deletePurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deletePurchaseOrderEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/purchaseOrders + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllPurchaseOrderEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllPurchaseOrderEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllPurchaseOrderEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllPurchaseOrderEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseOrders`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/purchaseOrders/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/purchaseOrders/{id}/PurchaseConditions + * @param id + * @param patchPurchaseOrderPurchaseConditionsDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchPurchaseOrderPurchaseConditionsEndpoint.'); + } + if (patchPurchaseOrderPurchaseConditionsDto === null || patchPurchaseOrderPurchaseConditionsDto === undefined) { + throw new Error('Required parameter patchPurchaseOrderPurchaseConditionsDto was null or undefined when calling patchPurchaseOrderPurchaseConditionsEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/PurchaseConditions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchPurchaseOrderPurchaseConditionsDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/purchaseproducts.service.ts b/src/app/services/api/api/purchaseproducts.service.ts new file mode 100644 index 0000000..22d4975 --- /dev/null +++ b/src/app/services/api/api/purchaseproducts.service.ts @@ -0,0 +1,235 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreatePurchaseProductDto } from '../model/create-purchase-product-dto'; +// @ts-ignore +import { GetPurchaseProductDto } from '../model/get-purchase-product-dto'; +// @ts-ignore +import { PatchPurchaseProductQuantityDto } from '../model/patch-purchase-product-quantity-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PurchaseproductsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/purchaseProducts + * @param createPurchaseProductDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createPurchaseProductEndpoint(createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createPurchaseProductEndpoint(createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createPurchaseProductEndpoint(createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createPurchaseProductEndpoint(createPurchaseProductDto: CreatePurchaseProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createPurchaseProductDto === null || createPurchaseProductDto === undefined) { + throw new Error('Required parameter createPurchaseProductDto was null or undefined when calling createPurchaseProductEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseProducts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createPurchaseProductDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/purchaseProducts/{productId}/{purchaseOrderId} + * @param productId + * @param purchaseOrderId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePurchaseProductEndpoint(productId: number, purchaseOrderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deletePurchaseProductEndpoint(productId: number, purchaseOrderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePurchaseProductEndpoint(productId: number, purchaseOrderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deletePurchaseProductEndpoint(productId: number, purchaseOrderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling deletePurchaseProductEndpoint.'); + } + if (purchaseOrderId === null || purchaseOrderId === undefined) { + throw new Error('Required parameter purchaseOrderId was null or undefined when calling deletePurchaseProductEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "purchaseOrderId", value: purchaseOrderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/purchaseProducts/{productId}/{purchaseOrderId}/Quantity + * @param productId + * @param purchaseOrderId + * @param patchPurchaseProductQuantityDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); + } + if (purchaseOrderId === null || purchaseOrderId === undefined) { + throw new Error('Required parameter purchaseOrderId was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); + } + if (patchPurchaseProductQuantityDto === null || patchPurchaseProductQuantityDto === undefined) { + throw new Error('Required parameter patchPurchaseProductQuantityDto was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "purchaseOrderId", value: purchaseOrderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/Quantity`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchPurchaseProductQuantityDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/quotationproducts.service.ts b/src/app/services/api/api/quotationproducts.service.ts new file mode 100644 index 0000000..622203d --- /dev/null +++ b/src/app/services/api/api/quotationproducts.service.ts @@ -0,0 +1,235 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateQuotationProductDto } from '../model/create-quotation-product-dto'; +// @ts-ignore +import { GetQuotationProductDto } from '../model/get-quotation-product-dto'; +// @ts-ignore +import { PatchQuotationProductQuantityDto } from '../model/patch-quotation-product-quantity-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class QuotationproductsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/quotationProducts + * @param createQuotationProductDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createQuotationProductEndpoint(createQuotationProductDto: CreateQuotationProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createQuotationProductEndpoint(createQuotationProductDto: CreateQuotationProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createQuotationProductEndpoint(createQuotationProductDto: CreateQuotationProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createQuotationProductEndpoint(createQuotationProductDto: CreateQuotationProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createQuotationProductDto === null || createQuotationProductDto === undefined) { + throw new Error('Required parameter createQuotationProductDto was null or undefined when calling createQuotationProductEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotationProducts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createQuotationProductDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/quotationProducts/{productId}/{quotationId} + * @param productId + * @param quotationId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteQuotationProductEndpoint(productId: number, quotationId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteQuotationProductEndpoint(productId: number, quotationId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteQuotationProductEndpoint(productId: number, quotationId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteQuotationProductEndpoint(productId: number, quotationId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling deleteQuotationProductEndpoint.'); + } + if (quotationId === null || quotationId === undefined) { + throw new Error('Required parameter quotationId was null or undefined when calling deleteQuotationProductEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotationProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "quotationId", value: quotationId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/quotationProducts/{productId}/{quotationId}/Quantity + * @param productId + * @param quotationId + * @param patchQuotationProductQuantityDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling patchQuotationProductQuantityEndpoint.'); + } + if (quotationId === null || quotationId === undefined) { + throw new Error('Required parameter quotationId was null or undefined when calling patchQuotationProductQuantityEndpoint.'); + } + if (patchQuotationProductQuantityDto === null || patchQuotationProductQuantityDto === undefined) { + throw new Error('Required parameter patchQuotationProductQuantityDto was null or undefined when calling patchQuotationProductQuantityEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotationProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "quotationId", value: quotationId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/Quantity`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchQuotationProductQuantityDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/quotations.service.ts b/src/app/services/api/api/quotations.service.ts new file mode 100644 index 0000000..752b39f --- /dev/null +++ b/src/app/services/api/api/quotations.service.ts @@ -0,0 +1,265 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { GetQuotationDto } from '../model/get-quotation-dto'; +// @ts-ignore +import { PatchQuotationConditionsSaleDto } from '../model/patch-quotation-conditions-sale-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class QuotationsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint delete /API/quotations/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteQuotationEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/quotations + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllQuotationEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllQuotationEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllQuotationEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllQuotationEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/quotations/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getQuotationEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/quotations/{id}/saleConditions + * @param id + * @param patchQuotationConditionsSaleDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchQuotationConditionsSaleEndpoint.'); + } + if (patchQuotationConditionsSaleDto === null || patchQuotationConditionsSaleDto === undefined) { + throw new Error('Required parameter patchQuotationConditionsSaleDto was null or undefined when calling patchQuotationConditionsSaleEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/saleConditions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchQuotationConditionsSaleDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/settings.service.ts b/src/app/services/api/api/settings.service.ts new file mode 100644 index 0000000..b6a4951 --- /dev/null +++ b/src/app/services/api/api/settings.service.ts @@ -0,0 +1,351 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateSettingDto } from '../model/create-setting-dto'; +// @ts-ignore +import { GetSettingDto } from '../model/get-setting-dto'; +// @ts-ignore +import { PatchSettingElectronicSignatureDto } from '../model/patch-setting-electronic-signature-dto'; +// @ts-ignore +import { PatchSettingLogoDto } from '../model/patch-setting-logo-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class SettingsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/settings + * @param createSettingDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createSettingEndpoint(createSettingDto: CreateSettingDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createSettingDto === null || createSettingDto === undefined) { + throw new Error('Required parameter createSettingDto was null or undefined when calling createSettingEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/settings`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createSettingDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/settings/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteSettingEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/settings/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/settings/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getSettingEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/settings/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/settings/{id}/ElectronicSignature + * @param id + * @param patchSettingElectronicSignatureDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchSettingElectronicSignatureEndpoint.'); + } + if (patchSettingElectronicSignatureDto === null || patchSettingElectronicSignatureDto === undefined) { + throw new Error('Required parameter patchSettingElectronicSignatureDto was null or undefined when calling patchSettingElectronicSignatureEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/settings/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/ElectronicSignature`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchSettingElectronicSignatureDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/settings/{id}/logo + * @param id + * @param patchSettingLogoDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchSettingLogoEndpoint.'); + } + if (patchSettingLogoDto === null || patchSettingLogoDto === undefined) { + throw new Error('Required parameter patchSettingLogoDto was null or undefined when calling patchSettingLogoEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/settings/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/logo`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchSettingLogoDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/suppliers.service.ts b/src/app/services/api/api/suppliers.service.ts new file mode 100644 index 0000000..7c4b123 --- /dev/null +++ b/src/app/services/api/api/suppliers.service.ts @@ -0,0 +1,401 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateSupplierDto } from '../model/create-supplier-dto'; +// @ts-ignore +import { GetSupplierDto } from '../model/get-supplier-dto'; +// @ts-ignore +import { PatchSupplierDeliveryDelayDto } from '../model/patch-supplier-delivery-delay-dto'; +// @ts-ignore +import { UpdateSupplierDto } from '../model/update-supplier-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class SuppliersService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/suppliers + * @param createSupplierDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createSupplierDto === null || createSupplierDto === undefined) { + throw new Error('Required parameter createSupplierDto was null or undefined when calling createSupplierEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/suppliers`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createSupplierDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/suppliers/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteSupplierEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/suppliers + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllSuppliersEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllSuppliersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllSuppliersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllSuppliersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/suppliers`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/suppliers/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getSupplierEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/suppliers/{id}/deliveryDelay + * @param id + * @param patchSupplierDeliveryDelayDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchSupplierDeliveryDelayEndpoint.'); + } + if (patchSupplierDeliveryDelayDto === null || patchSupplierDeliveryDelayDto === undefined) { + throw new Error('Required parameter patchSupplierDeliveryDelayDto was null or undefined when calling patchSupplierDeliveryDelayEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/deliveryDelay`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchSupplierDeliveryDelayDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/suppliers/{id} + * @param id + * @param updateSupplierDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateSupplierEndpoint.'); + } + if (updateSupplierDto === null || updateSupplierDto === undefined) { + throw new Error('Required parameter updateSupplierDto was null or undefined when calling updateSupplierEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateSupplierDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/users.service.ts b/src/app/services/api/api/users.service.ts new file mode 100644 index 0000000..5e1e5d4 --- /dev/null +++ b/src/app/services/api/api/users.service.ts @@ -0,0 +1,469 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ConnectUserDto } from '../model/connect-user-dto'; +// @ts-ignore +import { CreateUserDto } from '../model/create-user-dto'; +// @ts-ignore +import { GetTokenDto } from '../model/get-token-dto'; +// @ts-ignore +import { GetUserDto } from '../model/get-user-dto'; +// @ts-ignore +import { PatchUserPasswordDto } from '../model/patch-user-password-dto'; +// @ts-ignore +import { UpdateUserDto } from '../model/update-user-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class UsersService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/users/connection + * @param connectUserDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public connectUserEndpoint(connectUserDto: ConnectUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (connectUserDto === null || connectUserDto === undefined) { + throw new Error('Required parameter connectUserDto was null or undefined when calling connectUserEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/users/connection`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: connectUserDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint post /API/users + * @param createUserDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createUserEndpoint(createUserDto: CreateUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createUserDto === null || createUserDto === undefined) { + throw new Error('Required parameter createUserDto was null or undefined when calling createUserEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/users`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createUserDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/users/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteUserEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteUserEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteUserEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteUserEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteUserEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/users + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllUsersEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllUsersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllUsersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllUsersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/users`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/users/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getUserEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getUserEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getUserEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/users/{id}/password + * @param id + * @param patchUserPasswordDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchUserPasswordEndpoint.'); + } + if (patchUserPasswordDto === null || patchUserPasswordDto === undefined) { + throw new Error('Required parameter patchUserPasswordDto was null or undefined when calling patchUserPasswordEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/password`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchUserPasswordDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/users/{id} + * @param id + * @param updateUserDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateUserEndpoint.'); + } + if (updateUserDto === null || updateUserDto === undefined) { + throw new Error('Required parameter updateUserDto was null or undefined when calling updateUserEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateUserDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/warehouseproducts.service.ts b/src/app/services/api/api/warehouseproducts.service.ts new file mode 100644 index 0000000..532d7c7 --- /dev/null +++ b/src/app/services/api/api/warehouseproducts.service.ts @@ -0,0 +1,168 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { GetTotalQuantityDto } from '../model/get-total-quantity-dto'; +// @ts-ignore +import { GetWareHouseProductDto } from '../model/get-ware-house-product-dto'; +// @ts-ignore +import { PatchWareHouseProductQuantityDto } from '../model/patch-ware-house-product-quantity-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class WarehouseproductsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint get /API/wareHouseProducts/{productId} + * @param productId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTotalQuantityEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTotalQuantityEndpoint(productId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTotalQuantityEndpoint(productId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTotalQuantityEndpoint(productId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling getTotalQuantityEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/wareHouseProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/wareHouseProducts/{productId}/{wareHouseId}/quantity + * @param productId + * @param wareHouseId + * @param patchWareHouseProductQuantityDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling patchWareHouseProductQuantityEndpoint.'); + } + if (wareHouseId === null || wareHouseId === undefined) { + throw new Error('Required parameter wareHouseId was null or undefined when calling patchWareHouseProductQuantityEndpoint.'); + } + if (patchWareHouseProductQuantityDto === null || patchWareHouseProductQuantityDto === undefined) { + throw new Error('Required parameter patchWareHouseProductQuantityDto was null or undefined when calling patchWareHouseProductQuantityEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/wareHouseProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "wareHouseId", value: wareHouseId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/quantity`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchWareHouseProductQuantityDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/configuration.ts b/src/app/services/api/configuration.ts new file mode 100644 index 0000000..5ffdfbb --- /dev/null +++ b/src/app/services/api/configuration.ts @@ -0,0 +1,193 @@ +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

    + * See {@link README.md} for more details + *

    + */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

    + * See {@link README.md} for more details + *

    + */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; + } + if (username !== undefined) { + this.username = username; + } + if (password !== undefined) { + this.password = password; + } + if (accessToken !== undefined) { + this.accessToken = accessToken; + } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; + + // init default JWTBearerAuth credential + if (!this.credentials['JWTBearerAuth']) { + this.credentials['JWTBearerAuth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value + ? headers.set(headerName, (prefix ?? '') + value) + : headers; + } + + public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams { + const value = this.lookupCredential(credentialKey); + return value + ? query.set(paramName, value) + : query; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/src/app/services/api/encoder.ts b/src/app/services/api/encoder.ts new file mode 100644 index 0000000..138c4d5 --- /dev/null +++ b/src/app/services/api/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/src/app/services/api/git_push.sh b/src/app/services/api/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/src/app/services/api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/src/app/services/api/index.ts b/src/app/services/api/index.ts new file mode 100644 index 0000000..02cb7d4 --- /dev/null +++ b/src/app/services/api/index.ts @@ -0,0 +1,7 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './provide-api'; +export * from './param'; diff --git a/src/app/services/api/model/connect-user-dto.ts b/src/app/services/api/model/connect-user-dto.ts new file mode 100644 index 0000000..2ce7974 --- /dev/null +++ b/src/app/services/api/model/connect-user-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConnectUserDto { + name?: string | null; + password?: string | null; +} + diff --git a/src/app/services/api/model/create-deliverer-dto.ts b/src/app/services/api/model/create-deliverer-dto.ts new file mode 100644 index 0000000..d7b5980 --- /dev/null +++ b/src/app/services/api/model/create-deliverer-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreateDelivererDto { + transporter?: string | null; +} + diff --git a/src/app/services/api/model/create-delivery-note-dto.ts b/src/app/services/api/model/create-delivery-note-dto.ts new file mode 100644 index 0000000..8635bf6 --- /dev/null +++ b/src/app/services/api/model/create-delivery-note-dto.ts @@ -0,0 +1,19 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreateDeliveryNoteDto { + trackingNumber?: string | null; + estimateDeliveryDate?: string; + expeditionDate?: string; + delivererId?: number; + productQuantities?: { [key: string]: number; } | null; +} + diff --git a/src/app/services/api/model/create-price-dto.ts b/src/app/services/api/model/create-price-dto.ts new file mode 100644 index 0000000..d127766 --- /dev/null +++ b/src/app/services/api/model/create-price-dto.ts @@ -0,0 +1,34 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreatePriceDto { + sellingPrice?: number; + supplierId?: number | null; + supplierName?: string | null; + supplierEmail?: string | null; + supplierPhone?: string | null; + supplierAddress?: string | null; + supplierZipCode?: string | null; + supplierCity?: string | null; + supplierDeliveryDelay?: number; + productId?: number | null; + productReferences?: string | null; + productName?: string | null; + productDuration?: number; + productCaliber?: number; + productApprovalNumber?: string | null; + productWeight?: number; + productNec?: number; + productImage?: string | null; + productLink?: string | null; + productMinimalQuantity?: number; +} + diff --git a/src/app/services/api/model/create-purchase-product-dto.ts b/src/app/services/api/model/create-purchase-product-dto.ts new file mode 100644 index 0000000..4e772d9 --- /dev/null +++ b/src/app/services/api/model/create-purchase-product-dto.ts @@ -0,0 +1,18 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreatePurchaseProductDto { + quantity?: number; + productId?: number; + purchaseOrderId?: number; + purchaseOrderPurchaseConditions?: string | null; +} + diff --git a/src/app/services/api/model/create-quotation-product-dto.ts b/src/app/services/api/model/create-quotation-product-dto.ts new file mode 100644 index 0000000..95a3c60 --- /dev/null +++ b/src/app/services/api/model/create-quotation-product-dto.ts @@ -0,0 +1,29 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreateQuotationProductDto { + quantity?: number; + quotationId?: number; + quotationMessage?: string | null; + quotationConditionsSale?: string | null; + productId?: number; + productReferences?: number; + productName?: string | null; + productDuration?: number; + productCaliber?: number; + productApprovalNumber?: number; + productWeight?: number; + productNec?: number; + productImage?: string | null; + productLink?: string | null; + productMinimalQuantity?: number; +} + diff --git a/src/app/services/api/model/create-setting-dto.ts b/src/app/services/api/model/create-setting-dto.ts new file mode 100644 index 0000000..21f659e --- /dev/null +++ b/src/app/services/api/model/create-setting-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreateSettingDto { + electronicSignature?: string | null; + logo?: string | null; +} + diff --git a/src/app/services/api/model/create-supplier-dto.ts b/src/app/services/api/model/create-supplier-dto.ts new file mode 100644 index 0000000..fc44016 --- /dev/null +++ b/src/app/services/api/model/create-supplier-dto.ts @@ -0,0 +1,21 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreateSupplierDto { + name?: string | null; + email?: string | null; + phone?: string | null; + address?: string | null; + zipCode?: string | null; + city?: string | null; + deliveryDelay?: number; +} + diff --git a/src/app/services/api/model/create-user-dto.ts b/src/app/services/api/model/create-user-dto.ts new file mode 100644 index 0000000..1c7145c --- /dev/null +++ b/src/app/services/api/model/create-user-dto.ts @@ -0,0 +1,18 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreateUserDto { + name?: string | null; + password?: string | null; + fonction?: string | null; + email?: string | null; +} + diff --git a/src/app/services/api/model/get-deliverer-dto.ts b/src/app/services/api/model/get-deliverer-dto.ts new file mode 100644 index 0000000..ee6e20d --- /dev/null +++ b/src/app/services/api/model/get-deliverer-dto.ts @@ -0,0 +1,18 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { GetDeliveryNoteDto } from './get-delivery-note-dto'; + + +export interface GetDelivererDto { + id?: number; + transporter?: string | null; + deliveryNotes?: Array | null; +} + diff --git a/src/app/services/api/model/get-delivery-note-dto.ts b/src/app/services/api/model/get-delivery-note-dto.ts new file mode 100644 index 0000000..d749a8a --- /dev/null +++ b/src/app/services/api/model/get-delivery-note-dto.ts @@ -0,0 +1,23 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { GetProductDeliveryDto } from './get-product-delivery-dto'; + + +export interface GetDeliveryNoteDto { + id?: number; + trackingNumber?: string | null; + estimateDeliveryDate?: string; + expeditionDate?: string; + realDeliveryDate?: string | null; + delivererId?: number; + delivererTransporter?: string | null; + products?: Array | null; +} + diff --git a/src/app/services/api/model/get-price-dto.ts b/src/app/services/api/model/get-price-dto.ts new file mode 100644 index 0000000..c002abc --- /dev/null +++ b/src/app/services/api/model/get-price-dto.ts @@ -0,0 +1,35 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetPriceDto { + id?: number; + sellingPrice?: number; + supplierId?: number; + supplierName?: string | null; + supplierEmail?: string | null; + supplierPhone?: string | null; + supplierAddress?: string | null; + supplierZipCode?: number; + supplierCity?: string | null; + supplierDeliveryDelay?: number; + productId?: number; + productReferences?: string | null; + productName?: string | null; + productDuration?: number; + productCaliber?: number; + productApprovalNumber?: number; + productWeight?: number; + productNec?: number; + productImage?: string | null; + productLink?: string | null; + productMinimalQuantity?: number; +} + diff --git a/src/app/services/api/model/get-product-delivery-dto.ts b/src/app/services/api/model/get-product-delivery-dto.ts new file mode 100644 index 0000000..5363cef --- /dev/null +++ b/src/app/services/api/model/get-product-delivery-dto.ts @@ -0,0 +1,33 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetProductDeliveryDto { + productId?: number; + productReference?: number; + productName?: string | null; + productDuration?: number; + productCaliber?: number; + productApprovalNumber?: number; + productWeight?: number; + productNec?: number; + productImage?: string | null; + productLink?: string | null; + productMinimalQuantity?: number; + deliveryNoteId?: number; + deliveryNoteTrackingNumber?: string | null; + deliveryNoteEstimateDeliveryDate?: string; + deliveryNoteExpeditionDate?: string; + deliveryNoteRealDeliveryDate?: string | null; + deliveryNoteDeliverId?: number; + deliveryNoteDeliverTransporter?: string | null; + quantity?: number; +} + diff --git a/src/app/services/api/model/get-product-dto.ts b/src/app/services/api/model/get-product-dto.ts new file mode 100644 index 0000000..812aed6 --- /dev/null +++ b/src/app/services/api/model/get-product-dto.ts @@ -0,0 +1,25 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetProductDto { + id?: number; + references?: string | null; + name?: string | null; + duration?: number; + caliber?: number; + approvalNumber?: string | null; + weight?: number; + nec?: number; + image?: string | null; + link?: string | null; + minimalQuantity?: number; +} + diff --git a/src/app/services/api/model/get-purchase-order-dto.ts b/src/app/services/api/model/get-purchase-order-dto.ts new file mode 100644 index 0000000..9cde421 --- /dev/null +++ b/src/app/services/api/model/get-purchase-order-dto.ts @@ -0,0 +1,18 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { GetPurchaseProductDto } from './get-purchase-product-dto'; + + +export interface GetPurchaseOrderDto { + id?: number; + purchaseConditions?: string | null; + getPurchaseProductDto?: Array | null; +} + diff --git a/src/app/services/api/model/get-purchase-product-dto.ts b/src/app/services/api/model/get-purchase-product-dto.ts new file mode 100644 index 0000000..b7ad6ff --- /dev/null +++ b/src/app/services/api/model/get-purchase-product-dto.ts @@ -0,0 +1,28 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetPurchaseProductDto { + productId?: number; + productReferences?: string | null; + productName?: string | null; + productDuration?: number; + productCaliber?: number; + productApprovalNumber?: number; + productWeight?: number; + productNec?: number; + productImage?: string | null; + productLink?: string | null; + productMinimalQuantity?: number; + purchaseOrderId?: number; + purchaseOrderPurchaseConditions?: string | null; + quantity?: number; +} + diff --git a/src/app/services/api/model/get-quotation-dto.ts b/src/app/services/api/model/get-quotation-dto.ts new file mode 100644 index 0000000..2143ee1 --- /dev/null +++ b/src/app/services/api/model/get-quotation-dto.ts @@ -0,0 +1,19 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { GetQuotationProductDto } from './get-quotation-product-dto'; + + +export interface GetQuotationDto { + id?: number; + message?: string | null; + conditionsSale?: string | null; + getQuotationProductDto?: Array | null; +} + diff --git a/src/app/services/api/model/get-quotation-product-dto.ts b/src/app/services/api/model/get-quotation-product-dto.ts new file mode 100644 index 0000000..09ca5f0 --- /dev/null +++ b/src/app/services/api/model/get-quotation-product-dto.ts @@ -0,0 +1,29 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetQuotationProductDto { + quantity?: number; + quotationId?: number; + quotationMessage?: string | null; + quotationConditionsSale?: string | null; + productId?: number; + productReferences?: string | null; + productName?: string | null; + productDuration?: number; + productCaliber?: number; + productApprovalNumber?: number; + productWeight?: number; + productNec?: number; + productImage?: string | null; + productLink?: string | null; + productMinimalQuantity?: number; +} + diff --git a/src/app/services/api/model/get-setting-dto.ts b/src/app/services/api/model/get-setting-dto.ts new file mode 100644 index 0000000..8d73ba9 --- /dev/null +++ b/src/app/services/api/model/get-setting-dto.ts @@ -0,0 +1,17 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetSettingDto { + id?: number; + electronicSignature?: string | null; + logo?: string | null; +} + diff --git a/src/app/services/api/model/get-supplier-dto.ts b/src/app/services/api/model/get-supplier-dto.ts new file mode 100644 index 0000000..35345b0 --- /dev/null +++ b/src/app/services/api/model/get-supplier-dto.ts @@ -0,0 +1,22 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetSupplierDto { + id?: number; + name?: string | null; + email?: string | null; + phone?: string | null; + address?: string | null; + zipCode?: string | null; + city?: string | null; + deliveryDelay?: number; +} + diff --git a/src/app/services/api/model/get-token-dto.ts b/src/app/services/api/model/get-token-dto.ts new file mode 100644 index 0000000..1078bed --- /dev/null +++ b/src/app/services/api/model/get-token-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetTokenDto { + token?: string | null; +} + diff --git a/src/app/services/api/model/get-total-quantity-dto.ts b/src/app/services/api/model/get-total-quantity-dto.ts new file mode 100644 index 0000000..6231f8e --- /dev/null +++ b/src/app/services/api/model/get-total-quantity-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetTotalQuantityDto { + productId?: number; + totalQuantity?: number; +} + diff --git a/src/app/services/api/model/get-user-dto.ts b/src/app/services/api/model/get-user-dto.ts new file mode 100644 index 0000000..e4121b6 --- /dev/null +++ b/src/app/services/api/model/get-user-dto.ts @@ -0,0 +1,20 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetUserDto { + id?: number; + name?: string | null; + password?: string | null; + salt?: string | null; + fonction?: string | null; + email?: string | null; +} + diff --git a/src/app/services/api/model/get-ware-house-product-dto.ts b/src/app/services/api/model/get-ware-house-product-dto.ts new file mode 100644 index 0000000..8e4e0fb --- /dev/null +++ b/src/app/services/api/model/get-ware-house-product-dto.ts @@ -0,0 +1,17 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetWareHouseProductDto { + quantity?: number; + wareHouseId?: number; + productId?: number; +} + diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts new file mode 100644 index 0000000..19d0c33 --- /dev/null +++ b/src/app/services/api/model/models.ts @@ -0,0 +1,40 @@ +export * from './connect-user-dto'; +export * from './create-deliverer-dto'; +export * from './create-delivery-note-dto'; +export * from './create-price-dto'; +export * from './create-purchase-product-dto'; +export * from './create-quotation-product-dto'; +export * from './create-setting-dto'; +export * from './create-supplier-dto'; +export * from './create-user-dto'; +export * from './get-deliverer-dto'; +export * from './get-delivery-note-dto'; +export * from './get-price-dto'; +export * from './get-product-delivery-dto'; +export * from './get-product-dto'; +export * from './get-purchase-order-dto'; +export * from './get-purchase-product-dto'; +export * from './get-quotation-dto'; +export * from './get-quotation-product-dto'; +export * from './get-setting-dto'; +export * from './get-supplier-dto'; +export * from './get-token-dto'; +export * from './get-total-quantity-dto'; +export * from './get-user-dto'; +export * from './get-ware-house-product-dto'; +export * from './patch-delivery-note-real-delivery-date-dto'; +export * from './patch-price-selling-price-dto'; +export * from './patch-product-minimal-stock-dto'; +export * from './patch-purchase-order-purchase-conditions-dto'; +export * from './patch-purchase-product-quantity-dto'; +export * from './patch-quotation-conditions-sale-dto'; +export * from './patch-quotation-product-quantity-dto'; +export * from './patch-setting-electronic-signature-dto'; +export * from './patch-setting-logo-dto'; +export * from './patch-supplier-delivery-delay-dto'; +export * from './patch-user-password-dto'; +export * from './patch-ware-house-product-quantity-dto'; +export * from './update-deliverer-dto'; +export * from './update-product-dto'; +export * from './update-supplier-dto'; +export * from './update-user-dto'; diff --git a/src/app/services/api/model/patch-delivery-note-real-delivery-date-dto.ts b/src/app/services/api/model/patch-delivery-note-real-delivery-date-dto.ts new file mode 100644 index 0000000..c851cdf --- /dev/null +++ b/src/app/services/api/model/patch-delivery-note-real-delivery-date-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchDeliveryNoteRealDeliveryDateDto { + realDeliveryDate?: string; +} + diff --git a/src/app/services/api/model/patch-price-selling-price-dto.ts b/src/app/services/api/model/patch-price-selling-price-dto.ts new file mode 100644 index 0000000..29333df --- /dev/null +++ b/src/app/services/api/model/patch-price-selling-price-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchPriceSellingPriceDto { + sellingPrice?: number; +} + diff --git a/src/app/services/api/model/patch-product-minimal-stock-dto.ts b/src/app/services/api/model/patch-product-minimal-stock-dto.ts new file mode 100644 index 0000000..b37e9db --- /dev/null +++ b/src/app/services/api/model/patch-product-minimal-stock-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchProductMinimalStockDto { + minimalQuantity?: number; +} + diff --git a/src/app/services/api/model/patch-purchase-order-purchase-conditions-dto.ts b/src/app/services/api/model/patch-purchase-order-purchase-conditions-dto.ts new file mode 100644 index 0000000..710de0d --- /dev/null +++ b/src/app/services/api/model/patch-purchase-order-purchase-conditions-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchPurchaseOrderPurchaseConditionsDto { + purchaseConditions?: string | null; +} + diff --git a/src/app/services/api/model/patch-purchase-product-quantity-dto.ts b/src/app/services/api/model/patch-purchase-product-quantity-dto.ts new file mode 100644 index 0000000..d8355ee --- /dev/null +++ b/src/app/services/api/model/patch-purchase-product-quantity-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchPurchaseProductQuantityDto { + quantity?: number; +} + diff --git a/src/app/services/api/model/patch-quotation-conditions-sale-dto.ts b/src/app/services/api/model/patch-quotation-conditions-sale-dto.ts new file mode 100644 index 0000000..36fd3db --- /dev/null +++ b/src/app/services/api/model/patch-quotation-conditions-sale-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchQuotationConditionsSaleDto { + conditionsSale?: string | null; +} + diff --git a/src/app/services/api/model/patch-quotation-product-quantity-dto.ts b/src/app/services/api/model/patch-quotation-product-quantity-dto.ts new file mode 100644 index 0000000..e32072a --- /dev/null +++ b/src/app/services/api/model/patch-quotation-product-quantity-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchQuotationProductQuantityDto { + quantity?: number; +} + diff --git a/src/app/services/api/model/patch-setting-electronic-signature-dto.ts b/src/app/services/api/model/patch-setting-electronic-signature-dto.ts new file mode 100644 index 0000000..13bcdbd --- /dev/null +++ b/src/app/services/api/model/patch-setting-electronic-signature-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchSettingElectronicSignatureDto { + electronicSignature?: string | null; +} + diff --git a/src/app/services/api/model/patch-setting-logo-dto.ts b/src/app/services/api/model/patch-setting-logo-dto.ts new file mode 100644 index 0000000..3257ca9 --- /dev/null +++ b/src/app/services/api/model/patch-setting-logo-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchSettingLogoDto { + logo?: string | null; +} + diff --git a/src/app/services/api/model/patch-supplier-delivery-delay-dto.ts b/src/app/services/api/model/patch-supplier-delivery-delay-dto.ts new file mode 100644 index 0000000..41585ec --- /dev/null +++ b/src/app/services/api/model/patch-supplier-delivery-delay-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchSupplierDeliveryDelayDto { + deliveryDelay?: number; +} + diff --git a/src/app/services/api/model/patch-user-password-dto.ts b/src/app/services/api/model/patch-user-password-dto.ts new file mode 100644 index 0000000..c9ac320 --- /dev/null +++ b/src/app/services/api/model/patch-user-password-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchUserPasswordDto { + password?: string | null; +} + diff --git a/src/app/services/api/model/patch-ware-house-product-quantity-dto.ts b/src/app/services/api/model/patch-ware-house-product-quantity-dto.ts new file mode 100644 index 0000000..4899b61 --- /dev/null +++ b/src/app/services/api/model/patch-ware-house-product-quantity-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchWareHouseProductQuantityDto { + quantity?: number; +} + diff --git a/src/app/services/api/model/update-deliverer-dto.ts b/src/app/services/api/model/update-deliverer-dto.ts new file mode 100644 index 0000000..68032be --- /dev/null +++ b/src/app/services/api/model/update-deliverer-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface UpdateDelivererDto { + transporter?: string | null; +} + diff --git a/src/app/services/api/model/update-product-dto.ts b/src/app/services/api/model/update-product-dto.ts new file mode 100644 index 0000000..f191e22 --- /dev/null +++ b/src/app/services/api/model/update-product-dto.ts @@ -0,0 +1,24 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface UpdateProductDto { + references?: string | null; + name?: string | null; + duration?: number; + caliber?: number; + approvalNumber?: string | null; + weight?: number; + nec?: number; + image?: string | null; + link?: string | null; + minimalQuantity?: number; +} + diff --git a/src/app/services/api/model/update-supplier-dto.ts b/src/app/services/api/model/update-supplier-dto.ts new file mode 100644 index 0000000..d2c7c5a --- /dev/null +++ b/src/app/services/api/model/update-supplier-dto.ts @@ -0,0 +1,21 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface UpdateSupplierDto { + name?: string | null; + email?: string | null; + phone?: string | null; + address?: string | null; + zipCode?: string | null; + city?: string | null; + deliveryDelay?: number; +} + diff --git a/src/app/services/api/model/update-user-dto.ts b/src/app/services/api/model/update-user-dto.ts new file mode 100644 index 0000000..672015b --- /dev/null +++ b/src/app/services/api/model/update-user-dto.ts @@ -0,0 +1,18 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface UpdateUserDto { + name?: string | null; + password?: string | null; + fonction?: string | null; + email?: string | null; +} + diff --git a/src/app/services/api/param.ts b/src/app/services/api/param.ts new file mode 100644 index 0000000..78a2d20 --- /dev/null +++ b/src/app/services/api/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; + +/** + * Standard types as defined in OpenAPI Specification: Data Types + */ +export type StandardDataType = + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +export type DataType = StandardDataType | string; + +/** + * Standard formats as defined in OpenAPI Specification: Data Types + */ +export type StandardDataFormat = + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; +} diff --git a/src/app/services/api/provide-api.ts b/src/app/services/api/provide-api.ts new file mode 100644 index 0000000..19c762a --- /dev/null +++ b/src/app/services/api/provide-api.ts @@ -0,0 +1,15 @@ +import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; +import { Configuration, ConfigurationParameters } from './configuration'; +import { BASE_PATH } from './variables'; + +// Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). +export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === "string" + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} \ No newline at end of file diff --git a/src/app/services/api/variables.ts b/src/app/services/api/variables.ts new file mode 100644 index 0000000..6fe5854 --- /dev/null +++ b/src/app/services/api/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} From dda9e0e4d72f9c7c727da07608fe64a9e4ecd52c Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 24 Nov 2025 21:44:55 +0100 Subject: [PATCH 044/127] added dashboard --- .../delivery-validator/delivery-validator.css | 114 ++++++++++++++++++ .../delivery-validator.html | 20 +++ .../delivery-validator/delivery-validator.ts | 44 +++++++ src/app/components/info-card/info-card.css | 42 +++++++ src/app/components/info-card/info-card.html | 7 ++ src/app/components/info-card/info-card.ts | 19 +++ src/app/components/info-table/info-table.css | 72 +++++++++++ src/app/components/info-table/info-table.html | 11 ++ src/app/components/info-table/info-table.ts | 44 +++++++ src/app/pages/welcome/welcome.html | 15 ++- src/app/pages/welcome/welcome.ts | 16 ++- 11 files changed, 396 insertions(+), 8 deletions(-) create mode 100644 src/app/components/delivery-validator/delivery-validator.css create mode 100644 src/app/components/delivery-validator/delivery-validator.html create mode 100644 src/app/components/delivery-validator/delivery-validator.ts create mode 100644 src/app/components/info-card/info-card.css create mode 100644 src/app/components/info-card/info-card.html create mode 100644 src/app/components/info-card/info-card.ts create mode 100644 src/app/components/info-table/info-table.css create mode 100644 src/app/components/info-table/info-table.html create mode 100644 src/app/components/info-table/info-table.ts diff --git a/src/app/components/delivery-validator/delivery-validator.css b/src/app/components/delivery-validator/delivery-validator.css new file mode 100644 index 0000000..4524bd8 --- /dev/null +++ b/src/app/components/delivery-validator/delivery-validator.css @@ -0,0 +1,114 @@ +/* Conteneur principal centré */ +.livraisons-container { + max-width: 650px; + margin: 40px 0 0 80px; + padding: 25px; + background: #f9fafb; + border-radius: 16px; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + + display: flex; + flex-direction: column; + align-items: flex-start; + + /* Box shadow pour effet superposition */ + box-shadow: + 0 4px 8px rgba(0, 0, 0, 0.06), + 0 8px 20px rgba(0, 0, 0, 0.08), + 0 16px 40px rgba(0, 0, 0, 0.06); +} + + +/* Barre de recherche */ +.search-input { + width: 100%; + padding: 14px 18px; + border-radius: 12px; + border: 1px solid #ddd; + margin-bottom: 20px; + font-size: 16px; + transition: all 0.3s ease; +} + +.search-input:focus { + border-color: #3b82f6; + box-shadow: 0 0 8px rgba(59,130,246,0.2); + outline: none; +} + +/* Liste scrollable */ +.livraisons-list { + width: 100%; + max-height: 350px; /* hauteur max de la liste */ + overflow-y: auto; /* scroll vertical activé */ + padding-right: 10px; /* pour le scrollbar */ +} + +/* Scrollbar personnalisée (optionnel) */ +.livraisons-list::-webkit-scrollbar { + width: 8px; +} + +.livraisons-list::-webkit-scrollbar-thumb { + background: #9ca3af; + border-radius: 4px; +} + +.livraisons-list::-webkit-scrollbar-track { + background: #f3f4f6; +} + +/* Carte de livraison */ +.livraison-card { + background: #ffffff; + padding: 20px 22px; + border-radius: 14px; + box-shadow: 0 6px 16px rgba(0,0,0,0.05); + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + margin-bottom: 18px; + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +.livraison-card:hover { + transform: translateY(-3px); + box-shadow: 0 10px 22px rgba(0,0,0,0.08); +} + +/* Infos livraison */ +.livraison-info h3 { + font-size: 17px; + margin: 0 0 4px; + color: #111827; +} + +.livraison-info p { + margin: 0; + font-size: 14px; + color: #6b7280; +} + +/* Bouton valider */ +.validate-btn { + padding: 10px 20px; + border-radius: 12px; + border: none; + cursor: pointer; + font-weight: 600; + background: #3b82f6; + color: white; + transition: all 0.3s ease; +} + +.validate-btn:hover { + background: #2563eb; +} + +.validate-btn.validated { + background: #9ca3af; + cursor: default; + color: #ffffff; + opacity: 0.9; +} diff --git a/src/app/components/delivery-validator/delivery-validator.html b/src/app/components/delivery-validator/delivery-validator.html new file mode 100644 index 0000000..2e3fb15 --- /dev/null +++ b/src/app/components/delivery-validator/delivery-validator.html @@ -0,0 +1,20 @@ +
    + + +
    + @for (deliveryItem of filteredLivraisons(); track deliveryItem.id) { +
    +
    +

    {{ deliveryItem.client }}

    +

    Date d'expédition: {{ deliveryItem.date }}

    +

    Produits : {{ deliveryItem.produits }}

    +
    + + +
    + } +
    +
    diff --git a/src/app/components/delivery-validator/delivery-validator.ts b/src/app/components/delivery-validator/delivery-validator.ts new file mode 100644 index 0000000..fc2fc54 --- /dev/null +++ b/src/app/components/delivery-validator/delivery-validator.ts @@ -0,0 +1,44 @@ +import {Component, computed, signal} from '@angular/core'; +import {NzButtonComponent, NzButtonSize} from "ng-zorro-antd/button"; +import {NzIconDirective} from "ng-zorro-antd/icon"; + +@Component({ + selector: 'app-delivery-validator', + imports: [ + NzButtonComponent, + NzIconDirective + ], + templateUrl: './delivery-validator.html', + styleUrl: './delivery-validator.css', +}) +export class DeliveryValidator { + size: NzButtonSize = 'large'; + search = signal(''); + + livraisons = signal([ + { id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 }, + { id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 }, + { id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 }, + { id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 }, + { id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 }, + { id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 }, + { id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 }, + { id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 }, + { id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 }, + { id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 }, + { id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 }, + { id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 } + ]); + + filteredLivraisons = computed(() => { + const query = this.search().toLowerCase(); + return this.livraisons().filter(l => + l.client.toLowerCase().includes(query) || + l.date.includes(query) + ); + }); + + validate(id: number) { + return + } +} diff --git a/src/app/components/info-card/info-card.css b/src/app/components/info-card/info-card.css new file mode 100644 index 0000000..278411c --- /dev/null +++ b/src/app/components/info-card/info-card.css @@ -0,0 +1,42 @@ +.card-content { + background: #ffffff; + padding: 32px 36px; + border-radius: 20px; + box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12); + width: 350px; + min-height: 180px; + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +.card-content:hover { + transform: translateY(-6px); + box-shadow: 0 14px 26px rgba(0, 0, 0, 0.16); +} + +/* Ligne du haut : icône ET nombre */ +.card-top { + display: flex; + align-items: center; + gap: 20px; +} + +/* Icône à gauche (plus grande) */ +.card-top nz-icon { + font-size: 50px; +} + +/* Nombre à droite de l'icône (plus grand) */ +.card-number { + font-size: 48px; + font-weight: 700; + margin: 0; + color: #111827; +} + +/* Texte en dessous (plus lisible) */ +.card-text { + margin-top: 18px; + font-size: 18px; + line-height: 1.4; + color: #4b5563; +} diff --git a/src/app/components/info-card/info-card.html b/src/app/components/info-card/info-card.html new file mode 100644 index 0000000..19579c6 --- /dev/null +++ b/src/app/components/info-card/info-card.html @@ -0,0 +1,7 @@ +
    +
    + +

    {{value()}}

    +
    +

    {{description()}}

    +
    \ No newline at end of file diff --git a/src/app/components/info-card/info-card.ts b/src/app/components/info-card/info-card.ts new file mode 100644 index 0000000..7a2c8d7 --- /dev/null +++ b/src/app/components/info-card/info-card.ts @@ -0,0 +1,19 @@ +import {Component, input} from '@angular/core'; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NgStyle} from "@angular/common"; + +@Component({ + selector: 'app-info-card', + imports: [ + NzIconDirective, + NgStyle + ], + templateUrl: './info-card.html', + styleUrl: './info-card.css', +}) +export class InfoCard { + icon = input.required() + value = input.required() + description = input.required() + color = input.required() +} diff --git a/src/app/components/info-table/info-table.css b/src/app/components/info-table/info-table.css new file mode 100644 index 0000000..66dad0d --- /dev/null +++ b/src/app/components/info-table/info-table.css @@ -0,0 +1,72 @@ +.documents-section { + display: flex; + flex-direction: column; + align-items: flex-start; /* contenu aligné à gauche */ + gap: 16px; /* espace entre le titre et la liste */ + margin: 40px 6%; +} + +/* Titre */ +.documents-section h1 { + font-size: 24px; + font-weight: 700; + color: #111827; + margin: 0; /* on gère l’espace avec le gap */ + letter-spacing: 0.5px; + text-transform: capitalize; + border-left: 4px solid #3b82f6; + padding-left: 12px; +} + +/* Liste de documents scrollable */ +.content { + width: 1000px; + display: flex; + flex-wrap: wrap; + gap: 16px; + padding: 30px 15px; + border-radius: 20px; + box-shadow: + 0 4px 8px rgba(0, 0, 0, 0.06), + 0 8px 20px rgba(0, 0, 0, 0.08), + 0 16px 40px rgba(0, 0, 0, 0.06); + max-height: 390px; + overflow-y: auto; +} + +/* Chaque carte */ +.content > div { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 120px; + height: 140px; + padding: 12px; + background: #ffffff; + border-radius: 14px; + cursor: pointer; + box-shadow: 0 6px 16px rgba(0,0,0,0.08); + transition: all 0.2s ease; + text-align: center; +} + +.content > div:hover { + transform: translateY(-3px); + box-shadow: 0 10px 22px rgba(0,0,0,0.12); +} + +.content img { + width: 48px; + height: 48px; + margin-bottom: 10px; + object-fit: contain; +} + +.content p { + margin: 0; + font-size: 16px; + font-weight: 600; + color: #111827; + word-break: break-word; +} diff --git a/src/app/components/info-table/info-table.html b/src/app/components/info-table/info-table.html new file mode 100644 index 0000000..85a991d --- /dev/null +++ b/src/app/components/info-table/info-table.html @@ -0,0 +1,11 @@ +
    +

    Documents récents

    +
    + @for (doc of purchaseOrder(); track doc.id) { +
    + pdf +

    {{ doc.name }}

    +
    + } +
    +
    \ No newline at end of file diff --git a/src/app/components/info-table/info-table.ts b/src/app/components/info-table/info-table.ts new file mode 100644 index 0000000..9cefdb9 --- /dev/null +++ b/src/app/components/info-table/info-table.ts @@ -0,0 +1,44 @@ +import { Component } from '@angular/core'; + +interface PurchaseOrder { + id: number; + name: string; +} + +@Component({ + selector: 'app-info-table', + templateUrl: './info-table.html', + styleUrls: ['./info-table.css'], +}) +export class InfoTable { + docs: PurchaseOrder[] = [ + { id: 1, name: 'Bon de commande'}, + { id: 2, name: 'Bon de commande'}, + { id: 3, name: 'Bon de commande'}, + { id: 1, name: 'Bon de commande'}, + { id: 2, name: 'Bon de commande'}, + { id: 3, name: 'Bon de commande'}, + { id: 1, name: 'Bon de commande'}, + { id: 2, name: 'Bon de commande'}, + { id: 3, name: 'Bon de commande'}, + { id: 1, name: 'Bon de commande'}, + { id: 2, name: 'Bon de commande'}, + { id: 3, name: 'Bon de commande'}, + { id: 1, name: 'Bon de commande'}, + { id: 2, name: 'Bon de commande'}, + { id: 3, name: 'Bon de commande'}, + { id: 1, name: 'Bon de commande'}, + { id: 2, name: 'Bon de commande'}, + { id: 3, name: 'Bon de commande'}, + { id: 1, name: 'Bon de commande'}, + { id: 2, name: 'Bon de commande'}, + { id: 3, name: 'Bon de commande'}, + { id: 1, name: 'Bon de commande'}, + { id: 2, name: 'Bon de commande'}, + { id: 3, name: 'Bon de commande'}, + ]; + + purchaseOrder(): PurchaseOrder[] { + return this.docs; + } +} diff --git a/src/app/pages/welcome/welcome.html b/src/app/pages/welcome/welcome.html index e62f14b..9155041 100644 --- a/src/app/pages/welcome/welcome.html +++ b/src/app/pages/welcome/welcome.html @@ -1,4 +1,11 @@ -

    - faire dashboard ici - et faire la verif des livraisons ici aussi -

    \ No newline at end of file +
    + + + + +
    + +
    + + +
    \ No newline at end of file diff --git a/src/app/pages/welcome/welcome.ts b/src/app/pages/welcome/welcome.ts index 138646b..8d152d6 100644 --- a/src/app/pages/welcome/welcome.ts +++ b/src/app/pages/welcome/welcome.ts @@ -1,11 +1,19 @@ import { Component } from '@angular/core'; -import {ModalNav} from "../../components/modal-nav/modal-nav"; -import {NzIconDirective} from "ng-zorro-antd/icon"; +import {InfoCard} from "../../components/info-card/info-card"; +import {DeliveryValidator} from "../../components/delivery-validator/delivery-validator"; +import {InfoTable} from "../../components/info-table/info-table"; @Component({ selector: 'app-welcome', - imports: [], + imports: [ + InfoCard, + DeliveryValidator, + InfoTable, + ], templateUrl: './welcome.html', styleUrl: './welcome.css' }) -export class Welcome {} + +export class Welcome { + +} From 46d121b016ac3faecd7b4ae6ea6b4f4f0284b137 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 25 Nov 2025 08:22:24 +0100 Subject: [PATCH 045/127] first commit --- package-lock.json | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 488f3a4..0c9a89a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,7 +500,6 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -517,7 +516,6 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -531,7 +529,6 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -564,7 +561,6 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -590,7 +586,6 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -609,7 +604,6 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -632,7 +626,6 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -714,7 +707,6 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1656,7 +1648,6 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -2516,7 +2507,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", - "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -4280,7 +4270,6 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", - "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", @@ -4448,7 +4437,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5647,7 +5635,6 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -6903,7 +6890,6 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -7191,7 +7177,6 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -8847,8 +8832,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/require-directory": { "version": "2.1.1", @@ -8996,7 +8980,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -9033,7 +9016,6 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -9782,8 +9764,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tuf-js": { "version": "3.1.0", @@ -9833,7 +9814,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9994,7 +9974,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -10382,7 +10361,6 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -10401,8 +10379,7 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT", - "peer": true + "license": "MIT" } } } From 6b067e058cfdcf980bfd6297b13eb6177c163135 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 25 Nov 2025 09:17:44 +0100 Subject: [PATCH 046/127] updated stock table --- .../quotation-table/quotation-table.html | 2 + .../components/stock-table/stock-table.html | 71 +++++++---- src/app/components/stock-table/stock-table.ts | 111 ++++++++++++------ .../supplier-table/supplier-table.html | 2 + src/app/interfaces/stock.interface.ts | 1 + src/app/pages/quotation/quotation.html | 2 +- src/app/pages/stock/stock.html | 21 +++- src/app/pages/stock/stock.ts | 11 ++ src/app/pages/supplier/supplier.html | 2 +- 9 files changed, 154 insertions(+), 69 deletions(-) diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 3ddfe1e..0d2ac21 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -25,6 +25,7 @@ Réference Nom + Prix Quantité Action @@ -34,6 +35,7 @@ {{data.quotationProductReference}} {{data.quotationProductName}} + XX.XX€ {{data.quotationProductQuantity}}
    diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 7c33279..2ea8bf2 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -1,37 +1,58 @@ - + - - Nom - Réference - Nec - Calibre - Poid - Durée - Quantité - Limite - Action - + + + + + Nom + Référence + Nec + Calibre + Poids + Durée + Quantité + Limite + Action + + - @for (data of basicTable.data; track data) { + @for (data of rowSelectionTable.data; track data.id) { - {{data.product.name}} - {{data.product.reference}} - {{data.product.nec}} - {{data.product.caliber}} - {{data.product.weight}} - {{data.product.duration}} - {{data.quantity}} - {{data.product.minimalQuantity}} + + + + + {{ data.product.name }} + {{ data.product.reference }} + {{ data.product.nec }} + {{ data.product.caliber }} + {{ data.product.weight }} + {{ data.product.duration }} + {{ data.quantity }} + {{ data.product.minimalQuantity }} +
    - + -
    - -
    +
    diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index 65bda28..1aff173 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component, output} from '@angular/core'; import {StockInfo} from "../../interfaces/stock.interface"; import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalNav} from "../modal-nav/modal-nav"; @@ -6,54 +6,89 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; import {StockForm} from "../stock-form/stock-form"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {ProductTable} from "../product-table/product-table"; +import {FormsModule} from "@angular/forms"; +import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; +import {NzButtonComponent} from "ng-zorro-antd/button"; @Component({ - selector: 'app-stock-table', + selector: 'app-stock-table', imports: [ NzTableComponent, ModalNav, NzIconDirective, StockForm, - NzDividerComponent + NzDividerComponent, + FormsModule, + NzCheckboxComponent, + NzButtonComponent, ], - templateUrl: './stock-table.html', - styleUrl: './stock-table.css', + templateUrl: './stock-table.html', + styleUrl: './stock-table.css', }) + export class StockTable { listOfData: StockInfo[] = [ - { product: ProductTable.listOfProducts[0], quantity: 10 }, - { product: ProductTable.listOfProducts[1], quantity: 5 }, - { product: ProductTable.listOfProducts[2], quantity: 8 }, - { product: ProductTable.listOfProducts[3], quantity: 12 }, - { product: ProductTable.listOfProducts[4], quantity: 7 }, - { product: ProductTable.listOfProducts[5], quantity: 15 }, - { product: ProductTable.listOfProducts[6], quantity: 9 }, - { product: ProductTable.listOfProducts[7], quantity: 6 }, - { product: ProductTable.listOfProducts[8], quantity: 11 }, - { product: ProductTable.listOfProducts[9], quantity: 14 }, - { product: ProductTable.listOfProducts[10], quantity: 7 }, - { product: ProductTable.listOfProducts[11], quantity: 13 }, - { product: ProductTable.listOfProducts[12], quantity: 10 }, - { product: ProductTable.listOfProducts[13], quantity: 5 }, - { product: ProductTable.listOfProducts[14], quantity: 8 }, - { product: ProductTable.listOfProducts[15], quantity: 12 }, - { product: ProductTable.listOfProducts[16], quantity: 9 }, - { product: ProductTable.listOfProducts[17], quantity: 6 }, - { product: ProductTable.listOfProducts[18], quantity: 11 }, - { product: ProductTable.listOfProducts[19], quantity: 14 }, - { product: ProductTable.listOfProducts[20], quantity: 7 }, - { product: ProductTable.listOfProducts[21], quantity: 13 }, - { product: ProductTable.listOfProducts[22], quantity: 10 }, - { product: ProductTable.listOfProducts[23], quantity: 5 }, - { product: ProductTable.listOfProducts[24], quantity: 8 }, - { product: ProductTable.listOfProducts[25], quantity: 12 }, - { product: ProductTable.listOfProducts[26], quantity: 9 }, - { product: ProductTable.listOfProducts[27], quantity: 6 }, - { product: ProductTable.listOfProducts[28], quantity: 11 }, - { product: ProductTable.listOfProducts[29], quantity: 14 }, + { id: 1, product: ProductTable.listOfProducts[0], quantity: 10 }, + { id: 2, product: ProductTable.listOfProducts[1], quantity: 5 }, + { id: 3, product: ProductTable.listOfProducts[2], quantity: 8 }, + { id: 4, product: ProductTable.listOfProducts[3], quantity: 12 }, + { id: 5, product: ProductTable.listOfProducts[4], quantity: 7 }, + { id: 6, product: ProductTable.listOfProducts[5], quantity: 15 }, + { id: 7, product: ProductTable.listOfProducts[6], quantity: 9 }, + { id: 8, product: ProductTable.listOfProducts[7], quantity: 6 }, + { id: 9, product: ProductTable.listOfProducts[8], quantity: 11 }, + { id: 10, product: ProductTable.listOfProducts[9], quantity: 14 }, + { id: 11, product: ProductTable.listOfProducts[10], quantity: 7 }, + { id: 12, product: ProductTable.listOfProducts[11], quantity: 13 }, + { id: 13, product: ProductTable.listOfProducts[12], quantity: 10 }, + { id: 14, product: ProductTable.listOfProducts[13], quantity: 5 }, ]; - delete(){ - return + checked = false; + indeterminate = false; + setOfCheckedId = new Set(); + + get hasSelection(): boolean { + return this.setOfCheckedId.size > 0; } -} + + + updateCheckedSet(id: number, checked: boolean): void { + if (checked) this.setOfCheckedId.add(id); + else this.setOfCheckedId.delete(id); + } + + onItemChecked(id: number, checked: boolean): void { + this.updateCheckedSet(id, checked); + this.refreshCheckedStatus(); + } + + onAllChecked(checked: boolean): void { + this.listOfData.forEach(item => this.updateCheckedSet(item.id, checked)); + this.refreshCheckedStatus(); + } + + refreshCheckedStatus(): void { + const total = this.listOfData.length; + const checkedCount = this.setOfCheckedId.size; + + this.checked = checkedCount === total; + this.indeterminate = checkedCount > 0 && checkedCount < total; + + // 🔥 Émission asynchrone -> corrige le retard d’affichage + setTimeout(() => { + this.selectionChange.emit(this.hasSelection); + }); + } + + + onCurrentPageDataChange($event: StockInfo[]): void { + this.listOfData = $event; + this.refreshCheckedStatus(); + } + + delete() { + return; + } + selectionChange = output() +} \ No newline at end of file diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index 8724470..b26448e 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -28,6 +28,7 @@ Nom Référence + Prix @@ -35,6 +36,7 @@ {{product.name}} {{product.reference}} + xx.x€ } diff --git a/src/app/interfaces/stock.interface.ts b/src/app/interfaces/stock.interface.ts index f21c99f..5d9439d 100644 --- a/src/app/interfaces/stock.interface.ts +++ b/src/app/interfaces/stock.interface.ts @@ -1,6 +1,7 @@ import {ProductInfo} from "./product.interface"; export interface StockInfo { + id: number; product: ProductInfo; quantity: number; } \ No newline at end of file diff --git a/src/app/pages/quotation/quotation.html b/src/app/pages/quotation/quotation.html index 6fa1e5b..2edf3b6 100644 --- a/src/app/pages/quotation/quotation.html +++ b/src/app/pages/quotation/quotation.html @@ -7,7 +7,7 @@
    -voir prix dans les produits +
    diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index e1edf81..97fcb2b 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,8 +1,21 @@ -
    - +
    + @if (hasSelection) { + + + + + + + + } + +
    + +
    -faire ici la creation de bon de commande avec case a cocher
    - +
    \ No newline at end of file diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 5b07d92..6d7e544 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,17 +1,28 @@ import { Component } from '@angular/core'; import {StockTable} from "../../components/stock-table/stock-table"; import {Search} from "../../components/search/search"; +import {ModalButton} from "../../components/modal-button/modal-button"; +import {PurchaseOrderForm} from "../../components/purchase-order-form/purchase-order-form"; +import {QuotationForm} from "../../components/quotation-form/quotation-form"; @Component({ selector: 'app-stock', imports: [ StockTable, Search, + ModalButton, + PurchaseOrderForm, + QuotationForm, ], templateUrl: './stock.html', styleUrl: './stock.css', }) export class Stock { + hasSelection = false; + + onSelectionChange(value: boolean) { + this.hasSelection = value; + } } diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 53cd6a6..08f4baa 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -7,7 +7,7 @@
    -voir pour le prix dans le sous tableau produit +
    From e79505a64fbe91b6701ad1c6bf9fc4686bd0b2fa Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 26 Nov 2025 13:44:54 +0100 Subject: [PATCH 047/127] added api --- package-lock.json | 29 +++++++++++++++++-- src/app/components/stock-table/stock-table.ts | 2 -- src/app/services/api/.openapi-generator/FILES | 1 - 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c9a89a..488f3a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,6 +500,7 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -516,6 +517,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -529,6 +531,7 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -561,6 +564,7 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -586,6 +590,7 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -604,6 +609,7 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -626,6 +632,7 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -707,6 +714,7 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1648,6 +1656,7 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -2507,6 +2516,7 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", + "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -4270,6 +4280,7 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", + "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", @@ -4437,6 +4448,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5635,6 +5647,7 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -6890,6 +6903,7 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -7177,6 +7191,7 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -8832,7 +8847,8 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/require-directory": { "version": "2.1.1", @@ -8980,6 +8996,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -9016,6 +9033,7 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -9764,7 +9782,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/tuf-js": { "version": "3.1.0", @@ -9814,6 +9833,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9974,6 +9994,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -10361,6 +10382,7 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -10379,7 +10401,8 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT" + "license": "MIT", + "peer": true } } } diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index 1aff173..cc1ccf5 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -8,7 +8,6 @@ import {NzDividerComponent} from "ng-zorro-antd/divider"; import {ProductTable} from "../product-table/product-table"; import {FormsModule} from "@angular/forms"; import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; -import {NzButtonComponent} from "ng-zorro-antd/button"; @Component({ selector: 'app-stock-table', @@ -20,7 +19,6 @@ import {NzButtonComponent} from "ng-zorro-antd/button"; NzDividerComponent, FormsModule, NzCheckboxComponent, - NzButtonComponent, ], templateUrl: './stock-table.html', styleUrl: './stock-table.css', diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 3d6d1ae..72ed5fa 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md api.base.service.ts api.module.ts From 8aef9f628b5840bc7f981858b729442d1a3a7606 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 26 Nov 2025 14:12:01 +0100 Subject: [PATCH 048/127] added select --- src/app/components/profil-form/profil-form.html | 12 +++++++++--- src/app/components/profil-form/profil-form.ts | 5 ++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/app/components/profil-form/profil-form.html b/src/app/components/profil-form/profil-form.html index c1e0fef..84d52cc 100644 --- a/src/app/components/profil-form/profil-form.html +++ b/src/app/components/profil-form/profil-form.html @@ -5,7 +5,7 @@ - + @@ -14,18 +14,24 @@ - + + Fonction - + + + + + + Mot de passe diff --git a/src/app/components/profil-form/profil-form.ts b/src/app/components/profil-form/profil-form.ts index b82c8e3..469f6bf 100644 --- a/src/app/components/profil-form/profil-form.ts +++ b/src/app/components/profil-form/profil-form.ts @@ -4,6 +4,7 @@ import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; @Component({ selector: 'app-profil-form', @@ -16,7 +17,9 @@ import {NzInputDirective} from "ng-zorro-antd/input"; NzFormItemComponent, NzFormLabelComponent, NzInputDirective, - ReactiveFormsModule + ReactiveFormsModule, + NzSelectComponent, + NzOptionComponent ], templateUrl: './profil-form.html', styleUrl: './profil-form.css', From 1bb713553e7d944589f80b8420783f48ebfd9b18 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 27 Nov 2025 15:00:09 +0100 Subject: [PATCH 049/127] first commit --- package-lock.json | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 488f3a4..0c9a89a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,7 +500,6 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -517,7 +516,6 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -531,7 +529,6 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -564,7 +561,6 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -590,7 +586,6 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -609,7 +604,6 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -632,7 +626,6 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -714,7 +707,6 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1656,7 +1648,6 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -2516,7 +2507,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", - "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -4280,7 +4270,6 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", - "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", @@ -4448,7 +4437,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5647,7 +5635,6 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -6903,7 +6890,6 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -7191,7 +7177,6 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -8847,8 +8832,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/require-directory": { "version": "2.1.1", @@ -8996,7 +8980,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -9033,7 +9016,6 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -9782,8 +9764,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tuf-js": { "version": "3.1.0", @@ -9833,7 +9814,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9994,7 +9974,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -10382,7 +10361,6 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -10401,8 +10379,7 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT", - "peer": true + "license": "MIT" } } } From 265d70bbc46a1620e6600f0552f8671c1b2b6cfa Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 27 Nov 2025 15:08:56 +0100 Subject: [PATCH 050/127] added all files for api --- src/app/services/api/.openapi-generator/FILES | 1 + src/app/services/api/api.base.service.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 72ed5fa..3d6d1ae 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore README.md api.base.service.ts api.module.ts diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 34531a6..1e0f210 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'https://localhost:44379'; + protected basePath = 'http://localhost:5298'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec; From 8d95127a46e4a7fc71c83df8946e029b0531a4e5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 27 Nov 2025 16:14:30 +0100 Subject: [PATCH 051/127] added create fonction, fetch, and delete --- .../components/modal-button/modal-button.ts | 7 +- .../components/profil-form/profil-form.html | 2 +- src/app/components/profil-form/profil-form.ts | 11 --- src/app/components/user-table/user-table.html | 17 ++-- src/app/components/user-table/user-table.ts | 81 ++++++++++--------- src/app/pages/user/user.html | 11 ++- src/app/pages/user/user.ts | 47 ++++++++++- 7 files changed, 116 insertions(+), 60 deletions(-) diff --git a/src/app/components/modal-button/modal-button.ts b/src/app/components/modal-button/modal-button.ts index b1ed57a..386caf6 100644 --- a/src/app/components/modal-button/modal-button.ts +++ b/src/app/components/modal-button/modal-button.ts @@ -1,4 +1,4 @@ -import {Component, input, Input} from '@angular/core'; +import {Component, input, Input, output} from '@angular/core'; import {NzModalComponent} from "ng-zorro-antd/modal"; import {NzButtonComponent} from "ng-zorro-antd/button"; @@ -16,6 +16,9 @@ export class ModalButton { name = input.required() type = input<"primary" | "default" | "dashed" | "link" | "text">() + ok = output(); + cancel = output(); + isVisible = false; isOkLoading = false; @@ -26,12 +29,14 @@ export class ModalButton { handleOk(): void { this.isOkLoading = true; setTimeout(() => { + this.ok.emit(); this.isVisible = false; this.isOkLoading = false; }, 1000); } handleCancel(): void { + this.cancel.emit(); this.isVisible = false; } } \ No newline at end of file diff --git a/src/app/components/profil-form/profil-form.html b/src/app/components/profil-form/profil-form.html index 84d52cc..4def138 100644 --- a/src/app/components/profil-form/profil-form.html +++ b/src/app/components/profil-form/profil-form.html @@ -1,4 +1,4 @@ - + Prénom diff --git a/src/app/components/profil-form/profil-form.ts b/src/app/components/profil-form/profil-form.ts index 469f6bf..7127e44 100644 --- a/src/app/components/profil-form/profil-form.ts +++ b/src/app/components/profil-form/profil-form.ts @@ -31,15 +31,4 @@ export class ProfilForm { fonction: new FormControl(null, [Validators.required]), password: new FormControl(null, [Validators.required]) }) - - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.profilForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.profilForm.getRawValue()) - - // Pour vider le formulaire - this.profilForm.reset() - } } diff --git a/src/app/components/user-table/user-table.html b/src/app/components/user-table/user-table.html index fe895f1..0b5d2c8 100644 --- a/src/app/components/user-table/user-table.html +++ b/src/app/components/user-table/user-table.html @@ -1,5 +1,8 @@ - - + + Nom Email @@ -8,11 +11,11 @@ - @for (data of basicTable.data; track data) { + @for (user of users(); track user.id) { - {{data.name}} - {{data.email}} - {{data.fonction}} + {{user.name}} + {{user.email}} + {{user.fonction}}
    @@ -20,7 +23,7 @@
    - +
    diff --git a/src/app/components/user-table/user-table.ts b/src/app/components/user-table/user-table.ts index a086c3f..92212d3 100644 --- a/src/app/components/user-table/user-table.ts +++ b/src/app/components/user-table/user-table.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {ModalNav} from "../modal-nav/modal-nav"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; @@ -6,6 +6,9 @@ import {StockForm} from "../stock-form/stock-form"; import {UserInfo} from "../../interfaces/user.interface"; import {ProfilForm} from "../profil-form/profil-form"; import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {GetUserDto, UsersService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-user-table', @@ -19,41 +22,47 @@ import {NzDividerComponent} from "ng-zorro-antd/divider"; templateUrl: './user-table.html', styleUrl: './user-table.css', }) -export class UserTable { - listOfData: UserInfo[] = [ - { name: 'Alice Martin', email: 'alice.martin@example.com', fonction: 'Responsable Stock' }, - { name: 'Bruno Lefevre', email: 'bruno.lefevre@example.com', fonction: 'Technicien' }, - { name: 'Claire Dupont', email: 'claire.dupont@example.com', fonction: 'Chef d’équipe' }, - { name: 'David Roux', email: 'david.roux@example.com', fonction: 'Opérateur' }, - { name: 'Emma Girard', email: 'emma.girard@example.com', fonction: 'Manager' }, - { name: 'Florian Petit', email: 'florian.petit@example.com', fonction: 'Contrôleur' }, - { name: 'Gabriel Fabre', email: 'gabriel.fabre@example.com', fonction: 'Technicien' }, - { name: 'Hélène Blanchard', email: 'helene.blanchard@example.com', fonction: 'Responsable Qualité' }, - { name: 'Idris Caron', email: 'idris.caron@example.com', fonction: 'Opérateur' }, - { name: 'Julie Laurent', email: 'julie.laurent@example.com', fonction: 'RH' }, - { name: 'Kevin Becker', email: 'kevin.becker@example.com', fonction: 'Chef d’équipe' }, - { name: 'Laura Denis', email: 'laura.denis@example.com', fonction: 'Responsable Stock' }, - { name: 'Maxime Robert', email: 'maxime.robert@example.com', fonction: 'Technicien' }, - { name: 'Nina Lambert', email: 'nina.lambert@example.com', fonction: 'Opérateur' }, - { name: 'Olivier Garnier', email: 'olivier.garnier@example.com', fonction: 'Manager' }, - { name: 'Pauline Henry', email: 'pauline.henry@example.com', fonction: 'Chef de Projet' }, - { name: 'Quentin Millet', email: 'quentin.millet@example.com', fonction: 'Technicien' }, - { name: 'Raphaël Julien', email: 'raphael.julien@example.com', fonction: 'Opérateur' }, - { name: 'Sophie Moreau', email: 'sophie.moreau@example.com', fonction: 'Responsable Qualité' }, - { name: 'Théo Renaud', email: 'theo.renaud@example.com', fonction: 'Technicien' }, - { name: 'Ulysse Berger', email: 'ulysse.berger@example.com', fonction: 'Opérateur' }, - { name: 'Valentine Roche', email: 'valentine.roche@example.com', fonction: 'RH' }, - { name: 'William Arnaud', email: 'william.arnaud@example.com', fonction: 'Chef d’équipe' }, - { name: 'Xavier Colin', email: 'xavier.colin@example.com', fonction: 'Technicien' }, - { name: 'Yasmine Perrot', email: 'yasmine.perrot@example.com', fonction: 'Manager' }, - { name: 'Zack Morel', email: 'zack.morel@example.com', fonction: 'Opérateur' }, - { name: 'Adèle Simon', email: 'adele.simon@example.com', fonction: 'Responsable Stock' }, - { name: 'Bastien Renault', email: 'bastien.renault@example.com', fonction: 'Technicien' }, - { name: 'Cindy Barret', email: 'cindy.barret@example.com', fonction: 'Assistante' }, - { name: 'Dorian Lefort', email: 'dorian.lefort@example.com', fonction: 'Contrôleur' }, - ]; +export class UserTable implements OnInit { + private usersService = inject(UsersService); + private notificationService = inject(NzNotificationService) + users = signal([]); + usersLoading = signal(false); + updateUser = viewChild.required('profilForm'); + modal = viewChild.required('modalNav'); - delete(){ - return + async ngOnInit() { + await this.fetchUsers(); } + + async fetchUsers() { + this.usersLoading.set(true) + + try { + const users = await firstValueFrom(this.usersService.getAllUsersEndpoint()) + this.users.set(users); + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) + } + this.usersLoading.set(false) + } + + async delete(user:number) { + try { + await firstValueFrom(this.usersService.deleteUserEndpoint(user)) + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + await this.fetchUsers(); + } + } diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index 81039bd..b10e9ec 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -1,6 +1,11 @@
    - - + + +
    @@ -9,5 +14,5 @@
    - +
    diff --git a/src/app/pages/user/user.ts b/src/app/pages/user/user.ts index ef69d5f..b5a0722 100644 --- a/src/app/pages/user/user.ts +++ b/src/app/pages/user/user.ts @@ -1,8 +1,11 @@ -import { Component } from '@angular/core'; +import {Component, inject, viewChild} from '@angular/core'; import {UserTable} from "../../components/user-table/user-table"; import {ModalButton} from "../../components/modal-button/modal-button"; import {ProfilForm} from "../../components/profil-form/profil-form"; import {Search} from "../../components/search/search"; +import {UsersService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-user', @@ -16,5 +19,47 @@ import {Search} from "../../components/search/search"; styleUrl: './user.css', }) export class User { + modal = viewChild.required('modalButton'); + createUser = viewChild.required('profilForm'); + usersTable = viewChild.required('userTable'); + private usersService = inject(UsersService); + private notificationService = inject(NzNotificationService) + async onModalOk() { + await this.addUser() + this.createUser().profilForm.reset(); + this.modal().isVisible = false; + await this.usersTable().fetchUsers() + } + + onModalCancel() { + this.modal().isVisible = false; + } + + async addUser() { + if (this.createUser().profilForm.invalid) + { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + } + try { + const users = this.createUser().profilForm.getRawValue(); + await firstValueFrom(this.usersService.createUserEndpoint(users)) + + console.log(users) + + this.notificationService.success( + 'Success', + 'Utilisateur crée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'enregistrement' + ) + } + } } + From 40b1c2620a0ff897545bb2c426d42e2fd6fc3370 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 27 Nov 2025 17:15:35 +0100 Subject: [PATCH 052/127] added edit fonction --- src/app/components/modal-nav/modal-nav.html | 4 +- src/app/components/modal-nav/modal-nav.ts | 13 +++--- src/app/components/profil-form/profil-form.ts | 17 +++++++- src/app/components/profil/profil.html | 2 +- src/app/components/user-table/user-table.html | 10 +++-- src/app/components/user-table/user-table.ts | 42 +++++++++++++++++++ src/app/pages/user/user.html | 2 +- src/app/pages/user/user.ts | 2 - 8 files changed, 77 insertions(+), 15 deletions(-) diff --git a/src/app/components/modal-nav/modal-nav.html b/src/app/components/modal-nav/modal-nav.html index 102ad5c..1401a39 100644 --- a/src/app/components/modal-nav/modal-nav.html +++ b/src/app/components/modal-nav/modal-nav.html @@ -1,5 +1,5 @@
    - +
    @@ -8,7 +8,7 @@ () + name = input.required() + ok = output(); + cancel = output(); isVisible = false; isOkLoading = false; @@ -23,12 +24,14 @@ export class ModalNav { handleOk(): void { this.isOkLoading = true; setTimeout(() => { - this.isVisible = false; + this.ok.emit(); this.isOkLoading = false; }, 1000); } handleCancel(): void { this.isVisible = false; + this.cancel.emit(); + } } diff --git a/src/app/components/profil-form/profil-form.ts b/src/app/components/profil-form/profil-form.ts index 7127e44..7d18b50 100644 --- a/src/app/components/profil-form/profil-form.ts +++ b/src/app/components/profil-form/profil-form.ts @@ -1,10 +1,11 @@ -import { Component } from '@angular/core'; +import {Component, effect, input} from '@angular/core'; import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {GetUserDto} from "../../services/api"; @Component({ selector: 'app-profil-form', @@ -31,4 +32,18 @@ export class ProfilForm { fonction: new FormControl(null, [Validators.required]), password: new FormControl(null, [Validators.required]) }) + + user = input(null); + constructor() { + effect(() => { + if (this.user()) { + this.profilForm.patchValue({ + name: this.user().name, + email: this.user().email, + fonction: this.user().fonction, + password: this.user().password + }); + } + }); + } } diff --git a/src/app/components/profil/profil.html b/src/app/components/profil/profil.html index 55ed75d..bf6e93f 100644 --- a/src/app/components/profil/profil.html +++ b/src/app/components/profil/profil.html @@ -1,6 +1,6 @@
    - +
    diff --git a/src/app/components/user-table/user-table.html b/src/app/components/user-table/user-table.html index 0b5d2c8..f973125 100644 --- a/src/app/components/user-table/user-table.html +++ b/src/app/components/user-table/user-table.html @@ -18,9 +18,7 @@ {{user.fonction}}
    - - - +
    @@ -31,3 +29,9 @@ } + + diff --git a/src/app/components/user-table/user-table.ts b/src/app/components/user-table/user-table.ts index 92212d3..8a5c86f 100644 --- a/src/app/components/user-table/user-table.ts +++ b/src/app/components/user-table/user-table.ts @@ -65,4 +65,46 @@ export class UserTable implements OnInit { await this.fetchUsers(); } + async edit(id: number, updateUserComponent: ProfilForm) { + if (updateUserComponent.profilForm.invalid) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + return; + } + + try { + const users = updateUserComponent.profilForm.getRawValue(); + await firstValueFrom(this.usersService.updateUserEndpoint(id, users)) + + this.notificationService.success( + 'Success', + 'Utilisateur modifié' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur lors de la modification' + ) + } + } + + selectedUser: GetUserDto | null = null; + openEditModal(user: GetUserDto) { + this.selectedUser = { ...user }; + this.modal().showModal(); + } + + async onModalOk(userId: number, updateUserComponent: ProfilForm, modal: ModalNav) { + if (!this.selectedUser) return; + + await this.edit(userId, updateUserComponent); + updateUserComponent.profilForm.reset(); + modal.isVisible = false; + await this.fetchUsers(); + } + onModalCancel(modal: ModalNav) { + modal.isVisible = false; + } } diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index b10e9ec..c87acd1 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -5,7 +5,7 @@ (ok)="onModalOk()" (cancel)="onModalCancel()"> - +
    diff --git a/src/app/pages/user/user.ts b/src/app/pages/user/user.ts index b5a0722..9e09149 100644 --- a/src/app/pages/user/user.ts +++ b/src/app/pages/user/user.ts @@ -48,8 +48,6 @@ export class User { const users = this.createUser().profilForm.getRawValue(); await firstValueFrom(this.usersService.createUserEndpoint(users)) - console.log(users) - this.notificationService.success( 'Success', 'Utilisateur crée' From b55bdedc20dc08d40b51968d24de80448d09ee59 Mon Sep 17 00:00:00 2001 From: Enzo Date: Thu, 27 Nov 2025 18:52:30 +0100 Subject: [PATCH 053/127] uptading Supplier Page --- package-lock.json | 29 +-- .../supplier-form/supplier-form.html | 11 +- .../components/supplier-form/supplier-form.ts | 15 +- .../supplier-table/supplier-table.html | 92 ++++---- .../supplier-table/supplier-table.ts | 199 ++++++++---------- src/app/services/api/.openapi-generator/FILES | 1 + src/app/services/api/api.base.service.ts | 2 +- .../services/api/model/get-supplier-dto.ts | 2 + 8 files changed, 148 insertions(+), 203 deletions(-) diff --git a/package-lock.json b/package-lock.json index 488f3a4..0c9a89a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,7 +500,6 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -517,7 +516,6 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -531,7 +529,6 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -564,7 +561,6 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -590,7 +586,6 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -609,7 +604,6 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -632,7 +626,6 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -714,7 +707,6 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1656,7 +1648,6 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -2516,7 +2507,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", - "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -4280,7 +4270,6 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", - "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", @@ -4448,7 +4437,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5647,7 +5635,6 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -6903,7 +6890,6 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -7191,7 +7177,6 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -8847,8 +8832,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/require-directory": { "version": "2.1.1", @@ -8996,7 +8980,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -9033,7 +9016,6 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -9782,8 +9764,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tuf-js": { "version": "3.1.0", @@ -9833,7 +9814,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9994,7 +9974,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -10382,7 +10361,6 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -10401,8 +10379,7 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT", - "peer": true + "license": "MIT" } } } diff --git a/src/app/components/supplier-form/supplier-form.html b/src/app/components/supplier-form/supplier-form.html index 1b7e80d..8702c8d 100644 --- a/src/app/components/supplier-form/supplier-form.html +++ b/src/app/components/supplier-form/supplier-form.html @@ -1,4 +1,4 @@ - + @@ -54,13 +54,4 @@ - - - Produits - - - - - - diff --git a/src/app/components/supplier-form/supplier-form.ts b/src/app/components/supplier-form/supplier-form.ts index 87895f2..b51f003 100644 --- a/src/app/components/supplier-form/supplier-form.ts +++ b/src/app/components/supplier-form/supplier-form.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import {Component, input} from '@angular/core'; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {GetSupplierDto} from "../../services/api"; @Component({ selector: 'app-supplier-form', @@ -28,18 +29,8 @@ export class SupplierForm { address: new FormControl(null, [Validators.required]), city: new FormControl(null, [Validators.required]), deliveryDelay: new FormControl(null, [Validators.required]), - product: new FormControl(null, [Validators.required]), }) + supplier= input.required() - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.supplierForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.supplierForm.getRawValue()) - - // Pour vider le formulaire - this.supplierForm.reset() - } } diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index b26448e..7a9cb69 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -1,61 +1,63 @@ - + - + Nom - email - Téléphone - Adresse - Ville - Délai Moyen - Produits - Action + Prénom + Email + Anniversaire + Emprunt + Action - - @for (data of basicTable.data; track data) { + + @for (supplier of suppliers(); track supplier.id) { - {{data.name}} - {{data.email}} - {{data.phone}} - {{data.address}}, {{data.zipCode}} - {{data.city}} - {{data.deliveryDelay}} + {{ supplier.name }} + {{ supplier.phone }} + {{ supplier.email }} + {{ supplier.address}} + {{ supplier.zipCode}} + {{ supplier.city}} + {{ supplier.deliveryDelay}} - -
    - - - - Nom - Référence - Prix - - - - @for (product of data.products; track product) { - - {{product.name}} - {{product.reference}} - xx.x€ - - } - - -
    + + + + + Produits + Nom + Référence + Prix + + + + @for (product of supplier.products; track product.id) { + + {{ product.name }} + {{ product.references }} + Price ??? + + } + + -
    - - - +
    + -
    - -
    +
    } + + diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index e6f9d25..03bd41c 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -1,13 +1,14 @@ -import { Component } from '@angular/core'; +import {Component, inject, signal, viewChild} from '@angular/core'; import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalButton} from "../modal-button/modal-button"; -import {DatePipe} from "@angular/common"; import {SupplierForm} from "../supplier-form/supplier-form"; -import {SupplierInfo} from "../../interfaces/supplier.interface"; -import {DelivererForm} from "../deliverer-form/deliverer-form"; +import {GetSupplierDto, SuppliersService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; +import {format} from "date-fns"; @Component({ selector: 'app-supplier-table', @@ -24,111 +25,91 @@ import {DelivererForm} from "../deliverer-form/deliverer-form"; }) export class SupplierTable { - listOfSupplier: SupplierInfo[] = [ - { - name: "PyroNova", - email: "contact@pyronova.com", - phone: "+33 1 45 23 67 89", - address: "12 Rue des Artisans", - zipCode: "69003", - city: "Lyon", - deliveryDelay: 4, - products: [] - }, - { - name: "FX Industries", - email: "sales@fxindus.com", - phone: "+33 2 41 22 90 10", - address: "118 Avenue Lumière", - zipCode: "49000", - city: "Angers", - deliveryDelay: 6, - products: [] - }, - { - name: "EuroFire", - email: "info@eurofire.eu", - phone: "+33 1 80 22 11 77", - address: "2 Avenue de l’Europe", - zipCode: "75012", - city: "Paris", - deliveryDelay: 3, - products: [] - }, - { - name: "FlashEffect", - email: "contact@flasheffect.fr", - phone: "+33 4 72 81 91 22", - address: "44 Rue Centrale", - zipCode: "69007", - city: "Lyon", - deliveryDelay: 5, - products: [] - }, - { - name: "StageLight FX", - email: "support@stagelightfx.com", - phone: "+33 5 55 74 99 31", - address: "99 Boulevard du Progrès", - zipCode: "31000", - city: "Toulouse", - deliveryDelay: 7, - products: [] - }, - { - name: "NovaSpark", - email: "hello@novaspark.fr", - phone: "+33 3 29 55 11 88", - address: "7 Rue de la Source", - zipCode: "54000", - city: "Nancy", - deliveryDelay: 4, - products: [] - }, - { - name: "FXWare", - email: "contact@fxware.eu", - phone: "+33 4 75 55 66 44", - address: "123 Route du Nord", - zipCode: "38000", - city: "Grenoble", - deliveryDelay: 6, - products: [] - }, - { - name: "PyroSet", - email: "info@pyroset.com", - phone: "+33 1 61 73 55 00", - address: "5 Chemin des Prés", - zipCode: "95000", - city: "Cergy", - deliveryDelay: 2, - products: [] - }, - { - name: "SkyFX", - email: "support@skyfx.fr", - phone: "+33 6 55 88 22 11", - address: "1 Rue du Ciel", - zipCode: "33000", - city: "Bordeaux", - deliveryDelay: 5, - products: [] - }, - { - name: "SparkLab", - email: "sales@sparklab.eu", - phone: "+33 2 33 55 77 12", - address: "33 Rue du Port", - zipCode: "14000", - city: "Caen", - deliveryDelay: 4, - products: [] - } - ]; + private suppliersService = inject(SuppliersService); + private notificationService = inject(NzNotificationService) + suppliers = signal([]); + suppliersLoading = signal(false); + updateSupplier = viewChild.required('supplierForm'); + modal = viewChild.required('modalNav'); - delete() { - return + async ngOnInit() { + await this.fetchSuppliers(); } -} + async fetchSuppliers() { + this.suppliersLoading.set(true) + + try { + const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint()) + this.suppliers.set(suppliers); + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) + } + this.suppliersLoading.set(false) + } + + async delete(supplier:number) { + try { + await firstValueFrom(this.suppliersService.deleteSupplierEndpoint(supplier)) + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + await this.fetchSuppliers(); + } + + async edit(id: number, updateSupplierComponent: SupplierForm) { + if (updateSupplierComponent.supplierForm.invalid) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + return; + } + + try { + + const suppliers = updateSupplierComponent.supplierForm.getRawValue(); + + await firstValueFrom(this.suppliersService.updateSupplierEndpoint(id, suppliers)) + + this.notificationService.success( + 'Success', + 'Fournisseur modifié' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur lors de la modification' + ) + } + } + + selectedSupplier: GetSupplierDto | null = null; + openEditModal(supplier: GetSupplierDto) { + this.selectedSupplier = { ...supplier }; + this.modal().showModal(); + } + + async onModalOk(supplierId: number, updateSupplierComponent: SupplierForm, modal: ModalNav) { + if (!this.selectedSupplier) return; + + await this.edit(supplierId, updateSupplierComponent); + updateSupplierComponent.supplierForm.reset(); + modal.isVisible = false; + await this.fetchSuppliers(); + } + + onModalCancel(modal: ModalNav) { + modal.isVisible = false; + } +} \ No newline at end of file diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 72ed5fa..3d6d1ae 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore README.md api.base.service.ts api.module.ts diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 34531a6..1e0f210 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'https://localhost:44379'; + protected basePath = 'http://localhost:5298'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec; diff --git a/src/app/services/api/model/get-supplier-dto.ts b/src/app/services/api/model/get-supplier-dto.ts index 35345b0..378eb06 100644 --- a/src/app/services/api/model/get-supplier-dto.ts +++ b/src/app/services/api/model/get-supplier-dto.ts @@ -7,6 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import { GetProductDto } from './get-product-dto'; export interface GetSupplierDto { @@ -18,5 +19,6 @@ export interface GetSupplierDto { zipCode?: string | null; city?: string | null; deliveryDelay?: number; + products?: Array | null; } From 376f2174565ab9318e21a0bd274e5b70fdc2c805 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 27 Nov 2025 19:25:08 +0100 Subject: [PATCH 054/127] updated supplier page --- package-lock.json | 29 ++++++++++-- .../components/modal-button/modal-button.ts | 13 ++++-- src/app/components/modal-nav/modal-nav.html | 4 +- src/app/components/modal-nav/modal-nav.ts | 13 +++--- .../components/supplier-form/supplier-form.ts | 19 ++++++-- .../supplier-table/supplier-table.ts | 6 +-- src/app/pages/supplier/supplier.html | 13 ++++-- src/app/pages/supplier/supplier.ts | 44 ++++++++++++++++++- src/app/services/api/.openapi-generator/FILES | 1 - src/app/services/api/api.base.service.ts | 2 +- 10 files changed, 117 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c9a89a..488f3a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,6 +500,7 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -516,6 +517,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -529,6 +531,7 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -561,6 +564,7 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -586,6 +590,7 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -604,6 +609,7 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -626,6 +632,7 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -707,6 +714,7 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1648,6 +1656,7 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -2507,6 +2516,7 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", + "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -4270,6 +4280,7 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", + "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", @@ -4437,6 +4448,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5635,6 +5647,7 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -6890,6 +6903,7 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -7177,6 +7191,7 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -8832,7 +8847,8 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/require-directory": { "version": "2.1.1", @@ -8980,6 +8996,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -9016,6 +9033,7 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -9764,7 +9782,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/tuf-js": { "version": "3.1.0", @@ -9814,6 +9833,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9974,6 +9994,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -10361,6 +10382,7 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -10379,7 +10401,8 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT" + "license": "MIT", + "peer": true } } } diff --git a/src/app/components/modal-button/modal-button.ts b/src/app/components/modal-button/modal-button.ts index b1ed57a..49d0fee 100644 --- a/src/app/components/modal-button/modal-button.ts +++ b/src/app/components/modal-button/modal-button.ts @@ -1,21 +1,24 @@ -import {Component, input, Input} from '@angular/core'; +import {Component, input, Input, output} from '@angular/core'; import {NzModalComponent} from "ng-zorro-antd/modal"; import {NzButtonComponent} from "ng-zorro-antd/button"; @Component({ - selector: 'app-modal-button', + selector: 'app-modal-button', imports: [ NzModalComponent, NzButtonComponent, ], - templateUrl: './modal-button.html', - styleUrl: './modal-button.css', + templateUrl: './modal-button.html', + styleUrl: './modal-button.css', }) export class ModalButton { name = input.required() type = input<"primary" | "default" | "dashed" | "link" | "text">() + ok = output(); + cancel = output(); + isVisible = false; isOkLoading = false; @@ -26,12 +29,14 @@ export class ModalButton { handleOk(): void { this.isOkLoading = true; setTimeout(() => { + this.ok.emit(); this.isVisible = false; this.isOkLoading = false; }, 1000); } handleCancel(): void { + this.cancel.emit(); this.isVisible = false; } } \ No newline at end of file diff --git a/src/app/components/modal-nav/modal-nav.html b/src/app/components/modal-nav/modal-nav.html index 102ad5c..1401a39 100644 --- a/src/app/components/modal-nav/modal-nav.html +++ b/src/app/components/modal-nav/modal-nav.html @@ -1,5 +1,5 @@
    - +
    @@ -8,7 +8,7 @@ () + name = input.required() + ok = output(); + cancel = output(); isVisible = false; isOkLoading = false; @@ -23,12 +24,14 @@ export class ModalNav { handleOk(): void { this.isOkLoading = true; setTimeout(() => { - this.isVisible = false; + this.ok.emit(); this.isOkLoading = false; }, 1000); } handleCancel(): void { this.isVisible = false; + this.cancel.emit(); + } } diff --git a/src/app/components/supplier-form/supplier-form.ts b/src/app/components/supplier-form/supplier-form.ts index b51f003..2341018 100644 --- a/src/app/components/supplier-form/supplier-form.ts +++ b/src/app/components/supplier-form/supplier-form.ts @@ -1,4 +1,4 @@ -import {Component, input} from '@angular/core'; +import {Component, effect, input} from '@angular/core'; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; @@ -31,6 +31,19 @@ export class SupplierForm { deliveryDelay: new FormControl(null, [Validators.required]), }) - supplier= input.required() - + supplier= input.required(); + constructor() { + effect(() => { + if (this.supplier()) { + this.supplierForm.patchValue({ + name: this.supplier().name, + email: this.supplier().email, + phone: this.supplier().phone, + address: this.supplier().address, + city: this.supplier().city, + deliveryDelay: this.supplier().deliveryDelay, + }); + } + }); + } } diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index 03bd41c..894b519 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -1,4 +1,4 @@ -import {Component, inject, signal, viewChild} from '@angular/core'; +import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; @@ -8,7 +8,6 @@ import {SupplierForm} from "../supplier-form/supplier-form"; import {GetSupplierDto, SuppliersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; -import {format} from "date-fns"; @Component({ selector: 'app-supplier-table', @@ -24,7 +23,7 @@ import {format} from "date-fns"; styleUrl: './supplier-table.css', }) -export class SupplierTable { +export class SupplierTable implements OnInit { private suppliersService = inject(SuppliersService); private notificationService = inject(NzNotificationService) suppliers = signal([]); @@ -87,6 +86,7 @@ export class SupplierTable { 'Fournisseur modifié' ) } catch (e) { + console.error(e); this.notificationService.error( 'Erreur', 'Erreur lors de la modification' diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 08f4baa..7ba9c6c 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -1,13 +1,18 @@
    - - + + +
    - +
    - +
    diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 7f5c1ee..6de0c4b 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -1,8 +1,11 @@ -import { Component } from '@angular/core'; +import {Component, inject, viewChild} from '@angular/core'; import {Search} from "../../components/search/search"; import {ModalButton} from "../../components/modal-button/modal-button"; import {SupplierTable} from "../../components/supplier-table/supplier-table"; import {SupplierForm} from "../../components/supplier-form/supplier-form"; +import {SuppliersService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-supplier', @@ -16,5 +19,44 @@ import {SupplierForm} from "../../components/supplier-form/supplier-form"; styleUrl: './supplier.css', }) export class Supplier { + modal = viewChild.required('modalButton'); + createSupplier = viewChild.required('supplierForm'); + suppliersTable = viewChild.required('suppliersTable'); + private usersService = inject(SuppliersService); + private notificationService = inject(NzNotificationService) + async onModalOk() { + await this.addSupplier() + this.createSupplier().supplierForm.reset(); + this.modal().isVisible = false; + await this.suppliersTable().fetchSuppliers() + } + + onModalCancel() { + this.modal().isVisible = false; + } + + async addSupplier() { + if (this.createSupplier().supplierForm.invalid) + { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + } + try { + const suppliers = this.createSupplier().supplierForm.getRawValue(); + await firstValueFrom(this.usersService.createSupplierEndpoint(suppliers)) + + this.notificationService.success( + 'Success', + 'Fournisseur enregistré' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'enregistrement' + ) + } + } } diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 3d6d1ae..72ed5fa 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md api.base.service.ts api.module.ts diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 1e0f210..34531a6 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'http://localhost:5298'; + protected basePath = 'https://localhost:44379'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec; From b54ba70c11cfc5a54c54ac940933acc148005160 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 28 Nov 2025 09:00:41 +0100 Subject: [PATCH 055/127] fixed errors in supplier page --- src/app/components/supplier-form/supplier-form.html | 11 ++++++++++- src/app/components/supplier-form/supplier-form.ts | 5 ++++- src/app/components/supplier-table/supplier-table.html | 9 ++++++--- src/app/components/supplier-table/supplier-table.ts | 1 - src/app/pages/supplier/supplier.html | 2 +- src/app/pages/supplier/supplier.ts | 4 ++-- src/app/services/api/.openapi-generator/FILES | 1 + src/app/services/api/api.base.service.ts | 2 +- 8 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/app/components/supplier-form/supplier-form.html b/src/app/components/supplier-form/supplier-form.html index 8702c8d..ed44a1a 100644 --- a/src/app/components/supplier-form/supplier-form.html +++ b/src/app/components/supplier-form/supplier-form.html @@ -36,6 +36,15 @@ + + + Code Postal + + + + + + Ville @@ -50,7 +59,7 @@ Délai Moyen - + diff --git a/src/app/components/supplier-form/supplier-form.ts b/src/app/components/supplier-form/supplier-form.ts index 2341018..c3cc539 100644 --- a/src/app/components/supplier-form/supplier-form.ts +++ b/src/app/components/supplier-form/supplier-form.ts @@ -27,11 +27,13 @@ export class SupplierForm { email: new FormControl(null, [Validators.required]), phone: new FormControl(null, [Validators.required]), address: new FormControl(null, [Validators.required]), + zipCode: new FormControl(null, [Validators.required]), city: new FormControl(null, [Validators.required]), deliveryDelay: new FormControl(null, [Validators.required]), }) - supplier= input.required(); + + supplier= input(); constructor() { effect(() => { if (this.supplier()) { @@ -40,6 +42,7 @@ export class SupplierForm { email: this.supplier().email, phone: this.supplier().phone, address: this.supplier().address, + zipCode: this.supplier().zipCode, city: this.supplier().city, deliveryDelay: this.supplier().deliveryDelay, }); diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index 7a9cb69..33d127f 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -4,10 +4,13 @@ Nom - Prénom + Téléphone Email - Anniversaire - Emprunt + Adresse + Code Postal + Ville + Délai moyen + Produits Action diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index 894b519..87ea541 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -78,7 +78,6 @@ export class SupplierTable implements OnInit { try { const suppliers = updateSupplierComponent.supplierForm.getRawValue(); - await firstValueFrom(this.suppliersService.updateSupplierEndpoint(id, suppliers)) this.notificationService.success( diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 7ba9c6c..5593490 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -5,7 +5,7 @@ (ok)="onModalOk()" (cancel)="onModalCancel()"> - +
    diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 6de0c4b..0a5051f 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -21,7 +21,7 @@ import {firstValueFrom} from "rxjs"; export class Supplier { modal = viewChild.required('modalButton'); createSupplier = viewChild.required('supplierForm'); - suppliersTable = viewChild.required('suppliersTable'); + supplierTable = viewChild.required('supplierTable'); private usersService = inject(SuppliersService); private notificationService = inject(NzNotificationService) @@ -29,7 +29,7 @@ export class Supplier { await this.addSupplier() this.createSupplier().supplierForm.reset(); this.modal().isVisible = false; - await this.suppliersTable().fetchSuppliers() + await this.supplierTable().fetchSuppliers() } onModalCancel() { diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 72ed5fa..3d6d1ae 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore README.md api.base.service.ts api.module.ts diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 34531a6..1e0f210 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'https://localhost:44379'; + protected basePath = 'http://localhost:5298'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec; From aae87da374ec282dd0204800e008ed6b7d47cec8 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 28 Nov 2025 09:05:30 +0100 Subject: [PATCH 056/127] fixed errors in supplier page --- src/app/components/supplier-table/supplier-table.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index 33d127f..b1a665d 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -23,7 +23,7 @@ {{ supplier.address}} {{ supplier.zipCode}} {{ supplier.city}} - {{ supplier.deliveryDelay}} + {{ supplier.deliveryDelay}} jours From 2419f602f3ac77e7c84ede7087720219afdaf515 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 28 Nov 2025 09:34:03 +0100 Subject: [PATCH 057/127] fixed errors in user page --- src/app/components/profil-form/profil-form.ts | 2 +- src/app/pages/user/user.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/profil-form/profil-form.ts b/src/app/components/profil-form/profil-form.ts index 7d18b50..0af8777 100644 --- a/src/app/components/profil-form/profil-form.ts +++ b/src/app/components/profil-form/profil-form.ts @@ -33,7 +33,7 @@ export class ProfilForm { password: new FormControl(null, [Validators.required]) }) - user = input(null); + user = input(); constructor() { effect(() => { if (this.user()) { diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index c87acd1..7fadb44 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -5,7 +5,7 @@ (ok)="onModalOk()" (cancel)="onModalCancel()"> - +
    From a76b184dc1e666a99141a76482e141c130b41908 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 29 Nov 2025 21:25:41 +0100 Subject: [PATCH 058/127] first commit --- package-lock.json | 29 +++++++++++++++++-- src/app/services/api/.openapi-generator/FILES | 1 - src/app/services/api/api.base.service.ts | 2 +- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c9a89a..488f3a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,6 +500,7 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -516,6 +517,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -529,6 +531,7 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -561,6 +564,7 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -586,6 +590,7 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -604,6 +609,7 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -626,6 +632,7 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -707,6 +714,7 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1648,6 +1656,7 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -2507,6 +2516,7 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", + "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -4270,6 +4280,7 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", + "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", @@ -4437,6 +4448,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5635,6 +5647,7 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -6890,6 +6903,7 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -7177,6 +7191,7 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -8832,7 +8847,8 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/require-directory": { "version": "2.1.1", @@ -8980,6 +8996,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -9016,6 +9033,7 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -9764,7 +9782,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/tuf-js": { "version": "3.1.0", @@ -9814,6 +9833,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9974,6 +9994,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -10361,6 +10382,7 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -10379,7 +10401,8 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT" + "license": "MIT", + "peer": true } } } diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 3d6d1ae..72ed5fa 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md api.base.service.ts api.module.ts diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 1e0f210..34531a6 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'http://localhost:5298'; + protected basePath = 'https://localhost:44379'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec; From 0189fb044062e21e64ee9324148777c10326a2da Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 29 Nov 2025 23:14:04 +0100 Subject: [PATCH 059/127] connect api to stock page for get, patch and delete --- src/app/components/stock-form/stock-form.html | 6 +- src/app/components/stock-form/stock-form.ts | 25 +-- .../components/stock-table/stock-table.html | 39 ++--- src/app/components/stock-table/stock-table.ts | 143 +++++++++++++----- src/app/pages/stock/stock.html | 12 +- src/app/pages/stock/stock.ts | 51 ++++++- src/app/pages/supplier/supplier.ts | 4 +- src/app/services/api/api/products.service.ts | 53 +++++++ 8 files changed, 255 insertions(+), 78 deletions(-) diff --git a/src/app/components/stock-form/stock-form.html b/src/app/components/stock-form/stock-form.html index d9bcb69..3892c63 100644 --- a/src/app/components/stock-form/stock-form.html +++ b/src/app/components/stock-form/stock-form.html @@ -1,12 +1,12 @@ -
    + Quantité minimale du produit - - + +
    \ No newline at end of file diff --git a/src/app/components/stock-form/stock-form.ts b/src/app/components/stock-form/stock-form.ts index c378450..c3934d1 100644 --- a/src/app/components/stock-form/stock-form.ts +++ b/src/app/components/stock-form/stock-form.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import {Component, effect, input} from '@angular/core'; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {GetProductDto} from "../../services/api"; @Component({ selector: 'app-stock-form', @@ -22,17 +23,19 @@ import {NzFlexDirective} from "ng-zorro-antd/flex"; }) export class StockForm { stockForm = new FormGroup({ - minQuantity: new FormControl(null, [Validators.required]) + id: new FormControl(null), + minimalQuantity: new FormControl(null, [Validators.required]) }) - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.stockForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.stockForm.getRawValue()) - - // Pour vider le formulaire - this.stockForm.reset() + product= input(); + constructor() { + effect(() => { + if (this.product()) { + this.stockForm.patchValue({ + id: this.product().id, + minimalQuantity: this.product().minimalQuantity, + }); + } + }); } } \ No newline at end of file diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 2ea8bf2..175df95 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -1,6 +1,6 @@ @@ -26,36 +26,39 @@ - @for (data of rowSelectionTable.data; track data.id) { + @for (product of products(); track product.id) { - {{ data.product.name }} - {{ data.product.reference }} - {{ data.product.nec }} - {{ data.product.caliber }} - {{ data.product.weight }} - {{ data.product.duration }} - {{ data.quantity }} - {{ data.product.minimalQuantity }} + {{ product.name }} + {{ product.references }} + {{ product.nec }} + {{ product.caliber }} + {{ product.weight }} + {{ product.duration }} + Quantité totale ??? + {{ product.minimalQuantity }}
    - - - + - +
    }
    + + \ No newline at end of file diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index cc1ccf5..5550d53 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -1,13 +1,14 @@ -import {Component, output} from '@angular/core'; -import {StockInfo} from "../../interfaces/stock.interface"; -import {NzTableComponent} from "ng-zorro-antd/table"; +import {Component, inject, OnInit, output, signal, viewChild} from '@angular/core'; +import {NzTableComponent, NzThMeasureDirective} from "ng-zorro-antd/table"; import {ModalNav} from "../modal-nav/modal-nav"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {StockForm} from "../stock-form/stock-form"; import {NzDividerComponent} from "ng-zorro-antd/divider"; -import {ProductTable} from "../product-table/product-table"; import {FormsModule} from "@angular/forms"; import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; +import {GetProductDto, ProductsService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-stock-table', @@ -19,38 +20,30 @@ import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; NzDividerComponent, FormsModule, NzCheckboxComponent, + NzThMeasureDirective, ], templateUrl: './stock-table.html', styleUrl: './stock-table.css', }) -export class StockTable { - listOfData: StockInfo[] = [ - { id: 1, product: ProductTable.listOfProducts[0], quantity: 10 }, - { id: 2, product: ProductTable.listOfProducts[1], quantity: 5 }, - { id: 3, product: ProductTable.listOfProducts[2], quantity: 8 }, - { id: 4, product: ProductTable.listOfProducts[3], quantity: 12 }, - { id: 5, product: ProductTable.listOfProducts[4], quantity: 7 }, - { id: 6, product: ProductTable.listOfProducts[5], quantity: 15 }, - { id: 7, product: ProductTable.listOfProducts[6], quantity: 9 }, - { id: 8, product: ProductTable.listOfProducts[7], quantity: 6 }, - { id: 9, product: ProductTable.listOfProducts[8], quantity: 11 }, - { id: 10, product: ProductTable.listOfProducts[9], quantity: 14 }, - { id: 11, product: ProductTable.listOfProducts[10], quantity: 7 }, - { id: 12, product: ProductTable.listOfProducts[11], quantity: 13 }, - { id: 13, product: ProductTable.listOfProducts[12], quantity: 10 }, - { id: 14, product: ProductTable.listOfProducts[13], quantity: 5 }, - ]; +export class StockTable implements OnInit { + private productsService = inject(ProductsService); + private notificationService = inject(NzNotificationService) + products = signal([]); + productsLoading = signal(false); + updateProduct = viewChild.required('stockForm'); + modal = viewChild.required('modalNav'); checked = false; indeterminate = false; setOfCheckedId = new Set(); + selectionChange = output() + currentPageData: GetProductDto[] = []; get hasSelection(): boolean { return this.setOfCheckedId.size > 0; } - updateCheckedSet(id: number, checked: boolean): void { if (checked) this.setOfCheckedId.add(id); else this.setOfCheckedId.delete(id); @@ -62,31 +55,109 @@ export class StockTable { } onAllChecked(checked: boolean): void { - this.listOfData.forEach(item => this.updateCheckedSet(item.id, checked)); + this.currentPageData.forEach(item => + this.updateCheckedSet(item.id, checked) + ); + this.refreshCheckedStatus(); + } + + onCurrentPageDataChange($event: GetProductDto[]): void { + this.currentPageData = $event; this.refreshCheckedStatus(); } refreshCheckedStatus(): void { - const total = this.listOfData.length; - const checkedCount = this.setOfCheckedId.size; + const total = this.currentPageData.length; + const checkedCount = this.currentPageData.filter(p => this.setOfCheckedId.has(p.id)).length; this.checked = checkedCount === total; this.indeterminate = checkedCount > 0 && checkedCount < total; - // 🔥 Émission asynchrone -> corrige le retard d’affichage - setTimeout(() => { - this.selectionChange.emit(this.hasSelection); - }); + setTimeout(() => this.selectionChange.emit(this.hasSelection)); } - - onCurrentPageDataChange($event: StockInfo[]): void { - this.listOfData = $event; - this.refreshCheckedStatus(); + get selectedIds() { + return Array.from(this.setOfCheckedId); } - delete() { - return; + async ngOnInit() { + await this.fetchProducts(); + } + + async fetchProducts() { + this.productsLoading.set(true) + + try { + const products = await firstValueFrom(this.productsService.getAllProductsEndpoint()) + this.products.set(products); + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) + } + this.productsLoading.set(false) + } + + async delete(productId:number) { + try { + await firstValueFrom(this.productsService.deleteProductEndpoint(productId)) + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + await this.fetchProducts(); + } + + async edit(id: number, updateProductComponent: StockForm) { + if (updateProductComponent.stockForm.invalid) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + return; + } + + try { + + const products = updateProductComponent.stockForm.getRawValue(); + await firstValueFrom(this.productsService.patchProductMinimalStockEndpoint(id, products)) + + this.notificationService.success( + 'Success', + 'Limite de stock modifiée' + ) + } catch (e) { + console.error(e); + this.notificationService.error( + 'Erreur', + 'Erreur lors de la modification' + ) + } + } + + selectedProduct: GetProductDto | null = null; + openEditModal(product: GetProductDto) { + this.selectedProduct = { ...product}; + this.modal().showModal(); + } + + async onModalOk(productId: number, updateProductComponent: StockForm, modal: ModalNav) { + if (!this.selectedProduct) return; + + await this.edit(productId, updateProductComponent); + updateProductComponent.stockForm.reset(); + modal.isVisible = false; + await this.fetchProducts(); + } + + onModalCancel(modal: ModalNav) { + modal.isVisible = false; } - selectionChange = output() } \ No newline at end of file diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index 97fcb2b..315cffd 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,11 +1,11 @@
    @if (hasSelection) { - - + + - - + + } @@ -15,7 +15,5 @@
    - +
    \ No newline at end of file diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 6d7e544..5fbebf5 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,9 +1,12 @@ -import { Component } from '@angular/core'; +import {Component, inject, viewChild} from '@angular/core'; import {StockTable} from "../../components/stock-table/stock-table"; import {Search} from "../../components/search/search"; import {ModalButton} from "../../components/modal-button/modal-button"; import {PurchaseOrderForm} from "../../components/purchase-order-form/purchase-order-form"; import {QuotationForm} from "../../components/quotation-form/quotation-form"; +import {ProductsService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-stock', @@ -19,10 +22,56 @@ import {QuotationForm} from "../../components/quotation-form/quotation-form"; }) export class Stock { + modal = viewChild.required('modalButton'); + createQuotation = viewChild.required('quotationForm'); + createPurchaseOrder = viewChild.required('purchaseOrderForm'); + productTable = viewChild.required('stockTable'); + private productsService = inject(ProductsService); + private notificationService = inject(NzNotificationService) + + // async onModalOk() { + // await this.addSupplier() + // this.createSupplier().supplierForm.reset(); + // this.modal().isVisible = false; + // await this.supplierTable().fetchSuppliers() + // } + // + // onModalCancel() { + // this.modal().isVisible = false; + // } + // + // async addSupplier() { + // if (this.createSupplier().supplierForm.invalid) + // { + // this.notificationService.error( + // 'Erreur', + // 'Erreur d\'écriture dans le formulaire' + // ) + // } + // try { + // const suppliers = this.createSupplier().supplierForm.getRawValue(); + // await firstValueFrom(this.usersService.createSupplierEndpoint(suppliers)) + // + // this.notificationService.success( + // 'Success', + // 'Fournisseur enregistré' + // ) + // } catch (e) { + // this.notificationService.error( + // 'Erreur', + // 'Erreur d\'enregistrement' + // ) + // } + // } + hasSelection = false; onSelectionChange(value: boolean) { this.hasSelection = value; } + test(){ + console.log(this.productTable().selectedIds); + } + } diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 0a5051f..5cbe79d 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -22,7 +22,7 @@ export class Supplier { modal = viewChild.required('modalButton'); createSupplier = viewChild.required('supplierForm'); supplierTable = viewChild.required('supplierTable'); - private usersService = inject(SuppliersService); + private suppliersService = inject(SuppliersService); private notificationService = inject(NzNotificationService) async onModalOk() { @@ -46,7 +46,7 @@ export class Supplier { } try { const suppliers = this.createSupplier().supplierForm.getRawValue(); - await firstValueFrom(this.usersService.createSupplierEndpoint(suppliers)) + await firstValueFrom(this.suppliersService.createSupplierEndpoint(suppliers)) this.notificationService.success( 'Success', diff --git a/src/app/services/api/api/products.service.ts b/src/app/services/api/api/products.service.ts index c6f3489..65263c5 100644 --- a/src/app/services/api/api/products.service.ts +++ b/src/app/services/api/api/products.service.ts @@ -39,6 +39,59 @@ export class ProductsService extends BaseService { super(basePath, configuration); } + /** + * @endpoint delete /API/products/{productId} + * @param productId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteProductEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteProductEndpoint(productId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteProductEndpoint(productId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteProductEndpoint(productId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling deleteProductEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/products/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint get /API/products * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. From 5c1403e9345607704c57615118d838301414a52b Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 11:44:37 +0100 Subject: [PATCH 060/127] fixed errors --- .../components/quotation-form/quotation-form.html | 12 +----------- src/app/components/quotation-form/quotation-form.ts | 11 ----------- src/app/components/stock-table/stock-table.html | 1 + src/app/pages/quotation/quotation.html | 4 ---- src/app/pages/quotation/quotation.ts | 6 ------ 5 files changed, 2 insertions(+), 32 deletions(-) diff --git a/src/app/components/quotation-form/quotation-form.html b/src/app/components/quotation-form/quotation-form.html index 2716fab..0ca8812 100644 --- a/src/app/components/quotation-form/quotation-form.html +++ b/src/app/components/quotation-form/quotation-form.html @@ -1,4 +1,4 @@ -
    + Message du devis @@ -18,15 +18,5 @@ - - - - Fournisseur - - - - - -
    diff --git a/src/app/components/quotation-form/quotation-form.ts b/src/app/components/quotation-form/quotation-form.ts index 6db611c..0e7a39c 100644 --- a/src/app/components/quotation-form/quotation-form.ts +++ b/src/app/components/quotation-form/quotation-form.ts @@ -26,15 +26,4 @@ export class QuotationForm { quotationMessage: new FormControl(null), quotationConditionsSale: new FormControl(null), }) - - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.QuotationForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.QuotationForm.getRawValue()) - - // Pour vider le formulaire - this.QuotationForm.reset() - } } diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 175df95..29daffa 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -1,6 +1,7 @@ diff --git a/src/app/pages/quotation/quotation.html b/src/app/pages/quotation/quotation.html index 2edf3b6..92efc0e 100644 --- a/src/app/pages/quotation/quotation.html +++ b/src/app/pages/quotation/quotation.html @@ -1,8 +1,4 @@
    - - - -
    diff --git a/src/app/pages/quotation/quotation.ts b/src/app/pages/quotation/quotation.ts index c22b8c2..02508f9 100644 --- a/src/app/pages/quotation/quotation.ts +++ b/src/app/pages/quotation/quotation.ts @@ -1,17 +1,11 @@ import { Component } from '@angular/core'; import {Search} from "../../components/search/search"; -import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; -import {ModalButton} from "../../components/modal-button/modal-button"; -import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form"; -import {QuotationForm} from "../../components/quotation-form/quotation-form"; import {QuotationTable} from "../../components/quotation-table/quotation-table"; @Component({ selector: 'app-quotation', imports: [ - ModalButton, Search, - QuotationForm, QuotationTable ], templateUrl: './quotation.html', From 9a90336642d1a086092f1b2db7e9fd9a4b51cfa2 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 12:12:43 +0100 Subject: [PATCH 061/127] add getall and delete function from quotation page --- .../quotation-form/quotation-form.html | 12 +- .../quotation-form/quotation-form.ts | 11 -- .../quotation-table/quotation-table.html | 43 ++++--- .../quotation-table/quotation-table.ts | 106 +++++++----------- src/app/pages/quotation/quotation.html | 4 - 5 files changed, 65 insertions(+), 111 deletions(-) diff --git a/src/app/components/quotation-form/quotation-form.html b/src/app/components/quotation-form/quotation-form.html index 2716fab..0ca8812 100644 --- a/src/app/components/quotation-form/quotation-form.html +++ b/src/app/components/quotation-form/quotation-form.html @@ -1,4 +1,4 @@ -
    + Message du devis @@ -18,15 +18,5 @@ - - - - Fournisseur - - - - - -
    diff --git a/src/app/components/quotation-form/quotation-form.ts b/src/app/components/quotation-form/quotation-form.ts index 6db611c..0e7a39c 100644 --- a/src/app/components/quotation-form/quotation-form.ts +++ b/src/app/components/quotation-form/quotation-form.ts @@ -26,15 +26,4 @@ export class QuotationForm { quotationMessage: new FormControl(null), quotationConditionsSale: new FormControl(null), }) - - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.QuotationForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.QuotationForm.getRawValue()) - - // Pour vider le formulaire - this.QuotationForm.reset() - } } diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 0d2ac21..c43bf62 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -1,22 +1,23 @@ - + Numéro de Devis Message Conditions de vente - Fournisseur Produit Action - @for (data of basicTable.data; track data) { + @for (quotation of quotations(); track quotation.id) { - {{data.quotationId}} - {{data.quotationMessage}} - {{data.quotationConditionsSale}} - {{data.Supplier}} - + {{quotation.id}} + {{quotation.message}} + {{quotation.conditionsSale}}
    @@ -31,25 +32,19 @@ - + @for (product of quotation.getQuotationProductDto; track product.productId) { - {{data.quotationProductReference}} - {{data.quotationProductName}} - XX.XX€ - {{data.quotationProductQuantity}} + {{ product.productReferences }} + {{ product.productName }} + Price ??? + Quantité ???
    - - - - -
    - -
    +
    - + }
    @@ -57,12 +52,16 @@
    +
    + +
    +
    - +
    diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index db47810..8bcb142 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -1,27 +1,13 @@ -import { Component } from '@angular/core'; +import {Component, inject, OnInit, signal} from '@angular/core'; import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalButton} from "../modal-button/modal-button"; import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {QuotationForm} from "../quotation-form/quotation-form"; -import {ProductTable} from "../product-table/product-table"; -import {ProductForm} from "../product-form/product-form"; - -interface QuotationInfo { - quotationId: number; - quotationMessage?: string; - quotationConditionsSale?: string; - quotationProduct: [ - { quotationProductReference: string; }, - { quotationProductName: string; }, - { quotationProductQuantity?: number; }, - ], - quotationProductReference: string; - quotationProductName: string; - quotationProductQuantity?: number; - Supplier?: string; -} +import {GetQuotationDto, QuotationsService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-quotation-table', @@ -32,56 +18,50 @@ interface QuotationInfo { NzIconDirective, NzTableComponent, QuotationForm, - ProductForm ], templateUrl: './quotation-table.html', styleUrl: './quotation-table.css', }) -export class QuotationTable { - quotations: QuotationInfo[] = [ - { - quotationId: 101, - quotationMessage: 'Livraison urgente demandée', - quotationConditionsSale: 'Paiement à 30 jours', - quotationProduct: [ - { quotationProductReference: 'DLV-1000' }, - { quotationProductName: 'Produit1'}, - { quotationProductQuantity: 5 }, - ], - quotationProductReference: 'DLV-1000', - quotationProductName: 'Produit1', - quotationProductQuantity: 5, - Supplier: 'Fireworkssupplier&Co' - }, - { - quotationId: 102, - quotationMessage: 'Livraison standard', - quotationConditionsSale: 'Payé d\'avance', - quotationProduct: [ - { quotationProductReference: 'DLV-1001' }, - { quotationProductName: 'Produit2'}, - { quotationProductQuantity: 6 }, - ], - quotationProductReference: 'DLV-1001', - quotationProductName: 'Produit2', - quotationProductQuantity: 6, - Supplier: 'Fireworkssupplier&Co' - }, - { - quotationId: 103, - quotationMessage: 'Livraison rapide', - quotationConditionsSale: 'Paiement à 15 jours', - quotationProduct: [ - { quotationProductReference: 'DLV-1003' }, - { quotationProductName: 'Produit3'}, - { quotationProductQuantity: 7 }, - ], - quotationProductReference: 'DLV-1002', - quotationProductName: 'Produit3', - quotationProductQuantity: 7, - Supplier: 'Fireworkssupplier&Co' +export class QuotationTable implements OnInit { + private quotationsService = inject(QuotationsService); + private notificationService = inject(NzNotificationService) + quotations = signal([]); + quotationsLoading = signal(false); + + async ngOnInit() { + await this.fetchQuotations(); + } + + async fetchQuotations() { + this.quotationsLoading.set(true) + + try { + const quotations = await firstValueFrom(this.quotationsService.getAllQuotationEndpoint()) + this.quotations.set(quotations); + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) } - ]; + this.quotationsLoading.set(false) + } + + async delete(quotation:number) { + try { + await firstValueFrom(this.quotationsService.deleteQuotationEndpoint(quotation)) + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + await this.fetchQuotations(); + } } diff --git a/src/app/pages/quotation/quotation.html b/src/app/pages/quotation/quotation.html index 2edf3b6..92efc0e 100644 --- a/src/app/pages/quotation/quotation.html +++ b/src/app/pages/quotation/quotation.html @@ -1,8 +1,4 @@
    - - - -
    From aad637c9c9767c03e7d0aa7425fe2cb7125d353c Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 12:32:27 +0100 Subject: [PATCH 062/127] add getall and delete function from purchase order page --- .../components/product-form/product-form.html | 2 +- .../components/product-form/product-form.ts | 11 - .../product-table/product-table.html | 1 - .../purchase-order-form.html | 2 +- .../purchase-order-form.ts | 11 - .../purchase-order-table.html | 38 ++-- .../purchase-order-table.ts | 202 ++++-------------- 7 files changed, 66 insertions(+), 201 deletions(-) diff --git a/src/app/components/product-form/product-form.html b/src/app/components/product-form/product-form.html index c4362c1..44e309a 100644 --- a/src/app/components/product-form/product-form.html +++ b/src/app/components/product-form/product-form.html @@ -1,4 +1,4 @@ -
    + Prix diff --git a/src/app/components/product-form/product-form.ts b/src/app/components/product-form/product-form.ts index f3fca0a..3efb4c9 100644 --- a/src/app/components/product-form/product-form.ts +++ b/src/app/components/product-form/product-form.ts @@ -26,15 +26,4 @@ export class ProductForm { price: new FormControl(null, [Validators.required]), quantity: new FormControl(null, [Validators.required]) }) - - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.productForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.productForm.getRawValue()) - - // Pour vider le formulaire - this.productForm.reset() - } } diff --git a/src/app/components/product-table/product-table.html b/src/app/components/product-table/product-table.html index 78cb7a1..e69de29 100644 --- a/src/app/components/product-table/product-table.html +++ b/src/app/components/product-table/product-table.html @@ -1 +0,0 @@ -

    product-table works!

    diff --git a/src/app/components/purchase-order-form/purchase-order-form.html b/src/app/components/purchase-order-form/purchase-order-form.html index 9e8e9e4..096142e 100644 --- a/src/app/components/purchase-order-form/purchase-order-form.html +++ b/src/app/components/purchase-order-form/purchase-order-form.html @@ -1,4 +1,4 @@ - + Conditions générales de vente diff --git a/src/app/components/purchase-order-form/purchase-order-form.ts b/src/app/components/purchase-order-form/purchase-order-form.ts index f2e737c..f5175f8 100644 --- a/src/app/components/purchase-order-form/purchase-order-form.ts +++ b/src/app/components/purchase-order-form/purchase-order-form.ts @@ -25,15 +25,4 @@ export class PurchaseOrderForm { purchaseOrderForm: FormGroup = new FormGroup({ purchaseCondition: new FormControl(null,[Validators.required]) }) - - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.purchaseOrderForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.purchaseOrderForm.getRawValue()) - - // Pour vider le formulaire - this.purchaseOrderForm.reset() - } } diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 27b75c5..72b31f4 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -1,4 +1,7 @@ - + Numéro @@ -9,37 +12,36 @@ - @for (data of basicTable.data; track data) { + @for (purchaseOrder of purchaseOrders(); track purchaseOrder.id) { - - - + {{ purchaseOrder.id }} + {{purchaseOrder.purchaseConditions}} + Fournisseur ???
    - + Nom + Reférence Prix Quantité Action - @for (product of data.productOrder; track product) { + @for (product of purchaseOrder.getPurchaseProductDto; track product.productId) { - {{product.product.name}} - {{product.price}}€ + {{product.productName}} + {{product.productReferences}} + Prix €€€€ {{product.quantity}}
    - - - -
    - +
    @@ -52,12 +54,16 @@
    +
    + +
    +
    - +
    @@ -65,7 +71,7 @@
    - +
    diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index ee9c5a3..1c50fe0 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -1,12 +1,14 @@ -import { Component } from '@angular/core'; +import {Component, inject, OnInit, signal} from '@angular/core'; import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; -import {PurchaseOrderInfo} from "../../interfaces/purchase-order.interface"; import {PurchaseOrderForm} from "../purchase-order-form/purchase-order-form"; import {ModalButton} from "../modal-button/modal-button"; import {ProductForm} from "../product-form/product-form"; +import {GetPurchaseOrderDto, PurchaseordersService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-purchase-order-table', @@ -22,172 +24,52 @@ import {ProductForm} from "../product-form/product-form"; templateUrl: './purchase-order-table.html', styleUrl: './purchase-order-table.css', }) -export class PurchaseOrderTable { - purchaseOrders: PurchaseOrderInfo[] = [ - { - purchaseCondition: "Condition d'achat standard 1", - supplier: { - name: "Fournisseur 1", - email: "contact1@example.com", - phone: "0100000001", - address: "1 Rue de Paris", - zipCode: "75001", - city: "Paris", - deliveryDelay: 3, - products: [ - { - reference: "F1-P1", - name: "Produit 1A", - supplier: [], - duration: 0, - caliber: "", - approvalNumber: "", - weight: 1, - nec: 0, - image: "", - link: "", - minimalQuantity: 1 - }, - { - reference: "F1-P2", - name: "Produit 1B", - supplier: [], - duration: 0, - caliber: "", - approvalNumber: "", - weight: 2, - nec: 0, - image: "", - link: "", - minimalQuantity: 1 - } - ] - }, - productOrder: [ - { - product: { - reference: "F1-P1", - name: "Produit 1A", - supplier: [], - duration: 0, - caliber: "", - approvalNumber: "", - weight: 1, - nec: 0, - image: "", - link: "", - minimalQuantity: 1 - }, - quantity: 5, - price: 10 - }, - { - product: { - reference: "F1-P2", - name: "Produit 1B", - supplier: [], - duration: 0, - caliber: "", - approvalNumber: "", - weight: 2, - nec: 0, - image: "", - link: "", - minimalQuantity: 1 - }, - quantity: 3, - price: 15 - } - ] - }, +export class PurchaseOrderTable implements OnInit { + private purchaseOrdersService = inject(PurchaseordersService); + private notificationService = inject(NzNotificationService) + purchaseOrders = signal([]); + purchaseOrdersLoading = signal(false); - { - purchaseCondition: "Condition d'achat standard 2", - supplier: { - name: "Fournisseur 2", - email: "contact2@example.com", - phone: "0100000002", - address: "2 Rue de Lyon", - zipCode: "75002", - city: "Paris", - deliveryDelay: 4, - products: [ - { - reference: "F2-P1", - name: "Produit 2A", - supplier: [], - duration: 0, - caliber: "", - approvalNumber: "", - weight: 1.5, - nec: 0, - image: "", - link: "", - minimalQuantity: 1 - }, - { - reference: "F2-P2", - name: "Produit 2B", - supplier: [], - duration: 0, - caliber: "", - approvalNumber: "", - weight: 2.5, - nec: 0, - image: "", - link: "", - minimalQuantity: 1 - } - ] - }, - productOrder: [ - { - product: { - reference: "F2-P1", - name: "Produit 2A", - supplier: [], - duration: 0, - caliber: "", - approvalNumber: "", - weight: 1.5, - nec: 0, - image: "", - link: "", - minimalQuantity: 1 - }, - quantity: 6, - price: 11 - }, - { - product: { - reference: "F2-P2", - name: "Produit 2B", - supplier: [], - duration: 0, - caliber: "", - approvalNumber: "", - weight: 2.5, - nec: 0, - image: "", - link: "", - minimalQuantity: 1 - }, - quantity: 4, - price: 16 - } - ] - }, - ]; + async ngOnInit() { + await this.fetchPurchaseOrder(); + } - delete() { - return + async fetchPurchaseOrder() { + this.purchaseOrdersLoading.set(true) + + try { + const purchaseOrders = await firstValueFrom(this.purchaseOrdersService.getAllPurchaseOrderEndpoint()) + this.purchaseOrders.set(purchaseOrders); + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) + } + this.purchaseOrdersLoading.set(false) + } + + async delete(purchaseOrderId:number) { + try { + await firstValueFrom(this.purchaseOrdersService.deletePurchaseOrderEndpoint(purchaseOrderId)) + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + await this.fetchPurchaseOrder(); } export(){ return } - transfert() { + transfer() { return } } From 0696bac9996e7f0ae75a635af0d8b57737b84614 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 12:32:53 +0100 Subject: [PATCH 063/127] fixed error --- src/app/components/purchase-order-table/purchase-order-table.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 1c50fe0..f02072f 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -5,7 +5,6 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; import {PurchaseOrderForm} from "../purchase-order-form/purchase-order-form"; import {ModalButton} from "../modal-button/modal-button"; -import {ProductForm} from "../product-form/product-form"; import {GetPurchaseOrderDto, PurchaseordersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @@ -19,7 +18,6 @@ import {firstValueFrom} from "rxjs"; NzTableComponent, PurchaseOrderForm, ModalButton, - ProductForm ], templateUrl: './purchase-order-table.html', styleUrl: './purchase-order-table.css', From ef1c7eba8337d2ed60aa00c612676210439a4142 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 13:10:12 +0100 Subject: [PATCH 064/127] added getall and delete functions for deliverer page --- .../deliverer-form/deliverer-form.html | 2 +- .../deliverer-form/deliverer-form.ts | 11 - .../deliverer-table/deliverer-table.html | 15 +- .../deliverer-table/deliverer-table.ts | 342 ++++-------------- .../product-table/product-table.html | 1 - 5 files changed, 79 insertions(+), 292 deletions(-) diff --git a/src/app/components/deliverer-form/deliverer-form.html b/src/app/components/deliverer-form/deliverer-form.html index 625096d..51b292b 100644 --- a/src/app/components/deliverer-form/deliverer-form.html +++ b/src/app/components/deliverer-form/deliverer-form.html @@ -1,4 +1,4 @@ - + Transporteur diff --git a/src/app/components/deliverer-form/deliverer-form.ts b/src/app/components/deliverer-form/deliverer-form.ts index 0125282..4c59ca6 100644 --- a/src/app/components/deliverer-form/deliverer-form.ts +++ b/src/app/components/deliverer-form/deliverer-form.ts @@ -24,15 +24,4 @@ export class DelivererForm { delivererForm: FormGroup = new FormGroup({ transporter: new FormControl(null, [Validators.required]) }) - - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.delivererForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.delivererForm.getRawValue()) - - // Pour vider le formulaire - this.delivererForm.reset() - } } diff --git a/src/app/components/deliverer-table/deliverer-table.html b/src/app/components/deliverer-table/deliverer-table.html index b7d3b68..7e8b132 100644 --- a/src/app/components/deliverer-table/deliverer-table.html +++ b/src/app/components/deliverer-table/deliverer-table.html @@ -1,4 +1,6 @@ - + Transporteur @@ -7,13 +9,14 @@ - @for (data of basicTable.data; track data) { + @for (deliverer of deliverers(); track deliverer.id) { - {{data.transporter}} + {{deliverer.transporter}}
    - + Numéro de livraison @@ -23,7 +26,7 @@ - @for (deliveryInfo of data.deliveryNote; track deliveryInfo) { + @for (deliveryInfo of deliverer.deliveryNotes; track deliveryInfo.id) { {{deliveryInfo.trackingNumber}} {{deliveryInfo.expeditionDate | date: 'dd/MM/yyyy'}} @@ -43,7 +46,7 @@
    - +
    diff --git a/src/app/components/deliverer-table/deliverer-table.ts b/src/app/components/deliverer-table/deliverer-table.ts index 9cb0b7d..be28e88 100644 --- a/src/app/components/deliverer-table/deliverer-table.ts +++ b/src/app/components/deliverer-table/deliverer-table.ts @@ -1,6 +1,4 @@ -import { Component } from '@angular/core'; -import {ProductTable} from "../product-table/product-table"; -import {DelivererInfo} from "../../interfaces/deliverer.interface"; +import {Component, inject, OnInit, signal} from '@angular/core'; import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; @@ -8,6 +6,9 @@ import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalButton} from "../modal-button/modal-button"; import {DatePipe} from "@angular/common"; import {DelivererForm} from "../deliverer-form/deliverer-form"; +import {DeliverersService, GetDelivererDto} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-deliverer-table', @@ -24,276 +25,71 @@ import {DelivererForm} from "../deliverer-form/deliverer-form"; styleUrl: './deliverer-table.css', }) -export class DelivererTable { - listOfDeliverers: DelivererInfo[] = [ - { - transporter: 'Transporteur 1', - deliveryNote: [ - { - trackingNumber: 'TRK-1000', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-20'), - expeditionDate: new Date('2025-11-15'), - realDeliveryDate: new Date('2025-11-19'), - productDelivery: [ - { product: ProductTable.listOfProducts[0], quantity: 5 }, - { product: ProductTable.listOfProducts[1], quantity: 3 }, - { product: ProductTable.listOfProducts[2], quantity: 7 }, - ], - }, - { - trackingNumber: 'TRK-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - { - trackingNumber: 'TRK-1000', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-20'), - expeditionDate: new Date('2025-11-15'), - realDeliveryDate: new Date('2025-11-19'), - productDelivery: [ - { product: ProductTable.listOfProducts[0], quantity: 5 }, - { product: ProductTable.listOfProducts[1], quantity: 3 }, - { product: ProductTable.listOfProducts[2], quantity: 7 }, - ], - }, - { - trackingNumber: 'TRK-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - { - trackingNumber: 'TRK-1000', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-20'), - expeditionDate: new Date('2025-11-15'), - realDeliveryDate: new Date('2025-11-19'), - productDelivery: [ - { product: ProductTable.listOfProducts[0], quantity: 5 }, - { product: ProductTable.listOfProducts[1], quantity: 3 }, - { product: ProductTable.listOfProducts[2], quantity: 7 }, - ], - }, - { - trackingNumber: 'TRK-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - { - trackingNumber: 'TRK-1000', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-20'), - expeditionDate: new Date('2025-11-15'), - realDeliveryDate: new Date('2025-11-19'), - productDelivery: [ - { product: ProductTable.listOfProducts[0], quantity: 5 }, - { product: ProductTable.listOfProducts[1], quantity: 3 }, - { product: ProductTable.listOfProducts[2], quantity: 7 }, - ], - }, - { - trackingNumber: 'TRK-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - { - trackingNumber: 'TRK-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - { - trackingNumber: 'TRK-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - { - trackingNumber: 'TRK-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - { - trackingNumber: 'TRK-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - ] - }, - { - transporter: 'Transporteur 2', - deliveryNote: [ - { - trackingNumber: 'TRK-1002', - deliverer: 'Transporteur 2', - estimateDeliveryDate: new Date('2025-11-23'), - expeditionDate: new Date('2025-11-17'), - realDeliveryDate: new Date('2025-11-22'), - productDelivery: [ - { product: ProductTable.listOfProducts[6], quantity: 3 }, - { product: ProductTable.listOfProducts[7], quantity: 8 }, - { product: ProductTable.listOfProducts[8], quantity: 5 }, - ], - }, - { - trackingNumber: 'TRK-1003', - deliverer: 'Transporteur 2', - estimateDeliveryDate: new Date('2025-11-24'), - expeditionDate: new Date('2025-11-18'), - realDeliveryDate: new Date('2025-11-23'), - productDelivery: [ - { product: ProductTable.listOfProducts[9], quantity: 4 }, - { product: ProductTable.listOfProducts[10], quantity: 6 }, - { product: ProductTable.listOfProducts[11], quantity: 7 }, - ], - } - ] - }, - { - transporter: 'Transporteur 3', - deliveryNote: [ - { - trackingNumber: 'TRK-1004', - deliverer: 'Transporteur 3', - estimateDeliveryDate: new Date('2025-11-25'), - expeditionDate: new Date('2025-11-19'), - realDeliveryDate: new Date('2025-11-24'), - productDelivery: [ - { product: ProductTable.listOfProducts[12], quantity: 2 }, - { product: ProductTable.listOfProducts[13], quantity: 5 }, - { product: ProductTable.listOfProducts[14], quantity: 6 }, - ], - }, - { - trackingNumber: 'TRK-1005', - deliverer: 'Transporteur 3', - estimateDeliveryDate: new Date('2025-11-26'), - expeditionDate: new Date('2025-11-20'), - realDeliveryDate: new Date('2025-11-25'), - productDelivery: [ - { product: ProductTable.listOfProducts[15], quantity: 3 }, - { product: ProductTable.listOfProducts[16], quantity: 7 }, - { product: ProductTable.listOfProducts[17], quantity: 4 }, - ], - } - ] - }, - { - transporter: 'Transporteur 4', - deliveryNote: [ - { - trackingNumber: 'TRK-1006', - deliverer: 'Transporteur 4', - estimateDeliveryDate: new Date('2025-11-27'), - expeditionDate: new Date('2025-11-21'), - realDeliveryDate: new Date('2025-11-26'), - productDelivery: [ - { product: ProductTable.listOfProducts[18], quantity: 5 }, - { product: ProductTable.listOfProducts[19], quantity: 6 }, - { product: ProductTable.listOfProducts[20], quantity: 7 }, - ], - }, - { - trackingNumber: 'TRK-1007', - deliverer: 'Transporteur 4', - estimateDeliveryDate: new Date('2025-11-28'), - expeditionDate: new Date('2025-11-22'), - realDeliveryDate: new Date('2025-11-27'), - productDelivery: [ - { product: ProductTable.listOfProducts[21], quantity: 3 }, - { product: ProductTable.listOfProducts[22], quantity: 5 }, - { product: ProductTable.listOfProducts[23], quantity: 4 }, - ], - } - ] - }, - { - transporter: 'Transporteur 5', - deliveryNote: [ - { - trackingNumber: 'TRK-1008', - deliverer: 'Transporteur 5', - estimateDeliveryDate: new Date('2025-11-29'), - expeditionDate: new Date('2025-11-23'), - realDeliveryDate: new Date('2025-11-28'), - productDelivery: [ - { product: ProductTable.listOfProducts[24], quantity: 6 }, - { product: ProductTable.listOfProducts[25], quantity: 7 }, - { product: ProductTable.listOfProducts[26], quantity: 3 }, - ], - }, - { - trackingNumber: 'TRK-1009', - deliverer: 'Transporteur 5', - estimateDeliveryDate: new Date('2025-11-30'), - expeditionDate: new Date('2025-11-24'), - realDeliveryDate: new Date('2025-11-29'), - productDelivery: [ - { product: ProductTable.listOfProducts[27], quantity: 5 }, - { product: ProductTable.listOfProducts[28], quantity: 4 }, - { product: ProductTable.listOfProducts[29], quantity: 6 }, - ], - } - ] - }, - ]; +export class DelivererTable implements OnInit { + private deliverersService = inject(DeliverersService); + private notificationService = inject(NzNotificationService) + deliverers = signal([]); + deliverersLoading = signal(false); - delete(){ - return + async ngOnInit() { + await this.fetchDeliverers(); + } + + async fetchDeliverers() { + this.deliverersLoading.set(true) + + try { + const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()) + this.deliverers.set(deliverers); + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) + } + this.deliverersLoading.set(false) + } + + async delete(deliverer:number) { + try { + await firstValueFrom(this.deliverersService.deleteDelivererEndpoint(deliverer)) + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + await this.fetchDeliverers(); + } + + async edit(id: number, updateDelivererComponent: DelivererForm) { + if (updateDelivererComponent.delivererForm.invalid) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + return; + } + + try { + + const deliverers = updateDelivererComponent.delivererForm.getRawValue(); + await firstValueFrom(this.deliverersService.updateDelivererEndpoint(id, deliverers)) + + this.notificationService.success( + 'Success', + 'Transporteur modifié' + ) + } catch (e) { + console.error(e); + this.notificationService.error( + 'Erreur', + 'Erreur lors de la modification' + ) + } } } diff --git a/src/app/components/product-table/product-table.html b/src/app/components/product-table/product-table.html index 78cb7a1..e69de29 100644 --- a/src/app/components/product-table/product-table.html +++ b/src/app/components/product-table/product-table.html @@ -1 +0,0 @@ -

    product-table works!

    From 7535689eef71afc8c269034d572b883e87936347 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 14:28:18 +0100 Subject: [PATCH 065/127] added getall and delete functions for deliverynote page --- .../deliverery-note-form.html | 8 +- .../deliverery-note-form.ts | 36 ++-- .../deliverery-note-table.html | 29 +-- .../deliverery-note-table.ts | 172 +++++------------- src/app/components/user-table/user-table.ts | 2 - src/app/interfaces/deliverer.interface.ts | 6 - src/app/interfaces/product-order.interface.ts | 7 - .../interfaces/purchase-order.interface.ts | 8 - src/app/interfaces/quotation.interface.ts | 9 - src/app/interfaces/stock.interface.ts | 7 - src/app/interfaces/supplier.interface.ts | 12 -- .../services/api/api/deliverynotes.service.ts | 53 ++++++ 12 files changed, 143 insertions(+), 206 deletions(-) delete mode 100644 src/app/interfaces/deliverer.interface.ts delete mode 100644 src/app/interfaces/product-order.interface.ts delete mode 100644 src/app/interfaces/purchase-order.interface.ts delete mode 100644 src/app/interfaces/quotation.interface.ts delete mode 100644 src/app/interfaces/stock.interface.ts delete mode 100644 src/app/interfaces/supplier.interface.ts diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.html b/src/app/components/deliverery-note-form/deliverery-note-form.html index 8f8a125..3cfaf9b 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.html +++ b/src/app/components/deliverery-note-form/deliverery-note-form.html @@ -1,11 +1,15 @@ - + Transporteur - + + @for (deliverer of deliverers(); track deliverer.id) { + + } + diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index e65ba35..98d2719 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -1,10 +1,13 @@ -import { Component } from '@angular/core'; +import {Component, inject, signal} from '@angular/core'; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; -import {NzInputDirective} from "ng-zorro-antd/input"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {DeliverersService, GetDelivererDto} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-deliverery-note-form', @@ -12,12 +15,13 @@ import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; NzFormItemComponent, NzFormLabelComponent, NzFormControlComponent, - NzInputDirective, NzColDirective, NzFlexDirective, NzFormDirective, ReactiveFormsModule, - NzDatePickerComponent + NzDatePickerComponent, + NzSelectComponent, + NzOptionComponent ], templateUrl: './deliverery-note-form.html', styleUrl: './deliverery-note-form.css', @@ -30,14 +34,24 @@ export class DelivereryNoteForm { realDate: new FormControl(null) }) - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.deliveryNoteForm.invalid) return; + private deliverersService = inject(DeliverersService); + private notificationService = inject(NzNotificationService); + deliverers = signal([]); - // Pour obtenir la valeur du formulaire - console.log(this.deliveryNoteForm.getRawValue()) + async fetchDeliverers() { + try { + const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()); + this.deliverers.set(deliverers); + } catch (e) { + this.notificationService.error('Erreur', 'Impossible de récupérer les transporteurs'); + } + } - // Pour vider le formulaire - this.deliveryNoteForm.reset() + async ngOnInit() { + await this.fetchDeliverers(); + } + + filter(input: string, option: any) { + return option.nzLabel.toLowerCase().includes(input.toLowerCase()); } } diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index 72e73f9..fe0eaa2 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -1,4 +1,7 @@ - + Numéro de livraison @@ -11,17 +14,17 @@ - @for (data of basicTable.data; track data) { + @for (deliveryNote of deliveryNotes(); track deliveryNote.id) { - {{data.trackingNumber}} - {{data.deliverer}} - {{data.expeditionDate | date: 'dd/MM/yyyy'}} - {{data.estimateDeliveryDate | date: 'dd/MM/yyyy'}} - {{data.realDeliveryDate | date: 'dd/MM/yyyy'}} + {{deliveryNote.trackingNumber}} + {{deliveryNote.delivererTransporter}} + {{deliveryNote.expeditionDate | date: 'dd/MM/yyyy'}} + {{deliveryNote.estimateDeliveryDate | date: 'dd/MM/yyyy'}} + {{deliveryNote.realDeliveryDate | date: 'dd/MM/yyyy'}}
    - + Réference @@ -30,10 +33,10 @@ - @for (product of data.productDelivery; track product) { + @for (product of deliveryNote.products; track product.productId) { - {{product.product.reference}} - {{product.product.name}} + {{product.productReference}} + {{product.productName}} {{product.quantity}} } @@ -49,11 +52,11 @@
    - +
    - +
    diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index 6a1df24..302c950 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -1,6 +1,4 @@ -import { Component } from '@angular/core'; -import {DeliveryNoteInfo} from "../../interfaces/delivery-note.interface"; -import {ProductTable} from "../product-table/product-table"; +import {Component, inject, OnInit, signal} from '@angular/core'; import {DatePipe} from "@angular/common"; import {ModalButton} from "../modal-button/modal-button"; import {ModalNav} from "../modal-nav/modal-nav"; @@ -8,6 +6,9 @@ import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form"; +import {DeliverynotesService, GetDeliveryNoteDto} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-deliverery-note-table', @@ -23,135 +24,48 @@ import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form"; templateUrl: './deliverery-note-table.html', styleUrl: './deliverery-note-table.css', }) -export class DelivereryNoteTable { - deliveryNotes: DeliveryNoteInfo[] = [ - { - trackingNumber: 'DLV-1000', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-20'), - expeditionDate: new Date('2025-11-15'), - realDeliveryDate: new Date('2025-11-19'), - productDelivery: [ - { product: ProductTable.listOfProducts[0], quantity: 5 }, - { product: ProductTable.listOfProducts[1], quantity: 3 }, - { product: ProductTable.listOfProducts[2], quantity: 7 }, - ], - }, - { - trackingNumber: 'DLV-1001', - deliverer: 'Transporteur 1', - estimateDeliveryDate: new Date('2025-11-22'), - expeditionDate: new Date('2025-11-16'), - realDeliveryDate: new Date('2025-11-21'), - productDelivery: [ - { product: ProductTable.listOfProducts[3], quantity: 2 }, - { product: ProductTable.listOfProducts[4], quantity: 4 }, - { product: ProductTable.listOfProducts[5], quantity: 6 }, - ], - }, - { - trackingNumber: 'DLV-1002', - deliverer: 'Transporteur 2', - estimateDeliveryDate: new Date('2025-11-23'), - expeditionDate: new Date('2025-11-17'), - realDeliveryDate: new Date('2025-11-22'), - productDelivery: [ - { product: ProductTable.listOfProducts[6], quantity: 3 }, - { product: ProductTable.listOfProducts[7], quantity: 8 }, - { product: ProductTable.listOfProducts[8], quantity: 5 }, - ], - }, - { - trackingNumber: 'DLV-1003', - deliverer: 'Transporteur 2', - estimateDeliveryDate: new Date('2025-11-24'), - expeditionDate: new Date('2025-11-18'), - realDeliveryDate: new Date('2025-11-23'), - productDelivery: [ - { product: ProductTable.listOfProducts[9], quantity: 4 }, - { product: ProductTable.listOfProducts[10], quantity: 6 }, - { product: ProductTable.listOfProducts[11], quantity: 7 }, - ], - }, - { - trackingNumber: 'DLV-1004', - deliverer: 'Transporteur 3', - estimateDeliveryDate: new Date('2025-11-25'), - expeditionDate: new Date('2025-11-19'), - realDeliveryDate: new Date('2025-11-24'), - productDelivery: [ - { product: ProductTable.listOfProducts[12], quantity: 2 }, - { product: ProductTable.listOfProducts[13], quantity: 5 }, - { product: ProductTable.listOfProducts[14], quantity: 6 }, - ], - }, - { - trackingNumber: 'DLV-1005', - deliverer: 'Transporteur 3', - estimateDeliveryDate: new Date('2025-11-26'), - expeditionDate: new Date('2025-11-20'), - realDeliveryDate: new Date('2025-11-25'), - productDelivery: [ - { product: ProductTable.listOfProducts[15], quantity: 3 }, - { product: ProductTable.listOfProducts[16], quantity: 7 }, - { product: ProductTable.listOfProducts[17], quantity: 4 }, - ], - }, - { - trackingNumber: 'DLV-1006', - deliverer: 'Transporteur 4', - estimateDeliveryDate: new Date('2025-11-27'), - expeditionDate: new Date('2025-11-21'), - realDeliveryDate: new Date('2025-11-26'), - productDelivery: [ - { product: ProductTable.listOfProducts[18], quantity: 5 }, - { product: ProductTable.listOfProducts[19], quantity: 6 }, - { product: ProductTable.listOfProducts[20], quantity: 7 }, - ], - }, - { - trackingNumber: 'DLV-1007', - deliverer: 'Transporteur 4', - estimateDeliveryDate: new Date('2025-11-28'), - expeditionDate: new Date('2025-11-22'), - realDeliveryDate: new Date('2025-11-27'), - productDelivery: [ - { product: ProductTable.listOfProducts[21], quantity: 3 }, - { product: ProductTable.listOfProducts[22], quantity: 5 }, - { product: ProductTable.listOfProducts[23], quantity: 4 }, - ], - }, - { - trackingNumber: 'DLV-1008', - deliverer: 'Transporteur 5', - estimateDeliveryDate: new Date('2025-11-29'), - expeditionDate: new Date('2025-11-23'), - realDeliveryDate: new Date('2025-11-28'), - productDelivery: [ - { product: ProductTable.listOfProducts[24], quantity: 6 }, - { product: ProductTable.listOfProducts[25], quantity: 7 }, - { product: ProductTable.listOfProducts[26], quantity: 3 }, - ], - }, - { - trackingNumber: 'DLV-1009', - deliverer: 'Transporteur 5', - estimateDeliveryDate: new Date('2025-11-30'), - expeditionDate: new Date('2025-11-24'), - realDeliveryDate: new Date('2025-11-29'), - productDelivery: [ - { product: ProductTable.listOfProducts[27], quantity: 5 }, - { product: ProductTable.listOfProducts[28], quantity: 4 }, - { product: ProductTable.listOfProducts[29], quantity: 6 }, - ], - }, - ]; +export class DelivereryNoteTable implements OnInit { + private DeliveryNotesService = inject(DeliverynotesService); + private notificationService = inject(NzNotificationService) + deliveryNotes = signal([]); + deliveryNotesLoading = signal(false); - delete() { - return + async ngOnInit() { + await this.fetchDeliveryNotes(); } - export() { + async fetchDeliveryNotes() { + this.deliveryNotesLoading.set(true) + + try { + const deliveryNotes = await firstValueFrom(this.DeliveryNotesService.getAllDeliveryNoteEndpoint()) + this.deliveryNotes.set(deliveryNotes); + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) + } + this.deliveryNotesLoading.set(false) + } + + async delete(deliveryNote:number) { + try { + await firstValueFrom(this.DeliveryNotesService.deleteDeliveryNoteEndpoint(deliveryNote)); + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + await this.fetchDeliveryNotes(); + } + + export(deliveryNote: number) { return } } diff --git a/src/app/components/user-table/user-table.ts b/src/app/components/user-table/user-table.ts index 8a5c86f..82b0c8c 100644 --- a/src/app/components/user-table/user-table.ts +++ b/src/app/components/user-table/user-table.ts @@ -2,8 +2,6 @@ import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {ModalNav} from "../modal-nav/modal-nav"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; -import {StockForm} from "../stock-form/stock-form"; -import {UserInfo} from "../../interfaces/user.interface"; import {ProfilForm} from "../profil-form/profil-form"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {GetUserDto, UsersService} from "../../services/api"; diff --git a/src/app/interfaces/deliverer.interface.ts b/src/app/interfaces/deliverer.interface.ts deleted file mode 100644 index d5222fd..0000000 --- a/src/app/interfaces/deliverer.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {DeliveryNoteInfo} from "./delivery-note.interface"; - -export interface DelivererInfo { - transporter: string; - deliveryNote: DeliveryNoteInfo[]; -} \ No newline at end of file diff --git a/src/app/interfaces/product-order.interface.ts b/src/app/interfaces/product-order.interface.ts deleted file mode 100644 index 13bcf8c..0000000 --- a/src/app/interfaces/product-order.interface.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ProductInfo} from "./product.interface"; - -export interface ProductOrderInfo { - product: ProductInfo; - quantity: number; - price: number; -} \ No newline at end of file diff --git a/src/app/interfaces/purchase-order.interface.ts b/src/app/interfaces/purchase-order.interface.ts deleted file mode 100644 index bb9a995..0000000 --- a/src/app/interfaces/purchase-order.interface.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {ProductOrderInfo} from "./product-order.interface"; -import {SupplierInfo} from "./supplier.interface"; - -export interface PurchaseOrderInfo { - purchaseCondition: string; - productOrder: ProductOrderInfo[]; - supplier: SupplierInfo; -} \ No newline at end of file diff --git a/src/app/interfaces/quotation.interface.ts b/src/app/interfaces/quotation.interface.ts deleted file mode 100644 index 1d8c87e..0000000 --- a/src/app/interfaces/quotation.interface.ts +++ /dev/null @@ -1,9 +0,0 @@ -import {ProductOrderInfo} from "./product-order.interface"; -import {SupplierInfo} from "./supplier.interface"; - -export interface QuotationInfo { - saleCondition: string; - message: string; - productOrder: ProductOrderInfo[]; - supplier: SupplierInfo; -} \ No newline at end of file diff --git a/src/app/interfaces/stock.interface.ts b/src/app/interfaces/stock.interface.ts deleted file mode 100644 index 5d9439d..0000000 --- a/src/app/interfaces/stock.interface.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ProductInfo} from "./product.interface"; - -export interface StockInfo { - id: number; - product: ProductInfo; - quantity: number; -} \ No newline at end of file diff --git a/src/app/interfaces/supplier.interface.ts b/src/app/interfaces/supplier.interface.ts deleted file mode 100644 index 1949a51..0000000 --- a/src/app/interfaces/supplier.interface.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {ProductInfo} from "./product.interface"; - -export interface SupplierInfo { - name: string; - email: string; - phone: string; - address: string; - zipCode: string; - city: string; - deliveryDelay: number; - products: ProductInfo[]; -} \ No newline at end of file diff --git a/src/app/services/api/api/deliverynotes.service.ts b/src/app/services/api/api/deliverynotes.service.ts index 8b73f81..a2d7d7b 100644 --- a/src/app/services/api/api/deliverynotes.service.ts +++ b/src/app/services/api/api/deliverynotes.service.ts @@ -103,6 +103,59 @@ export class DeliverynotesService extends BaseService { ); } + /** + * @endpoint delete /API/deliveryNotes/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteDeliveryNoteEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; + public deleteDeliveryNoteEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteDeliveryNoteEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteDeliveryNoteEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteDeliveryNoteEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint get /API/deliveryNotes * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. From 337345314119792b039a3633d8de8389ccc03104 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 14:29:46 +0100 Subject: [PATCH 066/127] deleted interfaces --- .../components/product-table/product-table.ts | 36 +------------------ src/app/interfaces/delivery-note.interface.ts | 10 ------ .../interfaces/product-delivery.interface.ts | 6 ---- src/app/interfaces/product.interface.ts | 13 ------- 4 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 src/app/interfaces/delivery-note.interface.ts delete mode 100644 src/app/interfaces/product-delivery.interface.ts delete mode 100644 src/app/interfaces/product.interface.ts diff --git a/src/app/components/product-table/product-table.ts b/src/app/components/product-table/product-table.ts index 0068b3b..d83fcac 100644 --- a/src/app/components/product-table/product-table.ts +++ b/src/app/components/product-table/product-table.ts @@ -1,5 +1,4 @@ import { Component } from '@angular/core'; -import {ProductInfo} from "../../interfaces/product.interface"; @Component({ selector: 'app-product-table', @@ -7,37 +6,4 @@ import {ProductInfo} from "../../interfaces/product.interface"; templateUrl: './product-table.html', styleUrl: './product-table.css', }) -export class ProductTable { - static listOfProducts: ProductInfo[] = [ - { reference: 'REF-1000', name: 'Produit 1', supplier: [1,2], duration: 12, caliber: 'A', approvalNumber: 'APP-2000', weight: 10, nec: 5000, image: 'https://picsum.photos/200/200?random=1', link: 'https://example.com/product/1', minimalQuantity: 5 }, - { reference: 'REF-1001', name: 'Produit 2', supplier: [2,3], duration: 15, caliber: 'B', approvalNumber: 'APP-2001', weight: 12, nec: 5001, image: 'https://picsum.photos/200/200?random=2', link: 'https://example.com/product/2', minimalQuantity: 8 }, - { reference: 'REF-1002', name: 'Produit 3', supplier: [3,4], duration: 10, caliber: 'C', approvalNumber: 'APP-2002', weight: 8, nec: 5002, image: 'https://picsum.photos/200/200?random=3', link: 'https://example.com/product/3', minimalQuantity: 6 }, - { reference: 'REF-1003', name: 'Produit 4', supplier: [1,5], duration: 20, caliber: 'A', approvalNumber: 'APP-2003', weight: 15, nec: 5003, image: 'https://picsum.photos/200/200?random=4', link: 'https://example.com/product/4', minimalQuantity: 7 }, - { reference: 'REF-1004', name: 'Produit 5', supplier: [2,6], duration: 18, caliber: 'B', approvalNumber: 'APP-2004', weight: 14, nec: 5004, image: 'https://picsum.photos/200/200?random=5', link: 'https://example.com/product/5', minimalQuantity: 5 }, - { reference: 'REF-1005', name: 'Produit 6', supplier: [3,7], duration: 22, caliber: 'C', approvalNumber: 'APP-2005', weight: 16, nec: 5005, image: 'https://picsum.photos/200/200?random=6', link: 'https://example.com/product/6', minimalQuantity: 9 }, - { reference: 'REF-1006', name: 'Produit 7', supplier: [4,8], duration: 17, caliber: 'A', approvalNumber: 'APP-2006', weight: 13, nec: 5006, image: 'https://picsum.photos/200/200?random=7', link: 'https://example.com/product/7', minimalQuantity: 6 }, - { reference: 'REF-1007', name: 'Produit 8', supplier: [5,9], duration: 14, caliber: 'B', approvalNumber: 'APP-2007', weight: 11, nec: 5007, image: 'https://picsum.photos/200/200?random=8', link: 'https://example.com/product/8', minimalQuantity: 8 }, - { reference: 'REF-1008', name: 'Produit 9', supplier: [6,10], duration: 19, caliber: 'C', approvalNumber: 'APP-2008', weight: 17, nec: 5008, image: 'https://picsum.photos/200/200?random=9', link: 'https://example.com/product/9', minimalQuantity: 7 }, - { reference: 'REF-1009', name: 'Produit 10', supplier: [1,2], duration: 21, caliber: 'A', approvalNumber: 'APP-2009', weight: 18, nec: 5009, image: 'https://picsum.photos/200/200?random=10', link: 'https://example.com/product/10', minimalQuantity: 6 }, - { reference: 'REF-1010', name: 'Produit 11', supplier: [2,3], duration: 13, caliber: 'B', approvalNumber: 'APP-2010', weight: 12, nec: 5010, image: 'https://picsum.photos/200/200?random=11', link: 'https://example.com/product/11', minimalQuantity: 5 }, - { reference: 'REF-1011', name: 'Produit 12', supplier: [3,4], duration: 16, caliber: 'C', approvalNumber: 'APP-2011', weight: 14, nec: 5011, image: 'https://picsum.photos/200/200?random=12', link: 'https://example.com/product/12', minimalQuantity: 7 }, - { reference: 'REF-1012', name: 'Produit 13', supplier: [1,5], duration: 20, caliber: 'A', approvalNumber: 'APP-2012', weight: 15, nec: 5012, image: 'https://picsum.photos/200/200?random=13', link: 'https://example.com/product/13', minimalQuantity: 6 }, - { reference: 'REF-1013', name: 'Produit 14', supplier: [2,6], duration: 11, caliber: 'B', approvalNumber: 'APP-2013', weight: 10, nec: 5013, image: 'https://picsum.photos/200/200?random=14', link: 'https://example.com/product/14', minimalQuantity: 9 }, - { reference: 'REF-1014', name: 'Produit 15', supplier: [3,7], duration: 18, caliber: 'C', approvalNumber: 'APP-2014', weight: 16, nec: 5014, image: 'https://picsum.photos/200/200?random=15', link: 'https://example.com/product/15', minimalQuantity: 8 }, - { reference: 'REF-1015', name: 'Produit 16', supplier: [4,8], duration: 17, caliber: 'A', approvalNumber: 'APP-2015', weight: 13, nec: 5015, image: 'https://picsum.photos/200/200?random=16', link: 'https://example.com/product/16', minimalQuantity: 5 }, - { reference: 'REF-1016', name: 'Produit 17', supplier: [5,9], duration: 14, caliber: 'B', approvalNumber: 'APP-2016', weight: 11, nec: 5016, image: 'https://picsum.photos/200/200?random=17', link: 'https://example.com/product/17', minimalQuantity: 6 }, - { reference: 'REF-1017', name: 'Produit 18', supplier: [6,10], duration: 22, caliber: 'C', approvalNumber: 'APP-2017', weight: 17, nec: 5017, image: 'https://picsum.photos/200/200?random=18', link: 'https://example.com/product/18', minimalQuantity: 7 }, - { reference: 'REF-1018', name: 'Produit 19', supplier: [1,2], duration: 19, caliber: 'A', approvalNumber: 'APP-2018', weight: 15, nec: 5018, image: 'https://picsum.photos/200/200?random=19', link: 'https://example.com/product/19', minimalQuantity: 6 }, - { reference: 'REF-1019', name: 'Produit 20', supplier: [2,3], duration: 16, caliber: 'B', approvalNumber: 'APP-2019', weight: 14, nec: 5019, image: 'https://picsum.photos/200/200?random=20', link: 'https://example.com/product/20', minimalQuantity: 5 }, - { reference: 'REF-1020', name: 'Produit 21', supplier: [3,4], duration: 21, caliber: 'C', approvalNumber: 'APP-2020', weight: 18, nec: 5020, image: 'https://picsum.photos/200/200?random=21', link: 'https://example.com/product/21', minimalQuantity: 7 }, - { reference: 'REF-1021', name: 'Produit 22', supplier: [1,5], duration: 15, caliber: 'A', approvalNumber: 'APP-2021', weight: 12, nec: 5021, image: 'https://picsum.photos/200/200?random=22', link: 'https://example.com/product/22', minimalQuantity: 8 }, - { reference: 'REF-1022', name: 'Produit 23', supplier: [2,6], duration: 13, caliber: 'B', approvalNumber: 'APP-2022', weight: 11, nec: 5022, image: 'https://picsum.photos/200/200?random=23', link: 'https://example.com/product/23', minimalQuantity: 6 }, - { reference: 'REF-1023', name: 'Produit 24', supplier: [3,7], duration: 12, caliber: 'C', approvalNumber: 'APP-2023', weight: 10, nec: 5023, image: 'https://picsum.photos/200/200?random=24', link: 'https://example.com/product/24', minimalQuantity: 9 }, - { reference: 'REF-1024', name: 'Produit 25', supplier: [4,8], duration: 17, caliber: 'A', approvalNumber: 'APP-2024', weight: 13, nec: 5024, image: 'https://picsum.photos/200/200?random=25', link: 'https://example.com/product/25', minimalQuantity: 7 }, - { reference: 'REF-1025', name: 'Produit 26', supplier: [5,9], duration: 18, caliber: 'B', approvalNumber: 'APP-2025', weight: 14, nec: 5025, image: 'https://picsum.photos/200/200?random=26', link: 'https://example.com/product/26', minimalQuantity: 6 }, - { reference: 'REF-1026', name: 'Produit 27', supplier: [6,10], duration: 20, caliber: 'C', approvalNumber: 'APP-2026', weight: 16, nec: 5026, image: 'https://picsum.photos/200/200?random=27', link: 'https://example.com/product/27', minimalQuantity: 5 }, - { reference: 'REF-1027', name: 'Produit 28', supplier: [1,2], duration: 15, caliber: 'A', approvalNumber: 'APP-2027', weight: 12, nec: 5027, image: 'https://picsum.photos/200/200?random=28', link: 'https://example.com/product/28', minimalQuantity: 8 }, - { reference: 'REF-1028', name: 'Produit 29', supplier: [2,3], duration: 14, caliber: 'B', approvalNumber: 'APP-2028', weight: 11, nec: 5028, image: 'https://picsum.photos/200/200?random=29', link: 'https://example.com/product/29', minimalQuantity: 7 }, - { reference: 'REF-1029', name: 'Produit 30', supplier: [3,4], duration: 19, caliber: 'C', approvalNumber: 'APP-2029', weight: 17, nec: 5029, image: 'https://picsum.photos/200/200?random=30', link: 'https://example.com/product/30', minimalQuantity: 6 }, - ]; -} +export class ProductTable {} diff --git a/src/app/interfaces/delivery-note.interface.ts b/src/app/interfaces/delivery-note.interface.ts deleted file mode 100644 index 88610e0..0000000 --- a/src/app/interfaces/delivery-note.interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {productDeliveryInfo} from "./product-delivery.interface"; - -export interface DeliveryNoteInfo { - trackingNumber: string; - deliverer: string; - estimateDeliveryDate: Date; - expeditionDate: Date; - realDeliveryDate: Date; - productDelivery: productDeliveryInfo[]; -} \ No newline at end of file diff --git a/src/app/interfaces/product-delivery.interface.ts b/src/app/interfaces/product-delivery.interface.ts deleted file mode 100644 index 050a5b7..0000000 --- a/src/app/interfaces/product-delivery.interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {ProductInfo} from "./product.interface"; - -export interface productDeliveryInfo { - product: ProductInfo; - quantity: number; -} \ No newline at end of file diff --git a/src/app/interfaces/product.interface.ts b/src/app/interfaces/product.interface.ts deleted file mode 100644 index 99354ff..0000000 --- a/src/app/interfaces/product.interface.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface ProductInfo { - reference: string; - name: string; - supplier: number[]; - duration: number; - caliber: string; - approvalNumber: string; - weight: number; - nec: number; - image: string; - link: string; - minimalQuantity: number; -} \ No newline at end of file From 1c8be0a261c074112a5fe46474e7293de4944197 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 14:52:19 +0100 Subject: [PATCH 067/127] added patch in delivery note page --- .../deliverery-note-form.html | 2 +- .../deliverery-note-form.ts | 2 +- .../deliverery-note-table.html | 7 +++- .../deliverery-note-table.ts | 36 +++++++++++++++++-- 4 files changed, 41 insertions(+), 6 deletions(-) diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.html b/src/app/components/deliverery-note-form/deliverery-note-form.html index 3cfaf9b..10025f0 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.html +++ b/src/app/components/deliverery-note-form/deliverery-note-form.html @@ -39,7 +39,7 @@
    - +
    \ No newline at end of file diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index 98d2719..0b69c02 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -31,7 +31,7 @@ export class DelivereryNoteForm { deliverer: new FormControl(null,[Validators.required]), expeditionDate: new FormControl(null,[Validators.required]), estimatedDate: new FormControl(null), - realDate: new FormControl(null) + realDeliveryDate: new FormControl(null) }) private deliverersService = inject(DeliverersService); diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index fe0eaa2..5a3c25b 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -24,7 +24,8 @@
    - + Réference @@ -47,6 +48,10 @@
    +
    + +
    + diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index 302c950..3a88398 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -9,6 +9,7 @@ import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form"; import {DeliverynotesService, GetDeliveryNoteDto} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; +import {format} from "date-fns"; @Component({ selector: 'app-deliverery-note-table', @@ -25,7 +26,7 @@ import {firstValueFrom} from "rxjs"; styleUrl: './deliverery-note-table.css', }) export class DelivereryNoteTable implements OnInit { - private DeliveryNotesService = inject(DeliverynotesService); + private deliveryNotesService = inject(DeliverynotesService); private notificationService = inject(NzNotificationService) deliveryNotes = signal([]); deliveryNotesLoading = signal(false); @@ -38,7 +39,7 @@ export class DelivereryNoteTable implements OnInit { this.deliveryNotesLoading.set(true) try { - const deliveryNotes = await firstValueFrom(this.DeliveryNotesService.getAllDeliveryNoteEndpoint()) + const deliveryNotes = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNoteEndpoint()) this.deliveryNotes.set(deliveryNotes); } catch (e) { this.notificationService.error( @@ -51,7 +52,7 @@ export class DelivereryNoteTable implements OnInit { async delete(deliveryNote:number) { try { - await firstValueFrom(this.DeliveryNotesService.deleteDeliveryNoteEndpoint(deliveryNote)); + await firstValueFrom(this.deliveryNotesService.deleteDeliveryNoteEndpoint(deliveryNote)); this.notificationService.success( 'Success', 'Suppression effectuée' @@ -65,6 +66,35 @@ export class DelivereryNoteTable implements OnInit { await this.fetchDeliveryNotes(); } + async validate(deliveryNote:number) { + try { + const PatchRealDate = { + realDeliveryDate: format(new Date(), 'yyyy-MM-dd') + }; + + try { + await firstValueFrom(this.deliveryNotesService.patchRealDeliveryDateEndpoint(deliveryNote, PatchRealDate)) + + this.notificationService.success( + 'Success', + 'Date actualisée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'La date à déjà été actualisée' + ) + } + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'actualisation de la date' + ) + } + + await this.fetchDeliveryNotes() + } + export(deliveryNote: number) { return } From b4aaa18103c95bc3c7cbd09a15487b2c5134fb29 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 15:47:43 +0100 Subject: [PATCH 068/127] fixed errors of price view in supplier page --- .../supplier-table/supplier-table.html | 22 +++++++++---------- .../supplier-table/supplier-table.ts | 2 +- src/app/services/api/model/get-price-dto.ts | 4 ++-- .../services/api/model/get-supplier-dto.ts | 2 ++ 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index b1a665d..1cb4747 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -20,27 +20,27 @@ {{ supplier.name }} {{ supplier.phone }} {{ supplier.email }} - {{ supplier.address}} - {{ supplier.zipCode}} - {{ supplier.city}} - {{ supplier.deliveryDelay}} jours + {{ supplier.address }} + {{ supplier.zipCode }} + {{ supplier.city }} + {{ supplier.deliveryDelay }} jours - + - Produits - Nom + Produit Référence Prix - @for (product of supplier.products; track product.id) { + @for (product of supplier.prices; track product.id) { - {{ product.name }} - {{ product.references }} - Price ??? + {{ product.productName }} + {{ product.productReferences }} + {{ product.sellingPrice }}€ } diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index 87ea541..98ae8c3 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -5,7 +5,7 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalButton} from "../modal-button/modal-button"; import {SupplierForm} from "../supplier-form/supplier-form"; -import {GetSupplierDto, SuppliersService} from "../../services/api"; +import {GetPriceDto, GetSupplierDto, SuppliersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; diff --git a/src/app/services/api/model/get-price-dto.ts b/src/app/services/api/model/get-price-dto.ts index c002abc..aecbf6e 100644 --- a/src/app/services/api/model/get-price-dto.ts +++ b/src/app/services/api/model/get-price-dto.ts @@ -17,7 +17,7 @@ export interface GetPriceDto { supplierEmail?: string | null; supplierPhone?: string | null; supplierAddress?: string | null; - supplierZipCode?: number; + supplierZipCode?: string | null; supplierCity?: string | null; supplierDeliveryDelay?: number; productId?: number; @@ -25,7 +25,7 @@ export interface GetPriceDto { productName?: string | null; productDuration?: number; productCaliber?: number; - productApprovalNumber?: number; + productApprovalNumber?: string | null; productWeight?: number; productNec?: number; productImage?: string | null; diff --git a/src/app/services/api/model/get-supplier-dto.ts b/src/app/services/api/model/get-supplier-dto.ts index 378eb06..a612c83 100644 --- a/src/app/services/api/model/get-supplier-dto.ts +++ b/src/app/services/api/model/get-supplier-dto.ts @@ -7,6 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ +import { GetPriceDto } from './get-price-dto'; import { GetProductDto } from './get-product-dto'; @@ -20,5 +21,6 @@ export interface GetSupplierDto { city?: string | null; deliveryDelay?: number; products?: Array | null; + prices?: Array | null; } From b7bd3be6a3bbda9d26c7d7b02020f03f92a34d9d Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 16:05:33 +0100 Subject: [PATCH 069/127] updated deliverer page for edit and add deliverer --- .../deliverer-form/deliverer-form.ts | 14 +++++- .../deliverer-table/deliverer-table.html | 14 +++--- .../deliverer-table/deliverer-table.ts | 28 +++++++++-- src/app/pages/deliverer/deliverer.html | 11 +++-- src/app/pages/deliverer/deliverer.ts | 46 ++++++++++++++++++- 5 files changed, 98 insertions(+), 15 deletions(-) diff --git a/src/app/components/deliverer-form/deliverer-form.ts b/src/app/components/deliverer-form/deliverer-form.ts index 4c59ca6..08f8b8b 100644 --- a/src/app/components/deliverer-form/deliverer-form.ts +++ b/src/app/components/deliverer-form/deliverer-form.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import {Component, effect, input} from '@angular/core'; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {GetDelivererDto} from "../../services/api"; @Component({ selector: 'app-deliverer-form', @@ -24,4 +25,15 @@ export class DelivererForm { delivererForm: FormGroup = new FormGroup({ transporter: new FormControl(null, [Validators.required]) }) + + deliverer= input(); + constructor() { + effect(() => { + if (this.deliverer()) { + this.delivererForm.patchValue({ + transporter: this.deliverer().transporter + }); + } + }); + } } diff --git a/src/app/components/deliverer-table/deliverer-table.html b/src/app/components/deliverer-table/deliverer-table.html index 7e8b132..bf57752 100644 --- a/src/app/components/deliverer-table/deliverer-table.html +++ b/src/app/components/deliverer-table/deliverer-table.html @@ -41,16 +41,18 @@
    - - - + -
    - -
    +
    }
    + + diff --git a/src/app/components/deliverer-table/deliverer-table.ts b/src/app/components/deliverer-table/deliverer-table.ts index be28e88..ca1b4c8 100644 --- a/src/app/components/deliverer-table/deliverer-table.ts +++ b/src/app/components/deliverer-table/deliverer-table.ts @@ -1,4 +1,4 @@ -import {Component, inject, OnInit, signal} from '@angular/core'; +import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; @@ -6,9 +6,10 @@ import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalButton} from "../modal-button/modal-button"; import {DatePipe} from "@angular/common"; import {DelivererForm} from "../deliverer-form/deliverer-form"; -import {DeliverersService, GetDelivererDto} from "../../services/api"; +import {DeliverersService, GetDelivererDto, GetSupplierDto} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; +import {SupplierForm} from "../supplier-form/supplier-form"; @Component({ selector: 'app-deliverer-table', @@ -19,7 +20,7 @@ import {firstValueFrom} from "rxjs"; NzTableComponent, ModalButton, DatePipe, - DelivererForm + DelivererForm, ], templateUrl: './deliverer-table.html', styleUrl: './deliverer-table.css', @@ -30,6 +31,8 @@ export class DelivererTable implements OnInit { private notificationService = inject(NzNotificationService) deliverers = signal([]); deliverersLoading = signal(false); + updateDeliverer = viewChild.required('delivererForm'); + modal = viewChild.required('modalNav'); async ngOnInit() { await this.fetchDeliverers(); @@ -92,4 +95,23 @@ export class DelivererTable implements OnInit { ) } } + + selectedDeliverer: GetDelivererDto | null = null; + openEditModal(supplier: GetSupplierDto) { + this.selectedDeliverer = { ...supplier }; + this.modal().showModal(); + } + + async onModalOk(supplierId: number, updateDelivererComponent: DelivererForm, modal: ModalNav) { + if (!this.selectedDeliverer) return; + + await this.edit(supplierId, updateDelivererComponent); + updateDelivererComponent.delivererForm.reset(); + modal.isVisible = false; + await this.fetchDeliverers(); + } + + onModalCancel(modal: ModalNav) { + modal.isVisible = false; + } } diff --git a/src/app/pages/deliverer/deliverer.html b/src/app/pages/deliverer/deliverer.html index b06a07a..ade7bee 100644 --- a/src/app/pages/deliverer/deliverer.html +++ b/src/app/pages/deliverer/deliverer.html @@ -1,6 +1,11 @@
    - - + + +
    @@ -9,5 +14,5 @@
    - +
    diff --git a/src/app/pages/deliverer/deliverer.ts b/src/app/pages/deliverer/deliverer.ts index 3d5ca1b..2aba356 100644 --- a/src/app/pages/deliverer/deliverer.ts +++ b/src/app/pages/deliverer/deliverer.ts @@ -1,8 +1,11 @@ -import { Component } from '@angular/core'; +import {Component, inject, viewChild} from '@angular/core'; import {ModalButton} from "../../components/modal-button/modal-button"; import {DelivererTable} from "../../components/deliverer-table/deliverer-table"; import {DelivererForm} from "../../components/deliverer-form/deliverer-form"; import {Search} from "../../components/search/search"; +import {DeliverersService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-deliverer', @@ -16,5 +19,44 @@ import {Search} from "../../components/search/search"; styleUrl: './deliverer.css', }) export class Deliverer { + modal = viewChild.required('modalButton'); + createDeliverer = viewChild.required('delivererForm'); + delivererTable = viewChild.required('delivererTable'); + private deliverersService = inject(DeliverersService); + private notificationService = inject(NzNotificationService) -} + async onModalOk() { + await this.addDeliverer() + this.createDeliverer().delivererForm.reset(); + this.modal().isVisible = false; + await this.delivererTable().fetchDeliverers() + } + + onModalCancel() { + this.modal().isVisible = false; + } + + async addDeliverer() { + if (this.createDeliverer().delivererForm.invalid) + { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + } + try { + const deliverers = this.createDeliverer().delivererForm.getRawValue(); + await firstValueFrom(this.deliverersService.createDelivererEndpoint(deliverers)) + + this.notificationService.success( + 'Success', + 'Transporteur enregistré' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'enregistrement' + ) + } + } +} \ No newline at end of file From 9b49f5fe11ec6b1af586516368dd16f93175ba87 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 17:20:14 +0100 Subject: [PATCH 070/127] added totalQuantity in stock page --- .../components/stock-table/stock-table.html | 3 +- src/app/components/stock-table/stock-table.ts | 47 +++++++++++++++---- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 29daffa..b2f26e2 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -43,9 +43,8 @@ {{ product.caliber }} {{ product.weight }} {{ product.duration }} - Quantité totale ??? + {{ product.totalQuantity }} {{ product.minimalQuantity }} -
    diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index 5550d53..c99f6de 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -6,10 +6,14 @@ import {StockForm} from "../stock-form/stock-form"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {FormsModule} from "@angular/forms"; import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; -import {GetProductDto, ProductsService} from "../../services/api"; +import {GetProductDto, ProductsService, WarehouseproductsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; +interface ProductWithQuantity extends GetProductDto { + totalQuantity?: number; +} + @Component({ selector: 'app-stock-table', imports: [ @@ -28,8 +32,9 @@ import {firstValueFrom} from "rxjs"; export class StockTable implements OnInit { private productsService = inject(ProductsService); + private wareHousseProductsService = inject(WarehouseproductsService) private notificationService = inject(NzNotificationService) - products = signal([]); + products = signal([]); productsLoading = signal(false); updateProduct = viewChild.required('stockForm'); modal = viewChild.required('modalNav'); @@ -84,19 +89,43 @@ export class StockTable implements OnInit { await this.fetchProducts(); } - async fetchProducts() { - this.productsLoading.set(true) - + async fetchTotalQuantity(product: ProductWithQuantity) { try { - const products = await firstValueFrom(this.productsService.getAllProductsEndpoint()) - this.products.set(products); + const res = await firstValueFrom( + this.wareHousseProductsService.getTotalQuantityEndpoint(product.id) + ); + product.totalQuantity = res.totalQuantity; + } catch (e) { + product.totalQuantity = 0; + this.notificationService.error( + 'Erreur', + `Impossible de récupérer la quantité pour le produit n°${product.id}` + ); + } + } + + async fetchProducts() { + this.productsLoading.set(true); + try { + const products = await firstValueFrom(this.productsService.getAllProductsEndpoint()); + + // transforme chaque produit en ProductWithQuantity + const productsWithQuantity: ProductWithQuantity[] = products.map(p => ({ ...p })); + + this.products.set(productsWithQuantity); + + // récupérer la quantité pour chaque produit en parallèle + await Promise.all(productsWithQuantity.map(p => this.fetchTotalQuantity(p))); + + // déclencher la mise à jour du signal + this.products.set([...productsWithQuantity]); } catch (e) { this.notificationService.error( 'Erreur', 'Erreur de communication avec l\'API' - ) + ); } - this.productsLoading.set(false) + this.productsLoading.set(false); } async delete(productId:number) { From 837e608258a6f534852a3618b085c8e046811d49 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 17:37:24 +0100 Subject: [PATCH 071/127] fixed errors --- src/app/components/stock-table/stock-table.ts | 4 ---- src/app/components/user-table/user-table.html | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index c99f6de..d774470 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -97,10 +97,6 @@ export class StockTable implements OnInit { product.totalQuantity = res.totalQuantity; } catch (e) { product.totalQuantity = 0; - this.notificationService.error( - 'Erreur', - `Impossible de récupérer la quantité pour le produit n°${product.id}` - ); } } diff --git a/src/app/components/user-table/user-table.html b/src/app/components/user-table/user-table.html index f973125..074759b 100644 --- a/src/app/components/user-table/user-table.html +++ b/src/app/components/user-table/user-table.html @@ -4,7 +4,7 @@ class="mr-7"> - Nom + Prénom Email Fonction Action From c42c29a9fd9ff2d3230b58862eeb5325f94bd8c5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 1 Dec 2025 10:48:03 +0100 Subject: [PATCH 072/127] fix modal size --- package-lock.json | 29 ++----------------- .../deliverer-table/deliverer-table.html | 2 +- .../deliverery-note-form.html | 2 +- .../deliverery-note-table.html | 2 +- .../components/modal-button/modal-button.html | 1 + .../components/modal-button/modal-button.ts | 1 + .../purchase-order-table.html | 2 +- .../quotation-table/quotation-table.html | 2 +- .../supplier-table/supplier-table.html | 2 +- src/app/pages/deliverer/deliverer.html | 3 +- .../pages/delivery-note/delivery-note.html | 2 +- src/app/pages/stock/stock.html | 4 +-- src/app/pages/supplier/supplier.html | 3 +- src/app/services/api/.openapi-generator/FILES | 1 + src/app/services/api/api.base.service.ts | 2 +- 15 files changed, 20 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 488f3a4..0c9a89a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,7 +500,6 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -517,7 +516,6 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -531,7 +529,6 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -564,7 +561,6 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -590,7 +586,6 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -609,7 +604,6 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -632,7 +626,6 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -714,7 +707,6 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1656,7 +1648,6 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -2516,7 +2507,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", - "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -4280,7 +4270,6 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", - "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", @@ -4448,7 +4437,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5647,7 +5635,6 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -6903,7 +6890,6 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -7191,7 +7177,6 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -8847,8 +8832,7 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/require-directory": { "version": "2.1.1", @@ -8996,7 +8980,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -9033,7 +9016,6 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -9782,8 +9764,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tuf-js": { "version": "3.1.0", @@ -9833,7 +9814,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9994,7 +9974,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -10382,7 +10361,6 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -10401,8 +10379,7 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT", - "peer": true + "license": "MIT" } } } diff --git a/src/app/components/deliverer-table/deliverer-table.html b/src/app/components/deliverer-table/deliverer-table.html index bf57752..3c16214 100644 --- a/src/app/components/deliverer-table/deliverer-table.html +++ b/src/app/components/deliverer-table/deliverer-table.html @@ -13,7 +13,7 @@ {{deliverer.transporter}} - +
    diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.html b/src/app/components/deliverery-note-form/deliverery-note-form.html index 10025f0..3b754a8 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.html +++ b/src/app/components/deliverery-note-form/deliverery-note-form.html @@ -4,7 +4,7 @@ Transporteur - + @for (deliverer of deliverers(); track deliverer.id) { diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index 5a3c25b..801f261 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -22,7 +22,7 @@ {{deliveryNote.estimateDeliveryDate | date: 'dd/MM/yyyy'}} {{deliveryNote.realDeliveryDate | date: 'dd/MM/yyyy'}} - +
    diff --git a/src/app/components/modal-button/modal-button.html b/src/app/components/modal-button/modal-button.html index cf8186c..c3e1197 100644 --- a/src/app/components/modal-button/modal-button.html +++ b/src/app/components/modal-button/modal-button.html @@ -11,6 +11,7 @@ (nzOnOk)="handleOk()" [nzOkLoading]="isOkLoading" [nzContent]="modalContent" + [nzWidth]="size()" > diff --git a/src/app/components/modal-button/modal-button.ts b/src/app/components/modal-button/modal-button.ts index 49d0fee..b9a5bb2 100644 --- a/src/app/components/modal-button/modal-button.ts +++ b/src/app/components/modal-button/modal-button.ts @@ -13,6 +13,7 @@ import {NzButtonComponent} from "ng-zorro-antd/button"; }) export class ModalButton { + size = input(); name = input.required() type = input<"primary" | "default" | "dashed" | "link" | "text">() diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 72b31f4..820d935 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -18,7 +18,7 @@ {{purchaseOrder.purchaseConditions}} Fournisseur ??? - +
    diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index c43bf62..0e879db 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -19,7 +19,7 @@ {{quotation.message}} {{quotation.conditionsSale}} - +
    diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index 1cb4747..4cae48c 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -25,7 +25,7 @@ {{ supplier.city }} {{ supplier.deliveryDelay }} jours - + diff --git a/src/app/pages/deliverer/deliverer.html b/src/app/pages/deliverer/deliverer.html index ade7bee..c8e69d1 100644 --- a/src/app/pages/deliverer/deliverer.html +++ b/src/app/pages/deliverer/deliverer.html @@ -3,7 +3,8 @@ type="primary" name="Ajouter un transporteur" (ok)="onModalOk()" - (cancel)="onModalCancel()"> + (cancel)="onModalCancel()" + size="35%"> diff --git a/src/app/pages/delivery-note/delivery-note.html b/src/app/pages/delivery-note/delivery-note.html index bf3ae8f..1524126 100644 --- a/src/app/pages/delivery-note/delivery-note.html +++ b/src/app/pages/delivery-note/delivery-note.html @@ -1,5 +1,5 @@
    - + diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index 315cffd..11d2f0b 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,10 +1,10 @@
    @if (hasSelection) { - + - + } diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 5593490..bcfdf42 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -3,7 +3,8 @@ type="primary" name="Ajouter un fournisseur" (ok)="onModalOk()" - (cancel)="onModalCancel()"> + (cancel)="onModalCancel()" + size="35%"> diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 72ed5fa..3d6d1ae 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore README.md api.base.service.ts api.module.ts diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 34531a6..1e0f210 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'https://localhost:44379'; + protected basePath = 'http://localhost:5298'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec; From cdcdaaa25e2cab701b856a92fd02dd4e530a78f0 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 1 Dec 2025 12:41:40 +0100 Subject: [PATCH 073/127] added suppr and edit modal for supplier price --- src/app/components/price-form/price-form.css | 0 src/app/components/price-form/price-form.html | 13 ++ src/app/components/price-form/price-form.ts | 40 +++++ .../supplier-table/supplier-table.html | 38 ++++- .../supplier-table/supplier-table.ts | 137 +++++++++++------- 5 files changed, 170 insertions(+), 58 deletions(-) create mode 100644 src/app/components/price-form/price-form.css create mode 100644 src/app/components/price-form/price-form.html create mode 100644 src/app/components/price-form/price-form.ts diff --git a/src/app/components/price-form/price-form.css b/src/app/components/price-form/price-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/price-form/price-form.html b/src/app/components/price-form/price-form.html new file mode 100644 index 0000000..fb025a8 --- /dev/null +++ b/src/app/components/price-form/price-form.html @@ -0,0 +1,13 @@ +
    + + + Prix + + + + + + +
    + + diff --git a/src/app/components/price-form/price-form.ts b/src/app/components/price-form/price-form.ts new file mode 100644 index 0000000..ec8d527 --- /dev/null +++ b/src/app/components/price-form/price-form.ts @@ -0,0 +1,40 @@ +import {Component, effect, input} from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {GetPriceDto, GetSupplierDto} from "../../services/api"; + +@Component({ + selector: 'app-price-form', + imports: [ + FormsModule, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule + ], + templateUrl: './price-form.html', + styleUrl: './price-form.css', +}) +export class PriceForm { + priceForm: FormGroup = new FormGroup({ + price: new FormControl(null, [Validators.required]), + }) + + price= input(); + constructor() { + effect(() => { + if (this.price()) { + this.priceForm.patchValue({ + price: this.price().sellingPrice + }); + } + }); + } +} diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index 4cae48c..1a89523 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -25,22 +25,32 @@ {{ supplier.city }} {{ supplier.deliveryDelay }} jours - - + + - + Produit Référence Prix + Action - + @for (product of supplier.prices; track product.id) { {{ product.productName }} {{ product.productReferences }} {{ product.sellingPrice }}€ + +
    + + + +
    + } @@ -49,9 +59,11 @@
    - + - +
    @@ -60,7 +72,17 @@
    + + diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index 98ae8c3..d95457b 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -5,9 +5,10 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalButton} from "../modal-button/modal-button"; import {SupplierForm} from "../supplier-form/supplier-form"; -import {GetPriceDto, GetSupplierDto, SuppliersService} from "../../services/api"; +import {GetPriceDto, GetSupplierDto, PricesService, SuppliersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; +import {PriceForm} from "../price-form/price-form"; @Component({ selector: 'app-supplier-table', @@ -18,6 +19,7 @@ import {firstValueFrom} from "rxjs"; NzTableComponent, ModalButton, SupplierForm, + PriceForm, ], templateUrl: './supplier-table.html', styleUrl: './supplier-table.css', @@ -25,82 +27,68 @@ import {firstValueFrom} from "rxjs"; export class SupplierTable implements OnInit { private suppliersService = inject(SuppliersService); - private notificationService = inject(NzNotificationService) + private pricesService = inject(PricesService); + private notificationService = inject(NzNotificationService); suppliers = signal([]); suppliersLoading = signal(false); updateSupplier = viewChild.required('supplierForm'); - modal = viewChild.required('modalNav'); + supplierModal = viewChild.required('supplierModal'); + productModal = viewChild.required('productModal'); + selectedSupplier: GetSupplierDto | null = null; + selectedProduct: GetPriceDto | null = null; async ngOnInit() { await this.fetchSuppliers(); } async fetchSuppliers() { - this.suppliersLoading.set(true) - + this.suppliersLoading.set(true); try { - const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint()) + const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint()); this.suppliers.set(suppliers); } catch (e) { - this.notificationService.error( - 'Erreur', - 'Erreur de communication avec l\'API' - ) + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); } - this.suppliersLoading.set(false) - } - - async delete(supplier:number) { - try { - await firstValueFrom(this.suppliersService.deleteSupplierEndpoint(supplier)) - this.notificationService.success( - 'Success', - 'Suppression effectuée' - ) - } catch (e) { - this.notificationService.error( - 'Erreur', - 'Impossible de supprimer la ligne' - ) - } - await this.fetchSuppliers(); + this.suppliersLoading.set(false); } async edit(id: number, updateSupplierComponent: SupplierForm) { if (updateSupplierComponent.supplierForm.invalid) { - this.notificationService.error( - 'Erreur', - 'Erreur d\'écriture dans le formulaire' - ) + this.notificationService.error('Erreur', 'Erreur d\'écriture dans le formulaire'); return; } - try { - const suppliers = updateSupplierComponent.supplierForm.getRawValue(); - await firstValueFrom(this.suppliersService.updateSupplierEndpoint(id, suppliers)) - - this.notificationService.success( - 'Success', - 'Fournisseur modifié' - ) + await firstValueFrom(this.suppliersService.updateSupplierEndpoint(id, suppliers)); + this.notificationService.success('Success', 'Fournisseur modifié'); } catch (e) { console.error(e); - this.notificationService.error( - 'Erreur', - 'Erreur lors de la modification' - ) + this.notificationService.error('Erreur', 'Erreur lors de la modification'); } } - selectedSupplier: GetSupplierDto | null = null; - openEditModal(supplier: GetSupplierDto) { - this.selectedSupplier = { ...supplier }; - this.modal().showModal(); + async delete(supplier: number) { + try { + await firstValueFrom(this.suppliersService.deleteSupplierEndpoint(supplier)); + this.notificationService.success('Succès', 'Suppression effectuée'); + await this.fetchSuppliers(); + } catch (e) { + this.notificationService.error('Erreur', 'Impossible de supprimer la ligne'); + } } - async onModalOk(supplierId: number, updateSupplierComponent: SupplierForm, modal: ModalNav) { - if (!this.selectedSupplier) return; + openEditModal(supplier: GetSupplierDto) { + this.selectedSupplier = { ...supplier }; + this.supplierModal().showModal(); + } + + openEditProductModal(product: GetPriceDto) { + this.selectedProduct = { ...product }; + this.productModal().showModal(); + } + + async onModalOk(supplierId: number | undefined, updateSupplierComponent: SupplierForm, modal: ModalNav) { + if (!supplierId || !this.selectedSupplier) return; await this.edit(supplierId, updateSupplierComponent); updateSupplierComponent.supplierForm.reset(); @@ -108,7 +96,56 @@ export class SupplierTable implements OnInit { await this.fetchSuppliers(); } + async onModalProductOk( + productId: number | undefined, + supplierId: number | undefined, + updateProductComponent: PriceForm, + modal: ModalNav + ) { + if (!productId || !supplierId || !this.selectedProduct) return; + + await this.editPrice(productId, supplierId, updateProductComponent); + updateProductComponent.priceForm.reset(); + modal.isVisible = false; + await this.fetchSuppliers(); + } + onModalCancel(modal: ModalNav) { modal.isVisible = false; } -} \ No newline at end of file + + async editPrice(productId: number, supplierId: number, updateProductComponent: PriceForm) { + if (updateProductComponent.priceForm.invalid) { + this.notificationService.error('Erreur', 'Erreur d\'écriture dans le formulaire'); + return; + } + + try { + const formValue = updateProductComponent.priceForm.getRawValue(); + const body = { + productId, + supplierId, + sellingPrice: Number(formValue.price), + }; + + console.log('PATCH body =>', body); + + await firstValueFrom(this.pricesService.patchPriceEndpoint(productId, supplierId, body)); + this.notificationService.success('Success', 'Prix modifié'); + } catch (e) { + console.error(e); + this.notificationService.error('Erreur', 'Erreur lors de la modification'); + } + } + + + async deleteProduct(idProduct: number, idSupplier: number) { + try { + await firstValueFrom(this.pricesService.deletePriceEndpoint(idProduct, idSupplier)); + this.notificationService.success('Succès', 'Produit supprimé'); + await this.fetchSuppliers(); + } catch (e) { + this.notificationService.error('Erreur', 'Impossible de supprimer le produit'); + } + } +} From 0470b9c45c8d8e150f331354bf670de7dac7f075 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 1 Dec 2025 12:52:52 +0100 Subject: [PATCH 074/127] added suppr and edit modal for supplier price --- .../components/supplier-table/supplier-table.html | 4 ++-- .../components/supplier-table/supplier-table.ts | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index 1a89523..8c6c89b 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -45,7 +45,7 @@
    + (click)="openEditProductModal(product, supplier.id)"> @@ -81,7 +81,7 @@
    - +
    diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index f02072f..82f3c18 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -8,6 +8,7 @@ import {ModalButton} from "../modal-button/modal-button"; import {GetPurchaseOrderDto, PurchaseordersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; +import {FileService} from "../../services/file.service"; @Component({ selector: 'app-purchase-order-table', @@ -24,7 +25,8 @@ import {firstValueFrom} from "rxjs"; }) export class PurchaseOrderTable implements OnInit { private purchaseOrdersService = inject(PurchaseordersService); - private notificationService = inject(NzNotificationService) + private notificationService = inject(NzNotificationService); + private fileService = inject(FileService); purchaseOrders = signal([]); purchaseOrdersLoading = signal(false); @@ -63,8 +65,19 @@ export class PurchaseOrderTable implements OnInit { await this.fetchPurchaseOrder(); } - export(){ - return + async export(purchaseOrderId: number){ + try { + const pdf = await firstValueFrom( + this.purchaseOrdersService.getPurchaseOrderPdfEndpoint(purchaseOrderId, "response") + ); + this.fileService.downloadBlob(pdf) + } catch (e) { + console.error(e); + this.notificationService.error( + 'Erreur', + 'Impossible de générer un PDF' + ); + } } transfer() { diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 0e879db..84ede4d 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -65,7 +65,7 @@
    - +
    diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 8bcb142..6c1f551 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -8,6 +8,7 @@ import {QuotationForm} from "../quotation-form/quotation-form"; import {GetQuotationDto, QuotationsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; +import {FileService} from "../../services/file.service"; @Component({ selector: 'app-quotation-table', @@ -25,7 +26,8 @@ import {firstValueFrom} from "rxjs"; export class QuotationTable implements OnInit { private quotationsService = inject(QuotationsService); - private notificationService = inject(NzNotificationService) + private notificationService = inject(NzNotificationService); + private fileService = inject(FileService); quotations = signal([]); quotationsLoading = signal(false); @@ -63,5 +65,20 @@ export class QuotationTable implements OnInit { } await this.fetchQuotations(); } + + async export(quotationId: number){ + try { + const pdf = await firstValueFrom( + this.quotationsService.getQuotationPdfEndpoint(quotationId, "response") + ); + this.fileService.downloadBlob(pdf) + } catch (e) { + console.error(e); + this.notificationService.error( + 'Erreur', + 'Impossible de générer un PDF' + ); + } + } } diff --git a/src/app/services/api/api/deliverynotes.service.ts b/src/app/services/api/api/deliverynotes.service.ts index a2d7d7b..ea29226 100644 --- a/src/app/services/api/api/deliverynotes.service.ts +++ b/src/app/services/api/api/deliverynotes.service.ts @@ -260,6 +260,49 @@ export class DeliverynotesService extends BaseService { ); } + /** + * @endpoint get /API/deliveryNotes/{id}/pdf + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDeliveryNotePdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable; + public getDeliveryNotePdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDeliveryNotePdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDeliveryNotePdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getDeliveryNotePdfEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/pdf' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: "blob", + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint patch /API/deliveryNotes/{id} * @param id diff --git a/src/app/services/api/api/purchaseorders.service.ts b/src/app/services/api/api/purchaseorders.service.ts index 6aeaf5a..117aff2 100644 --- a/src/app/services/api/api/purchaseorders.service.ts +++ b/src/app/services/api/api/purchaseorders.service.ts @@ -194,6 +194,49 @@ export class PurchaseordersService extends BaseService { ); } + /** + * @endpoint get /API/purchaseOrders/{id}/pdf + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPurchaseOrderPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable; + public getPurchaseOrderPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPurchaseOrderPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPurchaseOrderPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderPdfEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/pdf' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: "blob", + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint patch /API/purchaseOrders/{id}/PurchaseConditions * @param id diff --git a/src/app/services/api/api/quotations.service.ts b/src/app/services/api/api/quotations.service.ts index 752b39f..f26e058 100644 --- a/src/app/services/api/api/quotations.service.ts +++ b/src/app/services/api/api/quotations.service.ts @@ -194,6 +194,49 @@ export class QuotationsService extends BaseService { ); } + /** + * @endpoint get /API/quotations/{id}/pdf + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getQuotationPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable; + public getQuotationPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; + public getQuotationPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; + public getQuotationPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getQuotationPdfEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/pdf' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: "blob", + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint patch /API/quotations/{id}/saleConditions * @param id diff --git a/src/app/services/file.service.ts b/src/app/services/file.service.ts new file mode 100644 index 0000000..3828709 --- /dev/null +++ b/src/app/services/file.service.ts @@ -0,0 +1,31 @@ +import { Injectable } from '@angular/core'; +import {HttpResponse} from "@angular/common/http"; + +@Injectable({ + providedIn: 'root', +}) +export class FileService { + getFilenameFromHttpResponse(httpResponse: HttpResponse) { + const contentDispositionHeader = httpResponse.headers.get('Content-Disposition'); + // console.log(contentDispositionHeader); + let result = contentDispositionHeader.split(';')[1].trim().split('=')[1]; + // Removing the " from the after trim operation + result = result.replace(/"/g, ''); + // Removing . from filename + // return result.replace(/./g, '_'); + + return result; + } + + downloadBlob(data: HttpResponse) { + const url = window.URL.createObjectURL(data.body); + const anchor = document.createElement('a'); + + anchor.download = this.getFilenameFromHttpResponse(data); + anchor.href = url; + anchor.click(); + anchor.remove(); + + window.URL.revokeObjectURL(url); + } +} From f812ce856cbd4f8707e68dfb9cdb34c3c528c692 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 4 Dec 2025 17:45:20 +0100 Subject: [PATCH 077/127] added loading function --- .../deliverery-note-table/deliverery-note-table.ts | 10 ++++++---- .../purchase-order-table/purchase-order-table.ts | 4 ++++ src/app/components/quotation-table/quotation-table.ts | 4 ++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index cc8e179..15f9380 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -10,7 +10,6 @@ import {DeliverynotesService, GetDeliveryNoteDto} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {format} from "date-fns"; -import {HttpResponse} from "@angular/common/http"; import {FileService} from "../../services/file.service"; @Component({ @@ -40,7 +39,6 @@ export class DelivereryNoteTable implements OnInit { async fetchDeliveryNotes() { this.deliveryNotesLoading.set(true) - try { const deliveryNotes = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNoteEndpoint()) this.deliveryNotes.set(deliveryNotes); @@ -54,6 +52,7 @@ export class DelivereryNoteTable implements OnInit { } async delete(deliveryNote:number) { + this.deliveryNotesLoading.set(true) try { await firstValueFrom(this.deliveryNotesService.deleteDeliveryNoteEndpoint(deliveryNote)); this.notificationService.success( @@ -66,10 +65,12 @@ export class DelivereryNoteTable implements OnInit { 'Impossible de supprimer la ligne' ) } + this.deliveryNotesLoading.set(false) await this.fetchDeliveryNotes(); } async validate(deliveryNote:number) { + this.deliveryNotesLoading.set(true) try { const PatchRealDate = { realDeliveryDate: format(new Date(), 'yyyy-MM-dd') @@ -94,11 +95,12 @@ export class DelivereryNoteTable implements OnInit { 'Erreur d\'actualisation de la date' ) } - + this.deliveryNotesLoading.set(false) await this.fetchDeliveryNotes() } async export(deliveryNoteId: number) { + this.deliveryNotesLoading.set(true) try { const pdf = await firstValueFrom( this.deliveryNotesService.getDeliveryNotePdfEndpoint(deliveryNoteId, "response") @@ -111,6 +113,6 @@ export class DelivereryNoteTable implements OnInit { 'Impossible de générer un PDF' ); } + this.deliveryNotesLoading.set(false) } - } diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 82f3c18..b3eac7f 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -50,6 +50,7 @@ export class PurchaseOrderTable implements OnInit { } async delete(purchaseOrderId:number) { + this.purchaseOrdersLoading.set(true) try { await firstValueFrom(this.purchaseOrdersService.deletePurchaseOrderEndpoint(purchaseOrderId)) this.notificationService.success( @@ -62,10 +63,12 @@ export class PurchaseOrderTable implements OnInit { 'Impossible de supprimer la ligne' ) } + this.purchaseOrdersLoading.set(false) await this.fetchPurchaseOrder(); } async export(purchaseOrderId: number){ + this.purchaseOrdersLoading.set(true) try { const pdf = await firstValueFrom( this.purchaseOrdersService.getPurchaseOrderPdfEndpoint(purchaseOrderId, "response") @@ -78,6 +81,7 @@ export class PurchaseOrderTable implements OnInit { 'Impossible de générer un PDF' ); } + this.purchaseOrdersLoading.set(false) } transfer() { diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 6c1f551..125499a 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -51,6 +51,7 @@ export class QuotationTable implements OnInit { } async delete(quotation:number) { + this.quotationsLoading.set(true) try { await firstValueFrom(this.quotationsService.deleteQuotationEndpoint(quotation)) this.notificationService.success( @@ -63,10 +64,12 @@ export class QuotationTable implements OnInit { 'Impossible de supprimer la ligne' ) } + this.quotationsLoading.set(false) await this.fetchQuotations(); } async export(quotationId: number){ + this.quotationsLoading.set(true) try { const pdf = await firstValueFrom( this.quotationsService.getQuotationPdfEndpoint(quotationId, "response") @@ -79,6 +82,7 @@ export class QuotationTable implements OnInit { 'Impossible de générer un PDF' ); } + this.quotationsLoading.set(false) } } From a3a6b6d626f37691316ea0a56ff141e3d8bbdc35 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 11 Dec 2025 15:30:12 +0100 Subject: [PATCH 078/127] update delivery note components --- .../deliverery-note-form.ts | 9 +++++---- .../deliverery-note-table.html | 17 ++++------------- .../deliverery-note-table.ts | 3 ++- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index 0b69c02..67e5e35 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -1,11 +1,11 @@ -import {Component, inject, signal} from '@angular/core'; +import {Component, effect, inject, input, OnInit, signal} from '@angular/core'; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; -import {DeliverersService, GetDelivererDto} from "../../services/api"; +import {DeliverersService, GetDelivererDto, GetDeliveryNoteDto} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @@ -21,13 +21,14 @@ import {firstValueFrom} from "rxjs"; ReactiveFormsModule, NzDatePickerComponent, NzSelectComponent, - NzOptionComponent + NzOptionComponent, ], templateUrl: './deliverery-note-form.html', styleUrl: './deliverery-note-form.css', }) -export class DelivereryNoteForm { +export class DelivereryNoteForm implements OnInit { deliveryNoteForm: FormGroup = new FormGroup({ + trackingNumber: new FormControl("TRK-" + Date.now), deliverer: new FormControl(null,[Validators.required]), expeditionDate: new FormControl(null,[Validators.required]), estimatedDate: new FormControl(null), diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index 801f261..1c164ca 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -48,24 +48,15 @@
    -
    - -
    + - - - + -
    - -
    - -
    - -
    +
    }
    + diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index 15f9380..d5b093d 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -1,4 +1,4 @@ -import {Component, inject, OnInit, signal} from '@angular/core'; +import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {DatePipe} from "@angular/common"; import {ModalButton} from "../modal-button/modal-button"; import {ModalNav} from "../modal-nav/modal-nav"; @@ -32,6 +32,7 @@ export class DelivereryNoteTable implements OnInit { private fileService = inject(FileService); deliveryNotes = signal([]); deliveryNotesLoading = signal(false); + modal = viewChild.required('modalNav'); async ngOnInit() { await this.fetchDeliveryNotes(); From 8d98a01c22e9ab1885f9fbdc0c55cf8e73180c55 Mon Sep 17 00:00:00 2001 From: Enzo Date: Thu, 11 Dec 2025 17:14:23 +0100 Subject: [PATCH 079/127] update searchbar on supplier and stock --- src/app/components/search/search.html | 6 +++--- src/app/components/search/search.ts | 14 ++++++-------- .../components/stock-table/stock-table.html | 4 ++-- src/app/components/stock-table/stock-table.ts | 18 +++++++++++++++++- .../supplier-table/supplier-table.html | 6 +++--- .../supplier-table/supplier-table.ts | 19 ++++++++++++++++++- src/app/components/user-table/user-table.ts | 3 +++ src/app/pages/stock/stock.html | 3 ++- src/app/pages/stock/stock.ts | 3 +++ src/app/pages/supplier/supplier.html | 3 +-- src/app/pages/supplier/supplier.ts | 4 ++++ 11 files changed, 62 insertions(+), 21 deletions(-) diff --git a/src/app/components/search/search.html b/src/app/components/search/search.html index 592bbb8..22e4ccb 100644 --- a/src/app/components/search/search.html +++ b/src/app/components/search/search.html @@ -1,9 +1,9 @@ -
    +
    - - + +
    diff --git a/src/app/components/search/search.ts b/src/app/components/search/search.ts index 138e854..fb6cf6d 100644 --- a/src/app/components/search/search.ts +++ b/src/app/components/search/search.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, output } from '@angular/core'; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; @@ -24,14 +24,12 @@ export class Search { searchValue: new FormControl(null) }) - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.searchForm.invalid) return; + searchEvent = output(); - // Pour obtenir la valeur du formulaire - console.log(this.searchForm.getRawValue()) + OnSearch(): void { + const raw = this.searchForm.controls['searchValue'].value ?? ''; + const value = String(raw).trim(); + this.searchEvent.emit(value); - // Pour vider le formulaire - this.searchForm.reset() } } diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index b2f26e2..b96cbf4 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -1,5 +1,5 @@ - @for (product of products(); track product.id) { + @for (product of filteredProducts(); track product.id) {
    diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 5fbebf5..fb14314 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -29,6 +29,9 @@ export class Stock { private productsService = inject(ProductsService); private notificationService = inject(NzNotificationService) + onProductSearch(query: string) { + this.productTable().applySearch(query); + } // async onModalOk() { // await this.addSupplier() // this.createSupplier().supplierForm.reset(); diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index bcfdf42..08475ce 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -8,9 +8,8 @@
    -
    - +
    diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 5cbe79d..858ddd8 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -36,6 +36,10 @@ export class Supplier { this.modal().isVisible = false; } + onSupplierSearch(query: string) { + this.supplierTable().applySearch(query); + } + async addSupplier() { if (this.createSupplier().supplierForm.invalid) { From 35f1909ca0b152a63d4fb6d8202d2e25909cc239 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 11 Dec 2025 17:19:48 +0100 Subject: [PATCH 080/127] update delivery note form --- .../deliverery-note-form.ts | 16 +++++++ .../deliverery-note-table.html | 7 +++ .../deliverery-note-table.ts | 48 ++++++++++++++++++- 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index 67e5e35..648db49 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -55,4 +55,20 @@ export class DelivereryNoteForm implements OnInit { filter(input: string, option: any) { return option.nzLabel.toLowerCase().includes(input.toLowerCase()); } + + deliveryNote= input(); + constructor() { + effect(() => { + if (this.deliveryNote()) { + this.deliveryNoteForm.patchValue({ + trackingNumber: this.deliveryNote().trackingNumber, + expeditionDate: this.deliveryNote().expeditionDate, + realDeliveryDate: this.deliveryNote().expeditionDate, + estimatedDate: this.deliveryNote().expeditionDate, + deliverer: this.deliveryNote().delivererId + }); + } + }); + } + } diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index 1c164ca..c16ebd3 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -50,6 +50,8 @@
    + + @@ -60,3 +62,8 @@ + diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index d5b093d..b86fc39 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -108,7 +108,6 @@ export class DelivereryNoteTable implements OnInit { ); this.fileService.downloadBlob(pdf) } catch (e) { - console.error(e); this.notificationService.error( 'Erreur', 'Impossible de générer un PDF' @@ -116,4 +115,51 @@ export class DelivereryNoteTable implements OnInit { } this.deliveryNotesLoading.set(false) } + + selectedDeliveryNote: GetDeliveryNoteDto | null = null; + openEditModal(deliveryNote: GetDeliveryNoteDto) { + this.selectedDeliveryNote = { ...deliveryNote }; + this.modal().showModal(); + } + + async onModalOk(id: number, updateDelivereryNoteComponent: DelivereryNoteForm, modal: ModalNav) { + if (!this.selectedDeliveryNote) return; + + await this.edit(id, updateDelivereryNoteComponent); + updateDelivereryNoteComponent.deliveryNoteForm.reset(); + modal.isVisible = false; + await this.fetchDeliveryNotes(); + } + + onModalCancel(modal: ModalNav) { + modal.isVisible = false; + } + + async edit(id: number, updateDelivereryNoteComponent: DelivereryNoteForm) { + if (updateDelivereryNoteComponent.deliveryNoteForm.invalid) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + return; + } + + try { + + const deliveryNotes = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue(); + await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNotes)) + + this.notificationService.success( + 'Success', + 'Bon de livraison modifié' + ) + } catch (e) { + console.error(e); + this.notificationService.error( + 'Erreur', + 'Erreur lors de la modification' + ) + } + + } } From 586c9458b198bbf23d5797140c5c7aa5322e873f Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 11 Dec 2025 17:48:54 +0100 Subject: [PATCH 081/127] update delivery note form --- .../deliverery-note-form.ts | 2 +- .../deliverery-note-table.ts | 12 +++- src/app/services/api/.openapi-generator/FILES | 1 + .../services/api/api/deliverynotes.service.ts | 70 +++++++++++++++++++ src/app/services/api/model/models.ts | 1 + .../api/model/update-delivery-note-dto.ts | 19 +++++ 6 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 src/app/services/api/model/update-delivery-note-dto.ts diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index 648db49..492501b 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -28,7 +28,7 @@ import {firstValueFrom} from "rxjs"; }) export class DelivereryNoteForm implements OnInit { deliveryNoteForm: FormGroup = new FormGroup({ - trackingNumber: new FormControl("TRK-" + Date.now), + trackingNumber: new FormControl(null), deliverer: new FormControl(null,[Validators.required]), expeditionDate: new FormControl(null,[Validators.required]), estimatedDate: new FormControl(null), diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index b86fc39..ae872d0 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -145,8 +145,19 @@ export class DelivereryNoteTable implements OnInit { } try { + const estimateDate = updateDelivereryNoteComponent.deliveryNoteForm.get('estimatedDate').value; + const expeditionDate = updateDelivereryNoteComponent.deliveryNoteForm.get('expeditionDate').value; + const realDate = updateDelivereryNoteComponent.deliveryNoteForm.get('realDeliveryDate').value; + + const estimateDateResult = format(estimateDate, 'yyyy-MM-dd'); + const expeditionDateResult = format(expeditionDate, 'yyyy-MM-dd'); + const realDateResult = format(realDate, 'yyyy-MM-dd'); const deliveryNotes = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue(); + deliveryNotes.estimatedDate = estimateDateResult; + deliveryNotes.expeditionDate = expeditionDateResult; + deliveryNotes.realDeliveryDate = realDateResult; + await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNotes)) this.notificationService.success( @@ -154,7 +165,6 @@ export class DelivereryNoteTable implements OnInit { 'Bon de livraison modifié' ) } catch (e) { - console.error(e); this.notificationService.error( 'Erreur', 'Erreur lors de la modification' diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 3d6d1ae..a7386ef 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -58,6 +58,7 @@ model/patch-supplier-delivery-delay-dto.ts model/patch-user-password-dto.ts model/patch-ware-house-product-quantity-dto.ts model/update-deliverer-dto.ts +model/update-delivery-note-dto.ts model/update-product-dto.ts model/update-supplier-dto.ts model/update-user-dto.ts diff --git a/src/app/services/api/api/deliverynotes.service.ts b/src/app/services/api/api/deliverynotes.service.ts index ea29226..3a69576 100644 --- a/src/app/services/api/api/deliverynotes.service.ts +++ b/src/app/services/api/api/deliverynotes.service.ts @@ -22,6 +22,8 @@ import { CreateDeliveryNoteDto } from '../model/create-delivery-note-dto'; import { GetDeliveryNoteDto } from '../model/get-delivery-note-dto'; // @ts-ignore import { PatchDeliveryNoteRealDeliveryDateDto } from '../model/patch-delivery-note-real-delivery-date-dto'; +// @ts-ignore +import { UpdateDeliveryNoteDto } from '../model/update-delivery-note-dto'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -371,4 +373,72 @@ export class DeliverynotesService extends BaseService { ); } + /** + * @endpoint put /API/deliveryNotes/{id} + * @param id + * @param updateDeliveryNoteDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateDeliveryNoteEndpoint.'); + } + if (updateDeliveryNoteDto === null || updateDeliveryNoteDto === undefined) { + throw new Error('Required parameter updateDeliveryNoteDto was null or undefined when calling updateDeliveryNoteEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateDeliveryNoteDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + } diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts index 19d0c33..39dd319 100644 --- a/src/app/services/api/model/models.ts +++ b/src/app/services/api/model/models.ts @@ -35,6 +35,7 @@ export * from './patch-supplier-delivery-delay-dto'; export * from './patch-user-password-dto'; export * from './patch-ware-house-product-quantity-dto'; export * from './update-deliverer-dto'; +export * from './update-delivery-note-dto'; export * from './update-product-dto'; export * from './update-supplier-dto'; export * from './update-user-dto'; diff --git a/src/app/services/api/model/update-delivery-note-dto.ts b/src/app/services/api/model/update-delivery-note-dto.ts new file mode 100644 index 0000000..181449d --- /dev/null +++ b/src/app/services/api/model/update-delivery-note-dto.ts @@ -0,0 +1,19 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface UpdateDeliveryNoteDto { + trackingNumber?: string | null; + estimateDeliveryDate?: string; + expeditionDate?: string; + realDeliveryDate?: string | null; + delivererId?: number; +} + From d160a29a56edc19e099907e142e62eb65ac3d25e Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 11 Dec 2025 19:30:46 +0100 Subject: [PATCH 082/127] updated delivery note --- package-lock.json | 29 +++++++++-- .../deliverery-note-form.html | 2 +- .../deliverery-note-form.ts | 4 +- .../deliverery-note-table.ts | 52 ++++++++++--------- src/app/services/api/.openapi-generator/FILES | 1 - src/app/services/api/api.base.service.ts | 2 +- 6 files changed, 58 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c9a89a..488f3a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -500,6 +500,7 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz", "integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -516,6 +517,7 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz", "integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -529,6 +531,7 @@ "integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "7.28.3", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -561,6 +564,7 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz", "integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -586,6 +590,7 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz", "integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -604,6 +609,7 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz", "integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -626,6 +632,7 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz", "integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -707,6 +714,7 @@ "integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.27.1", @@ -1648,6 +1656,7 @@ "integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@inquirer/checkbox": "^4.2.1", "@inquirer/confirm": "^5.1.14", @@ -2507,6 +2516,7 @@ "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz", "integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==", "license": "MIT", + "peer": true, "dependencies": { "file-type": "21.1.0", "iterare": "1.2.1", @@ -4270,6 +4280,7 @@ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", "license": "MIT", + "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", @@ -4437,6 +4448,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.25", "caniuse-lite": "^1.0.30001754", @@ -5635,6 +5647,7 @@ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", @@ -6890,6 +6903,7 @@ "integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -7177,6 +7191,7 @@ "integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", @@ -8832,7 +8847,8 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/require-directory": { "version": "2.1.1", @@ -8980,6 +8996,7 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -9016,6 +9033,7 @@ "integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -9764,7 +9782,8 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "license": "0BSD", + "peer": true }, "node_modules/tuf-js": { "version": "3.1.0", @@ -9814,6 +9833,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9974,6 +9994,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz", "integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", @@ -10361,6 +10382,7 @@ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -10379,7 +10401,8 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT" + "license": "MIT", + "peer": true } } } diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.html b/src/app/components/deliverery-note-form/deliverery-note-form.html index 3b754a8..d39e49d 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.html +++ b/src/app/components/deliverery-note-form/deliverery-note-form.html @@ -5,7 +5,7 @@ - + @for (deliverer of deliverers(); track deliverer.id) { } diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index 492501b..9ee8ec5 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -29,7 +29,7 @@ import {firstValueFrom} from "rxjs"; export class DelivereryNoteForm implements OnInit { deliveryNoteForm: FormGroup = new FormGroup({ trackingNumber: new FormControl(null), - deliverer: new FormControl(null,[Validators.required]), + delivererId: new FormControl(null,[Validators.required]), expeditionDate: new FormControl(null,[Validators.required]), estimatedDate: new FormControl(null), realDeliveryDate: new FormControl(null) @@ -65,7 +65,7 @@ export class DelivereryNoteForm implements OnInit { expeditionDate: this.deliveryNote().expeditionDate, realDeliveryDate: this.deliveryNote().expeditionDate, estimatedDate: this.deliveryNote().expeditionDate, - deliverer: this.deliveryNote().delivererId + delivererId: this.deliveryNote().delivererId }); } }); diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index ae872d0..205c26f 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -137,39 +137,43 @@ export class DelivereryNoteTable implements OnInit { async edit(id: number, updateDelivereryNoteComponent: DelivereryNoteForm) { if (updateDelivereryNoteComponent.deliveryNoteForm.invalid) { - this.notificationService.error( - 'Erreur', - 'Erreur d\'écriture dans le formulaire' - ) + this.notificationService.error('Erreur', 'Formulaire invalide'); return; } try { - const estimateDate = updateDelivereryNoteComponent.deliveryNoteForm.get('estimatedDate').value; - const expeditionDate = updateDelivereryNoteComponent.deliveryNoteForm.get('expeditionDate').value; - const realDate = updateDelivereryNoteComponent.deliveryNoteForm.get('realDeliveryDate').value; + const raw = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue(); - const estimateDateResult = format(estimateDate, 'yyyy-MM-dd'); - const expeditionDateResult = format(expeditionDate, 'yyyy-MM-dd'); - const realDateResult = format(realDate, 'yyyy-MM-dd'); + // convertit proprement les dates (string OU Date) + const toIso = (val: any) => { + if (!val) return null; - const deliveryNotes = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue(); - deliveryNotes.estimatedDate = estimateDateResult; - deliveryNotes.expeditionDate = expeditionDateResult; - deliveryNotes.realDeliveryDate = realDateResult; + // si c’est déjà un string ISO "yyyy-MM-dd", on renvoie tel quel + if (typeof val === 'string' && /^\d{4}-\d{2}-\d{2}/.test(val)) { + return val.substring(0, 10); + } - await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNotes)) + // sinon on reconstruit une Date + const d = new Date(val); + if (isNaN(d.getTime())) return null; - this.notificationService.success( - 'Success', - 'Bon de livraison modifié' - ) + return d.toISOString().substring(0, 10); // yyyy-MM-dd + }; + + const deliveryNoteDto = { + trackingNumber: raw.trackingNumber, + delivererId: raw.delivererId, + expeditionDate: toIso(raw.expeditionDate), + estimatedDate: toIso(raw.estimatedDate), + realDeliveryDate: toIso(raw.realDeliveryDate) + }; + + await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNoteDto)); + this.notificationService.success('Success', 'Bon de livraison modifié'); } catch (e) { - this.notificationService.error( - 'Erreur', - 'Erreur lors de la modification' - ) + console.error(e); + this.notificationService.error('Erreur', 'Erreur lors de la modification'); } - } + } diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index a7386ef..3066d77 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore README.md api.base.service.ts api.module.ts diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 1e0f210..34531a6 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'http://localhost:5298'; + protected basePath = 'https://localhost:44379'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec; From 3c8abbb60029fa2b2a2bea9e72556f7e6a26d48a Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 12 Dec 2025 21:18:46 +0100 Subject: [PATCH 083/127] fix error in user page --- src/app/pages/user/user.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index 7fadb44..a2e991b 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -3,7 +3,8 @@ type="primary" name="Ajouter un utilisateur" (ok)="onModalOk()" - (cancel)="onModalCancel()"> + (cancel)="onModalCancel()" + size="35%"> From a707a33a879b5076a844b8fd5399f8e8e38041b5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 12 Dec 2025 21:19:39 +0100 Subject: [PATCH 084/127] first commit --- src/app/services/api/.openapi-generator/FILES | 1 + .../services/api/api/quotations.service.ts | 70 +++++++++++++++++++ src/app/services/api/model/models.ts | 1 + 3 files changed, 72 insertions(+) diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 3066d77..a90289b 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -59,6 +59,7 @@ model/patch-ware-house-product-quantity-dto.ts model/update-deliverer-dto.ts model/update-delivery-note-dto.ts model/update-product-dto.ts +model/update-quotation-dto.ts model/update-supplier-dto.ts model/update-user-dto.ts param.ts diff --git a/src/app/services/api/api/quotations.service.ts b/src/app/services/api/api/quotations.service.ts index f26e058..07ec481 100644 --- a/src/app/services/api/api/quotations.service.ts +++ b/src/app/services/api/api/quotations.service.ts @@ -20,6 +20,8 @@ import { Observable } from 'rxjs'; import { GetQuotationDto } from '../model/get-quotation-dto'; // @ts-ignore import { PatchQuotationConditionsSaleDto } from '../model/patch-quotation-conditions-sale-dto'; +// @ts-ignore +import { UpdateQuotationDto } from '../model/update-quotation-dto'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -305,4 +307,72 @@ export class QuotationsService extends BaseService { ); } + /** + * @endpoint put /API/quotations/{id} + * @param id + * @param updateQuotationDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateQuotationEndpoint.'); + } + if (updateQuotationDto === null || updateQuotationDto === undefined) { + throw new Error('Required parameter updateQuotationDto was null or undefined when calling updateQuotationEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateQuotationDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + } diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts index 39dd319..d228c54 100644 --- a/src/app/services/api/model/models.ts +++ b/src/app/services/api/model/models.ts @@ -37,5 +37,6 @@ export * from './patch-ware-house-product-quantity-dto'; export * from './update-deliverer-dto'; export * from './update-delivery-note-dto'; export * from './update-product-dto'; +export * from './update-quotation-dto'; export * from './update-supplier-dto'; export * from './update-user-dto'; From 750a0da8173975238f25a2f408b0bd88fbf9f6ac Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 12 Dec 2025 21:46:16 +0100 Subject: [PATCH 085/127] added edit function --- .../deliverer-table/deliverer-table.ts | 12 +----- .../deliverery-note-table.ts | 37 +++++++++-------- .../quotation-form/quotation-form.html | 6 +-- .../quotation-form/quotation-form.ts | 22 +++++++--- .../quotation-table/quotation-table.html | 21 +++++----- .../quotation-table/quotation-table.ts | 40 ++++++++++++++++++- .../api/model/update-quotation-dto.ts | 16 ++++++++ 7 files changed, 104 insertions(+), 50 deletions(-) create mode 100644 src/app/services/api/model/update-quotation-dto.ts diff --git a/src/app/components/deliverer-table/deliverer-table.ts b/src/app/components/deliverer-table/deliverer-table.ts index ca1b4c8..c688c9f 100644 --- a/src/app/components/deliverer-table/deliverer-table.ts +++ b/src/app/components/deliverer-table/deliverer-table.ts @@ -79,20 +79,12 @@ export class DelivererTable implements OnInit { } try { - const deliverers = updateDelivererComponent.delivererForm.getRawValue(); await firstValueFrom(this.deliverersService.updateDelivererEndpoint(id, deliverers)) - this.notificationService.success( - 'Success', - 'Transporteur modifié' - ) + this.notificationService.success('Success', 'Transporteur modifié') } catch (e) { - console.error(e); - this.notificationService.error( - 'Erreur', - 'Erreur lors de la modification' - ) + this.notificationService.error('Erreur', 'Erreur lors de la modification') } } diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index 205c26f..4a31036 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -116,25 +116,6 @@ export class DelivereryNoteTable implements OnInit { this.deliveryNotesLoading.set(false) } - selectedDeliveryNote: GetDeliveryNoteDto | null = null; - openEditModal(deliveryNote: GetDeliveryNoteDto) { - this.selectedDeliveryNote = { ...deliveryNote }; - this.modal().showModal(); - } - - async onModalOk(id: number, updateDelivereryNoteComponent: DelivereryNoteForm, modal: ModalNav) { - if (!this.selectedDeliveryNote) return; - - await this.edit(id, updateDelivereryNoteComponent); - updateDelivereryNoteComponent.deliveryNoteForm.reset(); - modal.isVisible = false; - await this.fetchDeliveryNotes(); - } - - onModalCancel(modal: ModalNav) { - modal.isVisible = false; - } - async edit(id: number, updateDelivereryNoteComponent: DelivereryNoteForm) { if (updateDelivereryNoteComponent.deliveryNoteForm.invalid) { this.notificationService.error('Erreur', 'Formulaire invalide'); @@ -176,4 +157,22 @@ export class DelivereryNoteTable implements OnInit { } } + selectedDeliveryNote: GetDeliveryNoteDto | null = null; + openEditModal(deliveryNote: GetDeliveryNoteDto) { + this.selectedDeliveryNote = { ...deliveryNote }; + this.modal().showModal(); + } + + async onModalOk(id: number, updateDelivereryNoteComponent: DelivereryNoteForm, modal: ModalNav) { + if (!this.selectedDeliveryNote) return; + + await this.edit(id, updateDelivereryNoteComponent); + updateDelivereryNoteComponent.deliveryNoteForm.reset(); + modal.isVisible = false; + await this.fetchDeliveryNotes(); + } + + onModalCancel(modal: ModalNav) { + modal.isVisible = false; + } } diff --git a/src/app/components/quotation-form/quotation-form.html b/src/app/components/quotation-form/quotation-form.html index 0ca8812..b0b4420 100644 --- a/src/app/components/quotation-form/quotation-form.html +++ b/src/app/components/quotation-form/quotation-form.html @@ -1,11 +1,11 @@ - + Message du devis - + @@ -15,7 +15,7 @@ - + diff --git a/src/app/components/quotation-form/quotation-form.ts b/src/app/components/quotation-form/quotation-form.ts index 0e7a39c..a6aa2b6 100644 --- a/src/app/components/quotation-form/quotation-form.ts +++ b/src/app/components/quotation-form/quotation-form.ts @@ -1,10 +1,10 @@ -import { Component } from '@angular/core'; +import {Component, effect, input} from '@angular/core'; import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; -import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; +import {GetQuotationDto} from "../../services/api"; @Component({ selector: 'app-quotation-form', @@ -22,8 +22,20 @@ import {NzDatePickerComponent} from "ng-zorro-antd/date-picker"; styleUrl: './quotation-form.css', }) export class QuotationForm { - QuotationForm: FormGroup = new FormGroup({ - quotationMessage: new FormControl(null), - quotationConditionsSale: new FormControl(null), + quotationForm: FormGroup = new FormGroup({ + message: new FormControl(null, [Validators.required]), + conditionsSale: new FormControl(null, [Validators.required]), }) + + quotation= input(); + constructor() { + effect(() => { + if (this.quotation()) { + this.quotationForm.patchValue({ + message: this.quotation().message, + conditionsSale: this.quotation().conditionsSale, + }); + } + }); + } } diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 84ede4d..34309da 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -52,21 +52,13 @@
    -
    - -
    + - - - + -
    - -
    + -
    - -
    +
    @@ -74,3 +66,8 @@ + \ No newline at end of file diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 125499a..229ef9f 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -1,4 +1,4 @@ -import {Component, inject, OnInit, signal} from '@angular/core'; +import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {NzTableComponent} from "ng-zorro-antd/table"; import {ModalButton} from "../modal-button/modal-button"; import {ModalNav} from "../modal-nav/modal-nav"; @@ -9,6 +9,7 @@ import {GetQuotationDto, QuotationsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; +import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form"; @Component({ selector: 'app-quotation-table', @@ -19,6 +20,7 @@ import {FileService} from "../../services/file.service"; NzIconDirective, NzTableComponent, QuotationForm, + DelivereryNoteForm, ], templateUrl: './quotation-table.html', styleUrl: './quotation-table.css', @@ -30,6 +32,7 @@ export class QuotationTable implements OnInit { private fileService = inject(FileService); quotations = signal([]); quotationsLoading = signal(false); + modal = viewChild.required('modalNav'); async ngOnInit() { await this.fetchQuotations(); @@ -84,5 +87,40 @@ export class QuotationTable implements OnInit { } this.quotationsLoading.set(false) } + + async edit(id: number, updateQuotationComponent: QuotationForm) { + if (updateQuotationComponent.quotationForm.invalid) { + this.notificationService.error('Erreur', 'Formulaire invalide'); + return; + } + + try { + const quotations = updateQuotationComponent.quotationForm.getRawValue(); + await firstValueFrom(this.quotationsService.updateQuotationEndpoint(id, quotations)); + this.notificationService.success('Success', 'Devis modifié') + } catch (e) { + console.error(e) + this.notificationService.error('Erreur', 'Erreur lors de la modification') + } + } + + selectedQuotation: GetQuotationDto | null = null; + openEditModal(quotation: GetQuotationDto) { + this.selectedQuotation = { ...quotation }; + this.modal().showModal(); + } + + async onModalOk(id: number, updateQuotationComponent: QuotationForm, modal: ModalNav) { + if (!this.selectedQuotation) return; + + await this.edit(id, updateQuotationComponent); + updateQuotationComponent.quotationForm.reset(); + modal.isVisible = false; + await this.fetchQuotations(); + } + + onModalCancel(modal: ModalNav) { + modal.isVisible = false; + } } diff --git a/src/app/services/api/model/update-quotation-dto.ts b/src/app/services/api/model/update-quotation-dto.ts new file mode 100644 index 0000000..5895594 --- /dev/null +++ b/src/app/services/api/model/update-quotation-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface UpdateQuotationDto { + message?: string | null; + conditionsSale?: string | null; +} + From 22e50a8deacb9db89820bf6b349d4143c613806c Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Fri, 12 Dec 2025 21:56:09 +0100 Subject: [PATCH 086/127] added edit function --- .../purchase-order-form.html | 2 +- .../purchase-order-form.ts | 16 ++++++- .../purchase-order-table.html | 26 +++++----- .../purchase-order-table.ts | 48 ++++++++++++++++++- .../quotation-table/quotation-table.ts | 2 - 5 files changed, 72 insertions(+), 22 deletions(-) diff --git a/src/app/components/purchase-order-form/purchase-order-form.html b/src/app/components/purchase-order-form/purchase-order-form.html index 096142e..6804075 100644 --- a/src/app/components/purchase-order-form/purchase-order-form.html +++ b/src/app/components/purchase-order-form/purchase-order-form.html @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/src/app/components/purchase-order-form/purchase-order-form.ts b/src/app/components/purchase-order-form/purchase-order-form.ts index f5175f8..81dfa89 100644 --- a/src/app/components/purchase-order-form/purchase-order-form.ts +++ b/src/app/components/purchase-order-form/purchase-order-form.ts @@ -1,9 +1,10 @@ -import { Component } from '@angular/core'; +import {Component, effect, input} from '@angular/core'; import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; +import {GetPurchaseOrderDto, GetQuotationDto} from "../../services/api"; @Component({ selector: 'app-purchase-order-form', @@ -23,6 +24,17 @@ import {NzInputDirective} from "ng-zorro-antd/input"; }) export class PurchaseOrderForm { purchaseOrderForm: FormGroup = new FormGroup({ - purchaseCondition: new FormControl(null,[Validators.required]) + purchaseConditions: new FormControl(null,[Validators.required]) }) + + purchaseOrder= input(); + constructor() { + effect(() => { + if (this.purchaseOrder()) { + this.purchaseOrderForm.patchValue({ + purchaseConditions: this.purchaseOrder().purchaseConditions, + }); + } + }); + } } diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 2779a74..7887718 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -54,28 +54,24 @@
    -
    - -
    + - - - + -
    - -
    + -
    - -
    + -
    - -
    +
    } + + \ No newline at end of file diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index b3eac7f..4e48c21 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -1,14 +1,16 @@ -import {Component, inject, OnInit, signal} from '@angular/core'; +import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; import {PurchaseOrderForm} from "../purchase-order-form/purchase-order-form"; import {ModalButton} from "../modal-button/modal-button"; -import {GetPurchaseOrderDto, PurchaseordersService} from "../../services/api"; +import {GetPurchaseOrderDto, GetQuotationDto, PurchaseordersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; +import {QuotationForm} from "../quotation-form/quotation-form"; +import {DelivererForm} from "../deliverer-form/deliverer-form"; @Component({ selector: 'app-purchase-order-table', @@ -19,6 +21,7 @@ import {FileService} from "../../services/file.service"; NzTableComponent, PurchaseOrderForm, ModalButton, + DelivererForm, ], templateUrl: './purchase-order-table.html', styleUrl: './purchase-order-table.css', @@ -29,6 +32,7 @@ export class PurchaseOrderTable implements OnInit { private fileService = inject(FileService); purchaseOrders = signal([]); purchaseOrdersLoading = signal(false); + modal = viewChild.required('modalNav'); async ngOnInit() { await this.fetchPurchaseOrder(); @@ -87,4 +91,44 @@ export class PurchaseOrderTable implements OnInit { transfer() { return } + + async edit(id: number, updatePurchaseOrderComponent: PurchaseOrderForm) { + if (updatePurchaseOrderComponent.purchaseOrderForm.invalid) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + return; + } + + try { + const purchaseOrders = updatePurchaseOrderComponent.purchaseOrderForm.getRawValue(); + await firstValueFrom(this.purchaseOrdersService.patchPurchaseOrderPurchaseConditionsEndpoint(id, purchaseOrders)) + + this.notificationService.success('Success', 'Bon de commande modifié') + } catch (e) { + this.notificationService.error('Erreur', 'Erreur lors de la modification') + } + } + + selectedPurchaseOrder: GetPurchaseOrderDto | null = null; + openEditModal(purchaseOrder: GetPurchaseOrderDto) { + this.selectedPurchaseOrder = { ...purchaseOrder }; + this.modal().showModal(); + } + + async onModalOk(id: number, updatePurchaseOrderComponent: PurchaseOrderForm, modal: ModalNav) { + if (!this.selectedPurchaseOrder) return; + + await this.edit(id, updatePurchaseOrderComponent); + updatePurchaseOrderComponent.purchaseOrderForm.reset(); + modal.isVisible = false; + await this.fetchPurchaseOrder(); + } + + onModalCancel(modal: ModalNav) { + modal.isVisible = false; + } + + protected readonly PurchaseOrderForm = PurchaseOrderForm; } diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 229ef9f..5c63d21 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -9,7 +9,6 @@ import {GetQuotationDto, QuotationsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; -import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form"; @Component({ selector: 'app-quotation-table', @@ -20,7 +19,6 @@ import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form"; NzIconDirective, NzTableComponent, QuotationForm, - DelivereryNoteForm, ], templateUrl: './quotation-table.html', styleUrl: './quotation-table.css', From 8124d83e791f923ce8613da27b6fcf298c5c855d Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 13 Dec 2025 12:10:51 +0100 Subject: [PATCH 087/127] added edit quantity function --- .../purchase-order-table.html | 16 +++-- .../purchase-order-table.ts | 66 +++++++++++++++++-- .../quantity-form/quantity-form.css | 0 .../quantity-form/quantity-form.html | 11 ++++ .../components/quantity-form/quantity-form.ts | 40 +++++++++++ src/app/services/api/.openapi-generator/FILES | 2 + .../api/api/purchaseorders.service.ts | 66 +++++++++++++++++++ .../api/model/create-purchase-order-dto.ts | 17 +++++ .../create-purchase-order-product-dto.ts | 16 +++++ .../api/model/get-purchase-order-dto.ts | 2 +- .../api/model/get-purchase-product-dto.ts | 2 +- src/app/services/api/model/models.ts | 2 + 12 files changed, 228 insertions(+), 12 deletions(-) create mode 100644 src/app/components/quantity-form/quantity-form.css create mode 100644 src/app/components/quantity-form/quantity-form.html create mode 100644 src/app/components/quantity-form/quantity-form.ts create mode 100644 src/app/services/api/model/create-purchase-order-dto.ts create mode 100644 src/app/services/api/model/create-purchase-order-product-dto.ts diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 7887718..97c9acd 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -32,7 +32,7 @@ - @for (product of purchaseOrder.getPurchaseProductDto; track product.productId) { + @for (product of purchaseOrder.products; track product.productId) { {{product.productName}} {{product.productReferences}} @@ -40,9 +40,9 @@ {{product.quantity}}
    -
    - -
    + + +
    @@ -54,7 +54,7 @@
    - + @@ -74,4 +74,10 @@ +
    + + \ No newline at end of file diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 4e48c21..1772417 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -5,12 +5,16 @@ import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzTableComponent} from "ng-zorro-antd/table"; import {PurchaseOrderForm} from "../purchase-order-form/purchase-order-form"; import {ModalButton} from "../modal-button/modal-button"; -import {GetPurchaseOrderDto, GetQuotationDto, PurchaseordersService} from "../../services/api"; +import { + GetPurchaseOrderDto, + GetPurchaseProductDto, + PurchaseordersService, + PurchaseproductsService +} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; -import {QuotationForm} from "../quotation-form/quotation-form"; -import {DelivererForm} from "../deliverer-form/deliverer-form"; +import {QuantityForm} from "../quantity-form/quantity-form"; @Component({ selector: 'app-purchase-order-table', @@ -21,7 +25,7 @@ import {DelivererForm} from "../deliverer-form/deliverer-form"; NzTableComponent, PurchaseOrderForm, ModalButton, - DelivererForm, + QuantityForm, ], templateUrl: './purchase-order-table.html', styleUrl: './purchase-order-table.css', @@ -30,9 +34,11 @@ export class PurchaseOrderTable implements OnInit { private purchaseOrdersService = inject(PurchaseordersService); private notificationService = inject(NzNotificationService); private fileService = inject(FileService); + private purchaseProductService = inject(PurchaseproductsService) purchaseOrders = signal([]); purchaseOrdersLoading = signal(false); modal = viewChild.required('modalNav'); + modalQuantity = viewChild.required('modalQuantity'); async ngOnInit() { await this.fetchPurchaseOrder(); @@ -111,6 +117,43 @@ export class PurchaseOrderTable implements OnInit { } } + async deleteProduct(productId: number, purchaseOrderId: number) { + this.purchaseOrdersLoading.set(true) + try { + await firstValueFrom(this.purchaseProductService.deletePurchaseProductEndpoint(productId, purchaseOrderId)) + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + this.purchaseOrdersLoading.set(false) + await this.fetchPurchaseOrder(); + } + + async editQuantity(productId: number, purchaseOrderId: number, updateQuantityComponent: QuantityForm) { + if (updateQuantityComponent.quantityForm.invalid) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + return; + } + + try { + const quantity = updateQuantityComponent.quantityForm.getRawValue(); + await firstValueFrom(this.purchaseProductService.patchPurchaseProductQuantityEndpoint(productId, purchaseOrderId, quantity)) + + this.notificationService.success('Success', 'Quantité modifiée') + } catch (e) { + this.notificationService.error('Erreur', 'Erreur lors de la modification') + } + } + selectedPurchaseOrder: GetPurchaseOrderDto | null = null; openEditModal(purchaseOrder: GetPurchaseOrderDto) { this.selectedPurchaseOrder = { ...purchaseOrder }; @@ -130,5 +173,18 @@ export class PurchaseOrderTable implements OnInit { modal.isVisible = false; } - protected readonly PurchaseOrderForm = PurchaseOrderForm; + selectedQuantity: GetPurchaseProductDto | null = null; + openEditQuantityModal(quantity: GetPurchaseProductDto) { + this.selectedQuantity = { ...quantity }; + this.modalQuantity().showModal(); + } + + async onModalQuantityOk(productId: number, purchaseOrderId: number, updateQuantityComponent: QuantityForm, modal: ModalNav) { + if (!this.selectedQuantity) return; + + await this.editQuantity(productId, purchaseOrderId, updateQuantityComponent); + updateQuantityComponent.quantityForm.reset(); + modal.isVisible = false; + await this.fetchPurchaseOrder(); + } } diff --git a/src/app/components/quantity-form/quantity-form.css b/src/app/components/quantity-form/quantity-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/quantity-form/quantity-form.html b/src/app/components/quantity-form/quantity-form.html new file mode 100644 index 0000000..0d987c5 --- /dev/null +++ b/src/app/components/quantity-form/quantity-form.html @@ -0,0 +1,11 @@ +
    + + + Quantité + + + + + + +
    diff --git a/src/app/components/quantity-form/quantity-form.ts b/src/app/components/quantity-form/quantity-form.ts new file mode 100644 index 0000000..fb3e87c --- /dev/null +++ b/src/app/components/quantity-form/quantity-form.ts @@ -0,0 +1,40 @@ +import {Component, effect, input} from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {GetDelivererDto, GetPurchaseProductDto} from "../../services/api"; + +@Component({ + selector: 'app-quantity-form', + imports: [ + FormsModule, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ReactiveFormsModule + ], + templateUrl: './quantity-form.html', + styleUrl: './quantity-form.css', +}) +export class QuantityForm { + quantityForm: FormGroup = new FormGroup({ + quantity: new FormControl(null, [Validators.required]) + }) + + quantity= input(); + constructor() { + effect(() => { + if (this.quantity()) { + this.quantityForm.patchValue({ + quantity: this.quantity().quantity + }); + } + }); + } +} diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index a90289b..0c304de 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -23,6 +23,8 @@ model/connect-user-dto.ts model/create-deliverer-dto.ts model/create-delivery-note-dto.ts model/create-price-dto.ts +model/create-purchase-order-dto.ts +model/create-purchase-order-product-dto.ts model/create-purchase-product-dto.ts model/create-quotation-product-dto.ts model/create-setting-dto.ts diff --git a/src/app/services/api/api/purchaseorders.service.ts b/src/app/services/api/api/purchaseorders.service.ts index 117aff2..87a17a6 100644 --- a/src/app/services/api/api/purchaseorders.service.ts +++ b/src/app/services/api/api/purchaseorders.service.ts @@ -16,6 +16,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +// @ts-ignore +import { CreatePurchaseOrderDto } from '../model/create-purchase-order-dto'; // @ts-ignore import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto'; // @ts-ignore @@ -37,6 +39,70 @@ export class PurchaseordersService extends BaseService { super(basePath, configuration); } + /** + * @endpoint post /API/purchaseOrders + * @param createPurchaseOrderDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createPurchaseOrderDto === null || createPurchaseOrderDto === undefined) { + throw new Error('Required parameter createPurchaseOrderDto was null or undefined when calling createPurchaseOrder.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseOrders`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createPurchaseOrderDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint delete /API/purchaseOrders/{id} * @param id diff --git a/src/app/services/api/model/create-purchase-order-dto.ts b/src/app/services/api/model/create-purchase-order-dto.ts new file mode 100644 index 0000000..0b3b3c5 --- /dev/null +++ b/src/app/services/api/model/create-purchase-order-dto.ts @@ -0,0 +1,17 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { CreatePurchaseOrderProductDto } from './create-purchase-order-product-dto'; + + +export interface CreatePurchaseOrderDto { + purchaseConditions?: string | null; + products?: Array | null; +} + diff --git a/src/app/services/api/model/create-purchase-order-product-dto.ts b/src/app/services/api/model/create-purchase-order-product-dto.ts new file mode 100644 index 0000000..256d725 --- /dev/null +++ b/src/app/services/api/model/create-purchase-order-product-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreatePurchaseOrderProductDto { + productId?: number; + quantity?: number; +} + diff --git a/src/app/services/api/model/get-purchase-order-dto.ts b/src/app/services/api/model/get-purchase-order-dto.ts index 9cde421..96950b2 100644 --- a/src/app/services/api/model/get-purchase-order-dto.ts +++ b/src/app/services/api/model/get-purchase-order-dto.ts @@ -13,6 +13,6 @@ import { GetPurchaseProductDto } from './get-purchase-product-dto'; export interface GetPurchaseOrderDto { id?: number; purchaseConditions?: string | null; - getPurchaseProductDto?: Array | null; + products?: Array | null; } diff --git a/src/app/services/api/model/get-purchase-product-dto.ts b/src/app/services/api/model/get-purchase-product-dto.ts index b7ad6ff..75b09fe 100644 --- a/src/app/services/api/model/get-purchase-product-dto.ts +++ b/src/app/services/api/model/get-purchase-product-dto.ts @@ -15,7 +15,7 @@ export interface GetPurchaseProductDto { productName?: string | null; productDuration?: number; productCaliber?: number; - productApprovalNumber?: number; + productApprovalNumber?: string | null; productWeight?: number; productNec?: number; productImage?: string | null; diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts index d228c54..56ec3fb 100644 --- a/src/app/services/api/model/models.ts +++ b/src/app/services/api/model/models.ts @@ -2,6 +2,8 @@ export * from './connect-user-dto'; export * from './create-deliverer-dto'; export * from './create-delivery-note-dto'; export * from './create-price-dto'; +export * from './create-purchase-order-dto'; +export * from './create-purchase-order-product-dto'; export * from './create-purchase-product-dto'; export * from './create-quotation-product-dto'; export * from './create-setting-dto'; From 9ebe8ab37edb77052f8e177d532fdf6a92be06e9 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 13 Dec 2025 14:31:54 +0100 Subject: [PATCH 088/127] added create purchase order function --- .../create-purchaseorder-form.css | 0 .../create-purchaseorder-form.html | 36 ++++++ .../create-purchaseorder-form.ts | 52 +++++++++ .../purchase-order-form.ts | 2 +- src/app/pages/stock/stock.html | 13 ++- src/app/pages/stock/stock.ts | 110 ++++++++++++------ 6 files changed, 171 insertions(+), 42 deletions(-) create mode 100644 src/app/components/create-purchaseorder-form/create-purchaseorder-form.css create mode 100644 src/app/components/create-purchaseorder-form/create-purchaseorder-form.html create mode 100644 src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.css b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html new file mode 100644 index 0000000..b90a5be --- /dev/null +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html @@ -0,0 +1,36 @@ +
    + + + Conditions générales de vente + + + + + + + +
    + + + + Produit + Quantité + + + + @for (line of lines.controls.slice(); let i = $index; track i) { + + {{ line.value.name }} + + + + + + } + + +
    +
    diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts new file mode 100644 index 0000000..2de6df9 --- /dev/null +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts @@ -0,0 +1,52 @@ +import { Component } from '@angular/core'; +import {FormBuilder, FormGroup, FormArray, Validators, ReactiveFormsModule, FormControl} from '@angular/forms'; +import { GetProductDto } from '../../services/api'; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; + +@Component({ + selector: 'app-create-purchaseorder-form', + templateUrl: './create-purchaseorder-form.html', + styleUrl: './create-purchaseorder-form.css', + imports: [ + ReactiveFormsModule, + NzTableComponent, + NzInputNumberComponent, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + ] +}) +export class CreatePurchaseorderForm { + createPurchaseOrderForm: FormGroup + + constructor(private fb: FormBuilder) { + this.createPurchaseOrderForm = this.fb.group({ + purchaseConditions: new FormControl(null, Validators.required), + lines: this.fb.array([]) + }); + } + + get lines(): FormArray { + return this.createPurchaseOrderForm.get('lines') as FormArray; + } + + // Ajouter des produits sélectionnés dans le formulaire + syncSelectedProducts(selectedProducts: GetProductDto[]) { + this.lines.clear(); + selectedProducts.forEach(p => { + this.lines.push(this.fb.group({ + productId: [p.id], + name: [p.name], + quantity: [1, [Validators.required, Validators.min(1)]] + })); + }); + } +} diff --git a/src/app/components/purchase-order-form/purchase-order-form.ts b/src/app/components/purchase-order-form/purchase-order-form.ts index 81dfa89..a36589b 100644 --- a/src/app/components/purchase-order-form/purchase-order-form.ts +++ b/src/app/components/purchase-order-form/purchase-order-form.ts @@ -4,7 +4,7 @@ import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; -import {GetPurchaseOrderDto, GetQuotationDto} from "../../services/api"; +import {GetPurchaseOrderDto} from "../../services/api"; @Component({ selector: 'app-purchase-order-form', diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index da6cbda..d44d876 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,10 +1,17 @@
    @if (hasSelection) { - - + + - + } diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index fb14314..fa0a89a 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -4,9 +4,10 @@ import {Search} from "../../components/search/search"; import {ModalButton} from "../../components/modal-button/modal-button"; import {PurchaseOrderForm} from "../../components/purchase-order-form/purchase-order-form"; import {QuotationForm} from "../../components/quotation-form/quotation-form"; -import {ProductsService} from "../../services/api"; +import {ProductsService, PurchaseordersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; +import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-form/create-purchaseorder-form"; @Component({ selector: 'app-stock', @@ -14,58 +15,85 @@ import {firstValueFrom} from "rxjs"; StockTable, Search, ModalButton, - PurchaseOrderForm, QuotationForm, + CreatePurchaseorderForm, ], templateUrl: './stock.html', styleUrl: './stock.css', }) export class Stock { - modal = viewChild.required('modalButton'); createQuotation = viewChild.required('quotationForm'); - createPurchaseOrder = viewChild.required('purchaseOrderForm'); + createPurchaseOrder = viewChild.required('purchaseOrderForm'); productTable = viewChild.required('stockTable'); private productsService = inject(ProductsService); + private purchaseordersService = inject(PurchaseordersService) private notificationService = inject(NzNotificationService) + modalButtonPurchaseOrder = viewChild.required('modalButtonPurchaseOrder'); onProductSearch(query: string) { this.productTable().applySearch(query); } - // async onModalOk() { - // await this.addSupplier() - // this.createSupplier().supplierForm.reset(); - // this.modal().isVisible = false; - // await this.supplierTable().fetchSuppliers() - // } - // - // onModalCancel() { - // this.modal().isVisible = false; - // } - // - // async addSupplier() { - // if (this.createSupplier().supplierForm.invalid) - // { - // this.notificationService.error( - // 'Erreur', - // 'Erreur d\'écriture dans le formulaire' - // ) - // } - // try { - // const suppliers = this.createSupplier().supplierForm.getRawValue(); - // await firstValueFrom(this.usersService.createSupplierEndpoint(suppliers)) - // - // this.notificationService.success( - // 'Success', - // 'Fournisseur enregistré' - // ) - // } catch (e) { - // this.notificationService.error( - // 'Erreur', - // 'Erreur d\'enregistrement' - // ) - // } - // } + + async addPurchaseOrder() { + if (this.createPurchaseOrder().createPurchaseOrderForm.invalid) return; + + const orderLines = this.createPurchaseOrder().lines.value.map(line => ({ + productId: line.productId, + quantity: line.quantity + })); + + try { + const purchaseOrder = this.createPurchaseOrder().createPurchaseOrderForm.getRawValue(); + await firstValueFrom(this.purchaseordersService.createPurchaseOrder(purchaseOrder)); + this.notificationService.success('Succès', 'Bon de commande crée') + }catch (e) { + console.error(e); + this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.') + } + } + + async onModalOk() { + const form = this.createPurchaseOrder().createPurchaseOrderForm; + + if (form.invalid) { + this.notificationService.error('Erreur', 'Formulaire invalide'); + return; + } + + const orderLines = this.createPurchaseOrder().lines.value.map(line => ({ + productId: line.productId, + quantity: line.quantity + })); + + if (orderLines.length === 0) { + this.notificationService.error('Erreur', 'Aucun produit sélectionné'); + return; + } + + const purchaseOrder = { + purchaseConditions: form.get('purchaseConditions')!.value, + products: orderLines + }; + console.log('DTO envoyé :', purchaseOrder); + try { + await firstValueFrom( + this.purchaseordersService.createPurchaseOrder(purchaseOrder) + ); + this.notificationService.success('Succès', 'Bon de commande créé'); + form.reset(); + this.modalButtonPurchaseOrder().isVisible = false; + await this.productTable().fetchProducts(); + + } catch (e) { + console.error(e); + this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.'); + } + } + + onModalCancel() { + this.modalButtonPurchaseOrder().isVisible = false; + } hasSelection = false; @@ -77,4 +105,10 @@ export class Stock { console.log(this.productTable().selectedIds); } + openPurchaseOrderForm() { + const selectedProducts = this.productTable().products().filter(p => + this.productTable().selectedIds.includes(p.id) + ); + this.createPurchaseOrder().syncSelectedProducts(selectedProducts); + } } From 8b7d48779eb987bd70dd5d9141f2f289bccd2f66 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 13 Dec 2025 15:50:59 +0100 Subject: [PATCH 089/127] added create quotation function and edit end delete product in quotation table --- .../create-quotation-form.css | 0 .../create-quotation-form.html | 46 +++++ .../create-quotation-form.ts | 62 +++++++ .../purchase-order-table.ts | 1 - .../quotation-table/quotation-table.html | 14 +- .../quotation-table/quotation-table.ts | 63 ++++++- src/app/pages/stock/stock.html | 11 +- src/app/pages/stock/stock.ts | 166 ++++++++++-------- src/app/services/api/.openapi-generator/FILES | 2 + .../services/api/api/quotations.service.ts | 66 +++++++ .../api/model/create-product-quotation-dto.ts | 16 ++ .../api/model/create-quotation-dto.ts | 18 ++ .../api/model/create-quotation-product-dto.ts | 2 +- .../services/api/model/get-quotation-dto.ts | 2 +- .../api/model/get-quotation-product-dto.ts | 2 +- src/app/services/api/model/models.ts | 2 + 16 files changed, 392 insertions(+), 81 deletions(-) create mode 100644 src/app/components/create-quotation-form/create-quotation-form.css create mode 100644 src/app/components/create-quotation-form/create-quotation-form.html create mode 100644 src/app/components/create-quotation-form/create-quotation-form.ts create mode 100644 src/app/services/api/model/create-product-quotation-dto.ts create mode 100644 src/app/services/api/model/create-quotation-dto.ts diff --git a/src/app/components/create-quotation-form/create-quotation-form.css b/src/app/components/create-quotation-form/create-quotation-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/create-quotation-form/create-quotation-form.html b/src/app/components/create-quotation-form/create-quotation-form.html new file mode 100644 index 0000000..74e0fdb --- /dev/null +++ b/src/app/components/create-quotation-form/create-quotation-form.html @@ -0,0 +1,46 @@ +
    + + + Message + + + + + + + + + + Conditions générales + + + + + + + +
    + + + + Produit + Quantité + + + + @for (line of lines.controls.slice(); let i = $index; track i) { + + {{ line.value.name }} + + + + + + } + + +
    +
    diff --git a/src/app/components/create-quotation-form/create-quotation-form.ts b/src/app/components/create-quotation-form/create-quotation-form.ts new file mode 100644 index 0000000..52d5543 --- /dev/null +++ b/src/app/components/create-quotation-form/create-quotation-form.ts @@ -0,0 +1,62 @@ +import { Component } from '@angular/core'; +import { + FormArray, + FormBuilder, + FormControl, + FormGroup, + FormsModule, + ReactiveFormsModule, + Validators +} from "@angular/forms"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {GetProductDto} from "../../services/api"; + +@Component({ + selector: 'app-create-quotation-form', + imports: [ + FormsModule, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + NzInputNumberComponent, + NzTableComponent, + ReactiveFormsModule + ], + templateUrl: './create-quotation-form.html', + styleUrl: './create-quotation-form.css', +}) +export class CreateQuotationForm { + createQuotationForm: FormGroup + + constructor(private fb: FormBuilder) { + this.createQuotationForm = this.fb.group({ + message: new FormControl(null, Validators.required), + purchaseConditions: new FormControl(null, Validators.required), + lines: this.fb.array([]) + }); + } + + get lines(): FormArray { + return this.createQuotationForm.get('lines') as FormArray; + } + + // Ajouter des produits sélectionnés dans le formulaire + syncSelectedProducts(selectedProducts: GetProductDto[]) { + this.lines.clear(); + selectedProducts.forEach(p => { + this.lines.push(this.fb.group({ + productId: [p.id], + name: [p.name], + quantity: [1, [Validators.required, Validators.min(1)]] + })); + }); + } +} diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 1772417..49f4e3b 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -85,7 +85,6 @@ export class PurchaseOrderTable implements OnInit { ); this.fileService.downloadBlob(pdf) } catch (e) { - console.error(e); this.notificationService.error( 'Erreur', 'Impossible de générer un PDF' diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 34309da..32787ab 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -32,15 +32,17 @@ - @for (product of quotation.getQuotationProductDto; track product.productId) { + @for (product of quotation.products; track product.productId) { {{ product.productReferences }} {{ product.productName }} Price ??? - Quantité ??? + {{ product.quantity }}
    - + + +
    @@ -70,4 +72,10 @@ +
    + + \ No newline at end of file diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 5c63d21..eab961d 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -5,10 +5,16 @@ import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {QuotationForm} from "../quotation-form/quotation-form"; -import {GetQuotationDto, QuotationsService} from "../../services/api"; +import { + GetQuotationDto, + GetQuotationProductDto, + QuotationproductsService, + QuotationsService +} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; +import {QuantityForm} from "../quantity-form/quantity-form"; @Component({ selector: 'app-quotation-table', @@ -19,6 +25,7 @@ import {FileService} from "../../services/file.service"; NzIconDirective, NzTableComponent, QuotationForm, + QuantityForm, ], templateUrl: './quotation-table.html', styleUrl: './quotation-table.css', @@ -27,10 +34,12 @@ import {FileService} from "../../services/file.service"; export class QuotationTable implements OnInit { private quotationsService = inject(QuotationsService); private notificationService = inject(NzNotificationService); + private quotationProductsService = inject(QuotationproductsService) private fileService = inject(FileService); quotations = signal([]); quotationsLoading = signal(false); modal = viewChild.required('modalNav'); + modalQuantity = viewChild.required('modalQuantity'); async ngOnInit() { await this.fetchQuotations(); @@ -102,6 +111,43 @@ export class QuotationTable implements OnInit { } } + async deleteProduct(productId: number, quotationId: number) { + this.quotationsLoading.set(true) + try { + await firstValueFrom(this.quotationProductsService.deleteQuotationProductEndpoint(productId, quotationId)) + this.notificationService.success( + 'Success', + 'Suppression effectuée' + ) + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Impossible de supprimer la ligne' + ) + } + this.quotationsLoading.set(false) + await this.fetchQuotations(); + } + + async editQuantity(productId: number, quotationId: number, updateQuantityComponent: QuantityForm) { + if (updateQuantityComponent.quantityForm.invalid) { + this.notificationService.error( + 'Erreur', + 'Erreur d\'écriture dans le formulaire' + ) + return; + } + + try { + const quantity = updateQuantityComponent.quantityForm.getRawValue(); + await firstValueFrom(this.quotationProductsService.patchQuotationProductQuantityEndpoint(productId, quotationId, quantity)) + + this.notificationService.success('Success', 'Quantité modifiée') + } catch (e) { + this.notificationService.error('Erreur', 'Erreur lors de la modification') + } + } + selectedQuotation: GetQuotationDto | null = null; openEditModal(quotation: GetQuotationDto) { this.selectedQuotation = { ...quotation }; @@ -120,5 +166,20 @@ export class QuotationTable implements OnInit { onModalCancel(modal: ModalNav) { modal.isVisible = false; } + + selectedQuantity: GetQuotationProductDto | null = null; + openEditQuantityModal(quantity: GetQuotationProductDto) { + this.selectedQuantity = { ...quantity }; + this.modalQuantity().showModal(); + } + + async onModalQuantityOk(productId: number, quotationId: number, updateQuantityComponent: QuantityForm, modal: ModalNav) { + if (!this.selectedQuantity) return; + + await this.editQuantity(productId, quotationId, updateQuantityComponent); + updateQuantityComponent.quantityForm.reset(); + modal.isVisible = false; + await this.fetchQuotations(); + } } diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index d44d876..f123e20 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -11,8 +11,15 @@ - - + + } diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index fa0a89a..4b53257 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -2,12 +2,12 @@ import {Component, inject, viewChild} from '@angular/core'; import {StockTable} from "../../components/stock-table/stock-table"; import {Search} from "../../components/search/search"; import {ModalButton} from "../../components/modal-button/modal-button"; -import {PurchaseOrderForm} from "../../components/purchase-order-form/purchase-order-form"; import {QuotationForm} from "../../components/quotation-form/quotation-form"; -import {ProductsService, PurchaseordersService} from "../../services/api"; +import {PurchaseordersService, QuotationsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-form/create-purchaseorder-form"; +import {CreateQuotationForm} from "../../components/create-quotation-form/create-quotation-form"; @Component({ selector: 'app-stock', @@ -15,85 +15,22 @@ import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-for StockTable, Search, ModalButton, - QuotationForm, CreatePurchaseorderForm, + CreateQuotationForm, ], templateUrl: './stock.html', styleUrl: './stock.css', }) export class Stock { - createQuotation = viewChild.required('quotationForm'); createPurchaseOrder = viewChild.required('purchaseOrderForm'); + createQuotation = viewChild.required('quotationForm'); productTable = viewChild.required('stockTable'); - private productsService = inject(ProductsService); private purchaseordersService = inject(PurchaseordersService) + private quotationsService = inject(QuotationsService) private notificationService = inject(NzNotificationService) modalButtonPurchaseOrder = viewChild.required('modalButtonPurchaseOrder'); - - onProductSearch(query: string) { - this.productTable().applySearch(query); - } - - async addPurchaseOrder() { - if (this.createPurchaseOrder().createPurchaseOrderForm.invalid) return; - - const orderLines = this.createPurchaseOrder().lines.value.map(line => ({ - productId: line.productId, - quantity: line.quantity - })); - - try { - const purchaseOrder = this.createPurchaseOrder().createPurchaseOrderForm.getRawValue(); - await firstValueFrom(this.purchaseordersService.createPurchaseOrder(purchaseOrder)); - this.notificationService.success('Succès', 'Bon de commande crée') - }catch (e) { - console.error(e); - this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.') - } - } - - async onModalOk() { - const form = this.createPurchaseOrder().createPurchaseOrderForm; - - if (form.invalid) { - this.notificationService.error('Erreur', 'Formulaire invalide'); - return; - } - - const orderLines = this.createPurchaseOrder().lines.value.map(line => ({ - productId: line.productId, - quantity: line.quantity - })); - - if (orderLines.length === 0) { - this.notificationService.error('Erreur', 'Aucun produit sélectionné'); - return; - } - - const purchaseOrder = { - purchaseConditions: form.get('purchaseConditions')!.value, - products: orderLines - }; - console.log('DTO envoyé :', purchaseOrder); - try { - await firstValueFrom( - this.purchaseordersService.createPurchaseOrder(purchaseOrder) - ); - this.notificationService.success('Succès', 'Bon de commande créé'); - form.reset(); - this.modalButtonPurchaseOrder().isVisible = false; - await this.productTable().fetchProducts(); - - } catch (e) { - console.error(e); - this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.'); - } - } - - onModalCancel() { - this.modalButtonPurchaseOrder().isVisible = false; - } + modalButtonQuotation = viewChild.required('modalButtonQuotation'); hasSelection = false; @@ -101,8 +38,48 @@ export class Stock { this.hasSelection = value; } - test(){ - console.log(this.productTable().selectedIds); + onProductSearch(query: string) { + this.productTable().applySearch(query); + } + + async addPurchaseOrder() { + const form = this.createPurchaseOrder().createPurchaseOrderForm; + if (form.invalid) { + this.notificationService.error('Erreur', 'Formulaire invalide'); + return; + } + const orderLines = this.createPurchaseOrder().lines.value.map(line => ({ + productId: line.productId, + quantity: line.quantity + })); + if (orderLines.length === 0) { + this.notificationService.error('Erreur', 'Aucun produit sélectionné'); + return; + } + const purchaseOrder = { + purchaseConditions: form.get('purchaseConditions')!.value, + products: orderLines + }; + try { + await firstValueFrom( + this.purchaseordersService.createPurchaseOrder(purchaseOrder) + ); + this.notificationService.success('Succès', 'Bon de commande créé'); + } catch (e) { + this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.'); + } + + } + + async onModalOk() { + await this.addPurchaseOrder(); + this.createPurchaseOrder().createPurchaseOrderForm.reset(); + this.modalButtonPurchaseOrder().isVisible = false; + await this.productTable().fetchProducts(); + } + + onModalCancel() { + this.modalButtonPurchaseOrder().isVisible = false; } openPurchaseOrderForm() { @@ -111,4 +88,51 @@ export class Stock { ); this.createPurchaseOrder().syncSelectedProducts(selectedProducts); } + + async addQuotation() { + if (this.createQuotation().createQuotationForm.invalid) { + this.notificationService.error('Erreur', 'Formulaire invalide'); + return; + } + const orderLines = this.createQuotation().lines.value.map(line => ({ + productId: line.productId, + quantity: line.quantity + })); + if (orderLines.length === 0) { + this.notificationService.error('Erreur', 'Aucun produit sélectionné'); + return; + } + const quotation = { + message: this.createQuotation().createQuotationForm.get('message')!.value, + purchaseConditions: this.createQuotation().createQuotationForm.get('purchaseConditions')!.value, + products: orderLines + }; + try { + await firstValueFrom( + this.quotationsService.createQuotationEndpoint(quotation) + ); + this.notificationService.success('Succès', 'Devis créé'); + } catch (e) { + this.notificationService.error('Erreur', 'Erreur lors de la création du devis.'); + } + + } + + async onModalQuotationOk() { + await this.addQuotation(); + this.createQuotation().createQuotationForm.reset(); + this.modalButtonQuotation().isVisible = false; + await this.productTable().fetchProducts(); + } + + onModalQuotationCancel() { + this.modalButtonQuotation().isVisible = false; + } + + openQuotationForm() { + const selectedProducts = this.productTable().products().filter(p => + this.productTable().selectedIds.includes(p.id) + ); + this.createQuotation().syncSelectedProducts(selectedProducts); + } } diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 0c304de..c32abf7 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -23,9 +23,11 @@ model/connect-user-dto.ts model/create-deliverer-dto.ts model/create-delivery-note-dto.ts model/create-price-dto.ts +model/create-product-quotation-dto.ts model/create-purchase-order-dto.ts model/create-purchase-order-product-dto.ts model/create-purchase-product-dto.ts +model/create-quotation-dto.ts model/create-quotation-product-dto.ts model/create-setting-dto.ts model/create-supplier-dto.ts diff --git a/src/app/services/api/api/quotations.service.ts b/src/app/services/api/api/quotations.service.ts index 07ec481..7c925c7 100644 --- a/src/app/services/api/api/quotations.service.ts +++ b/src/app/services/api/api/quotations.service.ts @@ -16,6 +16,8 @@ import { HttpClient, HttpHeaders, HttpParams, import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; +// @ts-ignore +import { CreateQuotationDto } from '../model/create-quotation-dto'; // @ts-ignore import { GetQuotationDto } from '../model/get-quotation-dto'; // @ts-ignore @@ -39,6 +41,70 @@ export class QuotationsService extends BaseService { super(basePath, configuration); } + /** + * @endpoint post /API/quotations + * @param createQuotationDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createQuotationDto === null || createQuotationDto === undefined) { + throw new Error('Required parameter createQuotationDto was null or undefined when calling createQuotationEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createQuotationDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint delete /API/quotations/{id} * @param id diff --git a/src/app/services/api/model/create-product-quotation-dto.ts b/src/app/services/api/model/create-product-quotation-dto.ts new file mode 100644 index 0000000..76033ca --- /dev/null +++ b/src/app/services/api/model/create-product-quotation-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface CreateProductQuotationDto { + productId?: number; + quantity?: number; +} + diff --git a/src/app/services/api/model/create-quotation-dto.ts b/src/app/services/api/model/create-quotation-dto.ts new file mode 100644 index 0000000..7b6faaa --- /dev/null +++ b/src/app/services/api/model/create-quotation-dto.ts @@ -0,0 +1,18 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { CreateProductQuotationDto } from './create-product-quotation-dto'; + + +export interface CreateQuotationDto { + message?: string | null; + conditionsSale?: string | null; + products?: Array | null; +} + diff --git a/src/app/services/api/model/create-quotation-product-dto.ts b/src/app/services/api/model/create-quotation-product-dto.ts index 95a3c60..b6ea6d3 100644 --- a/src/app/services/api/model/create-quotation-product-dto.ts +++ b/src/app/services/api/model/create-quotation-product-dto.ts @@ -19,7 +19,7 @@ export interface CreateQuotationProductDto { productName?: string | null; productDuration?: number; productCaliber?: number; - productApprovalNumber?: number; + productApprovalNumber?: string | null; productWeight?: number; productNec?: number; productImage?: string | null; diff --git a/src/app/services/api/model/get-quotation-dto.ts b/src/app/services/api/model/get-quotation-dto.ts index 2143ee1..a8d25be 100644 --- a/src/app/services/api/model/get-quotation-dto.ts +++ b/src/app/services/api/model/get-quotation-dto.ts @@ -14,6 +14,6 @@ export interface GetQuotationDto { id?: number; message?: string | null; conditionsSale?: string | null; - getQuotationProductDto?: Array | null; + products?: Array | null; } diff --git a/src/app/services/api/model/get-quotation-product-dto.ts b/src/app/services/api/model/get-quotation-product-dto.ts index 09ca5f0..89eb74d 100644 --- a/src/app/services/api/model/get-quotation-product-dto.ts +++ b/src/app/services/api/model/get-quotation-product-dto.ts @@ -19,7 +19,7 @@ export interface GetQuotationProductDto { productName?: string | null; productDuration?: number; productCaliber?: number; - productApprovalNumber?: number; + productApprovalNumber?: string | null; productWeight?: number; productNec?: number; productImage?: string | null; diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts index 56ec3fb..f8ad444 100644 --- a/src/app/services/api/model/models.ts +++ b/src/app/services/api/model/models.ts @@ -2,9 +2,11 @@ export * from './connect-user-dto'; export * from './create-deliverer-dto'; export * from './create-delivery-note-dto'; export * from './create-price-dto'; +export * from './create-product-quotation-dto'; export * from './create-purchase-order-dto'; export * from './create-purchase-order-product-dto'; export * from './create-purchase-product-dto'; +export * from './create-quotation-dto'; export * from './create-quotation-product-dto'; export * from './create-setting-dto'; export * from './create-supplier-dto'; From 5e039281de4b902e6089ca8b9f36a7c1b37d9604 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 20 Dec 2025 13:58:49 +0100 Subject: [PATCH 090/127] first commit --- src/app/services/api/api/products.service.ts | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/app/services/api/api/products.service.ts b/src/app/services/api/api/products.service.ts index 65263c5..a1e6451 100644 --- a/src/app/services/api/api/products.service.ts +++ b/src/app/services/api/api/products.service.ts @@ -142,6 +142,56 @@ export class ProductsService extends BaseService { ); } + /** + * @endpoint get /API/products/underLimit + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllProductsUnderLimitEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllProductsUnderLimitEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllProductsUnderLimitEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/products/underLimit`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint get /API/products/{id} * @param id From cb4686765b1abe1c1a2091646e9fb498b53f90fd Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sat, 20 Dec 2025 16:46:46 +0100 Subject: [PATCH 091/127] created function for create delivery note --- .../deliverery-note-form.ts | 4 +- .../deliverery-note-table.html | 26 ---------- .../deliverery-note-table.ts | 4 +- .../purchase-order-table.html | 2 +- .../purchase-order-table.ts | 51 +++++++++++++++++-- .../pages/delivery-note/delivery-note.html | 4 -- src/app/pages/delivery-note/delivery-note.ts | 2 - .../api/model/get-product-delivery-dto.ts | 4 +- 8 files changed, 54 insertions(+), 43 deletions(-) diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index 9ee8ec5..06dd7a1 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -63,8 +63,8 @@ export class DelivereryNoteForm implements OnInit { this.deliveryNoteForm.patchValue({ trackingNumber: this.deliveryNote().trackingNumber, expeditionDate: this.deliveryNote().expeditionDate, - realDeliveryDate: this.deliveryNote().expeditionDate, - estimatedDate: this.deliveryNote().expeditionDate, + realDeliveryDate: this.deliveryNote().realDeliveryDate, + estimatedDate: this.deliveryNote().estimateDeliveryDate, delivererId: this.deliveryNote().delivererId }); } diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index c16ebd3..1189394 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -9,7 +9,6 @@ Date d'expédition Date de livraison estimée Date de livraison réelle - Produits Action @@ -21,31 +20,6 @@ {{deliveryNote.expeditionDate | date: 'dd/MM/yyyy'}} {{deliveryNote.estimateDeliveryDate | date: 'dd/MM/yyyy'}} {{deliveryNote.realDeliveryDate | date: 'dd/MM/yyyy'}} - - -
    - - - - Réference - Nom - Quantité - - - - @for (product of deliveryNote.products; track product.productId) { - - {{product.productReference}} - {{product.productName}} - {{product.quantity}} - - } - - -
    -
    -
    diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.ts b/src/app/components/deliverery-note-table/deliverery-note-table.ts index 4a31036..c717d0a 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.ts +++ b/src/app/components/deliverery-note-table/deliverery-note-table.ts @@ -1,6 +1,5 @@ import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {DatePipe} from "@angular/common"; -import {ModalButton} from "../modal-button/modal-button"; import {ModalNav} from "../modal-nav/modal-nav"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzIconDirective} from "ng-zorro-antd/icon"; @@ -15,7 +14,6 @@ import {FileService} from "../../services/file.service"; @Component({ selector: 'app-deliverery-note-table', imports: [ - ModalButton, ModalNav, NzDividerComponent, NzIconDirective, @@ -41,7 +39,7 @@ export class DelivereryNoteTable implements OnInit { async fetchDeliveryNotes() { this.deliveryNotesLoading.set(true) try { - const deliveryNotes = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNoteEndpoint()) + const deliveryNotes = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNoteEndpoint()); this.deliveryNotes.set(deliveryNotes); } catch (e) { this.notificationService.error( diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 97c9acd..49e5ff8 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -62,7 +62,7 @@ - +
    diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 49f4e3b..6210d50 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -6,6 +6,9 @@ import {NzTableComponent} from "ng-zorro-antd/table"; import {PurchaseOrderForm} from "../purchase-order-form/purchase-order-form"; import {ModalButton} from "../modal-button/modal-button"; import { + CreateDeliveryNoteDto, + DeliverynotesService, + GetDeliveryNoteDto, GetProductDeliveryDto, GetPurchaseOrderDto, GetPurchaseProductDto, PurchaseordersService, @@ -15,6 +18,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; import {QuantityForm} from "../quantity-form/quantity-form"; +import {PurchaseOrder} from "../../pages/purchase-order/purchase-order"; @Component({ selector: 'app-purchase-order-table', @@ -34,7 +38,8 @@ export class PurchaseOrderTable implements OnInit { private purchaseOrdersService = inject(PurchaseordersService); private notificationService = inject(NzNotificationService); private fileService = inject(FileService); - private purchaseProductService = inject(PurchaseproductsService) + private purchaseProductService = inject(PurchaseproductsService); + private deliveryNoteService = inject(DeliverynotesService); purchaseOrders = signal([]); purchaseOrdersLoading = signal(false); modal = viewChild.required('modalNav'); @@ -93,10 +98,50 @@ export class PurchaseOrderTable implements OnInit { this.purchaseOrdersLoading.set(false) } - transfer() { - return + async transfer(purchaseOrder: GetPurchaseOrderDto) { + this.purchaseOrdersLoading.set(true); + try { + const today = new Date(); + const date = today.toISOString().split('T')[0]; // yyyy-mm-dd + + const futureDate = new Date(today); + futureDate.setMonth(today.getMonth() + 2); + const yyyy = futureDate.getFullYear(); + const mm = (futureDate.getMonth() + 1).toString().padStart(2, '0'); + const dd = futureDate.getDate().toString().padStart(2, '0'); + const estimateDate = `${yyyy}-${mm}-${dd}`; + + let trackingValue = 'TRK-'; + const idStr = purchaseOrder.id?.toString() ?? ''; + if (idStr.length < 2) trackingValue += '00' + idStr + '-' + date; + else if (idStr.length < 3) trackingValue += '0' + idStr + '-' + date; + else trackingValue += idStr.substring(0, 3) + date.replace(/-/g, ''); + + const productQuantities: Record = {}; + purchaseOrder.products?.forEach(p => { + if(p.productId != null && p.quantity != null) { + productQuantities[p.productId] = p.quantity; + } + }); + + const deliveryNoteDto: CreateDeliveryNoteDto = { + trackingNumber: trackingValue, + expeditionDate: date, + estimateDeliveryDate: estimateDate, + delivererId: 1, + productQuantities: productQuantities + }; + + await firstValueFrom(this.deliveryNoteService.createDeliveryNoteEndpoint(deliveryNoteDto)); + this.notificationService.success('Succès', 'Bon de livraison créé avec succès'); + } catch (e) { + console.error(e); + this.notificationService.error('Erreur', 'Erreur lors du transfert'); + } + this.purchaseOrdersLoading.set(false); } + async edit(id: number, updatePurchaseOrderComponent: PurchaseOrderForm) { if (updatePurchaseOrderComponent.purchaseOrderForm.invalid) { this.notificationService.error( diff --git a/src/app/pages/delivery-note/delivery-note.html b/src/app/pages/delivery-note/delivery-note.html index 1524126..ac33ecb 100644 --- a/src/app/pages/delivery-note/delivery-note.html +++ b/src/app/pages/delivery-note/delivery-note.html @@ -1,8 +1,4 @@
    - - - -
    diff --git a/src/app/pages/delivery-note/delivery-note.ts b/src/app/pages/delivery-note/delivery-note.ts index 2183f24..26e00a0 100644 --- a/src/app/pages/delivery-note/delivery-note.ts +++ b/src/app/pages/delivery-note/delivery-note.ts @@ -8,8 +8,6 @@ import {Search} from "../../components/search/search"; selector: 'app-delivery-note', imports: [ DelivereryNoteTable, - ModalButton, - DelivereryNoteForm, Search ], templateUrl: './delivery-note.html', diff --git a/src/app/services/api/model/get-product-delivery-dto.ts b/src/app/services/api/model/get-product-delivery-dto.ts index 5363cef..3bcbb83 100644 --- a/src/app/services/api/model/get-product-delivery-dto.ts +++ b/src/app/services/api/model/get-product-delivery-dto.ts @@ -11,11 +11,11 @@ export interface GetProductDeliveryDto { productId?: number; - productReference?: number; + productReference?: string | null; productName?: string | null; productDuration?: number; productCaliber?: number; - productApprovalNumber?: number; + productApprovalNumber?: string | null; productWeight?: number; productNec?: number; productImage?: string | null; From b03196ce0f2c88f7e689a965af04f81829ccef01 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 10:40:08 +0100 Subject: [PATCH 092/127] deleted notifs components --- package-lock.json | 12 +- package.json | 4 +- src/app/app.config.ts | 24 +- src/app/app.html | 9 +- src/app/app.routes.ts | 2 +- src/app/app.ts | 18 +- .../create-purchaseorder-form.ts | 4 +- .../create-quotation-form.ts | 8 +- .../deliverer-form/deliverer-form.ts | 9 +- .../deliverer-table/deliverer-table.css | 7 +- .../deliverer-table/deliverer-table.html | 27 +- .../deliverer-table/deliverer-table.ts | 11 +- .../deliverery-note-form.html | 3 +- .../deliverery-note-form.ts | 13 +- .../deliverery-note-table.css | 7 +- .../deliverery-note-table.html | 52 +- .../deliverery-note-table.ts | 13 +- .../delivery-validator/delivery-validator.css | 15 +- .../delivery-validator.html | 5 +- .../delivery-validator/delivery-validator.ts | 30 +- src/app/components/info-card/info-card.html | 4 +- src/app/components/info-card/info-card.ts | 6 +- src/app/components/info-table/info-table.css | 11 +- src/app/components/info-table/info-table.ts | 50 +- .../components/modal-button/modal-button.html | 2 +- src/app/components/modal-nav/modal-nav.ts | 4 +- src/app/components/notif-list/notif-list.css | 0 src/app/components/notif-list/notif-list.html | 34 - src/app/components/notif-list/notif-list.ts | 92 --- src/app/components/price-form/price-form.ts | 9 +- .../components/product-form/product-form.ts | 8 +- .../components/product-table/product-table.ts | 13 +- src/app/components/profil-form/profil-form.ts | 7 +- src/app/components/profil/profil.html | 6 +- src/app/components/profil/profil.ts | 18 +- .../purchase-order-form.ts | 11 +- .../purchase-order-table.css | 7 +- .../purchase-order-table.html | 35 +- .../purchase-order-table.ts | 18 +- .../components/quantity-form/quantity-form.ts | 9 +- .../quotation-form/quotation-form.ts | 3 +- .../quotation-table/quotation-table.css | 7 +- .../quotation-table/quotation-table.html | 33 +- .../quotation-table/quotation-table.ts | 10 +- src/app/components/search/search.ts | 8 +- .../components/setting-form/setting-form.html | 4 +- .../components/setting-form/setting-form.ts | 8 +- src/app/components/stock-form/stock-form.ts | 9 +- .../components/stock-table/stock-table.css | 7 +- .../components/stock-table/stock-table.html | 17 +- src/app/components/stock-table/stock-table.ts | 8 +- .../components/supplier-form/supplier-form.ts | 3 +- .../supplier-table/supplier-table.css | 7 +- .../supplier-table/supplier-table.html | 3 +- .../supplier-table/supplier-table.ts | 4 +- src/app/components/user-table/user-table.css | 7 +- src/app/components/user-table/user-table.html | 17 +- src/app/components/user-table/user-table.ts | 13 +- src/app/interfaces/notif.interface.ts | 5 - src/app/pages/deliverer/deliverer.ts | 9 +- src/app/pages/delivery-note/delivery-note.ts | 8 +- .../pages/purchase-order/purchase-order.ts | 8 +- src/app/pages/quotation/quotation.ts | 8 +- src/app/pages/stock/stock.ts | 6 +- src/app/pages/supplier/supplier.ts | 9 +- src/app/pages/user/user.ts | 9 +- src/app/pages/welcome/welcome.html | 6 +- src/app/pages/welcome/welcome.routes.ts | 6 +- src/app/pages/welcome/welcome.ts | 8 +- src/app/services/api/.openapi-generator/FILES | 6 +- src/app/services/api/README.md | 6 +- src/app/services/api/api.base.service.ts | 12 +- src/app/services/api/api.module.ts | 22 +- src/app/services/api/api/api.ts | 36 +- .../services/api/api/deliverers.service.ts | 225 ++++-- .../services/api/api/deliverynotes.service.ts | 331 +++++--- src/app/services/api/api/prices.service.ts | 213 ++---- src/app/services/api/api/products.service.ts | 279 +++++-- .../api/api/purchaseorders.service.ts | 583 ++++++++++++-- .../api/api/purchaseproducts.service.ts | 235 ------ .../api/api/quotationproducts.service.ts | 235 ------ .../services/api/api/quotations.service.ts | 715 +++++++++++++++--- src/app/services/api/api/settings.service.ts | 259 +++++-- src/app/services/api/api/suppliers.service.ts | 489 +++++++++--- src/app/services/api/api/users.service.ts | 307 ++++++-- .../api/api/warehouseproducts.service.ts | 128 +++- src/app/services/api/configuration.ts | 26 +- src/app/services/api/encoder.ts | 5 +- .../api/model/add-quotation-product-dto.ts | 16 + .../services/api/model/connect-user-dto.ts | 4 +- .../api/model/create-deliverer-dto.ts | 4 +- .../api/model/create-delivery-note-dto.ts | 4 +- .../services/api/model/create-price-dto.ts | 23 +- .../api/model/create-product-quotation-dto.ts | 4 +- .../api/model/create-purchase-order-dto.ts | 6 +- .../create-purchase-order-product-dto.ts | 4 +- .../api/model/create-purchase-product-dto.ts | 7 +- .../api/model/create-quotation-dto.ts | 6 +- .../api/model/create-quotation-product-dto.ts | 29 - .../services/api/model/create-setting-dto.ts | 8 +- .../services/api/model/create-supplier-dto.ts | 4 +- src/app/services/api/model/create-user-dto.ts | 4 +- .../services/api/model/get-deliverer-dto.ts | 6 +- .../api/model/get-delivery-note-dto.ts | 6 +- src/app/services/api/model/get-price-dto.ts | 15 +- .../api/model/get-product-delivery-dto.ts | 11 +- src/app/services/api/model/get-product-dto.ts | 4 +- .../api/model/get-purchase-order-dto.ts | 7 +- .../api/model/get-purchase-product-dto.ts | 9 +- .../services/api/model/get-quotation-dto.ts | 6 +- .../api/model/get-quotation-product-dto.ts | 9 +- src/app/services/api/model/get-setting-dto.ts | 4 +- .../services/api/model/get-supplier-dto.ts | 8 +- src/app/services/api/model/get-token-dto.ts | 4 +- .../api/model/get-total-quantity-dto.ts | 4 +- src/app/services/api/model/get-user-dto.ts | 4 +- .../api/model/get-ware-house-product-dto.ts | 4 +- src/app/services/api/model/models.ts | 3 +- ...ch-delivery-note-real-delivery-date-dto.ts | 4 +- .../model/patch-price-selling-price-dto.ts | 4 +- .../model/patch-product-minimal-stock-dto.ts | 4 +- ...-purchase-order-purchase-conditions-dto.ts | 4 +- .../patch-purchase-product-quantity-dto.ts | 4 +- .../patch-quotation-conditions-sale-dto.ts | 4 +- .../api/model/patch-quotation-message-dto.ts | 15 + .../patch-quotation-product-quantity-dto.ts | 4 +- .../patch-setting-electronic-signature-dto.ts | 6 +- .../api/model/patch-setting-logo-dto.ts | 6 +- .../patch-supplier-delivery-delay-dto.ts | 4 +- .../api/model/patch-user-password-dto.ts | 4 +- .../patch-ware-house-product-quantity-dto.ts | 4 +- .../api/model/update-deliverer-dto.ts | 4 +- .../api/model/update-delivery-note-dto.ts | 4 +- .../services/api/model/update-product-dto.ts | 4 +- .../api/model/update-quotation-dto.ts | 4 +- .../services/api/model/update-supplier-dto.ts | 4 +- src/app/services/api/model/update-user-dto.ts | 4 +- src/app/services/api/param.ts | 64 +- src/app/services/api/provide-api.ts | 10 +- src/app/services/api/variables.ts | 2 +- src/app/services/file.service.ts | 8 +- src/index.html | 13 +- src/main.ts | 8 +- src/theme.less | 1 - 144 files changed, 3346 insertions(+), 2057 deletions(-) delete mode 100644 src/app/components/notif-list/notif-list.css delete mode 100644 src/app/components/notif-list/notif-list.html delete mode 100644 src/app/components/notif-list/notif-list.ts delete mode 100644 src/app/interfaces/notif.interface.ts delete mode 100644 src/app/services/api/api/purchaseproducts.service.ts delete mode 100644 src/app/services/api/api/quotationproducts.service.ts create mode 100644 src/app/services/api/model/add-quotation-product-dto.ts delete mode 100644 src/app/services/api/model/create-quotation-product-dto.ts create mode 100644 src/app/services/api/model/patch-quotation-message-dto.ts diff --git a/package-lock.json b/package-lock.json index 488f3a4..ce8b605 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "@angular/build": "^20.3.9", "@angular/cli": "^20.3.9", "@angular/compiler-cli": "^20.3.0", + "baseline-browser-mapping": "^2.10.32", "less": "^4.2.0", "typescript": "~5.9.2" } @@ -4315,13 +4316,16 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.8.27", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.27.tgz", - "integrity": "sha512-2CXFpkjVnY2FT+B6GrSYxzYf65BJWEqz5tIRHCvNsZZ2F3CmsCB37h8SpYgKG7y9C4YAeTipIPWG7EmFmhAeXA==", + "version": "2.10.32", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.32.tgz", + "integrity": "sha512-wbPvpyjJPC0zdfdKXxqEL3Ea+bOMD/87X4lftiJkkaBiuG6ALQy1SLmEd7BSmVCuwCQsBrCamgBoLyfFDD1EPg==", "dev": true, "license": "Apache-2.0", "bin": { - "baseline-browser-mapping": "dist/cli.js" + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" } }, "node_modules/basic-ftp": { diff --git a/package.json b/package.json index 8328499..5b9e439 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,7 @@ "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", - "openapi": "rm -rf src/app/services/api && openapi-generator-cli generate -i http://localhost:5298/swagger/v1/swagger.json -g typescript-angular -o src/app/services/api -c openapi-generator.yaml", - "openapiWin": "set JAVA_TOOL_OPTIONS=-Dcom.sun.net.ssl.checkRevocation=false -Djavax.net.ssl.trustStoreType=WINDOWS-ROOT && openapi-generator-cli generate -i https://localhost:44379/swagger/v1/swagger.json -g typescript-angular -o src/app/services/api -c openapi-generator.yaml\n" + "openapi": "rimraf src/app/services/api && openapi-generator-cli generate -i http://localhost:5298/swagger/v1/swagger.json -g typescript-angular -o src/app/services/api -c openapi-generator.yaml" }, "prettier": { "printWidth": 100, @@ -43,6 +42,7 @@ "@angular/build": "^20.3.9", "@angular/cli": "^20.3.9", "@angular/compiler-cli": "^20.3.0", + "baseline-browser-mapping": "^2.10.32", "less": "^4.2.0", "typescript": "~5.9.2" } diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 010986a..ee8ef76 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,19 +1,19 @@ -import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core'; -import { provideRouter } from '@angular/router'; +import {ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection} from '@angular/core'; +import {provideRouter} from '@angular/router'; -import { routes } from './app.routes'; -import { fr_FR, provideNzI18n } from 'ng-zorro-antd/i18n'; -import { registerLocaleData } from '@angular/common'; +import {routes} from './app.routes'; +import {fr_FR, provideNzI18n} from 'ng-zorro-antd/i18n'; +import {registerLocaleData} from '@angular/common'; import fr from '@angular/common/locales/fr'; -import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; -import { provideHttpClient } from '@angular/common/http'; +import {provideAnimationsAsync} from '@angular/platform-browser/animations/async'; +import {provideHttpClient} from '@angular/common/http'; registerLocaleData(fr); export const appConfig: ApplicationConfig = { - providers: [ - provideBrowserGlobalErrorListeners(), - provideZoneChangeDetection({ eventCoalescing: true }), - provideRouter(routes), provideNzI18n(fr_FR), provideAnimationsAsync(), provideHttpClient() - ] + providers: [ + provideBrowserGlobalErrorListeners(), + provideZoneChangeDetection({eventCoalescing: true}), + provideRouter(routes), provideNzI18n(fr_FR), provideAnimationsAsync(), provideHttpClient() + ] }; diff --git a/src/app/app.html b/src/app/app.html index 413ed55..9087561 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -5,9 +5,9 @@ diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index fbf55ca..a60b085 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -96,12 +96,12 @@ export class SupplierTable implements OnInit { } openEditModal(supplier: GetSupplierDto) { - this.selectedSupplier = { ...supplier }; + this.selectedSupplier = {...supplier}; this.supplierModal().showModal(); } openEditProductModal(product: GetPriceDto, supplierId: number) { - this.selectedProduct = { ...product }; + this.selectedProduct = {...product}; this.selectedProductSupplierId = supplierId; this.productModal().showModal(); } diff --git a/src/app/components/user-table/user-table.css b/src/app/components/user-table/user-table.css index 7ae664f..c804da2 100644 --- a/src/app/components/user-table/user-table.css +++ b/src/app/components/user-table/user-table.css @@ -6,7 +6,7 @@ nz-table { background: #fff; border-radius: 8px; overflow: hidden; - box-shadow: 0 2px 6px rgba(0,0,0,0.1); + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } @@ -66,18 +66,21 @@ nz-table tbody td p { nz-table thead { display: none; } + nz-table tbody tr { display: block; margin-bottom: 16px; - box-shadow: 0 1px 3px rgba(0,0,0,0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); border-radius: 8px; padding: 12px; } + nz-table tbody td { display: flex; justify-content: space-between; padding: 6px 12px; } + nz-table tbody td::before { content: attr(data-label); font-weight: 600; diff --git a/src/app/components/user-table/user-table.html b/src/app/components/user-table/user-table.html index 074759b..dfbccb2 100644 --- a/src/app/components/user-table/user-table.html +++ b/src/app/components/user-table/user-table.html @@ -2,7 +2,7 @@ [nzLoading]="usersLoading()" [nzFrontPagination]="false" class="mr-7"> - + Prénom Email @@ -13,15 +13,17 @@ @for (user of users(); track user.id) { - {{user.name}} - {{user.email}} - {{user.fonction}} + {{ user.name }} + {{ user.email }} + {{ user.fonction }}
    - +
    - +
    @@ -31,7 +33,8 @@ diff --git a/src/app/components/user-table/user-table.ts b/src/app/components/user-table/user-table.ts index 4c24792..1ec91b0 100644 --- a/src/app/components/user-table/user-table.ts +++ b/src/app/components/user-table/user-table.ts @@ -9,7 +9,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @Component({ - selector: 'app-user-table', + selector: 'app-user-table', imports: [ ModalNav, NzIconDirective, @@ -17,8 +17,8 @@ import {firstValueFrom} from "rxjs"; ProfilForm, NzDividerComponent ], - templateUrl: './user-table.html', - styleUrl: './user-table.css', + templateUrl: './user-table.html', + styleUrl: './user-table.css', }) export class UserTable implements OnInit { private usersService = inject(UsersService); @@ -47,7 +47,7 @@ export class UserTable implements OnInit { this.usersLoading.set(false) } - async delete(user:number) { + async delete(user: number) { try { await firstValueFrom(this.usersService.deleteUserEndpoint(user)) this.notificationService.success( @@ -89,8 +89,9 @@ export class UserTable implements OnInit { } selectedUser: GetUserDto | null = null; + openEditModal(user: GetUserDto) { - this.selectedUser = { ...user }; + this.selectedUser = {...user}; this.modal().showModal(); } @@ -102,9 +103,11 @@ export class UserTable implements OnInit { modal.isVisible = false; await this.fetchUsers(); } + onModalCancel(modal: ModalNav) { modal.isVisible = false; } + filterUser(input: string, option: any) { return option.nzLabel.toLowerCase().includes(input.toLowerCase()); } diff --git a/src/app/interfaces/notif.interface.ts b/src/app/interfaces/notif.interface.ts deleted file mode 100644 index ff5ce4f..0000000 --- a/src/app/interfaces/notif.interface.ts +++ /dev/null @@ -1,5 +0,0 @@ -export interface NotifInfo { - author: string; - title: string; - content: string; -} \ No newline at end of file diff --git a/src/app/pages/deliverer/deliverer.ts b/src/app/pages/deliverer/deliverer.ts index 2aba356..e2baf31 100644 --- a/src/app/pages/deliverer/deliverer.ts +++ b/src/app/pages/deliverer/deliverer.ts @@ -8,15 +8,15 @@ import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @Component({ - selector: 'app-deliverer', + selector: 'app-deliverer', imports: [ ModalButton, DelivererTable, DelivererForm, Search ], - templateUrl: './deliverer.html', - styleUrl: './deliverer.css', + templateUrl: './deliverer.html', + styleUrl: './deliverer.css', }) export class Deliverer { modal = viewChild.required('modalButton'); @@ -37,8 +37,7 @@ export class Deliverer { } async addDeliverer() { - if (this.createDeliverer().delivererForm.invalid) - { + if (this.createDeliverer().delivererForm.invalid) { this.notificationService.error( 'Erreur', 'Erreur d\'écriture dans le formulaire' diff --git a/src/app/pages/delivery-note/delivery-note.ts b/src/app/pages/delivery-note/delivery-note.ts index 26e00a0..df0ca0b 100644 --- a/src/app/pages/delivery-note/delivery-note.ts +++ b/src/app/pages/delivery-note/delivery-note.ts @@ -1,17 +1,17 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; import {ModalButton} from "../../components/modal-button/modal-button"; import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form"; import {Search} from "../../components/search/search"; @Component({ - selector: 'app-delivery-note', + selector: 'app-delivery-note', imports: [ DelivereryNoteTable, Search ], - templateUrl: './delivery-note.html', - styleUrl: './delivery-note.css', + templateUrl: './delivery-note.html', + styleUrl: './delivery-note.css', }) export class DeliveryNote { diff --git a/src/app/pages/purchase-order/purchase-order.ts b/src/app/pages/purchase-order/purchase-order.ts index cdfd85b..c8f63bf 100644 --- a/src/app/pages/purchase-order/purchase-order.ts +++ b/src/app/pages/purchase-order/purchase-order.ts @@ -1,15 +1,15 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; import {Search} from "../../components/search/search"; import {PurchaseOrderTable} from "../../components/purchase-order-table/purchase-order-table"; @Component({ - selector: 'app-purchase-order', + selector: 'app-purchase-order', imports: [ Search, PurchaseOrderTable, ], - templateUrl: './purchase-order.html', - styleUrl: './purchase-order.css', + templateUrl: './purchase-order.html', + styleUrl: './purchase-order.css', }) export class PurchaseOrder { diff --git a/src/app/pages/quotation/quotation.ts b/src/app/pages/quotation/quotation.ts index 02508f9..07ba09c 100644 --- a/src/app/pages/quotation/quotation.ts +++ b/src/app/pages/quotation/quotation.ts @@ -1,15 +1,15 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; import {Search} from "../../components/search/search"; import {QuotationTable} from "../../components/quotation-table/quotation-table"; @Component({ - selector: 'app-quotation', + selector: 'app-quotation', imports: [ Search, QuotationTable ], - templateUrl: './quotation.html', - styleUrl: './quotation.css', + templateUrl: './quotation.html', + styleUrl: './quotation.css', }) export class Quotation { diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 4b53257..0a0096b 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -10,7 +10,7 @@ import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-for import {CreateQuotationForm} from "../../components/create-quotation-form/create-quotation-form"; @Component({ - selector: 'app-stock', + selector: 'app-stock', imports: [ StockTable, Search, @@ -18,8 +18,8 @@ import {CreateQuotationForm} from "../../components/create-quotation-form/create CreatePurchaseorderForm, CreateQuotationForm, ], - templateUrl: './stock.html', - styleUrl: './stock.css', + templateUrl: './stock.html', + styleUrl: './stock.css', }) export class Stock { diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 858ddd8..0f8e443 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -8,15 +8,15 @@ import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @Component({ - selector: 'app-supplier', + selector: 'app-supplier', imports: [ Search, SupplierForm, SupplierTable, ModalButton ], - templateUrl: './supplier.html', - styleUrl: './supplier.css', + templateUrl: './supplier.html', + styleUrl: './supplier.css', }) export class Supplier { modal = viewChild.required('modalButton'); @@ -41,8 +41,7 @@ export class Supplier { } async addSupplier() { - if (this.createSupplier().supplierForm.invalid) - { + if (this.createSupplier().supplierForm.invalid) { this.notificationService.error( 'Erreur', 'Erreur d\'écriture dans le formulaire' diff --git a/src/app/pages/user/user.ts b/src/app/pages/user/user.ts index 9e09149..7b74ff6 100644 --- a/src/app/pages/user/user.ts +++ b/src/app/pages/user/user.ts @@ -8,15 +8,15 @@ import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @Component({ - selector: 'app-user', + selector: 'app-user', imports: [ UserTable, ModalButton, ProfilForm, Search ], - templateUrl: './user.html', - styleUrl: './user.css', + templateUrl: './user.html', + styleUrl: './user.css', }) export class User { modal = viewChild.required('modalButton'); @@ -37,8 +37,7 @@ export class User { } async addUser() { - if (this.createUser().profilForm.invalid) - { + if (this.createUser().profilForm.invalid) { this.notificationService.error( 'Erreur', 'Erreur d\'écriture dans le formulaire' diff --git a/src/app/pages/welcome/welcome.html b/src/app/pages/welcome/welcome.html index 9155041..9e9695c 100644 --- a/src/app/pages/welcome/welcome.html +++ b/src/app/pages/welcome/welcome.html @@ -1,8 +1,10 @@
    - + - +
    diff --git a/src/app/pages/welcome/welcome.routes.ts b/src/app/pages/welcome/welcome.routes.ts index b1857b5..5e0f846 100644 --- a/src/app/pages/welcome/welcome.routes.ts +++ b/src/app/pages/welcome/welcome.routes.ts @@ -1,6 +1,6 @@ -import { Routes } from '@angular/router'; -import { Welcome } from './welcome'; +import {Routes} from '@angular/router'; +import {Welcome} from './welcome'; export const WELCOME_ROUTES: Routes = [ - { path: '', component: Welcome }, + {path: '', component: Welcome}, ]; diff --git a/src/app/pages/welcome/welcome.ts b/src/app/pages/welcome/welcome.ts index 8d152d6..d73a531 100644 --- a/src/app/pages/welcome/welcome.ts +++ b/src/app/pages/welcome/welcome.ts @@ -1,17 +1,17 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; import {InfoCard} from "../../components/info-card/info-card"; import {DeliveryValidator} from "../../components/delivery-validator/delivery-validator"; import {InfoTable} from "../../components/info-table/info-table"; @Component({ - selector: 'app-welcome', + selector: 'app-welcome', imports: [ InfoCard, DeliveryValidator, InfoTable, ], - templateUrl: './welcome.html', - styleUrl: './welcome.css' + templateUrl: './welcome.html', + styleUrl: './welcome.css' }) export class Welcome { diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index c32abf7..6103f04 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore README.md api.base.service.ts api.module.ts @@ -8,8 +9,6 @@ api/deliverynotes.service.ts api/prices.service.ts api/products.service.ts api/purchaseorders.service.ts -api/purchaseproducts.service.ts -api/quotationproducts.service.ts api/quotations.service.ts api/settings.service.ts api/suppliers.service.ts @@ -19,6 +18,7 @@ configuration.ts encoder.ts git_push.sh index.ts +model/add-quotation-product-dto.ts model/connect-user-dto.ts model/create-deliverer-dto.ts model/create-delivery-note-dto.ts @@ -28,7 +28,6 @@ model/create-purchase-order-dto.ts model/create-purchase-order-product-dto.ts model/create-purchase-product-dto.ts model/create-quotation-dto.ts -model/create-quotation-product-dto.ts model/create-setting-dto.ts model/create-supplier-dto.ts model/create-user-dto.ts @@ -54,6 +53,7 @@ model/patch-product-minimal-stock-dto.ts model/patch-purchase-order-purchase-conditions-dto.ts model/patch-purchase-product-quantity-dto.ts model/patch-quotation-conditions-sale-dto.ts +model/patch-quotation-message-dto.ts model/patch-quotation-product-quantity-dto.ts model/patch-setting-electronic-signature-dto.ts model/patch-setting-logo-dto.ts diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md index c2ba935..29f22fe 100644 --- a/src/app/services/api/README.md +++ b/src/app/services/api/README.md @@ -73,7 +73,9 @@ export const appConfig: ApplicationConfig = { ``` **NOTE** -If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: +If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you +can still import an Angular module: + ```typescript import { ApiModule } from ''; ``` @@ -181,5 +183,7 @@ new Configuration({ ``` [parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations + [style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + [@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts index 34531a6..ed63bc3 100644 --- a/src/app/services/api/api.base.service.ts +++ b/src/app/services/api/api.base.service.ts @@ -1,23 +1,23 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; -import { CustomHttpParameterCodec } from './encoder'; -import { Configuration } from './configuration'; +import {HttpHeaders, HttpParams, HttpParameterCodec} from '@angular/common/http'; +import {CustomHttpParameterCodec} from './encoder'; +import {Configuration} from './configuration'; export class BaseService { - protected basePath = 'https://localhost:44379'; + protected basePath = 'http://localhost:5298'; public defaultHeaders = new HttpHeaders(); public configuration: Configuration; public encoder: HttpParameterCodec; - constructor(basePath?: string|string[], configuration?: Configuration) { + constructor(basePath?: string | string[], configuration?: Configuration) { this.configuration = configuration || new Configuration(); if (typeof this.configuration.basePath !== 'string') { const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; diff --git a/src/app/services/api/api.module.ts b/src/app/services/api/api.module.ts index 58d341f..68ca8d7 100644 --- a/src/app/services/api/api.module.ts +++ b/src/app/services/api/api.module.ts @@ -1,30 +1,30 @@ -import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; -import { Configuration } from './configuration'; -import { HttpClient } from '@angular/common/http'; +import {NgModule, ModuleWithProviders, SkipSelf, Optional} from '@angular/core'; +import {Configuration} from './configuration'; +import {HttpClient} from '@angular/common/http'; @NgModule({ - imports: [], - declarations: [], - exports: [], - providers: [] + imports: [], + declarations: [], + exports: [], + providers: [] }) export class ApiModule { public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { return { ngModule: ApiModule, - providers: [ { provide: Configuration, useFactory: configurationFactory } ] + providers: [{provide: Configuration, useFactory: configurationFactory}] }; } - constructor( @Optional() @SkipSelf() parentModule: ApiModule, - @Optional() http: HttpClient) { + constructor(@Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { if (parentModule) { throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); } if (!http) { throw new Error('You need to import the HttpClientModule in your AppModule! \n' + - 'See also https://github.com/angular/angular/issues/20575'); + 'See also https://github.com/angular/angular/issues/20575'); } } } diff --git a/src/app/services/api/api/api.ts b/src/app/services/api/api/api.ts index 1fb6648..58e0a7c 100644 --- a/src/app/services/api/api/api.ts +++ b/src/app/services/api/api/api.ts @@ -1,25 +1,31 @@ export * from './deliverers.service'; -import { DeliverersService } from './deliverers.service'; +import {DeliverersService} from './deliverers.service'; + export * from './deliverynotes.service'; -import { DeliverynotesService } from './deliverynotes.service'; +import {DeliverynotesService} from './deliverynotes.service'; + export * from './prices.service'; -import { PricesService } from './prices.service'; +import {PricesService} from './prices.service'; + export * from './products.service'; -import { ProductsService } from './products.service'; +import {ProductsService} from './products.service'; + export * from './purchaseorders.service'; -import { PurchaseordersService } from './purchaseorders.service'; -export * from './purchaseproducts.service'; -import { PurchaseproductsService } from './purchaseproducts.service'; -export * from './quotationproducts.service'; -import { QuotationproductsService } from './quotationproducts.service'; +import {PurchaseordersService} from './purchaseorders.service'; + export * from './quotations.service'; -import { QuotationsService } from './quotations.service'; +import {QuotationsService} from './quotations.service'; + export * from './settings.service'; -import { SettingsService } from './settings.service'; +import {SettingsService} from './settings.service'; + export * from './suppliers.service'; -import { SuppliersService } from './suppliers.service'; +import {SuppliersService} from './suppliers.service'; + export * from './users.service'; -import { UsersService } from './users.service'; +import {UsersService} from './users.service'; + export * from './warehouseproducts.service'; -import { WarehouseproductsService } from './warehouseproducts.service'; -export const APIS = [DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, PurchaseproductsService, QuotationproductsService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService]; +import {WarehouseproductsService} from './warehouseproducts.service'; + +export const APIS = [DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService]; diff --git a/src/app/services/api/api/deliverers.service.ts b/src/app/services/api/api/deliverers.service.ts index aac5dfe..f5c3839 100644 --- a/src/app/services/api/api/deliverers.service.ts +++ b/src/app/services/api/api/deliverers.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,46 +9,62 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { CreateDelivererDto } from '../model/create-deliverer-dto'; +import {CreateDelivererDto} from '../model/create-deliverer-dto'; // @ts-ignore -import { GetDelivererDto } from '../model/get-deliverer-dto'; +import {GetDelivererDto} from '../model/get-deliverer-dto'; // @ts-ignore -import { UpdateDelivererDto } from '../model/update-deliverer-dto'; +import {UpdateDelivererDto} from '../model/update-deliverer-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class DeliverersService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** * @endpoint post /API/deliverers - * @param createDelivererDto + * @param createDelivererDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (createDelivererDto === null || createDelivererDto === undefined) { throw new Error('Required parameter createDelivererDto was null or undefined when calling createDelivererEndpoint.'); } @@ -88,16 +104,16 @@ export class DeliverersService extends BaseService { } let localVarPath = `/API/deliverers`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: createDelivererDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -105,22 +121,37 @@ export class DeliverersService extends BaseService { /** * @endpoint delete /API/deliverers/{delivererId} - * @param delivererId + * @param delivererId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deleteDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + public deleteDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (delivererId === null || delivererId === undefined) { throw new Error('Required parameter delivererId was null or undefined when calling deleteDelivererEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -141,16 +172,24 @@ export class DeliverersService extends BaseService { } } - let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "delivererId", value: delivererId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/deliverers/${this.configuration.encodeParam({ + name: "delivererId", + value: delivererId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -161,10 +200,26 @@ export class DeliverersService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllDelivererEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllDelivererEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllDelivererEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllDelivererEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllDelivererEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllDelivererEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllDelivererEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllDelivererEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { let localVarHeaders = this.defaultHeaders; @@ -192,15 +247,15 @@ export class DeliverersService extends BaseService { } let localVarPath = `/API/deliverers`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -208,14 +263,30 @@ export class DeliverersService extends BaseService { /** * @endpoint get /API/deliverers/{delivererId} - * @param delivererId + * @param delivererId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (delivererId === null || delivererId === undefined) { throw new Error('Required parameter delivererId was null or undefined when calling getDelivererEndpoint.'); } @@ -245,16 +316,24 @@ export class DeliverersService extends BaseService { } } - let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "delivererId", value: delivererId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/deliverers/${this.configuration.encodeParam({ + name: "delivererId", + value: delivererId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -262,15 +341,31 @@ export class DeliverersService extends BaseService { /** * @endpoint put /API/deliverers/{id} - * @param id - * @param updateDelivererDto + * @param id + * @param updateDelivererDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateDelivererEndpoint.'); } @@ -312,17 +407,25 @@ export class DeliverersService extends BaseService { } } - let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/deliverers/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: updateDelivererDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/deliverynotes.service.ts b/src/app/services/api/api/deliverynotes.service.ts index 3a69576..dcea385 100644 --- a/src/app/services/api/api/deliverynotes.service.ts +++ b/src/app/services/api/api/deliverynotes.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,57 +9,71 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { CreateDeliveryNoteDto } from '../model/create-delivery-note-dto'; +import {CreateDeliveryNoteDto} from '../model/create-delivery-note-dto'; // @ts-ignore -import { GetDeliveryNoteDto } from '../model/get-delivery-note-dto'; +import {GetDeliveryNoteDto} from '../model/get-delivery-note-dto'; // @ts-ignore -import { PatchDeliveryNoteRealDeliveryDateDto } from '../model/patch-delivery-note-real-delivery-date-dto'; +import {PatchDeliveryNoteRealDeliveryDateDto} from '../model/patch-delivery-note-real-delivery-date-dto'; // @ts-ignore -import { UpdateDeliveryNoteDto } from '../model/update-delivery-note-dto'; +import {UpdateDeliveryNoteDto} from '../model/update-delivery-note-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class DeliverynotesService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** * @endpoint post /API/deliveryNotes - * @param createDeliveryNoteDto + * @param createDeliveryNoteDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (createDeliveryNoteDto === null || createDeliveryNoteDto === undefined) { throw new Error('Required parameter createDeliveryNoteDto was null or undefined when calling createDeliveryNoteEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -90,16 +104,16 @@ export class DeliverynotesService extends BaseService { } let localVarPath = `/API/deliveryNotes`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: createDeliveryNoteDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -107,22 +121,37 @@ export class DeliverynotesService extends BaseService { /** * @endpoint delete /API/deliveryNotes/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteDeliveryNoteEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deleteDeliveryNoteEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteDeliveryNoteEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteDeliveryNoteEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + public deleteDeliveryNoteEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteDeliveryNoteEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteDeliveryNoteEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteDeliveryNoteEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling deleteDeliveryNoteEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -143,16 +172,24 @@ export class DeliverynotesService extends BaseService { } } - let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -163,10 +200,26 @@ export class DeliverynotesService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllDeliveryNoteEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllDeliveryNoteEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllDeliveryNoteEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllDeliveryNoteEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllDeliveryNoteEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllDeliveryNoteEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllDeliveryNoteEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllDeliveryNoteEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { let localVarHeaders = this.defaultHeaders; @@ -194,15 +247,15 @@ export class DeliverynotesService extends BaseService { } let localVarPath = `/API/deliveryNotes`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -210,14 +263,30 @@ export class DeliverynotesService extends BaseService { /** * @endpoint get /API/deliveryNotes/{deliveryNoteId} - * @param deliveryNoteId + * @param deliveryNoteId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDeliveryNoteEndpoint(deliveryNoteId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getDeliveryNoteEndpoint(deliveryNoteId: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (deliveryNoteId === null || deliveryNoteId === undefined) { throw new Error('Required parameter deliveryNoteId was null or undefined when calling getDeliveryNoteEndpoint.'); } @@ -247,16 +316,24 @@ export class DeliverynotesService extends BaseService { } } - let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "deliveryNoteId", value: deliveryNoteId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ + name: "deliveryNoteId", + value: deliveryNoteId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -264,14 +341,30 @@ export class DeliverynotesService extends BaseService { /** * @endpoint get /API/deliveryNotes/{id}/pdf - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getDeliveryNotePdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable; - public getDeliveryNotePdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDeliveryNotePdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDeliveryNotePdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable { + public getDeliveryNotePdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getDeliveryNotePdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getDeliveryNotePdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getDeliveryNotePdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getDeliveryNotePdfEndpoint.'); } @@ -290,16 +383,24 @@ export class DeliverynotesService extends BaseService { const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/pdf`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: "blob", - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -307,15 +408,31 @@ export class DeliverynotesService extends BaseService { /** * @endpoint patch /API/deliveryNotes/{id} - * @param id - * @param patchDeliveryNoteRealDeliveryDateDto + * @param id + * @param patchDeliveryNoteRealDeliveryDateDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling patchRealDeliveryDateEndpoint.'); } @@ -325,9 +442,7 @@ export class DeliverynotesService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -357,17 +472,25 @@ export class DeliverynotesService extends BaseService { } } - let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchDeliveryNoteRealDeliveryDateDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -375,15 +498,31 @@ export class DeliverynotesService extends BaseService { /** * @endpoint put /API/deliveryNotes/{id} - * @param id - * @param updateDeliveryNoteDto + * @param id + * @param updateDeliveryNoteDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateDeliveryNoteEndpoint.'); } @@ -393,9 +532,7 @@ export class DeliverynotesService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -425,17 +562,25 @@ export class DeliverynotesService extends BaseService { } } - let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, + let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: updateDeliveryNoteDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/prices.service.ts b/src/app/services/api/api/prices.service.ts index 619d887..76d7a3f 100644 --- a/src/app/services/api/api/prices.service.ts +++ b/src/app/services/api/api/prices.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,169 +9,60 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { CreatePriceDto } from '../model/create-price-dto'; -// @ts-ignore -import { GetPriceDto } from '../model/get-price-dto'; -// @ts-ignore -import { PatchPriceSellingPriceDto } from '../model/patch-price-selling-price-dto'; +import {PatchPriceSellingPriceDto} from '../model/patch-price-selling-price-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class PricesService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } - /** - * @endpoint post /API/prices - * @param createPriceDto - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createPriceEndpoint(createPriceDto: CreatePriceDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createPriceEndpoint(createPriceDto: CreatePriceDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createPriceEndpoint(createPriceDto: CreatePriceDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createPriceEndpoint(createPriceDto: CreatePriceDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (createPriceDto === null || createPriceDto === undefined) { - throw new Error('Required parameter createPriceDto was null or undefined when calling createPriceEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/prices`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createPriceDto, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * @endpoint delete /API/prices/{productId}/{supplierId} - * @param productId - * @param supplierId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deletePriceEndpoint(productId: number, supplierId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deletePriceEndpoint(productId: number, supplierId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deletePriceEndpoint(productId: number, supplierId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deletePriceEndpoint(productId: number, supplierId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { - if (productId === null || productId === undefined) { - throw new Error('Required parameter productId was null or undefined when calling deletePriceEndpoint.'); - } - if (supplierId === null || supplierId === undefined) { - throw new Error('Required parameter supplierId was null or undefined when calling deletePriceEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/prices/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "supplierId", value: supplierId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - /** * @endpoint patch /API/prices/{productId}/{supplierId}/SellingPrice - * @param productId - * @param supplierId - * @param patchPriceSellingPriceDto + * @param productId + * @param supplierId + * @param patchPriceSellingPriceDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (productId === null || productId === undefined) { throw new Error('Required parameter productId was null or undefined when calling patchPriceEndpoint.'); } @@ -184,9 +75,7 @@ export class PricesService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -216,17 +105,33 @@ export class PricesService extends BaseService { } } - let localVarPath = `/API/prices/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "supplierId", value: supplierId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/SellingPrice`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + let localVarPath = `/API/prices/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "supplierId", + value: supplierId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/SellingPrice`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchPriceSellingPriceDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/products.service.ts b/src/app/services/api/api/products.service.ts index a1e6451..f040cfd 100644 --- a/src/app/services/api/api/products.service.ts +++ b/src/app/services/api/api/products.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,54 +9,69 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { GetProductDto } from '../model/get-product-dto'; +import {GetProductDto} from '../model/get-product-dto'; // @ts-ignore -import { PatchProductMinimalStockDto } from '../model/patch-product-minimal-stock-dto'; +import {PatchProductMinimalStockDto} from '../model/patch-product-minimal-stock-dto'; // @ts-ignore -import { UpdateProductDto } from '../model/update-product-dto'; +import {UpdateProductDto} from '../model/update-product-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class ProductsService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** * @endpoint delete /API/products/{productId} - * @param productId + * @param productId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteProductEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deleteProductEndpoint(productId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteProductEndpoint(productId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteProductEndpoint(productId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + public deleteProductEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteProductEndpoint(productId: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteProductEndpoint(productId: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteProductEndpoint(productId: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (productId === null || productId === undefined) { throw new Error('Required parameter productId was null or undefined when calling deleteProductEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -77,16 +92,24 @@ export class ProductsService extends BaseService { } } - let localVarPath = `/API/products/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/products/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -97,10 +120,26 @@ export class ProductsService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllProductsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllProductsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllProductsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllProductsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllProductsEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllProductsEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllProductsEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllProductsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { let localVarHeaders = this.defaultHeaders; @@ -128,15 +167,15 @@ export class ProductsService extends BaseService { } let localVarPath = `/API/products`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -147,10 +186,26 @@ export class ProductsService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllProductsUnderLimitEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllProductsUnderLimitEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllProductsUnderLimitEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllProductsUnderLimitEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllProductsUnderLimitEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllProductsUnderLimitEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { let localVarHeaders = this.defaultHeaders; @@ -178,15 +233,15 @@ export class ProductsService extends BaseService { } let localVarPath = `/API/products/underLimit`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -194,14 +249,30 @@ export class ProductsService extends BaseService { /** * @endpoint get /API/products/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getProductEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getProductEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getProductEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getProductEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getProductEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getProductEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getProductEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getProductEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getProductEndpoint.'); } @@ -231,16 +302,24 @@ export class ProductsService extends BaseService { } } - let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/products/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -248,15 +327,31 @@ export class ProductsService extends BaseService { /** * @endpoint patch /API/products/{id}/MinimalStock - * @param id - * @param patchProductMinimalStockDto + * @param id + * @param patchProductMinimalStockDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling patchProductMinimalStockEndpoint.'); } @@ -266,9 +361,7 @@ export class ProductsService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -298,17 +391,25 @@ export class ProductsService extends BaseService { } } - let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/MinimalStock`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + let localVarPath = `/API/products/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/MinimalStock`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchProductMinimalStockDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -316,15 +417,31 @@ export class ProductsService extends BaseService { /** * @endpoint put /API/products/{id} - * @param id - * @param updateProductDto + * @param id + * @param updateProductDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateProductEndpoint.'); } @@ -334,9 +451,7 @@ export class ProductsService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -366,17 +481,25 @@ export class ProductsService extends BaseService { } } - let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, + let localVarPath = `/API/products/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: updateProductDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/purchaseorders.service.ts b/src/app/services/api/api/purchaseorders.service.ts index 87a17a6..ed2a306 100644 --- a/src/app/services/api/api/purchaseorders.service.ts +++ b/src/app/services/api/api/purchaseorders.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,55 +9,175 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { CreatePurchaseOrderDto } from '../model/create-purchase-order-dto'; +import {CreatePurchaseOrderDto} from '../model/create-purchase-order-dto'; // @ts-ignore -import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto'; +import {CreatePurchaseProductDto} from '../model/create-purchase-product-dto'; // @ts-ignore -import { PatchPurchaseOrderPurchaseConditionsDto } from '../model/patch-purchase-order-purchase-conditions-dto'; +import {GetPurchaseOrderDto} from '../model/get-purchase-order-dto'; +// @ts-ignore +import {PatchPurchaseOrderPurchaseConditionsDto} from '../model/patch-purchase-order-purchase-conditions-dto'; +// @ts-ignore +import {PatchPurchaseProductQuantityDto} from '../model/patch-purchase-product-quantity-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class PurchaseordersService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** - * @endpoint post /API/purchaseOrders - * @param createPurchaseOrderDto + * @endpoint post /API/purchaseOrders/{purchaseOrderId}/{productId} + * @param purchaseOrderId + * @param productId + * @param createPurchaseProductDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (purchaseOrderId === null || purchaseOrderId === undefined) { + throw new Error('Required parameter purchaseOrderId was null or undefined when calling addProductFromPurchaseOrderEndpoint.'); + } + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling addProductFromPurchaseOrderEndpoint.'); + } + if (createPurchaseProductDto === null || createPurchaseProductDto === undefined) { + throw new Error('Required parameter createPurchaseProductDto was null or undefined when calling addProductFromPurchaseOrderEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ + name: "purchaseOrderId", + value: purchaseOrderId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createPurchaseProductDto, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint post /API/purchaseOrders + * @param createPurchaseOrderDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (createPurchaseOrderDto === null || createPurchaseOrderDto === undefined) { throw new Error('Required parameter createPurchaseOrderDto was null or undefined when calling createPurchaseOrder.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -88,39 +208,58 @@ export class PurchaseordersService extends BaseService { } let localVarPath = `/API/purchaseOrders`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: createPurchaseOrderDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); } /** - * @endpoint delete /API/purchaseOrders/{id} - * @param id + * @endpoint delete /API/purchaseOrders/{productId}/{purchaseOrderId} + * @param productId + * @param purchaseOrderId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deletePurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deletePurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deletePurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deletePurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling deletePurchaseOrderEndpoint.'); + public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling deleteProductFromPurchaseOrderEndpoint.'); + } + if (purchaseOrderId === null || purchaseOrderId === undefined) { + throw new Error('Required parameter purchaseOrderId was null or undefined when calling deleteProductFromPurchaseOrderEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -141,16 +280,108 @@ export class PurchaseordersService extends BaseService { } } - let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "purchaseOrderId", + value: purchaseOrderId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/purchaseOrders/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deletePurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deletePurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deletePurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deletePurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deletePurchaseOrderEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -161,10 +392,26 @@ export class PurchaseordersService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllPurchaseOrderEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllPurchaseOrderEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllPurchaseOrderEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllPurchaseOrderEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllPurchaseOrderEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllPurchaseOrderEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllPurchaseOrderEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllPurchaseOrderEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { let localVarHeaders = this.defaultHeaders; @@ -192,15 +439,15 @@ export class PurchaseordersService extends BaseService { } let localVarPath = `/API/purchaseOrders`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -208,14 +455,30 @@ export class PurchaseordersService extends BaseService { /** * @endpoint get /API/purchaseOrders/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getPurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getPurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getPurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getPurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderEndpoint.'); } @@ -245,16 +508,24 @@ export class PurchaseordersService extends BaseService { } } - let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -262,14 +533,30 @@ export class PurchaseordersService extends BaseService { /** * @endpoint get /API/purchaseOrders/{id}/pdf - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPurchaseOrderPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable; - public getPurchaseOrderPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPurchaseOrderPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPurchaseOrderPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable { + public getPurchaseOrderPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getPurchaseOrderPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getPurchaseOrderPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getPurchaseOrderPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderPdfEndpoint.'); } @@ -288,16 +575,24 @@ export class PurchaseordersService extends BaseService { const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/pdf`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: "blob", - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -305,15 +600,31 @@ export class PurchaseordersService extends BaseService { /** * @endpoint patch /API/purchaseOrders/{id}/PurchaseConditions - * @param id - * @param patchPurchaseOrderPurchaseConditionsDto + * @param id + * @param patchPurchaseOrderPurchaseConditionsDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling patchPurchaseOrderPurchaseConditionsEndpoint.'); } @@ -323,9 +634,7 @@ export class PurchaseordersService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -355,17 +664,127 @@ export class PurchaseordersService extends BaseService { } } - let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/PurchaseConditions`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/PurchaseConditions`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchPurchaseOrderPurchaseConditionsDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/purchaseOrders/{productId}/{purchaseOrderId}/Quantity + * @param productId + * @param purchaseOrderId + * @param patchPurchaseProductQuantityDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); + } + if (purchaseOrderId === null || purchaseOrderId === undefined) { + throw new Error('Required parameter purchaseOrderId was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); + } + if (patchPurchaseProductQuantityDto === null || patchPurchaseProductQuantityDto === undefined) { + throw new Error('Required parameter patchPurchaseProductQuantityDto was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "purchaseOrderId", + value: purchaseOrderId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/Quantity`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchPurchaseProductQuantityDto, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/purchaseproducts.service.ts b/src/app/services/api/api/purchaseproducts.service.ts deleted file mode 100644 index 22d4975..0000000 --- a/src/app/services/api/api/purchaseproducts.service.ts +++ /dev/null @@ -1,235 +0,0 @@ -/** - * PyroFetes - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { CreatePurchaseProductDto } from '../model/create-purchase-product-dto'; -// @ts-ignore -import { GetPurchaseProductDto } from '../model/get-purchase-product-dto'; -// @ts-ignore -import { PatchPurchaseProductQuantityDto } from '../model/patch-purchase-product-quantity-dto'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - - - -@Injectable({ - providedIn: 'root' -}) -export class PurchaseproductsService extends BaseService { - - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); - } - - /** - * @endpoint post /API/purchaseProducts - * @param createPurchaseProductDto - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createPurchaseProductEndpoint(createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createPurchaseProductEndpoint(createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createPurchaseProductEndpoint(createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createPurchaseProductEndpoint(createPurchaseProductDto: CreatePurchaseProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (createPurchaseProductDto === null || createPurchaseProductDto === undefined) { - throw new Error('Required parameter createPurchaseProductDto was null or undefined when calling createPurchaseProductEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/purchaseProducts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createPurchaseProductDto, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * @endpoint delete /API/purchaseProducts/{productId}/{purchaseOrderId} - * @param productId - * @param purchaseOrderId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deletePurchaseProductEndpoint(productId: number, purchaseOrderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deletePurchaseProductEndpoint(productId: number, purchaseOrderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deletePurchaseProductEndpoint(productId: number, purchaseOrderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deletePurchaseProductEndpoint(productId: number, purchaseOrderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { - if (productId === null || productId === undefined) { - throw new Error('Required parameter productId was null or undefined when calling deletePurchaseProductEndpoint.'); - } - if (purchaseOrderId === null || purchaseOrderId === undefined) { - throw new Error('Required parameter purchaseOrderId was null or undefined when calling deletePurchaseProductEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/purchaseProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "purchaseOrderId", value: purchaseOrderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * @endpoint patch /API/purchaseProducts/{productId}/{purchaseOrderId}/Quantity - * @param productId - * @param purchaseOrderId - * @param patchPurchaseProductQuantityDto - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (productId === null || productId === undefined) { - throw new Error('Required parameter productId was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); - } - if (purchaseOrderId === null || purchaseOrderId === undefined) { - throw new Error('Required parameter purchaseOrderId was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); - } - if (patchPurchaseProductQuantityDto === null || patchPurchaseProductQuantityDto === undefined) { - throw new Error('Required parameter patchPurchaseProductQuantityDto was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/purchaseProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "purchaseOrderId", value: purchaseOrderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/Quantity`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: patchPurchaseProductQuantityDto, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - -} diff --git a/src/app/services/api/api/quotationproducts.service.ts b/src/app/services/api/api/quotationproducts.service.ts deleted file mode 100644 index 622203d..0000000 --- a/src/app/services/api/api/quotationproducts.service.ts +++ /dev/null @@ -1,235 +0,0 @@ -/** - * PyroFetes - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { CreateQuotationProductDto } from '../model/create-quotation-product-dto'; -// @ts-ignore -import { GetQuotationProductDto } from '../model/get-quotation-product-dto'; -// @ts-ignore -import { PatchQuotationProductQuantityDto } from '../model/patch-quotation-product-quantity-dto'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - - - -@Injectable({ - providedIn: 'root' -}) -export class QuotationproductsService extends BaseService { - - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); - } - - /** - * @endpoint post /API/quotationProducts - * @param createQuotationProductDto - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createQuotationProductEndpoint(createQuotationProductDto: CreateQuotationProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createQuotationProductEndpoint(createQuotationProductDto: CreateQuotationProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createQuotationProductEndpoint(createQuotationProductDto: CreateQuotationProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createQuotationProductEndpoint(createQuotationProductDto: CreateQuotationProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (createQuotationProductDto === null || createQuotationProductDto === undefined) { - throw new Error('Required parameter createQuotationProductDto was null or undefined when calling createQuotationProductEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/quotationProducts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createQuotationProductDto, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * @endpoint delete /API/quotationProducts/{productId}/{quotationId} - * @param productId - * @param quotationId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteQuotationProductEndpoint(productId: number, quotationId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deleteQuotationProductEndpoint(productId: number, quotationId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteQuotationProductEndpoint(productId: number, quotationId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteQuotationProductEndpoint(productId: number, quotationId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { - if (productId === null || productId === undefined) { - throw new Error('Required parameter productId was null or undefined when calling deleteQuotationProductEndpoint.'); - } - if (quotationId === null || quotationId === undefined) { - throw new Error('Required parameter quotationId was null or undefined when calling deleteQuotationProductEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/quotationProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "quotationId", value: quotationId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * @endpoint patch /API/quotationProducts/{productId}/{quotationId}/Quantity - * @param productId - * @param quotationId - * @param patchQuotationProductQuantityDto - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (productId === null || productId === undefined) { - throw new Error('Required parameter productId was null or undefined when calling patchQuotationProductQuantityEndpoint.'); - } - if (quotationId === null || quotationId === undefined) { - throw new Error('Required parameter quotationId was null or undefined when calling patchQuotationProductQuantityEndpoint.'); - } - if (patchQuotationProductQuantityDto === null || patchQuotationProductQuantityDto === undefined) { - throw new Error('Required parameter patchQuotationProductQuantityDto was null or undefined when calling patchQuotationProductQuantityEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/quotationProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "quotationId", value: quotationId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/Quantity`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: patchQuotationProductQuantityDto, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - -} diff --git a/src/app/services/api/api/quotations.service.ts b/src/app/services/api/api/quotations.service.ts index 7c925c7..f18a669 100644 --- a/src/app/services/api/api/quotations.service.ts +++ b/src/app/services/api/api/quotations.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,57 +9,167 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { CreateQuotationDto } from '../model/create-quotation-dto'; +import {AddQuotationProductDto} from '../model/add-quotation-product-dto'; // @ts-ignore -import { GetQuotationDto } from '../model/get-quotation-dto'; +import {CreateQuotationDto} from '../model/create-quotation-dto'; // @ts-ignore -import { PatchQuotationConditionsSaleDto } from '../model/patch-quotation-conditions-sale-dto'; +import {GetQuotationDto} from '../model/get-quotation-dto'; // @ts-ignore -import { UpdateQuotationDto } from '../model/update-quotation-dto'; +import {PatchQuotationConditionsSaleDto} from '../model/patch-quotation-conditions-sale-dto'; +// @ts-ignore +import {PatchQuotationMessageDto} from '../model/patch-quotation-message-dto'; +// @ts-ignore +import {PatchQuotationProductQuantityDto} from '../model/patch-quotation-product-quantity-dto'; +// @ts-ignore +import {UpdateQuotationDto} from '../model/update-quotation-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class QuotationsService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** - * @endpoint post /API/quotations - * @param createQuotationDto + * @endpoint post /API/quotations/{productId}/products + * @param productId + * @param addQuotationProductDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling addProductoToQuotationEndpoint.'); + } + if (addQuotationProductDto === null || addQuotationProductDto === undefined) { + throw new Error('Required parameter addQuotationProductDto was null or undefined when calling addProductoToQuotationEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/products`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: addQuotationProductDto, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint post /API/quotations + * @param createQuotationDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (createQuotationDto === null || createQuotationDto === undefined) { throw new Error('Required parameter createQuotationDto was null or undefined when calling createQuotationEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -90,39 +200,58 @@ export class QuotationsService extends BaseService { } let localVarPath = `/API/quotations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: createQuotationDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); } /** - * @endpoint delete /API/quotations/{id} - * @param id + * @endpoint delete /API/quotations/{productId}/{quotationId} + * @param productId + * @param quotationId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deleteQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling deleteQuotationEndpoint.'); + public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling deleteProductFromQuotationEndpoint.'); + } + if (quotationId === null || quotationId === undefined) { + throw new Error('Required parameter quotationId was null or undefined when calling deleteProductFromQuotationEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -143,16 +272,108 @@ export class QuotationsService extends BaseService { } } - let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "quotationId", + value: quotationId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/quotations/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteQuotationEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -163,10 +384,26 @@ export class QuotationsService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllQuotationEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllQuotationEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllQuotationEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllQuotationEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllQuotationEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllQuotationEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllQuotationEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllQuotationEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { let localVarHeaders = this.defaultHeaders; @@ -194,15 +431,15 @@ export class QuotationsService extends BaseService { } let localVarPath = `/API/quotations`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -210,14 +447,30 @@ export class QuotationsService extends BaseService { /** * @endpoint get /API/quotations/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getQuotationEndpoint.'); } @@ -247,16 +500,24 @@ export class QuotationsService extends BaseService { } } - let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -264,14 +525,30 @@ export class QuotationsService extends BaseService { /** * @endpoint get /API/quotations/{id}/pdf - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getQuotationPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable; - public getQuotationPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; - public getQuotationPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable>; - public getQuotationPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable { + public getQuotationPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getQuotationPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getQuotationPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getQuotationPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/pdf', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getQuotationPdfEndpoint.'); } @@ -290,16 +567,24 @@ export class QuotationsService extends BaseService { const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/pdf`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: "blob", - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -307,15 +592,31 @@ export class QuotationsService extends BaseService { /** * @endpoint patch /API/quotations/{id}/saleConditions - * @param id - * @param patchQuotationConditionsSaleDto + * @param id + * @param patchQuotationConditionsSaleDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling patchQuotationConditionsSaleEndpoint.'); } @@ -325,9 +626,7 @@ export class QuotationsService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -357,17 +656,217 @@ export class QuotationsService extends BaseService { } } - let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/saleConditions`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/saleConditions`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchQuotationConditionsSaleDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/quotations/{id}/message + * @param id + * @param patchQuotationMessageDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling patchQuotationMessageEndpoint.'); + } + if (patchQuotationMessageDto === null || patchQuotationMessageDto === undefined) { + throw new Error('Required parameter patchQuotationMessageDto was null or undefined when calling patchQuotationMessageEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/message`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchQuotationMessageDto, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint patch /API/quotations/{productId}/{quotationId}/Quantity + * @param productId + * @param quotationId + * @param patchQuotationProductQuantityDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling patchQuotationProductQuantityEndpoint.'); + } + if (quotationId === null || quotationId === undefined) { + throw new Error('Required parameter quotationId was null or undefined when calling patchQuotationProductQuantityEndpoint.'); + } + if (patchQuotationProductQuantityDto === null || patchQuotationProductQuantityDto === undefined) { + throw new Error('Required parameter patchQuotationProductQuantityDto was null or undefined when calling patchQuotationProductQuantityEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "quotationId", + value: quotationId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/Quantity`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patchQuotationProductQuantityDto, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -375,15 +874,31 @@ export class QuotationsService extends BaseService { /** * @endpoint put /API/quotations/{id} - * @param id - * @param updateQuotationDto + * @param id + * @param updateQuotationDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateQuotationEndpoint.'); } @@ -393,9 +908,7 @@ export class QuotationsService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -425,17 +938,25 @@ export class QuotationsService extends BaseService { } } - let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, + let localVarPath = `/API/quotations/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: updateQuotationDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/settings.service.ts b/src/app/services/api/api/settings.service.ts index b6a4951..1bbecf8 100644 --- a/src/app/services/api/api/settings.service.ts +++ b/src/app/services/api/api/settings.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,57 +9,71 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { CreateSettingDto } from '../model/create-setting-dto'; +import {CreateSettingDto} from '../model/create-setting-dto'; // @ts-ignore -import { GetSettingDto } from '../model/get-setting-dto'; +import {GetSettingDto} from '../model/get-setting-dto'; // @ts-ignore -import { PatchSettingElectronicSignatureDto } from '../model/patch-setting-electronic-signature-dto'; +import {PatchSettingElectronicSignatureDto} from '../model/patch-setting-electronic-signature-dto'; // @ts-ignore -import { PatchSettingLogoDto } from '../model/patch-setting-logo-dto'; +import {PatchSettingLogoDto} from '../model/patch-setting-logo-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class SettingsService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** * @endpoint post /API/settings - * @param createSettingDto + * @param createSettingDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createSettingEndpoint(createSettingDto: CreateSettingDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createSettingEndpoint(createSettingDto: CreateSettingDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (createSettingDto === null || createSettingDto === undefined) { throw new Error('Required parameter createSettingDto was null or undefined when calling createSettingEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -90,16 +104,16 @@ export class SettingsService extends BaseService { } let localVarPath = `/API/settings`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: createSettingDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -107,22 +121,37 @@ export class SettingsService extends BaseService { /** * @endpoint delete /API/settings/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deleteSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + public deleteSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling deleteSettingEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -143,16 +172,24 @@ export class SettingsService extends BaseService { } } - let localVarPath = `/API/settings/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/settings/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -160,14 +197,30 @@ export class SettingsService extends BaseService { /** * @endpoint get /API/settings/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getSettingEndpoint.'); } @@ -197,16 +250,24 @@ export class SettingsService extends BaseService { } } - let localVarPath = `/API/settings/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/settings/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -214,15 +275,31 @@ export class SettingsService extends BaseService { /** * @endpoint patch /API/settings/{id}/ElectronicSignature - * @param id - * @param patchSettingElectronicSignatureDto + * @param id + * @param patchSettingElectronicSignatureDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling patchSettingElectronicSignatureEndpoint.'); } @@ -232,9 +309,7 @@ export class SettingsService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -264,17 +339,25 @@ export class SettingsService extends BaseService { } } - let localVarPath = `/API/settings/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/ElectronicSignature`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + let localVarPath = `/API/settings/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/ElectronicSignature`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchSettingElectronicSignatureDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -282,15 +365,31 @@ export class SettingsService extends BaseService { /** * @endpoint patch /API/settings/{id}/logo - * @param id - * @param patchSettingLogoDto + * @param id + * @param patchSettingLogoDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling patchSettingLogoEndpoint.'); } @@ -300,9 +399,7 @@ export class SettingsService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -332,17 +429,25 @@ export class SettingsService extends BaseService { } } - let localVarPath = `/API/settings/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/logo`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + let localVarPath = `/API/settings/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/logo`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchSettingLogoDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/suppliers.service.ts b/src/app/services/api/api/suppliers.service.ts index 7c4b123..bb9a8c3 100644 --- a/src/app/services/api/api/suppliers.service.ts +++ b/src/app/services/api/api/suppliers.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,57 +9,175 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { CreateSupplierDto } from '../model/create-supplier-dto'; +import {CreatePriceDto} from '../model/create-price-dto'; // @ts-ignore -import { GetSupplierDto } from '../model/get-supplier-dto'; +import {CreateSupplierDto} from '../model/create-supplier-dto'; // @ts-ignore -import { PatchSupplierDeliveryDelayDto } from '../model/patch-supplier-delivery-delay-dto'; +import {GetSupplierDto} from '../model/get-supplier-dto'; // @ts-ignore -import { UpdateSupplierDto } from '../model/update-supplier-dto'; +import {PatchSupplierDeliveryDelayDto} from '../model/patch-supplier-delivery-delay-dto'; +// @ts-ignore +import {UpdateSupplierDto} from '../model/update-supplier-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class SuppliersService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** - * @endpoint post /API/suppliers - * @param createSupplierDto + * @endpoint post /API/suppliers/{supplierId}/{productId} + * @param supplierId + * @param productId + * @param createPriceDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (supplierId === null || supplierId === undefined) { + throw new Error('Required parameter supplierId was null or undefined when calling addProductToSupplierEndpoint.'); + } + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling addProductToSupplierEndpoint.'); + } + if (createPriceDto === null || createPriceDto === undefined) { + throw new Error('Required parameter createPriceDto was null or undefined when calling addProductToSupplierEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ + name: "supplierId", + value: supplierId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createPriceDto, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint post /API/suppliers + * @param createSupplierDto + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (createSupplierDto === null || createSupplierDto === undefined) { throw new Error('Required parameter createSupplierDto was null or undefined when calling createSupplierEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -90,39 +208,58 @@ export class SuppliersService extends BaseService { } let localVarPath = `/API/suppliers`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: createSupplierDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); } /** - * @endpoint delete /API/suppliers/{id} - * @param id + * @endpoint delete /API/suppliers/{supplierId}/{productId} + * @param supplierId + * @param productId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deleteSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling deleteSupplierEndpoint.'); + public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (supplierId === null || supplierId === undefined) { + throw new Error('Required parameter supplierId was null or undefined when calling deleteProductToSupplierEndpoint.'); + } + if (productId === null || productId === undefined) { + throw new Error('Required parameter productId was null or undefined when calling deleteProductToSupplierEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -143,16 +280,108 @@ export class SuppliersService extends BaseService { } } - let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ + name: "supplierId", + value: supplierId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/suppliers/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteSupplierEndpoint.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -163,10 +392,26 @@ export class SuppliersService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllSuppliersEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllSuppliersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllSuppliersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllSuppliersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllSuppliersEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllSuppliersEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllSuppliersEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllSuppliersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { let localVarHeaders = this.defaultHeaders; @@ -194,15 +439,15 @@ export class SuppliersService extends BaseService { } let localVarPath = `/API/suppliers`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -210,14 +455,30 @@ export class SuppliersService extends BaseService { /** * @endpoint get /API/suppliers/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getSupplierEndpoint.'); } @@ -247,16 +508,24 @@ export class SuppliersService extends BaseService { } } - let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -264,15 +533,31 @@ export class SuppliersService extends BaseService { /** * @endpoint patch /API/suppliers/{id}/deliveryDelay - * @param id - * @param patchSupplierDeliveryDelayDto + * @param id + * @param patchSupplierDeliveryDelayDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling patchSupplierDeliveryDelayEndpoint.'); } @@ -282,9 +567,7 @@ export class SuppliersService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -314,17 +597,25 @@ export class SuppliersService extends BaseService { } } - let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/deliveryDelay`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('patch', `${basePath}${localVarPath}`, + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/deliveryDelay`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchSupplierDeliveryDelayDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -332,15 +623,31 @@ export class SuppliersService extends BaseService { /** * @endpoint put /API/suppliers/{id} - * @param id - * @param updateSupplierDto + * @param id + * @param updateSupplierDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateSupplierEndpoint.'); } @@ -350,9 +657,7 @@ export class SuppliersService extends BaseService { let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -382,17 +687,25 @@ export class SuppliersService extends BaseService { } } - let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, + let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: updateSupplierDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/users.service.ts b/src/app/services/api/api/users.service.ts index 5e1e5d4..2de5e9a 100644 --- a/src/app/services/api/api/users.service.ts +++ b/src/app/services/api/api/users.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,52 +9,68 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { ConnectUserDto } from '../model/connect-user-dto'; +import {ConnectUserDto} from '../model/connect-user-dto'; // @ts-ignore -import { CreateUserDto } from '../model/create-user-dto'; +import {CreateUserDto} from '../model/create-user-dto'; // @ts-ignore -import { GetTokenDto } from '../model/get-token-dto'; +import {GetTokenDto} from '../model/get-token-dto'; // @ts-ignore -import { GetUserDto } from '../model/get-user-dto'; +import {GetUserDto} from '../model/get-user-dto'; // @ts-ignore -import { PatchUserPasswordDto } from '../model/patch-user-password-dto'; +import {PatchUserPasswordDto} from '../model/patch-user-password-dto'; // @ts-ignore -import { UpdateUserDto } from '../model/update-user-dto'; +import {UpdateUserDto} from '../model/update-user-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class UsersService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** * @endpoint post /API/users/connection - * @param connectUserDto + * @param connectUserDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public connectUserEndpoint(connectUserDto: ConnectUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public connectUserEndpoint(connectUserDto: ConnectUserDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public connectUserEndpoint(connectUserDto: ConnectUserDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (connectUserDto === null || connectUserDto === undefined) { throw new Error('Required parameter connectUserDto was null or undefined when calling connectUserEndpoint.'); } @@ -94,16 +110,16 @@ export class UsersService extends BaseService { } let localVarPath = `/API/users/connection`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: connectUserDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -111,14 +127,30 @@ export class UsersService extends BaseService { /** * @endpoint post /API/users - * @param createUserDto + * @param createUserDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createUserEndpoint(createUserDto: CreateUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createUserEndpoint(createUserDto: CreateUserDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public createUserEndpoint(createUserDto: CreateUserDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (createUserDto === null || createUserDto === undefined) { throw new Error('Required parameter createUserDto was null or undefined when calling createUserEndpoint.'); } @@ -158,16 +190,16 @@ export class UsersService extends BaseService { } let localVarPath = `/API/users`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: createUserDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -175,22 +207,37 @@ export class UsersService extends BaseService { /** * @endpoint delete /API/users/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public deleteUserEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable; - public deleteUserEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteUserEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteUserEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable { + public deleteUserEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable; + public deleteUserEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteUserEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public deleteUserEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: undefined, + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling deleteUserEndpoint.'); } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - ]); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } @@ -211,16 +258,24 @@ export class UsersService extends BaseService { } } - let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/users/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -231,10 +286,26 @@ export class UsersService extends BaseService { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getAllUsersEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllUsersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllUsersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAllUsersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getAllUsersEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllUsersEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllUsersEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllUsersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { let localVarHeaders = this.defaultHeaders; @@ -262,15 +333,15 @@ export class UsersService extends BaseService { } let localVarPath = `/API/users`; - const { basePath, withCredentials } = this.configuration; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request>('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -278,14 +349,30 @@ export class UsersService extends BaseService { /** * @endpoint get /API/users/{id} - * @param id + * @param id * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getUserEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getUserEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getUserEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getUserEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getUserEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getUserEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getUserEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getUserEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getUserEndpoint.'); } @@ -315,16 +402,24 @@ export class UsersService extends BaseService { } } - let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/users/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -332,15 +427,31 @@ export class UsersService extends BaseService { /** * @endpoint patch /API/users/{id}/password - * @param id - * @param patchUserPasswordDto + * @param id + * @param patchUserPasswordDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchUserPasswordEndpoint(id: number, patchUserPasswordDto: PatchUserPasswordDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling patchUserPasswordEndpoint.'); } @@ -382,17 +493,25 @@ export class UsersService extends BaseService { } } - let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/password`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/users/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/password`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchUserPasswordDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -400,15 +519,31 @@ export class UsersService extends BaseService { /** * @endpoint put /API/users/{id} - * @param id - * @param updateUserDto + * @param id + * @param updateUserDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public updateUserEndpoint(id: number, updateUserDto: UpdateUserDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateUserEndpoint.'); } @@ -450,17 +585,25 @@ export class UsersService extends BaseService { } } - let localVarPath = `/API/users/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/users/${this.configuration.encodeParam({ + name: "id", + value: id, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('put', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: updateUserDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/api/warehouseproducts.service.ts b/src/app/services/api/api/warehouseproducts.service.ts index 532d7c7..89d1beb 100644 --- a/src/app/services/api/api/warehouseproducts.service.ts +++ b/src/app/services/api/api/warehouseproducts.service.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,46 +9,62 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; // @ts-ignore -import { GetTotalQuantityDto } from '../model/get-total-quantity-dto'; +import {GetTotalQuantityDto} from '../model/get-total-quantity-dto'; // @ts-ignore -import { GetWareHouseProductDto } from '../model/get-ware-house-product-dto'; +import {GetWareHouseProductDto} from '../model/get-ware-house-product-dto'; // @ts-ignore -import { PatchWareHouseProductQuantityDto } from '../model/patch-ware-house-product-quantity-dto'; +import {PatchWareHouseProductQuantityDto} from '../model/patch-ware-house-product-quantity-dto'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; - +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class WarehouseproductsService extends BaseService { - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } /** * @endpoint get /API/wareHouseProducts/{productId} - * @param productId + * @param productId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getTotalQuantityEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTotalQuantityEndpoint(productId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTotalQuantityEndpoint(productId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTotalQuantityEndpoint(productId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getTotalQuantityEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public getTotalQuantityEndpoint(productId: number, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getTotalQuantityEndpoint(productId: number, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getTotalQuantityEndpoint(productId: number, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (productId === null || productId === undefined) { throw new Error('Required parameter productId was null or undefined when calling getTotalQuantityEndpoint.'); } @@ -78,16 +94,24 @@ export class WarehouseproductsService extends BaseService { } } - let localVarPath = `/API/wareHouseProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/wareHouseProducts/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); @@ -95,16 +119,32 @@ export class WarehouseproductsService extends BaseService { /** * @endpoint patch /API/wareHouseProducts/{productId}/{wareHouseId}/quantity - * @param productId - * @param wareHouseId - * @param patchWareHouseProductQuantityDto + * @param productId + * @param wareHouseId + * @param patchWareHouseProductQuantityDto * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable; + public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public patchWareHouseProductQuantityEndpoint(productId: number, wareHouseId: number, patchWareHouseProductQuantityDto: PatchWareHouseProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { if (productId === null || productId === undefined) { throw new Error('Required parameter productId was null or undefined when calling patchWareHouseProductQuantityEndpoint.'); } @@ -149,17 +189,33 @@ export class WarehouseproductsService extends BaseService { } } - let localVarPath = `/API/wareHouseProducts/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "wareHouseId", value: wareHouseId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/quantity`; - const { basePath, withCredentials } = this.configuration; + let localVarPath = `/API/wareHouseProducts/${this.configuration.encodeParam({ + name: "productId", + value: productId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/${this.configuration.encodeParam({ + name: "wareHouseId", + value: wareHouseId, + in: "path", + style: "simple", + explode: false, + dataType: "number", + dataFormat: "int32" + })}/quantity`; + const {basePath, withCredentials} = this.configuration; return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: patchWareHouseProductQuantityDto, responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), + ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), reportProgress: reportProgress } ); diff --git a/src/app/services/api/configuration.ts b/src/app/services/api/configuration.ts index 5ffdfbb..1dc1e57 100644 --- a/src/app/services/api/configuration.ts +++ b/src/app/services/api/configuration.ts @@ -1,11 +1,11 @@ -import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; -import { Param } from './param'; +import {HttpHeaders, HttpParams, HttpParameterCodec} from '@angular/common/http'; +import {Param} from './param'; export interface ConfigurationParameters { /** * @deprecated Since 5.0. Use credentials instead */ - apiKeys?: {[ key: string ]: string}; + apiKeys?: { [key: string]: string }; username?: string; password?: string; /** @@ -31,14 +31,14 @@ export interface ConfigurationParameters { * document. They should map to the value used for authentication * minus any standard prefixes such as 'Basic' or 'Bearer'. */ - credentials?: {[ key: string ]: string | (() => string | undefined)}; + credentials?: { [key: string]: string | (() => string | undefined) }; } export class Configuration { /** * @deprecated Since 5.0. Use credentials instead */ - apiKeys?: {[ key: string ]: string}; + apiKeys?: { [key: string]: string }; username?: string; password?: string; /** @@ -64,9 +64,19 @@ export class Configuration { * document. They should map to the value used for authentication * minus any standard prefixes such as 'Basic' or 'Bearer'. */ - credentials: {[ key: string ]: string | (() => string | undefined)}; + credentials: { [key: string]: string | (() => string | undefined) }; -constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + constructor({ + accessToken, + apiKeys, + basePath, + credentials, + encodeParam, + encoder, + password, + username, + withCredentials + }: ConfigurationParameters = {}) { if (apiKeys) { this.apiKeys = apiKeys; } @@ -108,7 +118,7 @@ constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, * @param contentTypes - the array of content types that are available for selection * @returns the selected content-type or undefined if no selection could be made. */ - public selectHeaderContentType (contentTypes: string[]): string | undefined { + public selectHeaderContentType(contentTypes: string[]): string | undefined { if (contentTypes.length === 0) { return undefined; } diff --git a/src/app/services/api/encoder.ts b/src/app/services/api/encoder.ts index 138c4d5..8e4032a 100644 --- a/src/app/services/api/encoder.ts +++ b/src/app/services/api/encoder.ts @@ -1,4 +1,4 @@ -import { HttpParameterCodec } from '@angular/common/http'; +import {HttpParameterCodec} from '@angular/common/http'; /** * Custom HttpParameterCodec @@ -8,12 +8,15 @@ export class CustomHttpParameterCodec implements HttpParameterCodec { encodeKey(k: string): string { return encodeURIComponent(k); } + encodeValue(v: string): string { return encodeURIComponent(v); } + decodeKey(k: string): string { return decodeURIComponent(k); } + decodeValue(v: string): string { return decodeURIComponent(v); } diff --git a/src/app/services/api/model/add-quotation-product-dto.ts b/src/app/services/api/model/add-quotation-product-dto.ts new file mode 100644 index 0000000..0685086 --- /dev/null +++ b/src/app/services/api/model/add-quotation-product-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface AddQuotationProductDto { + quantity?: number; + quotationId?: number; +} + diff --git a/src/app/services/api/model/connect-user-dto.ts b/src/app/services/api/model/connect-user-dto.ts index 2ce7974..a2f2960 100644 --- a/src/app/services/api/model/connect-user-dto.ts +++ b/src/app/services/api/model/connect-user-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface ConnectUserDto { +export interface ConnectUserDto { name?: string | null; password?: string | null; } diff --git a/src/app/services/api/model/create-deliverer-dto.ts b/src/app/services/api/model/create-deliverer-dto.ts index d7b5980..bf30aa5 100644 --- a/src/app/services/api/model/create-deliverer-dto.ts +++ b/src/app/services/api/model/create-deliverer-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface CreateDelivererDto { +export interface CreateDelivererDto { transporter?: string | null; } diff --git a/src/app/services/api/model/create-delivery-note-dto.ts b/src/app/services/api/model/create-delivery-note-dto.ts index 8635bf6..e3bbc2f 100644 --- a/src/app/services/api/model/create-delivery-note-dto.ts +++ b/src/app/services/api/model/create-delivery-note-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface CreateDeliveryNoteDto { +export interface CreateDeliveryNoteDto { trackingNumber?: string | null; estimateDeliveryDate?: string; expeditionDate?: string; diff --git a/src/app/services/api/model/create-price-dto.ts b/src/app/services/api/model/create-price-dto.ts index d127766..b488dce 100644 --- a/src/app/services/api/model/create-price-dto.ts +++ b/src/app/services/api/model/create-price-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,7 @@ */ -export interface CreatePriceDto { +export interface CreatePriceDto { sellingPrice?: number; - supplierId?: number | null; - supplierName?: string | null; - supplierEmail?: string | null; - supplierPhone?: string | null; - supplierAddress?: string | null; - supplierZipCode?: string | null; - supplierCity?: string | null; - supplierDeliveryDelay?: number; - productId?: number | null; - productReferences?: string | null; - productName?: string | null; - productDuration?: number; - productCaliber?: number; - productApprovalNumber?: string | null; - productWeight?: number; - productNec?: number; - productImage?: string | null; - productLink?: string | null; - productMinimalQuantity?: number; } diff --git a/src/app/services/api/model/create-product-quotation-dto.ts b/src/app/services/api/model/create-product-quotation-dto.ts index 76033ca..a87e116 100644 --- a/src/app/services/api/model/create-product-quotation-dto.ts +++ b/src/app/services/api/model/create-product-quotation-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface CreateProductQuotationDto { +export interface CreateProductQuotationDto { productId?: number; quantity?: number; } diff --git a/src/app/services/api/model/create-purchase-order-dto.ts b/src/app/services/api/model/create-purchase-order-dto.ts index 0b3b3c5..8147c58 100644 --- a/src/app/services/api/model/create-purchase-order-dto.ts +++ b/src/app/services/api/model/create-purchase-order-dto.ts @@ -1,16 +1,16 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { CreatePurchaseOrderProductDto } from './create-purchase-order-product-dto'; +import {CreatePurchaseOrderProductDto} from './create-purchase-order-product-dto'; -export interface CreatePurchaseOrderDto { +export interface CreatePurchaseOrderDto { purchaseConditions?: string | null; products?: Array | null; } diff --git a/src/app/services/api/model/create-purchase-order-product-dto.ts b/src/app/services/api/model/create-purchase-order-product-dto.ts index 256d725..2d74e61 100644 --- a/src/app/services/api/model/create-purchase-order-product-dto.ts +++ b/src/app/services/api/model/create-purchase-order-product-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface CreatePurchaseOrderProductDto { +export interface CreatePurchaseOrderProductDto { productId?: number; quantity?: number; } diff --git a/src/app/services/api/model/create-purchase-product-dto.ts b/src/app/services/api/model/create-purchase-product-dto.ts index 4e772d9..3593b4a 100644 --- a/src/app/services/api/model/create-purchase-product-dto.ts +++ b/src/app/services/api/model/create-purchase-product-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,10 +9,7 @@ */ -export interface CreatePurchaseProductDto { +export interface CreatePurchaseProductDto { quantity?: number; - productId?: number; - purchaseOrderId?: number; - purchaseOrderPurchaseConditions?: string | null; } diff --git a/src/app/services/api/model/create-quotation-dto.ts b/src/app/services/api/model/create-quotation-dto.ts index 7b6faaa..00cea1a 100644 --- a/src/app/services/api/model/create-quotation-dto.ts +++ b/src/app/services/api/model/create-quotation-dto.ts @@ -1,16 +1,16 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { CreateProductQuotationDto } from './create-product-quotation-dto'; +import {CreateProductQuotationDto} from './create-product-quotation-dto'; -export interface CreateQuotationDto { +export interface CreateQuotationDto { message?: string | null; conditionsSale?: string | null; products?: Array | null; diff --git a/src/app/services/api/model/create-quotation-product-dto.ts b/src/app/services/api/model/create-quotation-product-dto.ts deleted file mode 100644 index b6ea6d3..0000000 --- a/src/app/services/api/model/create-quotation-product-dto.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * PyroFetes - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface CreateQuotationProductDto { - quantity?: number; - quotationId?: number; - quotationMessage?: string | null; - quotationConditionsSale?: string | null; - productId?: number; - productReferences?: number; - productName?: string | null; - productDuration?: number; - productCaliber?: number; - productApprovalNumber?: string | null; - productWeight?: number; - productNec?: number; - productImage?: string | null; - productLink?: string | null; - productMinimalQuantity?: number; -} - diff --git a/src/app/services/api/model/create-setting-dto.ts b/src/app/services/api/model/create-setting-dto.ts index 21f659e..22ab41f 100644 --- a/src/app/services/api/model/create-setting-dto.ts +++ b/src/app/services/api/model/create-setting-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,8 +9,8 @@ */ -export interface CreateSettingDto { - electronicSignature?: string | null; - logo?: string | null; +export interface CreateSettingDto { + electronicSignature?: Blob | null; + logo?: Blob | null; } diff --git a/src/app/services/api/model/create-supplier-dto.ts b/src/app/services/api/model/create-supplier-dto.ts index fc44016..395892b 100644 --- a/src/app/services/api/model/create-supplier-dto.ts +++ b/src/app/services/api/model/create-supplier-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface CreateSupplierDto { +export interface CreateSupplierDto { name?: string | null; email?: string | null; phone?: string | null; diff --git a/src/app/services/api/model/create-user-dto.ts b/src/app/services/api/model/create-user-dto.ts index 1c7145c..b0ae0c0 100644 --- a/src/app/services/api/model/create-user-dto.ts +++ b/src/app/services/api/model/create-user-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface CreateUserDto { +export interface CreateUserDto { name?: string | null; password?: string | null; fonction?: string | null; diff --git a/src/app/services/api/model/get-deliverer-dto.ts b/src/app/services/api/model/get-deliverer-dto.ts index ee6e20d..56bbe33 100644 --- a/src/app/services/api/model/get-deliverer-dto.ts +++ b/src/app/services/api/model/get-deliverer-dto.ts @@ -1,16 +1,16 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { GetDeliveryNoteDto } from './get-delivery-note-dto'; +import {GetDeliveryNoteDto} from './get-delivery-note-dto'; -export interface GetDelivererDto { +export interface GetDelivererDto { id?: number; transporter?: string | null; deliveryNotes?: Array | null; diff --git a/src/app/services/api/model/get-delivery-note-dto.ts b/src/app/services/api/model/get-delivery-note-dto.ts index d749a8a..56c4fea 100644 --- a/src/app/services/api/model/get-delivery-note-dto.ts +++ b/src/app/services/api/model/get-delivery-note-dto.ts @@ -1,16 +1,16 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { GetProductDeliveryDto } from './get-product-delivery-dto'; +import {GetProductDeliveryDto} from './get-product-delivery-dto'; -export interface GetDeliveryNoteDto { +export interface GetDeliveryNoteDto { id?: number; trackingNumber?: string | null; estimateDeliveryDate?: string; diff --git a/src/app/services/api/model/get-price-dto.ts b/src/app/services/api/model/get-price-dto.ts index aecbf6e..e427bc2 100644 --- a/src/app/services/api/model/get-price-dto.ts +++ b/src/app/services/api/model/get-price-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,10 @@ */ -export interface GetPriceDto { - id?: number; +export interface GetPriceDto { sellingPrice?: number; - supplierId?: number; - supplierName?: string | null; - supplierEmail?: string | null; - supplierPhone?: string | null; - supplierAddress?: string | null; - supplierZipCode?: string | null; - supplierCity?: string | null; - supplierDeliveryDelay?: number; productId?: number; - productReferences?: string | null; + productReference?: string | null; productName?: string | null; productDuration?: number; productCaliber?: number; diff --git a/src/app/services/api/model/get-product-delivery-dto.ts b/src/app/services/api/model/get-product-delivery-dto.ts index 3bcbb83..382ad9a 100644 --- a/src/app/services/api/model/get-product-delivery-dto.ts +++ b/src/app/services/api/model/get-product-delivery-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface GetProductDeliveryDto { +export interface GetProductDeliveryDto { productId?: number; productReference?: string | null; productName?: string | null; @@ -21,13 +21,6 @@ export interface GetProductDeliveryDto { productImage?: string | null; productLink?: string | null; productMinimalQuantity?: number; - deliveryNoteId?: number; - deliveryNoteTrackingNumber?: string | null; - deliveryNoteEstimateDeliveryDate?: string; - deliveryNoteExpeditionDate?: string; - deliveryNoteRealDeliveryDate?: string | null; - deliveryNoteDeliverId?: number; - deliveryNoteDeliverTransporter?: string | null; quantity?: number; } diff --git a/src/app/services/api/model/get-product-dto.ts b/src/app/services/api/model/get-product-dto.ts index 812aed6..c199b1a 100644 --- a/src/app/services/api/model/get-product-dto.ts +++ b/src/app/services/api/model/get-product-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface GetProductDto { +export interface GetProductDto { id?: number; references?: string | null; name?: string | null; diff --git a/src/app/services/api/model/get-purchase-order-dto.ts b/src/app/services/api/model/get-purchase-order-dto.ts index 96950b2..d10815a 100644 --- a/src/app/services/api/model/get-purchase-order-dto.ts +++ b/src/app/services/api/model/get-purchase-order-dto.ts @@ -1,18 +1,19 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { GetPurchaseProductDto } from './get-purchase-product-dto'; +import {GetPurchaseProductDto} from './get-purchase-product-dto'; -export interface GetPurchaseOrderDto { +export interface GetPurchaseOrderDto { id?: number; purchaseConditions?: string | null; + supplierId?: number; products?: Array | null; } diff --git a/src/app/services/api/model/get-purchase-product-dto.ts b/src/app/services/api/model/get-purchase-product-dto.ts index 75b09fe..deaff53 100644 --- a/src/app/services/api/model/get-purchase-product-dto.ts +++ b/src/app/services/api/model/get-purchase-product-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,9 @@ */ -export interface GetPurchaseProductDto { +export interface GetPurchaseProductDto { productId?: number; - productReferences?: string | null; + productReference?: string | null; productName?: string | null; productDuration?: number; productCaliber?: number; @@ -21,8 +21,7 @@ export interface GetPurchaseProductDto { productImage?: string | null; productLink?: string | null; productMinimalQuantity?: number; - purchaseOrderId?: number; - purchaseOrderPurchaseConditions?: string | null; + productPrice?: number; quantity?: number; } diff --git a/src/app/services/api/model/get-quotation-dto.ts b/src/app/services/api/model/get-quotation-dto.ts index a8d25be..75b859a 100644 --- a/src/app/services/api/model/get-quotation-dto.ts +++ b/src/app/services/api/model/get-quotation-dto.ts @@ -1,16 +1,16 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { GetQuotationProductDto } from './get-quotation-product-dto'; +import {GetQuotationProductDto} from './get-quotation-product-dto'; -export interface GetQuotationDto { +export interface GetQuotationDto { id?: number; message?: string | null; conditionsSale?: string | null; diff --git a/src/app/services/api/model/get-quotation-product-dto.ts b/src/app/services/api/model/get-quotation-product-dto.ts index 89eb74d..2641f2f 100644 --- a/src/app/services/api/model/get-quotation-product-dto.ts +++ b/src/app/services/api/model/get-quotation-product-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,10 @@ */ -export interface GetQuotationProductDto { +export interface GetQuotationProductDto { quantity?: number; - quotationId?: number; - quotationMessage?: string | null; - quotationConditionsSale?: string | null; productId?: number; - productReferences?: string | null; + productReference?: string | null; productName?: string | null; productDuration?: number; productCaliber?: number; diff --git a/src/app/services/api/model/get-setting-dto.ts b/src/app/services/api/model/get-setting-dto.ts index 8d73ba9..c6f3dbb 100644 --- a/src/app/services/api/model/get-setting-dto.ts +++ b/src/app/services/api/model/get-setting-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface GetSettingDto { +export interface GetSettingDto { id?: number; electronicSignature?: string | null; logo?: string | null; diff --git a/src/app/services/api/model/get-supplier-dto.ts b/src/app/services/api/model/get-supplier-dto.ts index a612c83..ae71fdc 100644 --- a/src/app/services/api/model/get-supplier-dto.ts +++ b/src/app/services/api/model/get-supplier-dto.ts @@ -1,17 +1,16 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { GetPriceDto } from './get-price-dto'; -import { GetProductDto } from './get-product-dto'; +import {GetPriceDto} from './get-price-dto'; -export interface GetSupplierDto { +export interface GetSupplierDto { id?: number; name?: string | null; email?: string | null; @@ -20,7 +19,6 @@ export interface GetSupplierDto { zipCode?: string | null; city?: string | null; deliveryDelay?: number; - products?: Array | null; prices?: Array | null; } diff --git a/src/app/services/api/model/get-token-dto.ts b/src/app/services/api/model/get-token-dto.ts index 1078bed..3419c33 100644 --- a/src/app/services/api/model/get-token-dto.ts +++ b/src/app/services/api/model/get-token-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface GetTokenDto { +export interface GetTokenDto { token?: string | null; } diff --git a/src/app/services/api/model/get-total-quantity-dto.ts b/src/app/services/api/model/get-total-quantity-dto.ts index 6231f8e..c23620f 100644 --- a/src/app/services/api/model/get-total-quantity-dto.ts +++ b/src/app/services/api/model/get-total-quantity-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface GetTotalQuantityDto { +export interface GetTotalQuantityDto { productId?: number; totalQuantity?: number; } diff --git a/src/app/services/api/model/get-user-dto.ts b/src/app/services/api/model/get-user-dto.ts index e4121b6..e66da7e 100644 --- a/src/app/services/api/model/get-user-dto.ts +++ b/src/app/services/api/model/get-user-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface GetUserDto { +export interface GetUserDto { id?: number; name?: string | null; password?: string | null; diff --git a/src/app/services/api/model/get-ware-house-product-dto.ts b/src/app/services/api/model/get-ware-house-product-dto.ts index 8e4e0fb..8efc1de 100644 --- a/src/app/services/api/model/get-ware-house-product-dto.ts +++ b/src/app/services/api/model/get-ware-house-product-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface GetWareHouseProductDto { +export interface GetWareHouseProductDto { quantity?: number; wareHouseId?: number; productId?: number; diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts index f8ad444..ca69a14 100644 --- a/src/app/services/api/model/models.ts +++ b/src/app/services/api/model/models.ts @@ -1,3 +1,4 @@ +export * from './add-quotation-product-dto'; export * from './connect-user-dto'; export * from './create-deliverer-dto'; export * from './create-delivery-note-dto'; @@ -7,7 +8,6 @@ export * from './create-purchase-order-dto'; export * from './create-purchase-order-product-dto'; export * from './create-purchase-product-dto'; export * from './create-quotation-dto'; -export * from './create-quotation-product-dto'; export * from './create-setting-dto'; export * from './create-supplier-dto'; export * from './create-user-dto'; @@ -32,6 +32,7 @@ export * from './patch-product-minimal-stock-dto'; export * from './patch-purchase-order-purchase-conditions-dto'; export * from './patch-purchase-product-quantity-dto'; export * from './patch-quotation-conditions-sale-dto'; +export * from './patch-quotation-message-dto'; export * from './patch-quotation-product-quantity-dto'; export * from './patch-setting-electronic-signature-dto'; export * from './patch-setting-logo-dto'; diff --git a/src/app/services/api/model/patch-delivery-note-real-delivery-date-dto.ts b/src/app/services/api/model/patch-delivery-note-real-delivery-date-dto.ts index c851cdf..8095bf9 100644 --- a/src/app/services/api/model/patch-delivery-note-real-delivery-date-dto.ts +++ b/src/app/services/api/model/patch-delivery-note-real-delivery-date-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchDeliveryNoteRealDeliveryDateDto { +export interface PatchDeliveryNoteRealDeliveryDateDto { realDeliveryDate?: string; } diff --git a/src/app/services/api/model/patch-price-selling-price-dto.ts b/src/app/services/api/model/patch-price-selling-price-dto.ts index 29333df..89d4afb 100644 --- a/src/app/services/api/model/patch-price-selling-price-dto.ts +++ b/src/app/services/api/model/patch-price-selling-price-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchPriceSellingPriceDto { +export interface PatchPriceSellingPriceDto { sellingPrice?: number; } diff --git a/src/app/services/api/model/patch-product-minimal-stock-dto.ts b/src/app/services/api/model/patch-product-minimal-stock-dto.ts index b37e9db..94df8ec 100644 --- a/src/app/services/api/model/patch-product-minimal-stock-dto.ts +++ b/src/app/services/api/model/patch-product-minimal-stock-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchProductMinimalStockDto { +export interface PatchProductMinimalStockDto { minimalQuantity?: number; } diff --git a/src/app/services/api/model/patch-purchase-order-purchase-conditions-dto.ts b/src/app/services/api/model/patch-purchase-order-purchase-conditions-dto.ts index 710de0d..5826679 100644 --- a/src/app/services/api/model/patch-purchase-order-purchase-conditions-dto.ts +++ b/src/app/services/api/model/patch-purchase-order-purchase-conditions-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchPurchaseOrderPurchaseConditionsDto { +export interface PatchPurchaseOrderPurchaseConditionsDto { purchaseConditions?: string | null; } diff --git a/src/app/services/api/model/patch-purchase-product-quantity-dto.ts b/src/app/services/api/model/patch-purchase-product-quantity-dto.ts index d8355ee..f793a24 100644 --- a/src/app/services/api/model/patch-purchase-product-quantity-dto.ts +++ b/src/app/services/api/model/patch-purchase-product-quantity-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchPurchaseProductQuantityDto { +export interface PatchPurchaseProductQuantityDto { quantity?: number; } diff --git a/src/app/services/api/model/patch-quotation-conditions-sale-dto.ts b/src/app/services/api/model/patch-quotation-conditions-sale-dto.ts index 36fd3db..4a7921b 100644 --- a/src/app/services/api/model/patch-quotation-conditions-sale-dto.ts +++ b/src/app/services/api/model/patch-quotation-conditions-sale-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchQuotationConditionsSaleDto { +export interface PatchQuotationConditionsSaleDto { conditionsSale?: string | null; } diff --git a/src/app/services/api/model/patch-quotation-message-dto.ts b/src/app/services/api/model/patch-quotation-message-dto.ts new file mode 100644 index 0000000..7b281f6 --- /dev/null +++ b/src/app/services/api/model/patch-quotation-message-dto.ts @@ -0,0 +1,15 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface PatchQuotationMessageDto { + message?: string | null; +} + diff --git a/src/app/services/api/model/patch-quotation-product-quantity-dto.ts b/src/app/services/api/model/patch-quotation-product-quantity-dto.ts index e32072a..67b5f1a 100644 --- a/src/app/services/api/model/patch-quotation-product-quantity-dto.ts +++ b/src/app/services/api/model/patch-quotation-product-quantity-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchQuotationProductQuantityDto { +export interface PatchQuotationProductQuantityDto { quantity?: number; } diff --git a/src/app/services/api/model/patch-setting-electronic-signature-dto.ts b/src/app/services/api/model/patch-setting-electronic-signature-dto.ts index 13bcdbd..4b352b5 100644 --- a/src/app/services/api/model/patch-setting-electronic-signature-dto.ts +++ b/src/app/services/api/model/patch-setting-electronic-signature-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchSettingElectronicSignatureDto { - electronicSignature?: string | null; +export interface PatchSettingElectronicSignatureDto { + electronicSignature?: Blob | null; } diff --git a/src/app/services/api/model/patch-setting-logo-dto.ts b/src/app/services/api/model/patch-setting-logo-dto.ts index 3257ca9..29f2ef8 100644 --- a/src/app/services/api/model/patch-setting-logo-dto.ts +++ b/src/app/services/api/model/patch-setting-logo-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchSettingLogoDto { - logo?: string | null; +export interface PatchSettingLogoDto { + logo?: Blob | null; } diff --git a/src/app/services/api/model/patch-supplier-delivery-delay-dto.ts b/src/app/services/api/model/patch-supplier-delivery-delay-dto.ts index 41585ec..de9555b 100644 --- a/src/app/services/api/model/patch-supplier-delivery-delay-dto.ts +++ b/src/app/services/api/model/patch-supplier-delivery-delay-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchSupplierDeliveryDelayDto { +export interface PatchSupplierDeliveryDelayDto { deliveryDelay?: number; } diff --git a/src/app/services/api/model/patch-user-password-dto.ts b/src/app/services/api/model/patch-user-password-dto.ts index c9ac320..f9dec43 100644 --- a/src/app/services/api/model/patch-user-password-dto.ts +++ b/src/app/services/api/model/patch-user-password-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchUserPasswordDto { +export interface PatchUserPasswordDto { password?: string | null; } diff --git a/src/app/services/api/model/patch-ware-house-product-quantity-dto.ts b/src/app/services/api/model/patch-ware-house-product-quantity-dto.ts index 4899b61..ccc0dad 100644 --- a/src/app/services/api/model/patch-ware-house-product-quantity-dto.ts +++ b/src/app/services/api/model/patch-ware-house-product-quantity-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface PatchWareHouseProductQuantityDto { +export interface PatchWareHouseProductQuantityDto { quantity?: number; } diff --git a/src/app/services/api/model/update-deliverer-dto.ts b/src/app/services/api/model/update-deliverer-dto.ts index 68032be..843fe76 100644 --- a/src/app/services/api/model/update-deliverer-dto.ts +++ b/src/app/services/api/model/update-deliverer-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface UpdateDelivererDto { +export interface UpdateDelivererDto { transporter?: string | null; } diff --git a/src/app/services/api/model/update-delivery-note-dto.ts b/src/app/services/api/model/update-delivery-note-dto.ts index 181449d..7d11f6a 100644 --- a/src/app/services/api/model/update-delivery-note-dto.ts +++ b/src/app/services/api/model/update-delivery-note-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface UpdateDeliveryNoteDto { +export interface UpdateDeliveryNoteDto { trackingNumber?: string | null; estimateDeliveryDate?: string; expeditionDate?: string; diff --git a/src/app/services/api/model/update-product-dto.ts b/src/app/services/api/model/update-product-dto.ts index f191e22..c1aeeb2 100644 --- a/src/app/services/api/model/update-product-dto.ts +++ b/src/app/services/api/model/update-product-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface UpdateProductDto { +export interface UpdateProductDto { references?: string | null; name?: string | null; duration?: number; diff --git a/src/app/services/api/model/update-quotation-dto.ts b/src/app/services/api/model/update-quotation-dto.ts index 5895594..8ddeab3 100644 --- a/src/app/services/api/model/update-quotation-dto.ts +++ b/src/app/services/api/model/update-quotation-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface UpdateQuotationDto { +export interface UpdateQuotationDto { message?: string | null; conditionsSale?: string | null; } diff --git a/src/app/services/api/model/update-supplier-dto.ts b/src/app/services/api/model/update-supplier-dto.ts index d2c7c5a..d835318 100644 --- a/src/app/services/api/model/update-supplier-dto.ts +++ b/src/app/services/api/model/update-supplier-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface UpdateSupplierDto { +export interface UpdateSupplierDto { name?: string | null; email?: string | null; phone?: string | null; diff --git a/src/app/services/api/model/update-user-dto.ts b/src/app/services/api/model/update-user-dto.ts index 672015b..d8d4d7c 100644 --- a/src/app/services/api/model/update-user-dto.ts +++ b/src/app/services/api/model/update-user-dto.ts @@ -1,7 +1,7 @@ /** * PyroFetes * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,7 @@ */ -export interface UpdateUserDto { +export interface UpdateUserDto { name?: string | null; password?: string | null; fonction?: string | null; diff --git a/src/app/services/api/param.ts b/src/app/services/api/param.ts index 78a2d20..7f0592c 100644 --- a/src/app/services/api/param.ts +++ b/src/app/services/api/param.ts @@ -2,14 +2,14 @@ * Standard parameter styles defined by OpenAPI spec */ export type StandardParamStyle = - | 'matrix' - | 'label' - | 'form' - | 'simple' - | 'spaceDelimited' - | 'pipeDelimited' - | 'deepObject' - ; + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; /** * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. @@ -25,13 +25,13 @@ export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; * Standard types as defined in OpenAPI Specification: Data Types */ export type StandardDataType = - | "integer" - | "number" - | "boolean" - | "string" - | "object" - | "array" - ; + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; /** * Standard {@link DataType}s plus your own types/classes. @@ -42,16 +42,16 @@ export type DataType = StandardDataType | string; * Standard formats as defined in OpenAPI Specification: Data Types */ export type StandardDataFormat = - | "int32" - | "int64" - | "float" - | "double" - | "byte" - | "binary" - | "date" - | "date-time" - | "password" - ; + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; export type DataFormat = StandardDataFormat | string; @@ -59,11 +59,11 @@ export type DataFormat = StandardDataFormat | string; * The parameter to encode. */ export interface Param { - name: string; - value: unknown; - in: ParamLocation; - style: ParamStyle, - explode: boolean; - dataType: DataType; - dataFormat: DataFormat | undefined; + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; } diff --git a/src/app/services/api/provide-api.ts b/src/app/services/api/provide-api.ts index 19c762a..b63aa71 100644 --- a/src/app/services/api/provide-api.ts +++ b/src/app/services/api/provide-api.ts @@ -1,15 +1,15 @@ -import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; -import { Configuration, ConfigurationParameters } from './configuration'; -import { BASE_PATH } from './variables'; +import {EnvironmentProviders, makeEnvironmentProviders} from "@angular/core"; +import {Configuration, ConfigurationParameters} from './configuration'; +import {BASE_PATH} from './variables'; // Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { return makeEnvironmentProviders([ typeof configOrBasePath === "string" - ? { provide: BASE_PATH, useValue: configOrBasePath } + ? {provide: BASE_PATH, useValue: configOrBasePath} : { provide: Configuration, - useValue: new Configuration({ ...configOrBasePath }), + useValue: new Configuration({...configOrBasePath}), }, ]); } \ No newline at end of file diff --git a/src/app/services/api/variables.ts b/src/app/services/api/variables.ts index 6fe5854..ac9262f 100644 --- a/src/app/services/api/variables.ts +++ b/src/app/services/api/variables.ts @@ -1,4 +1,4 @@ -import { InjectionToken } from '@angular/core'; +import {InjectionToken} from '@angular/core'; export const BASE_PATH = new InjectionToken('basePath'); export const COLLECTION_FORMATS = { diff --git a/src/app/services/file.service.ts b/src/app/services/file.service.ts index 3828709..f9dc5fe 100644 --- a/src/app/services/file.service.ts +++ b/src/app/services/file.service.ts @@ -1,18 +1,14 @@ -import { Injectable } from '@angular/core'; +import {Injectable} from '@angular/core'; import {HttpResponse} from "@angular/common/http"; @Injectable({ - providedIn: 'root', + providedIn: 'root', }) export class FileService { getFilenameFromHttpResponse(httpResponse: HttpResponse) { const contentDispositionHeader = httpResponse.headers.get('Content-Disposition'); - // console.log(contentDispositionHeader); let result = contentDispositionHeader.split(';')[1].trim().split('=')[1]; - // Removing the " from the after trim operation result = result.replace(/"/g, ''); - // Removing . from filename - // return result.replace(/./g, '_'); return result; } diff --git a/src/index.html b/src/index.html index 4570243..b3cdbf9 100644 --- a/src/index.html +++ b/src/index.html @@ -1,13 +1,14 @@ - - PyrofetesFrontend - - - + + PyroFêtes + + + - + diff --git a/src/main.ts b/src/main.ts index 5df75f9..d25a841 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ -import { bootstrapApplication } from '@angular/platform-browser'; -import { appConfig } from './app/app.config'; -import { App } from './app/app'; +import {bootstrapApplication} from '@angular/platform-browser'; +import {appConfig} from './app/app.config'; +import {App} from './app/app'; bootstrapApplication(App, appConfig) - .catch((err) => console.error(err)); + .catch((err) => console.error(err)); diff --git a/src/theme.less b/src/theme.less index ecf2541..532bbd2 100644 --- a/src/theme.less +++ b/src/theme.less @@ -1,4 +1,3 @@ - // Custom Theming for NG-ZORRO // For more information: https://ng.ant.design/docs/customize-theme/en @import "../node_modules/ng-zorro-antd/ng-zorro-antd.less"; From d2ca8b1bf29fffbf25c45f089bd2eb3077f3da4e Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 10:53:32 +0100 Subject: [PATCH 093/127] Adapted front with back update --- .../purchase-order-table/purchase-order-table.html | 2 +- .../purchase-order-table/purchase-order-table.ts | 8 ++------ src/app/components/quotation-table/quotation-table.html | 2 +- src/app/components/quotation-table/quotation-table.ts | 6 ++---- src/app/components/supplier-table/supplier-table.ts | 2 +- src/app/services/api/README.md | 6 +++--- src/app/services/api/model/get-purchase-product-dto.ts | 1 + src/app/services/api/model/get-quotation-product-dto.ts | 1 + 8 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 7b9e7e0..8a32d6a 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -35,7 +35,7 @@ @for (product of purchaseOrder.products; track product.productId) { {{ product.productName }} - {{ product.productReferences }} + {{ product.productReference }} Prix €€€€ {{ product.quantity }} diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 61788a1..c087fca 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -8,17 +8,14 @@ import {ModalButton} from "../modal-button/modal-button"; import { CreateDeliveryNoteDto, DeliverynotesService, - GetDeliveryNoteDto, GetProductDeliveryDto, GetPurchaseOrderDto, GetPurchaseProductDto, PurchaseordersService, - PurchaseproductsService } from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; import {QuantityForm} from "../quantity-form/quantity-form"; -import {PurchaseOrder} from "../../pages/purchase-order/purchase-order"; @Component({ selector: 'app-purchase-order-table', @@ -38,7 +35,6 @@ export class PurchaseOrderTable implements OnInit { private purchaseOrdersService = inject(PurchaseordersService); private notificationService = inject(NzNotificationService); private fileService = inject(FileService); - private purchaseProductService = inject(PurchaseproductsService); private deliveryNoteService = inject(DeliverynotesService); purchaseOrders = signal([]); purchaseOrdersLoading = signal(false); @@ -164,7 +160,7 @@ export class PurchaseOrderTable implements OnInit { async deleteProduct(productId: number, purchaseOrderId: number) { this.purchaseOrdersLoading.set(true) try { - await firstValueFrom(this.purchaseProductService.deletePurchaseProductEndpoint(productId, purchaseOrderId)) + await firstValueFrom(this.purchaseOrdersService.deleteProductFromPurchaseOrderEndpoint(productId, purchaseOrderId)) this.notificationService.success( 'Success', 'Suppression effectuée' @@ -190,7 +186,7 @@ export class PurchaseOrderTable implements OnInit { try { const quantity = updateQuantityComponent.quantityForm.getRawValue(); - await firstValueFrom(this.purchaseProductService.patchPurchaseProductQuantityEndpoint(productId, purchaseOrderId, quantity)) + await firstValueFrom(this.purchaseOrdersService.patchPurchaseProductQuantityEndpoint(productId, purchaseOrderId, quantity)) this.notificationService.success('Success', 'Quantité modifiée') } catch (e) { diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 78604db..0591d24 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -34,7 +34,7 @@ @for (product of quotation.products; track product.productId) { - {{ product.productReferences }} + {{ product.productReference }} {{ product.productName }} Price ??? {{ product.quantity }} diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index 120c8cc..07b0b43 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -8,7 +8,6 @@ import {QuotationForm} from "../quotation-form/quotation-form"; import { GetQuotationDto, GetQuotationProductDto, - QuotationproductsService, QuotationsService } from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; @@ -34,7 +33,6 @@ import {QuantityForm} from "../quantity-form/quantity-form"; export class QuotationTable implements OnInit { private quotationsService = inject(QuotationsService); private notificationService = inject(NzNotificationService); - private quotationProductsService = inject(QuotationproductsService) private fileService = inject(FileService); quotations = signal([]); quotationsLoading = signal(false); @@ -114,7 +112,7 @@ export class QuotationTable implements OnInit { async deleteProduct(productId: number, quotationId: number) { this.quotationsLoading.set(true) try { - await firstValueFrom(this.quotationProductsService.deleteQuotationProductEndpoint(productId, quotationId)) + await firstValueFrom(this.quotationsService.deleteProductFromQuotationEndpoint(productId, quotationId)) this.notificationService.success( 'Success', 'Suppression effectuée' @@ -140,7 +138,7 @@ export class QuotationTable implements OnInit { try { const quantity = updateQuantityComponent.quantityForm.getRawValue(); - await firstValueFrom(this.quotationProductsService.patchQuotationProductQuantityEndpoint(productId, quotationId, quantity)) + await firstValueFrom(this.quotationsService.patchQuotationProductQuantityEndpoint(productId, quotationId, quantity)) this.notificationService.success('Success', 'Quantité modifiée') } catch (e) { diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index a60b085..20c44d3 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -159,7 +159,7 @@ export class SupplierTable implements OnInit { async deleteProduct(idProduct: number, idSupplier: number) { try { - await firstValueFrom(this.pricesService.deletePriceEndpoint(idProduct, idSupplier)); + await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idProduct, idSupplier)); this.notificationService.success('Succès', 'Produit supprimé'); await this.fetchSuppliers(); } catch (e) { diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md index 29f22fe..4d71313 100644 --- a/src/app/services/api/README.md +++ b/src/app/services/api/README.md @@ -59,9 +59,9 @@ In your Angular project: ```typescript -import { ApplicationConfig } from '@angular/core'; -import { provideHttpClient } from '@angular/common/http'; -import { provideApi } from ''; +import {ApplicationConfig} from '@angular/core'; +import {provideHttpClient} from '@angular/common/http'; +import {provideApi} from ''; export const appConfig: ApplicationConfig = { providers: [ diff --git a/src/app/services/api/model/get-purchase-product-dto.ts b/src/app/services/api/model/get-purchase-product-dto.ts index deaff53..5b3a7a1 100644 --- a/src/app/services/api/model/get-purchase-product-dto.ts +++ b/src/app/services/api/model/get-purchase-product-dto.ts @@ -22,6 +22,7 @@ export interface GetPurchaseProductDto { productLink?: string | null; productMinimalQuantity?: number; productPrice?: number; + purchaseOrderId?: number; quantity?: number; } diff --git a/src/app/services/api/model/get-quotation-product-dto.ts b/src/app/services/api/model/get-quotation-product-dto.ts index 2641f2f..b60dab7 100644 --- a/src/app/services/api/model/get-quotation-product-dto.ts +++ b/src/app/services/api/model/get-quotation-product-dto.ts @@ -22,5 +22,6 @@ export interface GetQuotationProductDto { productImage?: string | null; productLink?: string | null; productMinimalQuantity?: number; + quotationId?: number; } From 8afa2e6f0633ee7199e8ac7af67b6b9d064bbe41 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 11:08:15 +0100 Subject: [PATCH 094/127] Fixed errors with suppliers --- .../purchase-order-table/purchase-order-table.html | 2 +- src/app/components/supplier-table/supplier-table.html | 6 +++--- src/app/components/supplier-table/supplier-table.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 8a32d6a..55a6d49 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -36,7 +36,7 @@ {{ product.productName }} {{ product.productReference }} - Prix €€€€ + {{ product.productPrice }} {{ product.quantity }}
    diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index 63a3039..5053fc8 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -36,10 +36,10 @@ - @for (product of supplier.prices; track product.id) { + @for (product of supplier.prices; track product.productId) { {{ product.productName }} - {{ product.productReferences }} + {{ product.productReference }} {{ product.sellingPrice }}€
    @@ -49,7 +49,7 @@ + (click)="deleteProduct(product.productId, supplier.id)">
    diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index 20c44d3..a074980 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -159,7 +159,7 @@ export class SupplierTable implements OnInit { async deleteProduct(idProduct: number, idSupplier: number) { try { - await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idProduct, idSupplier)); + await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idSupplier, idProduct)); this.notificationService.success('Succès', 'Produit supprimé'); await this.fetchSuppliers(); } catch (e) { From 561b8e5fc377c9fb39fe3ad7a5b4ce0d40289057 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 12:18:34 +0100 Subject: [PATCH 095/127] Fixed errors with price in all documents --- src/app/components/product-table/product-table.css | 0 src/app/components/product-table/product-table.html | 0 src/app/components/product-table/product-table.ts | 10 ---------- .../purchase-order-table/purchase-order-table.html | 4 ++-- .../components/quotation-table/quotation-table.html | 2 +- src/app/pages/stock/stock.ts | 3 ++- src/app/services/api/README.md | 6 +++--- src/app/services/api/model/get-purchase-order-dto.ts | 2 +- .../services/api/model/get-quotation-product-dto.ts | 1 + 9 files changed, 10 insertions(+), 18 deletions(-) delete mode 100644 src/app/components/product-table/product-table.css delete mode 100644 src/app/components/product-table/product-table.html delete mode 100644 src/app/components/product-table/product-table.ts diff --git a/src/app/components/product-table/product-table.css b/src/app/components/product-table/product-table.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/components/product-table/product-table.html b/src/app/components/product-table/product-table.html deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/components/product-table/product-table.ts b/src/app/components/product-table/product-table.ts deleted file mode 100644 index b5d283e..0000000 --- a/src/app/components/product-table/product-table.ts +++ /dev/null @@ -1,10 +0,0 @@ -import {Component} from '@angular/core'; - -@Component({ - selector: 'app-product-table', - imports: [], - templateUrl: './product-table.html', - styleUrl: './product-table.css', -}) -export class ProductTable { -} diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 55a6d49..7e08ab4 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -16,7 +16,7 @@ {{ purchaseOrder.id }} {{ purchaseOrder.purchaseConditions }} - Fournisseur ??? + {{ purchaseOrder.supplierName }}
    @@ -36,7 +36,7 @@ {{ product.productName }} {{ product.productReference }} - {{ product.productPrice }} + {{ product.productPrice }} € {{ product.quantity }}
    diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 0591d24..37da021 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -36,7 +36,7 @@ {{ product.productReference }} {{ product.productName }} - Price ??? + {{ product.productPrice }} € {{ product.quantity }}
    diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 0a0096b..9107402 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -2,7 +2,6 @@ import {Component, inject, viewChild} from '@angular/core'; import {StockTable} from "../../components/stock-table/stock-table"; import {Search} from "../../components/search/search"; import {ModalButton} from "../../components/modal-button/modal-button"; -import {QuotationForm} from "../../components/quotation-form/quotation-form"; import {PurchaseordersService, QuotationsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @@ -113,12 +112,14 @@ export class Stock { ); this.notificationService.success('Succès', 'Devis créé'); } catch (e) { + console.log(this.createQuotation()); this.notificationService.error('Erreur', 'Erreur lors de la création du devis.'); } } async onModalQuotationOk() { + console.log(this.createQuotation().createQuotationForm.getRawValue()); await this.addQuotation(); this.createQuotation().createQuotationForm.reset(); this.modalButtonQuotation().isVisible = false; diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md index 4d71313..29f22fe 100644 --- a/src/app/services/api/README.md +++ b/src/app/services/api/README.md @@ -59,9 +59,9 @@ In your Angular project: ```typescript -import {ApplicationConfig} from '@angular/core'; -import {provideHttpClient} from '@angular/common/http'; -import {provideApi} from ''; +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; export const appConfig: ApplicationConfig = { providers: [ diff --git a/src/app/services/api/model/get-purchase-order-dto.ts b/src/app/services/api/model/get-purchase-order-dto.ts index d10815a..7885bc4 100644 --- a/src/app/services/api/model/get-purchase-order-dto.ts +++ b/src/app/services/api/model/get-purchase-order-dto.ts @@ -13,7 +13,7 @@ import {GetPurchaseProductDto} from './get-purchase-product-dto'; export interface GetPurchaseOrderDto { id?: number; purchaseConditions?: string | null; - supplierId?: number; + supplierName?: string | null; products?: Array | null; } diff --git a/src/app/services/api/model/get-quotation-product-dto.ts b/src/app/services/api/model/get-quotation-product-dto.ts index b60dab7..c6eb321 100644 --- a/src/app/services/api/model/get-quotation-product-dto.ts +++ b/src/app/services/api/model/get-quotation-product-dto.ts @@ -22,6 +22,7 @@ export interface GetQuotationProductDto { productImage?: string | null; productLink?: string | null; productMinimalQuantity?: number; + productPrice?: number; quotationId?: number; } From dbeb5b43eee45722460131441043240ae29a6c1c Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 15:41:40 +0100 Subject: [PATCH 096/127] Added settings --- package-lock.json | 16 + package.json | 1 + .../components/setting-form/setting-form.html | 25 +- .../components/setting-form/setting-form.ts | 78 +++-- src/app/interfaces/setting.interface.ts | 2 +- src/app/services/api/.openapi-generator/FILES | 3 - src/app/services/api/api/settings.service.ts | 292 ++++-------------- .../services/api/model/create-setting-dto.ts | 16 - src/app/services/api/model/models.ts | 3 - .../patch-setting-electronic-signature-dto.ts | 15 - .../api/model/patch-setting-logo-dto.ts | 15 - 11 files changed, 153 insertions(+), 313 deletions(-) delete mode 100644 src/app/services/api/model/create-setting-dto.ts delete mode 100644 src/app/services/api/model/patch-setting-electronic-signature-dto.ts delete mode 100644 src/app/services/api/model/patch-setting-logo-dto.ts diff --git a/package-lock.json b/package-lock.json index ce8b605..45c2168 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@openapitools/openapi-generator-cli": "^2.25.2", "@tailwindcss/postcss": "^4.1.17", "@tailwindcss/vite": "^4.1.17", + "browser-image-compression": "^2.0.2", "ng-zorro-antd": "^20.4.0", "postcss": "^8.5.6", "rxjs": "~7.8.0", @@ -4432,6 +4433,15 @@ "node": ">=8" } }, + "node_modules/browser-image-compression": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/browser-image-compression/-/browser-image-compression-2.0.2.tgz", + "integrity": "sha512-pBLlQyUf6yB8SmmngrcOw3EoS4RpQ1BcylI3T9Yqn7+4nrQTXJD4sJDe5ODnJdrvNMaio5OicFo75rDyJD2Ucw==", + "license": "MIT", + "dependencies": { + "uzip": "0.20201231.0" + } + }, "node_modules/browserslist": { "version": "4.28.0", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz", @@ -9962,6 +9972,12 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, + "node_modules/uzip": { + "version": "0.20201231.0", + "resolved": "https://registry.npmjs.org/uzip/-/uzip-0.20201231.0.tgz", + "integrity": "sha512-OZeJfZP+R0z9D6TmBgLq2LHzSSptGMGDGigGiEe0pr8UBe/7fdflgHlHBNDASTXB5jnFuxHpNaJywSg8YFeGng==", + "license": "MIT" + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", diff --git a/package.json b/package.json index 5b9e439..f329542 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@openapitools/openapi-generator-cli": "^2.25.2", "@tailwindcss/postcss": "^4.1.17", "@tailwindcss/vite": "^4.1.17", + "browser-image-compression": "^2.0.2", "ng-zorro-antd": "^20.4.0", "postcss": "^8.5.6", "rxjs": "~7.8.0", diff --git a/src/app/components/setting-form/setting-form.html b/src/app/components/setting-form/setting-form.html index bfb98c5..6cb89bd 100644 --- a/src/app/components/setting-form/setting-form.html +++ b/src/app/components/setting-form/setting-form.html @@ -1,16 +1,21 @@ -
    +
    - logo + @if (settings().logo) { + + } @else { + logo + }
    Logo - - + +
    @@ -19,17 +24,21 @@
    - logo + @if (settings().electronicSignature) { + + } @else { + logo + }
    Signature - - + +
    - diff --git a/src/app/components/setting-form/setting-form.ts b/src/app/components/setting-form/setting-form.ts index a61157d..7d13726 100644 --- a/src/app/components/setting-form/setting-form.ts +++ b/src/app/components/setting-form/setting-form.ts @@ -1,9 +1,13 @@ -import {Component} from '@angular/core'; +import {Component, inject, OnInit, signal} from '@angular/core'; import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {SettingInfo} from "../../interfaces/setting.interface"; +import {firstValueFrom} from "rxjs"; +import {GetSettingDto, SettingsService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import imageCompression from "browser-image-compression"; @Component({ selector: 'app-setting-form', @@ -15,30 +19,68 @@ import {SettingInfo} from "../../interfaces/setting.interface"; NzFormItemComponent, NzFormLabelComponent, NzInputDirective, - ReactiveFormsModule + ReactiveFormsModule, ], templateUrl: './setting-form.html', styleUrl: './setting-form.css', }) -export class SettingForm { - settingForm: FormGroup = new FormGroup({ - logo: new FormControl(null), - signature: new FormControl(null) - }) +export class SettingForm implements OnInit { + private settingsService = inject(SettingsService); + private notificationService = inject(NzNotificationService); - submitForm() { - // Pour annuler si le formulaire est invalide - if (this.settingForm.invalid) return; - - // Pour obtenir la valeur du formulaire - console.log(this.settingForm.getRawValue()) - - // Pour vider le formulaire - this.settingForm.reset() - } + settings = signal({}); setting: SettingInfo = { logo: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png', - signature: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png' + electronicSignature: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png' + } + + settingForm: FormGroup = new FormGroup({ + logo: new FormControl(null), + electronicSignature: new FormControl(null) + }) + + async ngOnInit() { + await this.fetchSettings(); + } + + async fetchSettings() { + try { + const settingsPicture = await firstValueFrom(this.settingsService.getSettingEndpoint()); + this.settings.set(settingsPicture); + } catch { + this.notificationService.error( + 'Erreur', + 'Aucun paramètre défini' + ) + } + } + + async onFileChange(control: string, files?: FileList | null) { + if (!files?.length) return; + + const file = files[0]; + + const options = { + maxSizeMB: 1, + maxWidthOrHeight: 1080, + useWebWorker: true, + fileType: 'image/jpeg' + } + + const compressed = await imageCompression(file, options); + + try { + if (control === 'logo') { + await firstValueFrom(this.settingsService.patchSettingLogoEndpoint(compressed)); + } else { + await firstValueFrom(this.settingsService.patchSettingElectronicSignatureEndpoint(compressed)); + } + await this.fetchSettings(); + } catch { + this.notificationService.error('Erreur', "Erreur de communication avec l'API"); + } + + this.settingForm.reset(); } } diff --git a/src/app/interfaces/setting.interface.ts b/src/app/interfaces/setting.interface.ts index 4882359..2171a7c 100644 --- a/src/app/interfaces/setting.interface.ts +++ b/src/app/interfaces/setting.interface.ts @@ -1,4 +1,4 @@ export interface SettingInfo { logo: string; - signature: string; + electronicSignature: string; } \ No newline at end of file diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 6103f04..be3ab3e 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -28,7 +28,6 @@ model/create-purchase-order-dto.ts model/create-purchase-order-product-dto.ts model/create-purchase-product-dto.ts model/create-quotation-dto.ts -model/create-setting-dto.ts model/create-supplier-dto.ts model/create-user-dto.ts model/get-deliverer-dto.ts @@ -55,8 +54,6 @@ model/patch-purchase-product-quantity-dto.ts model/patch-quotation-conditions-sale-dto.ts model/patch-quotation-message-dto.ts model/patch-quotation-product-quantity-dto.ts -model/patch-setting-electronic-signature-dto.ts -model/patch-setting-logo-dto.ts model/patch-supplier-delivery-delay-dto.ts model/patch-user-password-dto.ts model/patch-ware-house-product-quantity-dto.ts diff --git a/src/app/services/api/api/settings.service.ts b/src/app/services/api/api/settings.service.ts index 1bbecf8..603198f 100644 --- a/src/app/services/api/api/settings.service.ts +++ b/src/app/services/api/api/settings.service.ts @@ -17,14 +17,8 @@ import { import {CustomHttpParameterCodec} from '../encoder'; import {Observable} from 'rxjs'; -// @ts-ignore -import {CreateSettingDto} from '../model/create-setting-dto'; // @ts-ignore import {GetSettingDto} from '../model/get-setting-dto'; -// @ts-ignore -import {PatchSettingElectronicSignatureDto} from '../model/patch-setting-electronic-signature-dto'; -// @ts-ignore -import {PatchSettingLogoDto} from '../model/patch-setting-logo-dto'; // @ts-ignore import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; @@ -42,188 +36,30 @@ export class SettingsService extends BaseService { } /** - * @endpoint post /API/settings - * @param createSettingDto + * @endpoint get /API/settings * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'body', reportProgress?: boolean, options?: { - httpHeaderAccept?: undefined, - context?: HttpContext, - transferCache?: boolean - }): Observable; - public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'response', reportProgress?: boolean, options?: { - httpHeaderAccept?: undefined, - context?: HttpContext, - transferCache?: boolean - }): Observable>; - public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'events', reportProgress?: boolean, options?: { - httpHeaderAccept?: undefined, - context?: HttpContext, - transferCache?: boolean - }): Observable>; - public createSettingEndpoint(createSettingDto: CreateSettingDto, observe: any = 'body', reportProgress: boolean = false, options?: { - httpHeaderAccept?: undefined, - context?: HttpContext, - transferCache?: boolean - }): Observable { - if (createSettingDto === null || createSettingDto === undefined) { - throw new Error('Required parameter createSettingDto was null or undefined when calling createSettingEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/settings`; - const {basePath, withCredentials} = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createSettingDto, - responseType: responseType_, - ...(withCredentials ? {withCredentials} : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), - reportProgress: reportProgress - } - ); - } - - /** - * @endpoint delete /API/settings/{id} - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { - httpHeaderAccept?: undefined, - context?: HttpContext, - transferCache?: boolean - }): Observable; - public deleteSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { - httpHeaderAccept?: undefined, - context?: HttpContext, - transferCache?: boolean - }): Observable>; - public deleteSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { - httpHeaderAccept?: undefined, - context?: HttpContext, - transferCache?: boolean - }): Observable>; - public deleteSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { - httpHeaderAccept?: undefined, - context?: HttpContext, - transferCache?: boolean - }): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling deleteSettingEndpoint.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/API/settings/${this.configuration.encodeParam({ - name: "id", - value: id, - in: "path", - style: "simple", - explode: false, - dataType: "number", - dataFormat: "int32" - })}`; - const {basePath, withCredentials} = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? {withCredentials} : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), - reportProgress: reportProgress - } - ); - } - - /** - * @endpoint get /API/settings/{id} - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { + public getSettingEndpoint(observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable; - public getSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: { + public getSettingEndpoint(observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: { + public getSettingEndpoint(observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: { + public getSettingEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getSettingEndpoint.'); - } let localVarHeaders = this.defaultHeaders; @@ -250,15 +86,7 @@ export class SettingsService extends BaseService { } } - let localVarPath = `/API/settings/${this.configuration.encodeParam({ - name: "id", - value: id, - in: "path", - style: "simple", - explode: false, - dataType: "number", - dataFormat: "int32" - })}`; + let localVarPath = `/API/settings`; const {basePath, withCredentials} = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { @@ -274,38 +102,31 @@ export class SettingsService extends BaseService { } /** - * @endpoint patch /API/settings/{id}/ElectronicSignature - * @param id - * @param patchSettingElectronicSignatureDto + * @endpoint patch /API/settings/electronicSignature + * @param electronicSignature * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'body', reportProgress?: boolean, options?: { + public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean }): Observable; - public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'response', reportProgress?: boolean, options?: { + public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean }): Observable>; - public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'events', reportProgress?: boolean, options?: { + public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean }): Observable>; - public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe: any = 'body', reportProgress: boolean = false, options?: { + public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean }): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling patchSettingElectronicSignatureEndpoint.'); - } - if (patchSettingElectronicSignatureDto === null || patchSettingElectronicSignatureDto === undefined) { - throw new Error('Required parameter patchSettingElectronicSignatureDto was null or undefined when calling patchSettingElectronicSignatureEndpoint.'); - } let localVarHeaders = this.defaultHeaders; @@ -318,14 +139,27 @@ export class SettingsService extends BaseService { const localVarTransferCache: boolean = options?.transferCache ?? true; - // to determine the Content-Type header const consumes: string[] = [ - 'application/json' + 'multipart/form-data' ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (electronicSignature !== undefined) { + localVarFormParams = localVarFormParams.append('electronicSignature', electronicSignature) as any || localVarFormParams; } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -339,20 +173,12 @@ export class SettingsService extends BaseService { } } - let localVarPath = `/API/settings/${this.configuration.encodeParam({ - name: "id", - value: id, - in: "path", - style: "simple", - explode: false, - dataType: "number", - dataFormat: "int32" - })}/ElectronicSignature`; + let localVarPath = `/API/settings/electronicSignature`; const {basePath, withCredentials} = this.configuration; return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, - body: patchSettingElectronicSignatureDto, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, @@ -364,38 +190,31 @@ export class SettingsService extends BaseService { } /** - * @endpoint patch /API/settings/{id}/logo - * @param id - * @param patchSettingLogoDto + * @endpoint patch /API/settings/logo + * @param logo * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'body', reportProgress?: boolean, options?: { + public patchSettingLogoEndpoint(logo?: Blob, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean }): Observable; - public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'response', reportProgress?: boolean, options?: { + public patchSettingLogoEndpoint(logo?: Blob, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean }): Observable>; - public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'events', reportProgress?: boolean, options?: { + public patchSettingLogoEndpoint(logo?: Blob, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean }): Observable>; - public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe: any = 'body', reportProgress: boolean = false, options?: { + public patchSettingLogoEndpoint(logo?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean }): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling patchSettingLogoEndpoint.'); - } - if (patchSettingLogoDto === null || patchSettingLogoDto === undefined) { - throw new Error('Required parameter patchSettingLogoDto was null or undefined when calling patchSettingLogoEndpoint.'); - } let localVarHeaders = this.defaultHeaders; @@ -408,14 +227,27 @@ export class SettingsService extends BaseService { const localVarTransferCache: boolean = options?.transferCache ?? true; - // to determine the Content-Type header const consumes: string[] = [ - 'application/json' + 'multipart/form-data' ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any; }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + // use FormData to transmit files using content-type "multipart/form-data" + // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data + localVarUseForm = canConsumeForm; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({encoder: this.encoder}); + } + + if (logo !== undefined) { + localVarFormParams = localVarFormParams.append('logo', logo) as any || localVarFormParams; } let responseType_: 'text' | 'json' | 'blob' = 'json'; @@ -429,20 +261,12 @@ export class SettingsService extends BaseService { } } - let localVarPath = `/API/settings/${this.configuration.encodeParam({ - name: "id", - value: id, - in: "path", - style: "simple", - explode: false, - dataType: "number", - dataFormat: "int32" - })}/logo`; + let localVarPath = `/API/settings/logo`; const {basePath, withCredentials} = this.configuration; return this.httpClient.request('patch', `${basePath}${localVarPath}`, { context: localVarHttpContext, - body: patchSettingLogoDto, + body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, responseType: responseType_, ...(withCredentials ? {withCredentials} : {}), headers: localVarHeaders, diff --git a/src/app/services/api/model/create-setting-dto.ts b/src/app/services/api/model/create-setting-dto.ts deleted file mode 100644 index 22ab41f..0000000 --- a/src/app/services/api/model/create-setting-dto.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * PyroFetes - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface CreateSettingDto { - electronicSignature?: Blob | null; - logo?: Blob | null; -} - diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts index ca69a14..5b2b4e5 100644 --- a/src/app/services/api/model/models.ts +++ b/src/app/services/api/model/models.ts @@ -8,7 +8,6 @@ export * from './create-purchase-order-dto'; export * from './create-purchase-order-product-dto'; export * from './create-purchase-product-dto'; export * from './create-quotation-dto'; -export * from './create-setting-dto'; export * from './create-supplier-dto'; export * from './create-user-dto'; export * from './get-deliverer-dto'; @@ -34,8 +33,6 @@ export * from './patch-purchase-product-quantity-dto'; export * from './patch-quotation-conditions-sale-dto'; export * from './patch-quotation-message-dto'; export * from './patch-quotation-product-quantity-dto'; -export * from './patch-setting-electronic-signature-dto'; -export * from './patch-setting-logo-dto'; export * from './patch-supplier-delivery-delay-dto'; export * from './patch-user-password-dto'; export * from './patch-ware-house-product-quantity-dto'; diff --git a/src/app/services/api/model/patch-setting-electronic-signature-dto.ts b/src/app/services/api/model/patch-setting-electronic-signature-dto.ts deleted file mode 100644 index 4b352b5..0000000 --- a/src/app/services/api/model/patch-setting-electronic-signature-dto.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * PyroFetes - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface PatchSettingElectronicSignatureDto { - electronicSignature?: Blob | null; -} - diff --git a/src/app/services/api/model/patch-setting-logo-dto.ts b/src/app/services/api/model/patch-setting-logo-dto.ts deleted file mode 100644 index 29f2ef8..0000000 --- a/src/app/services/api/model/patch-setting-logo-dto.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * PyroFetes - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export interface PatchSettingLogoDto { - logo?: Blob | null; -} - From 7e69cbd95227d42af5f342d11e8fbc9a669733d5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 25 May 2026 16:33:03 +0100 Subject: [PATCH 097/127] Fixed error with SupplierId on Delivery Note DTO --- .../components/purchase-order-table/purchase-order-table.ts | 3 ++- src/app/services/api/README.md | 6 +++--- src/app/services/api/model/create-delivery-note-dto.ts | 1 + src/app/services/api/model/get-purchase-order-dto.ts | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index c087fca..2a76c77 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -125,7 +125,8 @@ export class PurchaseOrderTable implements OnInit { expeditionDate: date, estimateDeliveryDate: estimateDate, delivererId: 1, - productQuantities: productQuantities + productQuantities: productQuantities, + supplierId: purchaseOrder.supplierId }; await firstValueFrom(this.deliveryNoteService.createDeliveryNoteEndpoint(deliveryNoteDto)); diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md index 29f22fe..4d71313 100644 --- a/src/app/services/api/README.md +++ b/src/app/services/api/README.md @@ -59,9 +59,9 @@ In your Angular project: ```typescript -import { ApplicationConfig } from '@angular/core'; -import { provideHttpClient } from '@angular/common/http'; -import { provideApi } from ''; +import {ApplicationConfig} from '@angular/core'; +import {provideHttpClient} from '@angular/common/http'; +import {provideApi} from ''; export const appConfig: ApplicationConfig = { providers: [ diff --git a/src/app/services/api/model/create-delivery-note-dto.ts b/src/app/services/api/model/create-delivery-note-dto.ts index e3bbc2f..49498e7 100644 --- a/src/app/services/api/model/create-delivery-note-dto.ts +++ b/src/app/services/api/model/create-delivery-note-dto.ts @@ -14,6 +14,7 @@ export interface CreateDeliveryNoteDto { estimateDeliveryDate?: string; expeditionDate?: string; delivererId?: number; + supplierId?: number; productQuantities?: { [key: string]: number; } | null; } diff --git a/src/app/services/api/model/get-purchase-order-dto.ts b/src/app/services/api/model/get-purchase-order-dto.ts index 7885bc4..3c21f66 100644 --- a/src/app/services/api/model/get-purchase-order-dto.ts +++ b/src/app/services/api/model/get-purchase-order-dto.ts @@ -13,6 +13,7 @@ import {GetPurchaseProductDto} from './get-purchase-product-dto'; export interface GetPurchaseOrderDto { id?: number; purchaseConditions?: string | null; + supplierId?: number; supplierName?: string | null; products?: Array | null; } From c10a0a7c2f158e87b5e065723e380c713d93d0ba Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 11:52:31 +0100 Subject: [PATCH 098/127] Added function to manage deliveries --- .../delivery-validator.html | 53 +++++-- .../delivery-validator/delivery-validator.ts | 132 ++++++++++++++---- src/app/components/info-card/info-card.ts | 2 +- src/app/components/info-table/info-table.css | 71 ---------- src/app/components/info-table/info-table.html | 11 -- src/app/components/info-table/info-table.ts | 44 ------ src/app/pages/welcome/welcome.html | 13 +- src/app/pages/welcome/welcome.ts | 56 +++++++- src/app/services/api/.openapi-generator/FILES | 2 + src/app/services/api/README.md | 6 +- src/app/services/api/api/api.ts | 5 +- .../services/api/api/deliverynotes.service.ts | 66 +++++++++ src/app/services/api/model/models.ts | 1 + 13 files changed, 286 insertions(+), 176 deletions(-) delete mode 100644 src/app/components/info-table/info-table.css delete mode 100644 src/app/components/info-table/info-table.html delete mode 100644 src/app/components/info-table/info-table.ts diff --git a/src/app/components/delivery-validator/delivery-validator.html b/src/app/components/delivery-validator/delivery-validator.html index e91d686..fe7be05 100644 --- a/src/app/components/delivery-validator/delivery-validator.html +++ b/src/app/components/delivery-validator/delivery-validator.html @@ -3,18 +3,55 @@ (input)="search.set($any($event.target).value)"/>
    - @for (deliveryItem of filteredLivraisons(); track deliveryItem.id) { + @for (deliveryItem of filteredDeliveries(); track deliveryItem.id) {
    -

    {{ deliveryItem.client }}

    -

    Date d'expédition: {{ deliveryItem.date }}

    -

    Produits : {{ deliveryItem.produits }}

    +

    {{ deliveryItem.delivererTransporter }}

    +

    Date d'expédition: {{ deliveryItem.expeditionDate }}

    +

    Quantité livrée : {{ deliveryItem.products.length }}

    - + + +
    + + + @for (wareHouse of wareHouses(); track wareHouse.id) { + + } + +
    + + +
    + + + + Réference + Nom + Quantité + + + + @for (product of deliveryItem.products; track product.productId) { + + {{ product.productReference }} + {{ product.productName }} + {{ product.quantity }} + + } + + +
    +
    }
    diff --git a/src/app/components/delivery-validator/delivery-validator.ts b/src/app/components/delivery-validator/delivery-validator.ts index 9b3d9a0..60a40ff 100644 --- a/src/app/components/delivery-validator/delivery-validator.ts +++ b/src/app/components/delivery-validator/delivery-validator.ts @@ -1,44 +1,120 @@ -import {Component, computed, signal} from '@angular/core'; -import {NzButtonComponent, NzButtonSize} from "ng-zorro-antd/button"; -import {NzIconDirective} from "ng-zorro-antd/icon"; +import {Component, computed, inject, OnInit, signal} from '@angular/core'; +import { + DeliverynotesService, + GetDeliveryNoteDto, GetWareHouseDto, + WarehouseproductsService, + WarehousesService +} from "../../services/api"; +import {firstValueFrom} from "rxjs"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {format} from "date-fns"; +import {ModalNav} from "../modal-nav/modal-nav"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {FormsModule} from "@angular/forms"; @Component({ selector: 'app-delivery-validator', imports: [ - NzButtonComponent, - NzIconDirective + NzTableComponent, + ModalNav, + NzSelectComponent, + NzOptionComponent, + FormsModule ], templateUrl: './delivery-validator.html', styleUrl: './delivery-validator.css', }) -export class DeliveryValidator { - size: NzButtonSize = 'large'; - search = signal(''); +export class DeliveryValidator implements OnInit { + private deliveryNotesService = inject(DeliverynotesService); + private notificationService = inject(NzNotificationService); + private warehousesService = inject(WarehousesService); + private warehouseProductsService = inject(WarehouseproductsService); - livraisons = signal([ - {id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12}, - {id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8}, - {id: 3, client: 'Auchan', date: '2025-02-05', produits: 23}, - {id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12}, - {id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8}, - {id: 3, client: 'Auchan', date: '2025-02-05', produits: 23}, - {id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12}, - {id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8}, - {id: 3, client: 'Auchan', date: '2025-02-05', produits: 23}, - {id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12}, - {id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8}, - {id: 3, client: 'Auchan', date: '2025-02-05', produits: 23} - ]); + search = signal(''); + deliveryNotes = signal([]); + wareHouses = signal([]); - filteredLivraisons = computed(() => { + selectedWarehouseId: number | null = null; + + async ngOnInit() { + await this.fetchDeliveryNotes(); + try { + const wareHouses = await firstValueFrom(this.warehousesService.getAllWarehouseEndpoint()); + this.wareHouses.set(wareHouses); + } catch { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) + } + } + + async fetchDeliveryNotes() { + try { + const deliveries = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNotesNotArrivedEndpoint()); + this.deliveryNotes.set(deliveries); + } catch { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API' + ) + } + } + + filteredDeliveries = computed(() => { const query = this.search().toLowerCase(); - return this.livraisons().filter(l => - l.client.toLowerCase().includes(query) || - l.date.includes(query) + return this.deliveryNotes().filter(l => + l.delivererTransporter.toLowerCase().includes(query) || + l.expeditionDate.includes(query) ); }); - validate(id: number) { - return + async check(id: number) { + try { + const PatchRealDate = { + realDeliveryDate: format(new Date(), 'yyyy-MM-dd') + }; + await firstValueFrom(this.deliveryNotesService.patchRealDeliveryDateEndpoint(id, PatchRealDate)); + } catch (e) { + this.notificationService.error( + 'Erreur', + 'Erreur de communication avec l\'API', + ) + } + } + + async validate(id: number, warehouseId: number, modal: ModalNav) { + try { + const deliveryNote = this.deliveryNotes().find(x => x.id === id); + + for (const product of deliveryNote.products) { + await firstValueFrom(this.warehouseProductsService.patchWareHouseProductQuantityEndpoint( + product.productId, + warehouseId, + { + quantity: product.quantity + } + )); + } + + this.notificationService.success( + 'Succès', + 'Les produits sont bien ajoutés au stock' + ) + + modal.isVisible = false; + await this.fetchDeliveryNotes(); + } catch { + this.notificationService.error( + 'Erreur', + 'Vous devez choisir un entrepôt', + ) + } + } + + async reject(modal: ModalNav) { + modal.isVisible = false; + await this.fetchDeliveryNotes(); } } diff --git a/src/app/components/info-card/info-card.ts b/src/app/components/info-card/info-card.ts index fb4b354..15b1c20 100644 --- a/src/app/components/info-card/info-card.ts +++ b/src/app/components/info-card/info-card.ts @@ -13,7 +13,7 @@ import {NgStyle} from "@angular/common"; }) export class InfoCard { icon = input.required() - value = input.required() + value = input.required() description = input.required() color = input.required() } diff --git a/src/app/components/info-table/info-table.css b/src/app/components/info-table/info-table.css deleted file mode 100644 index 91012b7..0000000 --- a/src/app/components/info-table/info-table.css +++ /dev/null @@ -1,71 +0,0 @@ -.documents-section { - display: flex; - flex-direction: column; - align-items: flex-start; /* contenu aligné à gauche */ - gap: 16px; /* espace entre le titre et la liste */ - margin: 40px 6%; -} - -/* Titre */ -.documents-section h1 { - font-size: 24px; - font-weight: 700; - color: #111827; - margin: 0; /* on gère l’espace avec le gap */ - letter-spacing: 0.5px; - text-transform: capitalize; - border-left: 4px solid #3b82f6; - padding-left: 12px; -} - -/* Liste de documents scrollable */ -.content { - width: 1000px; - display: flex; - flex-wrap: wrap; - gap: 16px; - padding: 30px 15px; - border-radius: 20px; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06), - 0 8px 20px rgba(0, 0, 0, 0.08), - 0 16px 40px rgba(0, 0, 0, 0.06); - max-height: 390px; - overflow-y: auto; -} - -/* Chaque carte */ -.content > div { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - width: 120px; - height: 140px; - padding: 12px; - background: #ffffff; - border-radius: 14px; - cursor: pointer; - box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); - transition: all 0.2s ease; - text-align: center; -} - -.content > div:hover { - transform: translateY(-3px); - box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12); -} - -.content img { - width: 48px; - height: 48px; - margin-bottom: 10px; - object-fit: contain; -} - -.content p { - margin: 0; - font-size: 16px; - font-weight: 600; - color: #111827; - word-break: break-word; -} diff --git a/src/app/components/info-table/info-table.html b/src/app/components/info-table/info-table.html deleted file mode 100644 index 85a991d..0000000 --- a/src/app/components/info-table/info-table.html +++ /dev/null @@ -1,11 +0,0 @@ -
    -

    Documents récents

    -
    - @for (doc of purchaseOrder(); track doc.id) { -
    - pdf -

    {{ doc.name }}

    -
    - } -
    -
    \ No newline at end of file diff --git a/src/app/components/info-table/info-table.ts b/src/app/components/info-table/info-table.ts deleted file mode 100644 index a02fc7f..0000000 --- a/src/app/components/info-table/info-table.ts +++ /dev/null @@ -1,44 +0,0 @@ -import {Component} from '@angular/core'; - -interface PurchaseOrder { - id: number; - name: string; -} - -@Component({ - selector: 'app-info-table', - templateUrl: './info-table.html', - styleUrls: ['./info-table.css'], -}) -export class InfoTable { - docs: PurchaseOrder[] = [ - {id: 1, name: 'Bon de commande'}, - {id: 2, name: 'Bon de commande'}, - {id: 3, name: 'Bon de commande'}, - {id: 1, name: 'Bon de commande'}, - {id: 2, name: 'Bon de commande'}, - {id: 3, name: 'Bon de commande'}, - {id: 1, name: 'Bon de commande'}, - {id: 2, name: 'Bon de commande'}, - {id: 3, name: 'Bon de commande'}, - {id: 1, name: 'Bon de commande'}, - {id: 2, name: 'Bon de commande'}, - {id: 3, name: 'Bon de commande'}, - {id: 1, name: 'Bon de commande'}, - {id: 2, name: 'Bon de commande'}, - {id: 3, name: 'Bon de commande'}, - {id: 1, name: 'Bon de commande'}, - {id: 2, name: 'Bon de commande'}, - {id: 3, name: 'Bon de commande'}, - {id: 1, name: 'Bon de commande'}, - {id: 2, name: 'Bon de commande'}, - {id: 3, name: 'Bon de commande'}, - {id: 1, name: 'Bon de commande'}, - {id: 2, name: 'Bon de commande'}, - {id: 3, name: 'Bon de commande'}, - ]; - - purchaseOrder(): PurchaseOrder[] { - return this.docs; - } -} diff --git a/src/app/pages/welcome/welcome.html b/src/app/pages/welcome/welcome.html index 9e9695c..ce1390c 100644 --- a/src/app/pages/welcome/welcome.html +++ b/src/app/pages/welcome/welcome.html @@ -1,13 +1,14 @@
    - - - - + + +
    -
    \ No newline at end of file diff --git a/src/app/pages/welcome/welcome.ts b/src/app/pages/welcome/welcome.ts index d73a531..8faebbb 100644 --- a/src/app/pages/welcome/welcome.ts +++ b/src/app/pages/welcome/welcome.ts @@ -1,19 +1,69 @@ -import {Component} from '@angular/core'; +import {Component, inject, signal} from '@angular/core'; import {InfoCard} from "../../components/info-card/info-card"; import {DeliveryValidator} from "../../components/delivery-validator/delivery-validator"; -import {InfoTable} from "../../components/info-table/info-table"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {DeliverersService, ProductsService, SuppliersService} from "../../services/api"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-welcome', imports: [ InfoCard, DeliveryValidator, - InfoTable, ], templateUrl: './welcome.html', styleUrl: './welcome.css' }) export class Welcome { + private productsService = inject(ProductsService); + private deliverersService = inject(DeliverersService); + private suppliersService = inject(SuppliersService); + private notificationsService = inject(NzNotificationService); + deliversCount = signal(0); + suppliersCount = signal(0); + productsUnderLimitCount = signal(0); + + async getDeliverers() { + try { + const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()); + this.deliversCount.set(deliverers.length); + } catch (e) { + this.notificationsService.error( + 'Error', + 'Error while getting deliverers.', + ) + } + } + + async getSuppliers() { + try { + const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint()); + this.suppliersCount.set(suppliers.length); + } catch (e) { + this.notificationsService.error( + 'Error', + 'Error while getting suppliers.', + ) + } + } + + async getProductsUnderLimit() { + try { + const products = await firstValueFrom(this.productsService.getAllProductsUnderLimitEndpoint()); + this.productsUnderLimitCount.set(products.length); + } catch (e) { + this.notificationsService.error( + 'Error', + 'Error while getting products.', + ) + } + } + + async ngOnInit() { + await this.getDeliverers(); + await this.getSuppliers(); + await this.getProductsUnderLimit(); + } } diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index be3ab3e..93654d7 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -14,6 +14,7 @@ api/settings.service.ts api/suppliers.service.ts api/users.service.ts api/warehouseproducts.service.ts +api/warehouses.service.ts configuration.ts encoder.ts git_push.sh @@ -44,6 +45,7 @@ model/get-supplier-dto.ts model/get-token-dto.ts model/get-total-quantity-dto.ts model/get-user-dto.ts +model/get-ware-house-dto.ts model/get-ware-house-product-dto.ts model/models.ts model/patch-delivery-note-real-delivery-date-dto.ts diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md index 4d71313..29f22fe 100644 --- a/src/app/services/api/README.md +++ b/src/app/services/api/README.md @@ -59,9 +59,9 @@ In your Angular project: ```typescript -import {ApplicationConfig} from '@angular/core'; -import {provideHttpClient} from '@angular/common/http'; -import {provideApi} from ''; +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; export const appConfig: ApplicationConfig = { providers: [ diff --git a/src/app/services/api/api/api.ts b/src/app/services/api/api/api.ts index 58e0a7c..4a692c4 100644 --- a/src/app/services/api/api/api.ts +++ b/src/app/services/api/api/api.ts @@ -28,4 +28,7 @@ import {UsersService} from './users.service'; export * from './warehouseproducts.service'; import {WarehouseproductsService} from './warehouseproducts.service'; -export const APIS = [DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService]; +export * from './warehouses.service'; +import {WarehousesService} from './warehouses.service'; + +export const APIS = [DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService, WarehousesService]; diff --git a/src/app/services/api/api/deliverynotes.service.ts b/src/app/services/api/api/deliverynotes.service.ts index dcea385..12ff36e 100644 --- a/src/app/services/api/api/deliverynotes.service.ts +++ b/src/app/services/api/api/deliverynotes.service.ts @@ -261,6 +261,72 @@ export class DeliverynotesService extends BaseService { ); } + /** + * @endpoint get /API/deliveryNotes/validation + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllDeliveryNotesNotArrivedEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/deliveryNotes/validation`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + /** * @endpoint get /API/deliveryNotes/{deliveryNoteId} * @param deliveryNoteId diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts index 5b2b4e5..074577e 100644 --- a/src/app/services/api/model/models.ts +++ b/src/app/services/api/model/models.ts @@ -24,6 +24,7 @@ export * from './get-supplier-dto'; export * from './get-token-dto'; export * from './get-total-quantity-dto'; export * from './get-user-dto'; +export * from './get-ware-house-dto'; export * from './get-ware-house-product-dto'; export * from './patch-delivery-note-real-delivery-date-dto'; export * from './patch-price-selling-price-dto'; From 2d8104aeae566c6f9a37a612b731f563c714c92d Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 12:07:08 +0100 Subject: [PATCH 099/127] Added function to manage deliveries --- .../services/api/api/warehouses.service.ts | 104 ++++++++++++++++++ .../services/api/model/get-ware-house-dto.ts | 16 +++ 2 files changed, 120 insertions(+) create mode 100644 src/app/services/api/api/warehouses.service.ts create mode 100644 src/app/services/api/model/get-ware-house-dto.ts diff --git a/src/app/services/api/api/warehouses.service.ts b/src/app/services/api/api/warehouses.service.ts new file mode 100644 index 0000000..08242ce --- /dev/null +++ b/src/app/services/api/api/warehouses.service.ts @@ -0,0 +1,104 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; + +// @ts-ignore +import {GetWareHouseDto} from '../model/get-ware-house-dto'; + +// @ts-ignore +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; + + +@Injectable({ + providedIn: 'root' +}) +export class WarehousesService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint get /API/wareHouses + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllWarehouseEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllWarehouseEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllWarehouseEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllWarehouseEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/wareHouses`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/model/get-ware-house-dto.ts b/src/app/services/api/model/get-ware-house-dto.ts new file mode 100644 index 0000000..f98b212 --- /dev/null +++ b/src/app/services/api/model/get-ware-house-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetWareHouseDto { + id?: number; + name?: string | null; +} + From 6e9daf3e60d2339c821cfb62b3a861ab4311c799 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 12:27:06 +0100 Subject: [PATCH 100/127] Reorganized dashboard --- .../delivery-validator/delivery-validator.css | 34 ++--------------- src/app/pages/welcome/welcome.html | 37 +++++++++++++------ 2 files changed, 28 insertions(+), 43 deletions(-) diff --git a/src/app/components/delivery-validator/delivery-validator.css b/src/app/components/delivery-validator/delivery-validator.css index 34ed1bb..919cf1c 100644 --- a/src/app/components/delivery-validator/delivery-validator.css +++ b/src/app/components/delivery-validator/delivery-validator.css @@ -11,7 +11,6 @@ flex-direction: column; align-items: flex-start; - /* Box shadow pour effet superposition */ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06), 0 8px 20px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.06); @@ -35,15 +34,13 @@ outline: none; } -/* Liste scrollable */ .livraisons-list { width: 100%; - max-height: 350px; /* hauteur max de la liste */ - overflow-y: auto; /* scroll vertical activé */ - padding-right: 10px; /* pour le scrollbar */ + max-height: 500px; + overflow-y: auto; + padding-right: 10px; } -/* Scrollbar personnalisée (optionnel) */ .livraisons-list::-webkit-scrollbar { width: 8px; } @@ -57,7 +54,6 @@ background: #f3f4f6; } -/* Carte de livraison */ .livraison-card { background: #ffffff; padding: 20px 22px; @@ -76,7 +72,6 @@ box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08); } -/* Infos livraison */ .livraison-info h3 { font-size: 17px; margin: 0 0 4px; @@ -88,26 +83,3 @@ font-size: 14px; color: #6b7280; } - -/* Bouton valider */ -.validate-btn { - padding: 10px 20px; - border-radius: 12px; - border: none; - cursor: pointer; - font-weight: 600; - background: #3b82f6; - color: white; - transition: all 0.3s ease; -} - -.validate-btn:hover { - background: #2563eb; -} - -.validate-btn.validated { - background: #9ca3af; - cursor: default; - color: #ffffff; - opacity: 0.9; -} diff --git a/src/app/pages/welcome/welcome.html b/src/app/pages/welcome/welcome.html index ce1390c..e289089 100644 --- a/src/app/pages/welcome/welcome.html +++ b/src/app/pages/welcome/welcome.html @@ -1,14 +1,27 @@ -
    - - - - -
    +
    +
    + +
    -
    - +
    +

    Tableau de bord

    +
    + + + + + + + + +
    +
    \ No newline at end of file From f233c46853e3d75b881a993200035ca054c0d7f8 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 14:09:09 +0100 Subject: [PATCH 101/127] Deleted search bar --- .../purchase-order-table.html | 2 -- .../quotation-table/quotation-table.html | 2 -- src/app/components/search/search.css | 36 ------------------- src/app/components/search/search.html | 10 ------ src/app/components/search/search.ts | 35 ------------------ src/app/pages/deliverer/deliverer.html | 6 +--- src/app/pages/deliverer/deliverer.ts | 2 -- .../pages/delivery-note/delivery-note.html | 8 +---- src/app/pages/delivery-note/delivery-note.ts | 4 --- .../pages/purchase-order/purchase-order.html | 8 +---- .../pages/purchase-order/purchase-order.ts | 2 -- src/app/pages/quotation/quotation.html | 8 +---- src/app/pages/quotation/quotation.ts | 2 -- src/app/pages/stock/stock.html | 7 +--- src/app/pages/stock/stock.ts | 6 ---- src/app/pages/supplier/supplier.html | 5 +-- src/app/pages/supplier/supplier.ts | 6 ---- src/app/pages/user/user.html | 6 +--- src/app/pages/user/user.ts | 2 -- 19 files changed, 7 insertions(+), 150 deletions(-) delete mode 100644 src/app/components/search/search.css delete mode 100644 src/app/components/search/search.html delete mode 100644 src/app/components/search/search.ts diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 7e08ab4..35d3220 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -57,8 +57,6 @@
    - - diff --git a/src/app/components/quotation-table/quotation-table.html b/src/app/components/quotation-table/quotation-table.html index 37da021..2adde02 100644 --- a/src/app/components/quotation-table/quotation-table.html +++ b/src/app/components/quotation-table/quotation-table.html @@ -57,8 +57,6 @@
    - - diff --git a/src/app/components/search/search.css b/src/app/components/search/search.css deleted file mode 100644 index da8a92a..0000000 --- a/src/app/components/search/search.css +++ /dev/null @@ -1,36 +0,0 @@ -/* From Uiverse.io by LightAndy1 */ -.group { - box-shadow: 0 1px 2px 1px #001529; - border-radius: 15px; - padding: 0.1rem 0.5rem 0.1rem 1rem; - display: flex; - line-height: 28px; - align-items: center; - position: relative; - max-width: 400px; -} - -.input { - width: 100%; - height: 32px; - line-height: 28px; - padding: 0 1rem; - border: 2px solid transparent; - border-radius: 8px; - outline: none; - background-color: #f3f3f4; - color: #0d0c22; - transition: 0.3s ease; -} - -.input::placeholder { - color: #9e9ea7; -} - -.input:focus, -input:hover { - outline: none; - border-color: #40A9FF; - background-color: #fff; - box-shadow: 0 0 0 4px rgba(199, 199, 197, 0.1); -} diff --git a/src/app/components/search/search.html b/src/app/components/search/search.html deleted file mode 100644 index 22e4ccb..0000000 --- a/src/app/components/search/search.html +++ /dev/null @@ -1,10 +0,0 @@ -
    - - -
    - - -
    -
    -
    -
    diff --git a/src/app/components/search/search.ts b/src/app/components/search/search.ts deleted file mode 100644 index 7c3afff..0000000 --- a/src/app/components/search/search.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {Component, output} from '@angular/core'; -import {NzIconDirective} from "ng-zorro-antd/icon"; -import {NzColDirective} from "ng-zorro-antd/grid"; -import {NzFlexDirective} from "ng-zorro-antd/flex"; -import {NzFormControlComponent, NzFormDirective, NzFormItemComponent} from "ng-zorro-antd/form"; -import {FormControl, FormGroup, ReactiveFormsModule} from "@angular/forms"; - -@Component({ - selector: 'app-search', - imports: [ - NzIconDirective, - NzColDirective, - NzFlexDirective, - NzFormControlComponent, - NzFormDirective, - NzFormItemComponent, - ReactiveFormsModule - ], - templateUrl: './search.html', - styleUrl: './search.css', -}) -export class Search { - searchForm: FormGroup = new FormGroup({ - searchValue: new FormControl(null) - }) - - searchEvent = output(); - - OnSearch(): void { - const raw = this.searchForm.controls['searchValue'].value ?? ''; - const value = String(raw).trim(); - this.searchEvent.emit(value); - - } -} diff --git a/src/app/pages/deliverer/deliverer.html b/src/app/pages/deliverer/deliverer.html index c8e69d1..e7f9268 100644 --- a/src/app/pages/deliverer/deliverer.html +++ b/src/app/pages/deliverer/deliverer.html @@ -8,12 +8,8 @@ - -
    - -
    -
    +
    diff --git a/src/app/pages/deliverer/deliverer.ts b/src/app/pages/deliverer/deliverer.ts index e2baf31..9178473 100644 --- a/src/app/pages/deliverer/deliverer.ts +++ b/src/app/pages/deliverer/deliverer.ts @@ -2,7 +2,6 @@ import {Component, inject, viewChild} from '@angular/core'; import {ModalButton} from "../../components/modal-button/modal-button"; import {DelivererTable} from "../../components/deliverer-table/deliverer-table"; import {DelivererForm} from "../../components/deliverer-form/deliverer-form"; -import {Search} from "../../components/search/search"; import {DeliverersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @@ -13,7 +12,6 @@ import {firstValueFrom} from "rxjs"; ModalButton, DelivererTable, DelivererForm, - Search ], templateUrl: './deliverer.html', styleUrl: './deliverer.css', diff --git a/src/app/pages/delivery-note/delivery-note.html b/src/app/pages/delivery-note/delivery-note.html index ac33ecb..2b50d1f 100644 --- a/src/app/pages/delivery-note/delivery-note.html +++ b/src/app/pages/delivery-note/delivery-note.html @@ -1,9 +1,3 @@ -
    -
    - -
    -
    - -
    +
    diff --git a/src/app/pages/delivery-note/delivery-note.ts b/src/app/pages/delivery-note/delivery-note.ts index df0ca0b..c35faa1 100644 --- a/src/app/pages/delivery-note/delivery-note.ts +++ b/src/app/pages/delivery-note/delivery-note.ts @@ -1,14 +1,10 @@ import {Component} from '@angular/core'; import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; -import {ModalButton} from "../../components/modal-button/modal-button"; -import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form"; -import {Search} from "../../components/search/search"; @Component({ selector: 'app-delivery-note', imports: [ DelivereryNoteTable, - Search ], templateUrl: './delivery-note.html', styleUrl: './delivery-note.css', diff --git a/src/app/pages/purchase-order/purchase-order.html b/src/app/pages/purchase-order/purchase-order.html index 9e67c89..b904151 100644 --- a/src/app/pages/purchase-order/purchase-order.html +++ b/src/app/pages/purchase-order/purchase-order.html @@ -1,10 +1,4 @@ -
    -
    - -
    -
    - -
    +
    diff --git a/src/app/pages/purchase-order/purchase-order.ts b/src/app/pages/purchase-order/purchase-order.ts index c8f63bf..55da4aa 100644 --- a/src/app/pages/purchase-order/purchase-order.ts +++ b/src/app/pages/purchase-order/purchase-order.ts @@ -1,11 +1,9 @@ import {Component} from '@angular/core'; -import {Search} from "../../components/search/search"; import {PurchaseOrderTable} from "../../components/purchase-order-table/purchase-order-table"; @Component({ selector: 'app-purchase-order', imports: [ - Search, PurchaseOrderTable, ], templateUrl: './purchase-order.html', diff --git a/src/app/pages/quotation/quotation.html b/src/app/pages/quotation/quotation.html index 92efc0e..a03e0d8 100644 --- a/src/app/pages/quotation/quotation.html +++ b/src/app/pages/quotation/quotation.html @@ -1,9 +1,3 @@ -
    -
    - -
    -
    - -
    +
    diff --git a/src/app/pages/quotation/quotation.ts b/src/app/pages/quotation/quotation.ts index 07ba09c..b3380f2 100644 --- a/src/app/pages/quotation/quotation.ts +++ b/src/app/pages/quotation/quotation.ts @@ -1,11 +1,9 @@ import {Component} from '@angular/core'; -import {Search} from "../../components/search/search"; import {QuotationTable} from "../../components/quotation-table/quotation-table"; @Component({ selector: 'app-quotation', imports: [ - Search, QuotationTable ], templateUrl: './quotation.html', diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index f123e20..be430c1 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -22,13 +22,8 @@ } - -
    - - -
    -
    +
    \ No newline at end of file diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 9107402..e30b475 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,6 +1,5 @@ import {Component, inject, viewChild} from '@angular/core'; import {StockTable} from "../../components/stock-table/stock-table"; -import {Search} from "../../components/search/search"; import {ModalButton} from "../../components/modal-button/modal-button"; import {PurchaseordersService, QuotationsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; @@ -12,7 +11,6 @@ import {CreateQuotationForm} from "../../components/create-quotation-form/create selector: 'app-stock', imports: [ StockTable, - Search, ModalButton, CreatePurchaseorderForm, CreateQuotationForm, @@ -37,10 +35,6 @@ export class Stock { this.hasSelection = value; } - onProductSearch(query: string) { - this.productTable().applySearch(query); - } - async addPurchaseOrder() { const form = this.createPurchaseOrder().createPurchaseOrderForm; if (form.invalid) { diff --git a/src/app/pages/supplier/supplier.html b/src/app/pages/supplier/supplier.html index 08475ce..6a6f549 100644 --- a/src/app/pages/supplier/supplier.html +++ b/src/app/pages/supplier/supplier.html @@ -8,11 +8,8 @@ -
    - -
    -
    +
    diff --git a/src/app/pages/supplier/supplier.ts b/src/app/pages/supplier/supplier.ts index 0f8e443..2e12b94 100644 --- a/src/app/pages/supplier/supplier.ts +++ b/src/app/pages/supplier/supplier.ts @@ -1,5 +1,4 @@ import {Component, inject, viewChild} from '@angular/core'; -import {Search} from "../../components/search/search"; import {ModalButton} from "../../components/modal-button/modal-button"; import {SupplierTable} from "../../components/supplier-table/supplier-table"; import {SupplierForm} from "../../components/supplier-form/supplier-form"; @@ -10,7 +9,6 @@ import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-supplier', imports: [ - Search, SupplierForm, SupplierTable, ModalButton @@ -36,10 +34,6 @@ export class Supplier { this.modal().isVisible = false; } - onSupplierSearch(query: string) { - this.supplierTable().applySearch(query); - } - async addSupplier() { if (this.createSupplier().supplierForm.invalid) { this.notificationService.error( diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index a2e991b..c02b772 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -8,12 +8,8 @@ - -
    - -
    -
    +
    diff --git a/src/app/pages/user/user.ts b/src/app/pages/user/user.ts index 7b74ff6..eb46672 100644 --- a/src/app/pages/user/user.ts +++ b/src/app/pages/user/user.ts @@ -2,7 +2,6 @@ import {Component, inject, viewChild} from '@angular/core'; import {UserTable} from "../../components/user-table/user-table"; import {ModalButton} from "../../components/modal-button/modal-button"; import {ProfilForm} from "../../components/profil-form/profil-form"; -import {Search} from "../../components/search/search"; import {UsersService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @@ -13,7 +12,6 @@ import {firstValueFrom} from "rxjs"; UserTable, ModalButton, ProfilForm, - Search ], templateUrl: './user.html', styleUrl: './user.css', From 4dd1d7e81d25255e7379a84eec4d422067d1948d Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 14:57:36 +0100 Subject: [PATCH 102/127] Fixed error with estimateDeliveryDate in form to update the raw --- .../deliverery-note-form.html | 3 +-- .../deliverery-note-form.ts | 11 +++----- .../deliverery-note-table.html | 10 +++++++ .../deliverery-note-table.ts | 27 ++++++------------- src/app/services/api/README.md | 6 ++--- 5 files changed, 26 insertions(+), 31 deletions(-) diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.html b/src/app/components/deliverery-note-form/deliverery-note-form.html index f398eea..770423f 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.html +++ b/src/app/components/deliverery-note-form/deliverery-note-form.html @@ -5,8 +5,7 @@ - + @for (deliverer of deliverers(); track deliverer.id) { } diff --git a/src/app/components/deliverery-note-form/deliverery-note-form.ts b/src/app/components/deliverery-note-form/deliverery-note-form.ts index 6cff67f..266a789 100644 --- a/src/app/components/deliverery-note-form/deliverery-note-form.ts +++ b/src/app/components/deliverery-note-form/deliverery-note-form.ts @@ -31,14 +31,17 @@ export class DelivereryNoteForm implements OnInit { trackingNumber: new FormControl(null), delivererId: new FormControl(null, [Validators.required]), expeditionDate: new FormControl(null, [Validators.required]), - estimatedDate: new FormControl(null), + estimatedDate: new FormControl(null, [Validators.required]), realDeliveryDate: new FormControl(null) }) private deliverersService = inject(DeliverersService); private notificationService = inject(NzNotificationService); + deliverers = signal([]); + deliveryNote = input(); + async fetchDeliverers() { try { const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()); @@ -52,12 +55,6 @@ export class DelivereryNoteForm implements OnInit { await this.fetchDeliverers(); } - filter(input: string, option: any) { - return option.nzLabel.toLowerCase().includes(input.toLowerCase()); - } - - deliveryNote = input(); - constructor() { effect(() => { if (this.deliveryNote()) { diff --git a/src/app/components/deliverery-note-table/deliverery-note-table.html b/src/app/components/deliverery-note-table/deliverery-note-table.html index bf0788a..daca5a9 100644 --- a/src/app/components/deliverery-note-table/deliverery-note-table.html +++ b/src/app/components/deliverery-note-table/deliverery-note-table.html @@ -9,6 +9,7 @@ Date d'expédition Date de livraison estimée Date de livraison réelle + Statut Action @@ -20,6 +21,15 @@ {{ deliveryNote.expeditionDate | date: 'dd/MM/yyyy' }} {{ deliveryNote.estimateDeliveryDate | date: 'dd/MM/yyyy' }} {{ deliveryNote.realDeliveryDate | date: 'dd/MM/yyyy' }} + + @if (deliveryNote.estimateDeliveryDate >= date && deliveryNote.realDeliveryDate == null) { +

    En cours

    + } @else if (deliveryNote.realDeliveryDate == null) { +

    En retard

    + } @else { +

    Terminée

    + } +
    (false); modal = viewChild.required('modalNav'); + date: string = ""; + async ngOnInit() { await this.fetchDeliveryNotes(); + this.date = new Date().toISOString().split('T')[0]; } async fetchDeliveryNotes() { @@ -123,34 +126,20 @@ export class DelivereryNoteTable implements OnInit { try { const raw = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue(); - // convertit proprement les dates (string OU Date) - const toIso = (val: any) => { - if (!val) return null; + const toIso = (val: any) => + val ? new Date(val).toISOString().substring(0, 10) : null; - // si c’est déjà un string ISO "yyyy-MM-dd", on renvoie tel quel - if (typeof val === 'string' && /^\d{4}-\d{2}-\d{2}/.test(val)) { - return val.substring(0, 10); - } - - // sinon on reconstruit une Date - const d = new Date(val); - if (isNaN(d.getTime())) return null; - - return d.toISOString().substring(0, 10); // yyyy-MM-dd - }; - - const deliveryNoteDto = { + const deliveryNoteDto: UpdateDeliveryNoteDto = { trackingNumber: raw.trackingNumber, delivererId: raw.delivererId, expeditionDate: toIso(raw.expeditionDate), - estimatedDate: toIso(raw.estimatedDate), + estimateDeliveryDate: toIso(raw.estimatedDate), realDeliveryDate: toIso(raw.realDeliveryDate) }; await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNoteDto)); this.notificationService.success('Success', 'Bon de livraison modifié'); } catch (e) { - console.error(e); this.notificationService.error('Erreur', 'Erreur lors de la modification'); } } diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md index 29f22fe..4d71313 100644 --- a/src/app/services/api/README.md +++ b/src/app/services/api/README.md @@ -59,9 +59,9 @@ In your Angular project: ```typescript -import { ApplicationConfig } from '@angular/core'; -import { provideHttpClient } from '@angular/common/http'; -import { provideApi } from ''; +import {ApplicationConfig} from '@angular/core'; +import {provideHttpClient} from '@angular/common/http'; +import {provideApi} from ''; export const appConfig: ApplicationConfig = { providers: [ From 961551e9267936282990f41b00ae04b458b20aea Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 18:35:44 +0100 Subject: [PATCH 103/127] Added checkbox in stock page --- .../add-product-supplier-form.css | 0 .../add-product-supplier-form.html | 40 ++++ .../add-product-supplier-form.ts | 68 +++++++ .../components/stock-table/stock-table.html | 19 +- src/app/components/stock-table/stock-table.ts | 191 +++++++----------- .../components/supplier-form/supplier-form.ts | 4 +- src/app/pages/stock/stock.html | 21 +- src/app/pages/stock/stock.ts | 156 +++++++++----- 8 files changed, 310 insertions(+), 189 deletions(-) create mode 100644 src/app/components/add-product-supplier-form/add-product-supplier-form.css create mode 100644 src/app/components/add-product-supplier-form/add-product-supplier-form.html create mode 100644 src/app/components/add-product-supplier-form/add-product-supplier-form.ts diff --git a/src/app/components/add-product-supplier-form/add-product-supplier-form.css b/src/app/components/add-product-supplier-form/add-product-supplier-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/add-product-supplier-form/add-product-supplier-form.html b/src/app/components/add-product-supplier-form/add-product-supplier-form.html new file mode 100644 index 0000000..66a94c5 --- /dev/null +++ b/src/app/components/add-product-supplier-form/add-product-supplier-form.html @@ -0,0 +1,40 @@ +
    + + + Fournisseur + + + + + @for (supplier of suppliers(); track supplier.id){ + + } + + + + +
    + + + + Produit + Prix + + + + @for (line of lines.controls; let i = $index; track i) { + + {{ line.value.name }} + + + + + + } + + +
    +
    diff --git a/src/app/components/add-product-supplier-form/add-product-supplier-form.ts b/src/app/components/add-product-supplier-form/add-product-supplier-form.ts new file mode 100644 index 0000000..9060015 --- /dev/null +++ b/src/app/components/add-product-supplier-form/add-product-supplier-form.ts @@ -0,0 +1,68 @@ +import {Component, inject, OnInit, signal} from '@angular/core'; +import {FormArray, FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {GetProductDto, GetSupplierDto, SuppliersService} from "../../services/api"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFormControlComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzTableComponent} from "ng-zorro-antd/table"; +import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {firstValueFrom} from "rxjs"; +import {NzNotificationService} from "ng-zorro-antd/notification"; + +@Component({ + selector: 'app-add-product-supplier-form', + imports: [ + NzRowDirective, + NzFormControlComponent, + NzFormLabelComponent, + ReactiveFormsModule, + NzFlexDirective, + NzColDirective, + NzTableComponent, + NzInputNumberComponent, + NzOptionComponent, + NzSelectComponent + ], + templateUrl: './add-product-supplier-form.html', + styleUrl: './add-product-supplier-form.css', +}) +export class AddProductSupplierForm implements OnInit { + addProductForm: FormGroup = new FormGroup({ + supplierId: new FormControl(null, Validators.required), + lines: new FormArray([], Validators.required), + }); + + private suppliersServices = inject(SuppliersService); + private notificationService = inject(NzNotificationService); + + suppliers = signal([]); + + async ngOnInit() { + try { + const suppliers = await firstValueFrom(this.suppliersServices.getAllSuppliersEndpoint()); + this.suppliers.set(suppliers); + } + catch { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + } + + get lines(): FormArray { + return this.addProductForm.get('lines') as FormArray; + } + + addProductToForm(selectedProducts: GetProductDto[]) { + this.lines.clear(); + + selectedProducts.forEach(p => { + this.lines.push( + new FormGroup({ + productId: new FormControl(p.id), + name: new FormControl(p.name), + price: new FormControl(1, [Validators.required,Validators.min(0)]) + }) + ); + }); + } +} diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 10db515..55148da 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -1,18 +1,16 @@ - + Nom Référence @@ -27,16 +25,15 @@ - @for (product of filteredProducts(); track product.id) { + @for (product of products(); track product.id) { - {{ product.name }} {{ product.references }} {{ product.nec }} diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index e0857d2..d2000a0 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -1,14 +1,14 @@ -import {Component, computed, inject, OnInit, output, signal, viewChild} from '@angular/core'; +import {Component, inject, OnInit, output, signal, viewChild} from '@angular/core'; import {NzTableComponent, NzThMeasureDirective} from "ng-zorro-antd/table"; import {ModalNav} from "../modal-nav/modal-nav"; import {NzIconDirective} from "ng-zorro-antd/icon"; import {StockForm} from "../stock-form/stock-form"; import {NzDividerComponent} from "ng-zorro-antd/divider"; import {FormsModule} from "@angular/forms"; -import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; import {GetProductDto, ProductsService, WarehouseproductsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; -import {firstValueFrom} from "rxjs"; +import {first, firstValueFrom} from "rxjs"; +import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; interface ProductWithQuantity extends GetProductDto { totalQuantity?: number; @@ -23,8 +23,8 @@ interface ProductWithQuantity extends GetProductDto { StockForm, NzDividerComponent, FormsModule, - NzCheckboxComponent, NzThMeasureDirective, + NzCheckboxComponent, ], templateUrl: './stock-table.html', styleUrl: './stock-table.css', @@ -34,109 +34,49 @@ export class StockTable implements OnInit { private productsService = inject(ProductsService); private wareHousseProductsService = inject(WarehouseproductsService) private notificationService = inject(NzNotificationService) + products = signal([]); productsLoading = signal(false); - updateProduct = viewChild.required('stockForm'); + modal = viewChild.required('modalNav'); - checked = false; - indeterminate = false; - setOfCheckedId = new Set(); - selectionChange = output() - currentPageData: GetProductDto[] = []; + selectionChange = output(); + productsTables = output(); - private searchQuery = signal(''); - - filteredProducts = computed(() => { - const q = this.searchQuery().toLowerCase().trim(); - - if (!q) return this.products(); - - return this.products().filter(s => { - const name = (s.name ?? '').toLowerCase(); - return name.includes(q); - }); - }); - - applySearch(query: string) { - this.searchQuery.set(query); - } - - get hasSelection(): boolean { - return this.setOfCheckedId.size > 0; - } - - updateCheckedSet(id: number, checked: boolean): void { - if (checked) this.setOfCheckedId.add(id); - else this.setOfCheckedId.delete(id); - } - - onItemChecked(id: number, checked: boolean): void { - this.updateCheckedSet(id, checked); - this.refreshCheckedStatus(); - } - - onAllChecked(checked: boolean): void { - this.currentPageData.forEach(item => - this.updateCheckedSet(item.id, checked) - ); - this.refreshCheckedStatus(); - } - - onCurrentPageDataChange($event: GetProductDto[]): void { - this.currentPageData = $event; - this.refreshCheckedStatus(); - } - - refreshCheckedStatus(): void { - const total = this.currentPageData.length; - const checkedCount = this.currentPageData.filter(p => this.setOfCheckedId.has(p.id)).length; - - this.checked = checkedCount === total; - this.indeterminate = checkedCount > 0 && checkedCount < total; - - setTimeout(() => this.selectionChange.emit(this.hasSelection)); - } - - get selectedIds() { - return Array.from(this.setOfCheckedId); - } + selectedProduct: GetProductDto | null = null; + checked: boolean = false; + indeterminate: boolean = false; + selectedIds: number[] = []; async ngOnInit() { await this.fetchProducts(); } - async fetchTotalQuantity(product: ProductWithQuantity) { - try { - const res = await firstValueFrom( - this.wareHousseProductsService.getTotalQuantityEndpoint(product.id) - ); - product.totalQuantity = res.totalQuantity; - } catch (e) { - product.totalQuantity = 0; - } - } - async fetchProducts() { this.productsLoading.set(true); try { const products = await firstValueFrom(this.productsService.getAllProductsEndpoint()); - // transforme chaque produit en ProductWithQuantity - const productsWithQuantity: ProductWithQuantity[] = products.map(p => ({...p})); - - this.products.set(productsWithQuantity); - - // récupérer la quantité pour chaque produit en parallèle - await Promise.all(productsWithQuantity.map(p => this.fetchTotalQuantity(p))); - - // déclencher la mise à jour du signal - this.products.set([...productsWithQuantity]); - } catch (e) { - this.notificationService.error( - 'Erreur', - 'Erreur de communication avec l\'API' + const productsWithQuantity = await Promise.all( + products.map(async (x) => { + try { + const quantity = await firstValueFrom(this.wareHousseProductsService.getTotalQuantityEndpoint(x.id)); + return { + ...x, + totalQuantity: quantity.totalQuantity ?? 0 + }; + } catch { + return { + ...x, + totalQuantity: 0 + }; + } + }) ); + this.products.set(productsWithQuantity); + this.productsTables.emit(productsWithQuantity); + } catch { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); } this.productsLoading.set(false); } @@ -144,48 +84,28 @@ export class StockTable implements OnInit { async delete(productId: number) { try { await firstValueFrom(this.productsService.deleteProductEndpoint(productId)) - this.notificationService.success( - 'Success', - 'Suppression effectuée' - ) - } catch (e) { - this.notificationService.error( - 'Erreur', - 'Impossible de supprimer la ligne' - ) + this.notificationService.success('Success', 'Suppression effectuée'); + } catch { + this.notificationService.error('Erreur', 'Impossible de supprimer la ligne'); } await this.fetchProducts(); } async edit(id: number, updateProductComponent: StockForm) { if (updateProductComponent.stockForm.invalid) { - this.notificationService.error( - 'Erreur', - 'Erreur d\'écriture dans le formulaire' - ) + this.notificationService.error('Erreur', 'Erreur d\'écriture dans le formulaire') return; } - try { - const products = updateProductComponent.stockForm.getRawValue(); - await firstValueFrom(this.productsService.patchProductMinimalStockEndpoint(id, products)) - - this.notificationService.success( - 'Success', - 'Limite de stock modifiée' - ) - } catch (e) { - console.error(e); - this.notificationService.error( - 'Erreur', - 'Erreur lors de la modification' - ) + await firstValueFrom(this.productsService.patchProductMinimalStockEndpoint(id, products)); + await this.fetchProducts(); + this.notificationService.success('Success', 'Limite de stock modifiée'); + } catch { + this.notificationService.error('Erreur', 'Erreur lors de la modification'); } } - selectedProduct: GetProductDto | null = null; - openEditModal(product: GetProductDto) { this.selectedProduct = {...product}; this.modal().showModal(); @@ -193,7 +113,6 @@ export class StockTable implements OnInit { async onModalOk(productId: number, updateProductComponent: StockForm, modal: ModalNav) { if (!this.selectedProduct) return; - await this.edit(productId, updateProductComponent); updateProductComponent.stockForm.reset(); modal.isVisible = false; @@ -203,4 +122,34 @@ export class StockTable implements OnInit { onModalCancel(modal: ModalNav) { modal.isVisible = false; } + + updateCheck(id: number, checked: boolean) { + if (checked) { + if (!this.selectedIds.includes(id)) { + this.selectedIds.push(id); + } + } else this.selectedIds = this.selectedIds.filter(x => x !== id); + } + + refreshCheckStatus() { + const total = this.products().length; + const checkedCount = this.selectedIds.length; + + this.checked = checkedCount === total; + this.indeterminate = checkedCount > 0 && checkedCount < total; + + this.selectionChange.emit(this.selectedIds); + } + + allCheck(checked: boolean) { + this.products().forEach(x => + this.updateCheck(x.id, checked) + ); + this.refreshCheckStatus(); + } + + onItemChecked(id: number, checked: boolean): void { + this.updateCheck(id, checked); + this.refreshCheckStatus(); + } } \ No newline at end of file diff --git a/src/app/components/supplier-form/supplier-form.ts b/src/app/components/supplier-form/supplier-form.ts index 2686f33..d3581a8 100644 --- a/src/app/components/supplier-form/supplier-form.ts +++ b/src/app/components/supplier-form/supplier-form.ts @@ -22,6 +22,8 @@ import {GetSupplierDto} from "../../services/api"; styleUrl: './supplier-form.css', }) export class SupplierForm { + supplier = input(); + supplierForm: FormGroup = new FormGroup({ name: new FormControl(null, [Validators.required]), email: new FormControl(null, [Validators.required]), @@ -33,8 +35,6 @@ export class SupplierForm { }) - supplier = input(); - constructor() { effect(() => { if (this.supplier()) { diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index be430c1..f1f29bd 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,9 +1,9 @@
    - @if (hasSelection) { + @if (productIds.length) { + + + + }
    - + +
    \ No newline at end of file diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index e30b475..a12156e 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,11 +1,12 @@ -import {Component, inject, viewChild} from '@angular/core'; +import {Component, inject, signal, viewChild} from '@angular/core'; import {StockTable} from "../../components/stock-table/stock-table"; import {ModalButton} from "../../components/modal-button/modal-button"; -import {PurchaseordersService, QuotationsService} from "../../services/api"; -import {NzNotificationService} from "ng-zorro-antd/notification"; -import {firstValueFrom} from "rxjs"; import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-form/create-purchaseorder-form"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {CreatePriceDto, PurchaseordersService, QuotationsService, SuppliersService} from "../../services/api"; +import {firstValueFrom} from "rxjs"; import {CreateQuotationForm} from "../../components/create-quotation-form/create-quotation-form"; +import {AddProductSupplierForm} from "../../components/add-product-supplier-form/add-product-supplier-form"; @Component({ selector: 'app-stock', @@ -14,6 +15,7 @@ import {CreateQuotationForm} from "../../components/create-quotation-form/create ModalButton, CreatePurchaseorderForm, CreateQuotationForm, + AddProductSupplierForm, ], templateUrl: './stock.html', styleUrl: './stock.css', @@ -22,112 +24,164 @@ import {CreateQuotationForm} from "../../components/create-quotation-form/create export class Stock { createPurchaseOrder = viewChild.required('purchaseOrderForm'); createQuotation = viewChild.required('quotationForm'); - productTable = viewChild.required('stockTable'); - private purchaseordersService = inject(PurchaseordersService) - private quotationsService = inject(QuotationsService) - private notificationService = inject(NzNotificationService) + addProduct = viewChild.required('supplierForm'); modalButtonPurchaseOrder = viewChild.required('modalButtonPurchaseOrder'); modalButtonQuotation = viewChild.required('modalButtonQuotation'); + modalButtonSupplier = viewChild.required('modalButtonSupplier'); - hasSelection = false; + private purchaseOrdersService = inject(PurchaseordersService); + private quotationsService = inject(QuotationsService); + private suppliersService = inject(SuppliersService); + private notificationService = inject(NzNotificationService); - onSelectionChange(value: boolean) { - this.hasSelection = value; + products = signal([]); + + productIds = []; + + getSelectedProducts() { + return this.products().filter(x => this.productIds.includes(x.id)); + } + + openPurchaseOrderForm() { + this.createPurchaseOrder().syncSelectedProducts(this.getSelectedProducts()); + } + + openQuotationForm() { + this.createQuotation().syncSelectedProducts(this.getSelectedProducts()); + } + + openSupplierForm() { + this.addProduct().addProductToForm(this.getSelectedProducts()); } async addPurchaseOrder() { const form = this.createPurchaseOrder().createPurchaseOrderForm; + if (form.invalid) { this.notificationService.error('Erreur', 'Formulaire invalide'); return; } + const orderLines = this.createPurchaseOrder().lines.value.map(line => ({ productId: line.productId, quantity: line.quantity })); - if (orderLines.length === 0) { + + if (!orderLines.length) { this.notificationService.error('Erreur', 'Aucun produit sélectionné'); return; } + const purchaseOrder = { purchaseConditions: form.get('purchaseConditions')!.value, products: orderLines }; + try { - await firstValueFrom( - this.purchaseordersService.createPurchaseOrder(purchaseOrder) - ); + await firstValueFrom(this.purchaseOrdersService.createPurchaseOrder(purchaseOrder)); this.notificationService.success('Succès', 'Bon de commande créé'); - } catch (e) { + } catch { this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.'); } - - } - - async onModalOk() { - await this.addPurchaseOrder(); - this.createPurchaseOrder().createPurchaseOrderForm.reset(); - this.modalButtonPurchaseOrder().isVisible = false; - await this.productTable().fetchProducts(); - } - - onModalCancel() { - this.modalButtonPurchaseOrder().isVisible = false; - } - - openPurchaseOrderForm() { - const selectedProducts = this.productTable().products().filter(p => - this.productTable().selectedIds.includes(p.id) - ); - this.createPurchaseOrder().syncSelectedProducts(selectedProducts); } async addQuotation() { - if (this.createQuotation().createQuotationForm.invalid) { + const form = this.createQuotation().createQuotationForm; + + if (form.invalid) { this.notificationService.error('Erreur', 'Formulaire invalide'); return; } + const orderLines = this.createQuotation().lines.value.map(line => ({ productId: line.productId, quantity: line.quantity })); - if (orderLines.length === 0) { + + if (!orderLines.length) { this.notificationService.error('Erreur', 'Aucun produit sélectionné'); return; } + const quotation = { message: this.createQuotation().createQuotationForm.get('message')!.value, purchaseConditions: this.createQuotation().createQuotationForm.get('purchaseConditions')!.value, products: orderLines }; + try { - await firstValueFrom( - this.quotationsService.createQuotationEndpoint(quotation) - ); - this.notificationService.success('Succès', 'Devis créé'); - } catch (e) { - console.log(this.createQuotation()); - this.notificationService.error('Erreur', 'Erreur lors de la création du devis.'); + await firstValueFrom(this.quotationsService.createQuotationEndpoint(quotation)); + this.notificationService.success('Succès', 'Bon de commande créé'); + } catch { + this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.'); + } + } + + async addProductFromSupplier() { + const form = this.addProduct().addProductForm; + let success = 0; + + if (form.invalid) { + this.notificationService.error('Erreur', 'Formulaire invalide'); + return; } + const supplierId = form.value.supplierId; + const lines = this.addProduct().lines.value; + + if (!lines.length) { + this.notificationService.error('Erreur', 'Aucun produit sélectionné'); + return; + } + + for (const line of lines) { + try { + await firstValueFrom( + this.suppliersService.addProductToSupplierEndpoint( + supplierId, + line.productId, + { + sellingPrice: line.price + } + ) + ); + + success++; + } catch {} + } + this.notificationService.success('Succès', `${success} produits ajoutés`); + } + + async onModalPurchaseOrderOk() { + await this.addPurchaseOrder(); + this.createPurchaseOrder().createPurchaseOrderForm.reset(); + this.modalButtonPurchaseOrder().isVisible = false; + this.onModalPurchaseOrderCancel(); + } + + onModalPurchaseOrderCancel() { + this.modalButtonPurchaseOrder().isVisible = false; } async onModalQuotationOk() { - console.log(this.createQuotation().createQuotationForm.getRawValue()); await this.addQuotation(); this.createQuotation().createQuotationForm.reset(); this.modalButtonQuotation().isVisible = false; - await this.productTable().fetchProducts(); + this.onModalQuotationCancel(); } onModalQuotationCancel() { this.modalButtonQuotation().isVisible = false; } - openQuotationForm() { - const selectedProducts = this.productTable().products().filter(p => - this.productTable().selectedIds.includes(p.id) - ); - this.createQuotation().syncSelectedProducts(selectedProducts); + async onModalSupplierOk() { + await this.addProductFromSupplier(); + this.addProduct().addProductForm.reset(); + this.modalButtonSupplier().isVisible = false; + this.onModalSupplierCancel(); + } + + onModalSupplierCancel() { + this.modalButtonSupplier().isVisible = false; } } From 14d3d25217f1ace03d328638b49b61aaee027d12 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 18:57:41 +0100 Subject: [PATCH 104/127] Fixed error with code to check product --- .../add-product-supplier-form.html | 2 +- .../add-product-supplier-form.ts | 8 ++--- .../create-purchaseorder-form.ts | 27 ++++++++--------- .../create-quotation-form.ts | 29 +++++++++---------- src/app/pages/stock/stock.ts | 6 ++-- 5 files changed, 34 insertions(+), 38 deletions(-) diff --git a/src/app/components/add-product-supplier-form/add-product-supplier-form.html b/src/app/components/add-product-supplier-form/add-product-supplier-form.html index 66a94c5..756fa5a 100644 --- a/src/app/components/add-product-supplier-form/add-product-supplier-form.html +++ b/src/app/components/add-product-supplier-form/add-product-supplier-form.html @@ -28,7 +28,7 @@ diff --git a/src/app/components/add-product-supplier-form/add-product-supplier-form.ts b/src/app/components/add-product-supplier-form/add-product-supplier-form.ts index 9060015..c22c773 100644 --- a/src/app/components/add-product-supplier-form/add-product-supplier-form.ts +++ b/src/app/components/add-product-supplier-form/add-product-supplier-form.ts @@ -55,12 +55,12 @@ export class AddProductSupplierForm implements OnInit { addProductToForm(selectedProducts: GetProductDto[]) { this.lines.clear(); - selectedProducts.forEach(p => { + selectedProducts.forEach(x => { this.lines.push( new FormGroup({ - productId: new FormControl(p.id), - name: new FormControl(p.name), - price: new FormControl(1, [Validators.required,Validators.min(0)]) + productId: new FormControl(x.id), + name: new FormControl(x.name), + price: new FormControl(0, [Validators.required,Validators.min(0)]) }) ); }); diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts index 2668f29..ecfea0e 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts @@ -25,28 +25,25 @@ import {NzInputDirective} from "ng-zorro-antd/input"; ] }) export class CreatePurchaseorderForm { - createPurchaseOrderForm: FormGroup - - constructor(private fb: FormBuilder) { - this.createPurchaseOrderForm = this.fb.group({ - purchaseConditions: new FormControl(null, Validators.required), - lines: this.fb.array([]) - }); - } + createPurchaseOrderForm: FormGroup = new FormGroup({ + purchaseConditions: new FormControl(null, Validators.required), + lines: new FormArray([], Validators.required), + }) get lines(): FormArray { return this.createPurchaseOrderForm.get('lines') as FormArray; } - // Ajouter des produits sélectionnés dans le formulaire - syncSelectedProducts(selectedProducts: GetProductDto[]) { + addProductToForm(selectedProducts: GetProductDto[]) { this.lines.clear(); selectedProducts.forEach(p => { - this.lines.push(this.fb.group({ - productId: [p.id], - name: [p.name], - quantity: [1, [Validators.required, Validators.min(1)]] - })); + this.lines.push( + new FormGroup({ + productId: new FormControl(p.id), + name: new FormControl(p.name), + quantity: new FormControl(1, [Validators.required,Validators.min(0)]) + }) + ); }); } } diff --git a/src/app/components/create-quotation-form/create-quotation-form.ts b/src/app/components/create-quotation-form/create-quotation-form.ts index e545f06..b5fafb5 100644 --- a/src/app/components/create-quotation-form/create-quotation-form.ts +++ b/src/app/components/create-quotation-form/create-quotation-form.ts @@ -34,29 +34,26 @@ import {GetProductDto} from "../../services/api"; styleUrl: './create-quotation-form.css', }) export class CreateQuotationForm { - createQuotationForm: FormGroup - - constructor(private fb: FormBuilder) { - this.createQuotationForm = this.fb.group({ - message: new FormControl(null, Validators.required), - purchaseConditions: new FormControl(null, Validators.required), - lines: this.fb.array([]) - }); - } + createQuotationForm: FormGroup = new FormGroup({ + message: new FormControl(null, Validators.required), + purchaseConditions: new FormControl(null, Validators.required), + lines: new FormArray([], Validators.required), + }) get lines(): FormArray { return this.createQuotationForm.get('lines') as FormArray; } - // Ajouter des produits sélectionnés dans le formulaire - syncSelectedProducts(selectedProducts: GetProductDto[]) { + addProductToForm(selectedProducts: GetProductDto[]) { this.lines.clear(); selectedProducts.forEach(p => { - this.lines.push(this.fb.group({ - productId: [p.id], - name: [p.name], - quantity: [1, [Validators.required, Validators.min(1)]] - })); + this.lines.push( + new FormGroup({ + productId: new FormControl(p.id), + name: new FormControl(p.name), + quantity: new FormControl(0, [Validators.required, Validators.min(0)]) + }) + ); }); } } diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index a12156e..b4779e1 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -43,11 +43,11 @@ export class Stock { } openPurchaseOrderForm() { - this.createPurchaseOrder().syncSelectedProducts(this.getSelectedProducts()); + this.createPurchaseOrder().addProductToForm(this.getSelectedProducts()); } openQuotationForm() { - this.createQuotation().syncSelectedProducts(this.getSelectedProducts()); + this.createQuotation().addProductToForm(this.getSelectedProducts()); } openSupplierForm() { @@ -77,6 +77,8 @@ export class Stock { products: orderLines }; + console.log(purchaseOrder); + try { await firstValueFrom(this.purchaseOrdersService.createPurchaseOrder(purchaseOrder)); this.notificationService.success('Succès', 'Bon de commande créé'); From 56d3d1bea71bf85fb98db9aa25e865ca2a5aa66b Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Tue, 26 May 2026 19:17:40 +0100 Subject: [PATCH 105/127] Added supplier in purchase order form --- .../add-product-supplier-form.ts | 23 ++++-------------- .../create-purchaseorder-form.html | 16 ++++++++++++- .../create-purchaseorder-form.ts | 10 ++++++-- .../create-quotation-form.html | 2 +- src/app/pages/stock/stock.html | 4 ++-- src/app/pages/stock/stock.ts | 24 +++++++++++++++---- 6 files changed, 49 insertions(+), 30 deletions(-) diff --git a/src/app/components/add-product-supplier-form/add-product-supplier-form.ts b/src/app/components/add-product-supplier-form/add-product-supplier-form.ts index c22c773..00f9533 100644 --- a/src/app/components/add-product-supplier-form/add-product-supplier-form.ts +++ b/src/app/components/add-product-supplier-form/add-product-supplier-form.ts @@ -1,14 +1,12 @@ -import {Component, inject, OnInit, signal} from '@angular/core'; +import {Component, input} from '@angular/core'; import {FormArray, FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; -import {GetProductDto, GetSupplierDto, SuppliersService} from "../../services/api"; +import {GetProductDto, GetSupplierDto} from "../../services/api"; import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; import {NzFormControlComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzTableComponent} from "ng-zorro-antd/table"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; -import {firstValueFrom} from "rxjs"; -import {NzNotificationService} from "ng-zorro-antd/notification"; @Component({ selector: 'app-add-product-supplier-form', @@ -27,26 +25,13 @@ import {NzNotificationService} from "ng-zorro-antd/notification"; templateUrl: './add-product-supplier-form.html', styleUrl: './add-product-supplier-form.css', }) -export class AddProductSupplierForm implements OnInit { +export class AddProductSupplierForm { addProductForm: FormGroup = new FormGroup({ supplierId: new FormControl(null, Validators.required), lines: new FormArray([], Validators.required), }); - private suppliersServices = inject(SuppliersService); - private notificationService = inject(NzNotificationService); - - suppliers = signal([]); - - async ngOnInit() { - try { - const suppliers = await firstValueFrom(this.suppliersServices.getAllSuppliersEndpoint()); - this.suppliers.set(suppliers); - } - catch { - this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); - } - } + suppliers = input.required(); get lines(): FormArray { return this.addProductForm.get('lines') as FormArray; diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html index b90a5be..e0afa79 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html @@ -9,6 +9,20 @@ + + + Fournisseur + + + + + @for (supplier of suppliers(); track supplier.id){ + + } + + + +
    @@ -18,7 +32,7 @@ - @for (line of lines.controls.slice(); let i = $index; track i) { + @for (line of lines.controls; let i = $index; track i) { {{ line.value.name }} diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts index ecfea0e..147f96e 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts @@ -1,12 +1,13 @@ -import {Component} from '@angular/core'; +import {Component, input} from '@angular/core'; import {FormBuilder, FormGroup, FormArray, Validators, ReactiveFormsModule, FormControl} from '@angular/forms'; -import {GetProductDto} from '../../services/api'; +import {GetProductDto, GetSupplierDto} from '../../services/api'; import {NzTableComponent} from "ng-zorro-antd/table"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzColDirective} from "ng-zorro-antd/grid"; import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; @Component({ selector: 'app-create-purchaseorder-form', @@ -22,12 +23,17 @@ import {NzInputDirective} from "ng-zorro-antd/input"; NzFormItemComponent, NzFormLabelComponent, NzInputDirective, + NzOptionComponent, + NzSelectComponent, ] }) export class CreatePurchaseorderForm { + suppliers = input.required(); + createPurchaseOrderForm: FormGroup = new FormGroup({ purchaseConditions: new FormControl(null, Validators.required), lines: new FormArray([], Validators.required), + supplierId: new FormControl(null, Validators.required), }) get lines(): FormArray { diff --git a/src/app/components/create-quotation-form/create-quotation-form.html b/src/app/components/create-quotation-form/create-quotation-form.html index 74e0fdb..a749284 100644 --- a/src/app/components/create-quotation-form/create-quotation-form.html +++ b/src/app/components/create-quotation-form/create-quotation-form.html @@ -28,7 +28,7 @@ - @for (line of lines.controls.slice(); let i = $index; track i) { + @for (line of lines.controls; let i = $index; track i) { {{ line.value.name }} diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index f1f29bd..e8c7b40 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -8,7 +8,7 @@ name="Créer un bon de commande" size="35%" class="ml-4"> - + - + }
    diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index b4779e1..edca83c 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -1,9 +1,14 @@ -import {Component, inject, signal, viewChild} from '@angular/core'; +import {Component, inject, OnInit, signal, viewChild} from '@angular/core'; import {StockTable} from "../../components/stock-table/stock-table"; import {ModalButton} from "../../components/modal-button/modal-button"; import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-form/create-purchaseorder-form"; import {NzNotificationService} from "ng-zorro-antd/notification"; -import {CreatePriceDto, PurchaseordersService, QuotationsService, SuppliersService} from "../../services/api"; +import { + GetSupplierDto, + PurchaseordersService, + QuotationsService, + SuppliersService +} from "../../services/api"; import {firstValueFrom} from "rxjs"; import {CreateQuotationForm} from "../../components/create-quotation-form/create-quotation-form"; import {AddProductSupplierForm} from "../../components/add-product-supplier-form/add-product-supplier-form"; @@ -21,7 +26,7 @@ import {AddProductSupplierForm} from "../../components/add-product-supplier-form styleUrl: './stock.css', }) -export class Stock { +export class Stock implements OnInit { createPurchaseOrder = viewChild.required('purchaseOrderForm'); createQuotation = viewChild.required('quotationForm'); addProduct = viewChild.required('supplierForm'); @@ -35,9 +40,20 @@ export class Stock { private notificationService = inject(NzNotificationService); products = signal([]); + suppliers = signal([]); productIds = []; + async ngOnInit() { + try { + const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint()); + this.suppliers.set(suppliers); + } + catch { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + } + getSelectedProducts() { return this.products().filter(x => this.productIds.includes(x.id)); } @@ -77,8 +93,6 @@ export class Stock { products: orderLines }; - console.log(purchaseOrder); - try { await firstValueFrom(this.purchaseOrdersService.createPurchaseOrder(purchaseOrder)); this.notificationService.success('Succès', 'Bon de commande créé'); From a7ef707388cf45008c2564c1f9d96aac6ae5b108 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 12:20:25 +0100 Subject: [PATCH 106/127] Fixed error to function to create purchase order --- .../add-product-supplier-form.html | 2 +- .../add-product-supplier-form.ts | 77 ++++++++++--------- .../create-purchaseorder-form.html | 5 +- .../create-purchaseorder-form.ts | 37 +++++++-- .../create-quotation-form.ts | 12 +-- src/app/components/stock-table/stock-table.ts | 4 +- src/app/pages/stock/stock.html | 18 +++-- src/app/pages/stock/stock.ts | 31 ++++---- src/app/services/api/README.md | 6 +- .../api/model/create-purchase-order-dto.ts | 1 + 10 files changed, 118 insertions(+), 75 deletions(-) diff --git a/src/app/components/add-product-supplier-form/add-product-supplier-form.html b/src/app/components/add-product-supplier-form/add-product-supplier-form.html index 756fa5a..606dc88 100644 --- a/src/app/components/add-product-supplier-form/add-product-supplier-form.html +++ b/src/app/components/add-product-supplier-form/add-product-supplier-form.html @@ -6,7 +6,7 @@ - @for (supplier of suppliers(); track supplier.id){ + @for (supplier of suppliers(); track supplier.id) { } diff --git a/src/app/components/add-product-supplier-form/add-product-supplier-form.ts b/src/app/components/add-product-supplier-form/add-product-supplier-form.ts index 00f9533..d031fe1 100644 --- a/src/app/components/add-product-supplier-form/add-product-supplier-form.ts +++ b/src/app/components/add-product-supplier-form/add-product-supplier-form.ts @@ -9,45 +9,46 @@ import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; @Component({ - selector: 'app-add-product-supplier-form', - imports: [ - NzRowDirective, - NzFormControlComponent, - NzFormLabelComponent, - ReactiveFormsModule, - NzFlexDirective, - NzColDirective, - NzTableComponent, - NzInputNumberComponent, - NzOptionComponent, - NzSelectComponent - ], - templateUrl: './add-product-supplier-form.html', - styleUrl: './add-product-supplier-form.css', + selector: 'app-add-product-supplier-form', + imports: [ + NzRowDirective, + NzFormControlComponent, + NzFormLabelComponent, + ReactiveFormsModule, + NzFlexDirective, + NzColDirective, + NzTableComponent, + NzInputNumberComponent, + NzOptionComponent, + NzSelectComponent + ], + templateUrl: './add-product-supplier-form.html', + styleUrl: './add-product-supplier-form.css', }) export class AddProductSupplierForm { - addProductForm: FormGroup = new FormGroup({ - supplierId: new FormControl(null, Validators.required), - lines: new FormArray([], Validators.required), - }); - - suppliers = input.required(); - - get lines(): FormArray { - return this.addProductForm.get('lines') as FormArray; - } - - addProductToForm(selectedProducts: GetProductDto[]) { - this.lines.clear(); - - selectedProducts.forEach(x => { - this.lines.push( - new FormGroup({ - productId: new FormControl(x.id), - name: new FormControl(x.name), - price: new FormControl(0, [Validators.required,Validators.min(0)]) - }) - ); + addProductForm: FormGroup = new FormGroup({ + supplierId: new FormControl(null, Validators.required), + lines: new FormArray([], Validators.required), }); - } + + suppliers = input.required(); + products = input.required(); + + get lines(): FormArray { + return this.addProductForm.get('lines') as FormArray; + } + + addProductToForm() { + this.lines.clear(); + + this.products().forEach(x => { + this.lines.push( + new FormGroup({ + productId: new FormControl(x.id), + name: new FormControl(x.name), + price: new FormControl(0, [Validators.required, Validators.min(0)]) + }) + ); + }); + } } diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html index e0afa79..4b08f97 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html @@ -15,8 +15,9 @@ - - @for (supplier of suppliers(); track supplier.id){ + + @for (supplier of suppliers(); track supplier.id) { } diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts index 147f96e..48f4b63 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts @@ -1,4 +1,4 @@ -import {Component, input} from '@angular/core'; +import {Component, input, OnInit, signal} from '@angular/core'; import {FormBuilder, FormGroup, FormArray, Validators, ReactiveFormsModule, FormControl} from '@angular/forms'; import {GetProductDto, GetSupplierDto} from '../../services/api'; import {NzTableComponent} from "ng-zorro-antd/table"; @@ -8,6 +8,7 @@ import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzInputDirective} from "ng-zorro-antd/input"; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {min} from "rxjs"; @Component({ selector: 'app-create-purchaseorder-form', @@ -29,6 +30,25 @@ import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; }) export class CreatePurchaseorderForm { suppliers = input.required(); + products = input.required(); + + getBestSupplier() { + let bestSupplier: GetSupplierDto = this.suppliers()[0]; + let maxProducts = 0; + + const selectedProducts = this.products().map(x => x.id); + + this.suppliers().forEach(x => { + const supplierProductsCount = x.prices.filter(p => selectedProducts.includes(p.productId)).length ?? 0; + + if (supplierProductsCount > maxProducts) { + maxProducts = supplierProductsCount; + bestSupplier = x; + } + }) + + return bestSupplier; + } createPurchaseOrderForm: FormGroup = new FormGroup({ purchaseConditions: new FormControl(null, Validators.required), @@ -40,16 +60,21 @@ export class CreatePurchaseorderForm { return this.createPurchaseOrderForm.get('lines') as FormArray; } - addProductToForm(selectedProducts: GetProductDto[]) { + addProductToForm() { this.lines.clear(); - selectedProducts.forEach(p => { + this.products().forEach(x => { this.lines.push( new FormGroup({ - productId: new FormControl(p.id), - name: new FormControl(p.name), - quantity: new FormControl(1, [Validators.required,Validators.min(0)]) + productId: new FormControl(x.id), + name: new FormControl(x.name), + quantity: new FormControl(1, [Validators.required, Validators.min(0)]) }) ); }); + + const bestSupplier = this.getBestSupplier(); + this.createPurchaseOrderForm.patchValue({ + supplierId: bestSupplier.id, + }); } } diff --git a/src/app/components/create-quotation-form/create-quotation-form.ts b/src/app/components/create-quotation-form/create-quotation-form.ts index b5fafb5..05a4d64 100644 --- a/src/app/components/create-quotation-form/create-quotation-form.ts +++ b/src/app/components/create-quotation-form/create-quotation-form.ts @@ -1,4 +1,4 @@ -import {Component} from '@angular/core'; +import {Component, input} from '@angular/core'; import { FormArray, FormBuilder, @@ -34,6 +34,8 @@ import {GetProductDto} from "../../services/api"; styleUrl: './create-quotation-form.css', }) export class CreateQuotationForm { + products = input.required(); + createQuotationForm: FormGroup = new FormGroup({ message: new FormControl(null, Validators.required), purchaseConditions: new FormControl(null, Validators.required), @@ -44,13 +46,13 @@ export class CreateQuotationForm { return this.createQuotationForm.get('lines') as FormArray; } - addProductToForm(selectedProducts: GetProductDto[]) { + addProductToForm() { this.lines.clear(); - selectedProducts.forEach(p => { + this.products().forEach(x => { this.lines.push( new FormGroup({ - productId: new FormControl(p.id), - name: new FormControl(p.name), + productId: new FormControl(x.id), + name: new FormControl(x.name), quantity: new FormControl(0, [Validators.required, Validators.min(0)]) }) ); diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index d2000a0..f4c54ae 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -41,7 +41,7 @@ export class StockTable implements OnInit { modal = viewChild.required('modalNav'); selectionChange = output(); - productsTables = output(); + productsTables = output(); selectedProduct: GetProductDto | null = null; checked: boolean = false; @@ -56,6 +56,7 @@ export class StockTable implements OnInit { this.productsLoading.set(true); try { const products = await firstValueFrom(this.productsService.getAllProductsEndpoint()); + this.productsTables.emit(products); const productsWithQuantity = await Promise.all( products.map(async (x) => { @@ -74,7 +75,6 @@ export class StockTable implements OnInit { }) ); this.products.set(productsWithQuantity); - this.productsTables.emit(productsWithQuantity); } catch { this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); } diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index e8c7b40..bae4840 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -1,5 +1,5 @@
    - @if (productIds.length) { + @if (productIds().length) { - + + - + + - + + }
    -
    \ No newline at end of file diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index edca83c..5080422 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -4,6 +4,8 @@ import {ModalButton} from "../../components/modal-button/modal-button"; import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-form/create-purchaseorder-form"; import {NzNotificationService} from "ng-zorro-antd/notification"; import { + CreatePurchaseOrderDto, + GetProductDto, GetSupplierDto, PurchaseordersService, QuotationsService, @@ -39,35 +41,36 @@ export class Stock implements OnInit { private suppliersService = inject(SuppliersService); private notificationService = inject(NzNotificationService); - products = signal([]); + products = signal([]); suppliers = signal([]); + selectedProducts = signal([]); - productIds = []; + productIds = signal([]); async ngOnInit() { try { const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint()); this.suppliers.set(suppliers); - } - catch { + } catch { this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); } } - getSelectedProducts() { - return this.products().filter(x => this.productIds.includes(x.id)); + onSelectionChange(ids: number[]) { + this.productIds.set(ids); + this.selectedProducts.set(this.products().filter(x => ids.includes(x.id))); } openPurchaseOrderForm() { - this.createPurchaseOrder().addProductToForm(this.getSelectedProducts()); + this.createPurchaseOrder().addProductToForm(); } openQuotationForm() { - this.createQuotation().addProductToForm(this.getSelectedProducts()); + this.createQuotation().addProductToForm(); } openSupplierForm() { - this.addProduct().addProductToForm(this.getSelectedProducts()); + this.addProduct().addProductToForm(); } async addPurchaseOrder() { @@ -88,9 +91,10 @@ export class Stock implements OnInit { return; } - const purchaseOrder = { - purchaseConditions: form.get('purchaseConditions')!.value, - products: orderLines + const purchaseOrder: CreatePurchaseOrderDto = { + purchaseConditions: form.value.purchaseConditions, + products: orderLines, + supplierId: form.value.supplierId }; try { @@ -163,7 +167,8 @@ export class Stock implements OnInit { ); success++; - } catch {} + } catch { + } } this.notificationService.success('Succès', `${success} produits ajoutés`); } diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md index 4d71313..29f22fe 100644 --- a/src/app/services/api/README.md +++ b/src/app/services/api/README.md @@ -59,9 +59,9 @@ In your Angular project: ```typescript -import {ApplicationConfig} from '@angular/core'; -import {provideHttpClient} from '@angular/common/http'; -import {provideApi} from ''; +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; export const appConfig: ApplicationConfig = { providers: [ diff --git a/src/app/services/api/model/create-purchase-order-dto.ts b/src/app/services/api/model/create-purchase-order-dto.ts index 8147c58..45b399f 100644 --- a/src/app/services/api/model/create-purchase-order-dto.ts +++ b/src/app/services/api/model/create-purchase-order-dto.ts @@ -12,6 +12,7 @@ import {CreatePurchaseOrderProductDto} from './create-purchase-order-product-dto export interface CreatePurchaseOrderDto { purchaseConditions?: string | null; + supplierId?: number; products?: Array | null; } From 0aec0be1d40ede44620a44eb357eff55d9ea92af Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 13:05:54 +0100 Subject: [PATCH 107/127] Fixed error to function to create quotation --- .../create-purchaseorder-form.ts | 3 +- .../create-quotation-form.html | 18 ++- .../create-quotation-form.ts | 56 +++++++++- src/app/pages/stock/stock.html | 1 + src/app/pages/stock/stock.ts | 14 ++- src/app/services/api/.openapi-generator/FILES | 2 + src/app/services/api/api/api.ts | 5 +- src/app/services/api/api/customers.service.ts | 104 ++++++++++++++++++ .../api/model/create-quotation-dto.ts | 2 + .../services/api/model/get-customer-dto.ts | 16 +++ src/app/services/api/model/models.ts | 1 + 11 files changed, 206 insertions(+), 16 deletions(-) create mode 100644 src/app/services/api/api/customers.service.ts create mode 100644 src/app/services/api/model/get-customer-dto.ts diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts index 48f4b63..168325c 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts @@ -72,9 +72,8 @@ export class CreatePurchaseorderForm { ); }); - const bestSupplier = this.getBestSupplier(); this.createPurchaseOrderForm.patchValue({ - supplierId: bestSupplier.id, + supplierId: this.getBestSupplier().id, }); } } diff --git a/src/app/components/create-quotation-form/create-quotation-form.html b/src/app/components/create-quotation-form/create-quotation-form.html index a749284..a70a780 100644 --- a/src/app/components/create-quotation-form/create-quotation-form.html +++ b/src/app/components/create-quotation-form/create-quotation-form.html @@ -1,4 +1,20 @@
    + + + Client + + + + + @for (customer of customers(); track customer.id) { + + } + + + + + Message @@ -15,7 +31,7 @@ - + diff --git a/src/app/components/create-quotation-form/create-quotation-form.ts b/src/app/components/create-quotation-form/create-quotation-form.ts index 05a4d64..0069596 100644 --- a/src/app/components/create-quotation-form/create-quotation-form.ts +++ b/src/app/components/create-quotation-form/create-quotation-form.ts @@ -1,4 +1,4 @@ -import {Component, input} from '@angular/core'; +import {Component, inject, input, OnInit, signal} from '@angular/core'; import { FormArray, FormBuilder, @@ -14,7 +14,10 @@ import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from import {NzInputDirective} from "ng-zorro-antd/input"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzTableComponent} from "ng-zorro-antd/table"; -import {GetProductDto} from "../../services/api"; +import {CustomersService, GetCustomerDto, GetProductDto, GetSupplierDto} from "../../services/api"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {firstValueFrom} from "rxjs"; +import {NzNotificationService} from "ng-zorro-antd/notification"; @Component({ selector: 'app-create-quotation-form', @@ -28,17 +31,36 @@ import {GetProductDto} from "../../services/api"; NzInputDirective, NzInputNumberComponent, NzTableComponent, - ReactiveFormsModule + ReactiveFormsModule, + NzOptionComponent, + NzSelectComponent ], templateUrl: './create-quotation-form.html', styleUrl: './create-quotation-form.css', }) -export class CreateQuotationForm { +export class CreateQuotationForm implements OnInit { + private customersService = inject(CustomersService); + private notificationService = inject(NzNotificationService); + + suppliers = input.required(); products = input.required(); + customers = signal([]); + + async ngOnInit() { + try { + const customers = await firstValueFrom(this.customersService.getAllCustomersEndpoint()) + this.customers.set(customers); + } catch { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API') + } + } + createQuotationForm: FormGroup = new FormGroup({ message: new FormControl(null, Validators.required), - purchaseConditions: new FormControl(null, Validators.required), + conditionsSale: new FormControl(null, Validators.required), + supplierId: new FormControl(null, Validators.required), + customerId: new FormControl(null, Validators.required), lines: new FormArray([], Validators.required), }) @@ -46,6 +68,24 @@ export class CreateQuotationForm { return this.createQuotationForm.get('lines') as FormArray; } + getDefaultSupplier() { + let defaultSupplier: GetSupplierDto = this.suppliers()[0]; + let maxProducts = 0; + + const selectedProducts = this.products().map(x => x.id); + + this.suppliers().forEach(x => { + const supplierProductsCount = x.prices.filter(p => selectedProducts.includes(p.productId)).length ?? 0; + + if (supplierProductsCount > maxProducts) { + maxProducts = supplierProductsCount; + defaultSupplier = x; + } + }) + + return defaultSupplier; + } + addProductToForm() { this.lines.clear(); this.products().forEach(x => { @@ -53,9 +93,13 @@ export class CreateQuotationForm { new FormGroup({ productId: new FormControl(x.id), name: new FormControl(x.name), - quantity: new FormControl(0, [Validators.required, Validators.min(0)]) + quantity: new FormControl(1, [Validators.required, Validators.min(1)]) }) ); }); + + this.createQuotationForm.patchValue({ + supplierId: this.getDefaultSupplier().id, + }); } } diff --git a/src/app/pages/stock/stock.html b/src/app/pages/stock/stock.html index bae4840..02f11c0 100644 --- a/src/app/pages/stock/stock.html +++ b/src/app/pages/stock/stock.html @@ -23,6 +23,7 @@ (ok)="onModalQuotationOk()" (cancel)="onModalQuotationCancel()"> diff --git a/src/app/pages/stock/stock.ts b/src/app/pages/stock/stock.ts index 5080422..7f78261 100644 --- a/src/app/pages/stock/stock.ts +++ b/src/app/pages/stock/stock.ts @@ -4,7 +4,7 @@ import {ModalButton} from "../../components/modal-button/modal-button"; import {CreatePurchaseorderForm} from "../../components/create-purchaseorder-form/create-purchaseorder-form"; import {NzNotificationService} from "ng-zorro-antd/notification"; import { - CreatePurchaseOrderDto, + CreatePurchaseOrderDto, CreateQuotationDto, GetProductDto, GetSupplierDto, PurchaseordersService, @@ -123,17 +123,19 @@ export class Stock implements OnInit { return; } - const quotation = { - message: this.createQuotation().createQuotationForm.get('message')!.value, - purchaseConditions: this.createQuotation().createQuotationForm.get('purchaseConditions')!.value, + const quotation: CreateQuotationDto = { + message: this.createQuotation().createQuotationForm.value.message, + conditionsSale: this.createQuotation().createQuotationForm.value.conditionsSale, + customerId: this.createQuotation().createQuotationForm.value.customerId, + supplierId: this.createQuotation().createQuotationForm.value.supplierId, products: orderLines }; try { await firstValueFrom(this.quotationsService.createQuotationEndpoint(quotation)); - this.notificationService.success('Succès', 'Bon de commande créé'); + this.notificationService.success('Succès', 'Devis créé'); } catch { - this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.'); + this.notificationService.error('Erreur', 'Erreur lors de la création du devis.'); } } diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES index 93654d7..9a756b8 100644 --- a/src/app/services/api/.openapi-generator/FILES +++ b/src/app/services/api/.openapi-generator/FILES @@ -4,6 +4,7 @@ README.md api.base.service.ts api.module.ts api/api.ts +api/customers.service.ts api/deliverers.service.ts api/deliverynotes.service.ts api/prices.service.ts @@ -31,6 +32,7 @@ model/create-purchase-product-dto.ts model/create-quotation-dto.ts model/create-supplier-dto.ts model/create-user-dto.ts +model/get-customer-dto.ts model/get-deliverer-dto.ts model/get-delivery-note-dto.ts model/get-price-dto.ts diff --git a/src/app/services/api/api/api.ts b/src/app/services/api/api/api.ts index 4a692c4..a0b0052 100644 --- a/src/app/services/api/api/api.ts +++ b/src/app/services/api/api/api.ts @@ -1,3 +1,6 @@ +export * from './customers.service'; +import {CustomersService} from './customers.service'; + export * from './deliverers.service'; import {DeliverersService} from './deliverers.service'; @@ -31,4 +34,4 @@ import {WarehouseproductsService} from './warehouseproducts.service'; export * from './warehouses.service'; import {WarehousesService} from './warehouses.service'; -export const APIS = [DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService, WarehousesService]; +export const APIS = [CustomersService, DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService, WarehousesService]; diff --git a/src/app/services/api/api/customers.service.ts b/src/app/services/api/api/customers.service.ts new file mode 100644 index 0000000..7ccd3da --- /dev/null +++ b/src/app/services/api/api/customers.service.ts @@ -0,0 +1,104 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import {Inject, Injectable, Optional} from '@angular/core'; +import { + HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext +} from '@angular/common/http'; +import {CustomHttpParameterCodec} from '../encoder'; +import {Observable} from 'rxjs'; + +// @ts-ignore +import {GetCustomerDto} from '../model/get-customer-dto'; + +// @ts-ignore +import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; +import {Configuration} from '../configuration'; +import {BaseService} from '../api.base.service'; + + +@Injectable({ + providedIn: 'root' +}) +export class CustomersService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint get /API/customers + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllCustomersEndpoint(observe?: 'body', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>; + public getAllCustomersEndpoint(observe?: 'response', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllCustomersEndpoint(observe?: 'events', reportProgress?: boolean, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable>>; + public getAllCustomersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: { + httpHeaderAccept?: 'application/json', + context?: HttpContext, + transferCache?: boolean + }): Observable { + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/API/customers`; + const {basePath, withCredentials} = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? {withCredentials} : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/model/create-quotation-dto.ts b/src/app/services/api/model/create-quotation-dto.ts index 00cea1a..c5bd555 100644 --- a/src/app/services/api/model/create-quotation-dto.ts +++ b/src/app/services/api/model/create-quotation-dto.ts @@ -13,6 +13,8 @@ import {CreateProductQuotationDto} from './create-product-quotation-dto'; export interface CreateQuotationDto { message?: string | null; conditionsSale?: string | null; + customerId?: number; + supplierId?: number; products?: Array | null; } diff --git a/src/app/services/api/model/get-customer-dto.ts b/src/app/services/api/model/get-customer-dto.ts new file mode 100644 index 0000000..65fe9c3 --- /dev/null +++ b/src/app/services/api/model/get-customer-dto.ts @@ -0,0 +1,16 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface GetCustomerDto { + id?: number; + note?: string | null; +} + diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts index 074577e..706d060 100644 --- a/src/app/services/api/model/models.ts +++ b/src/app/services/api/model/models.ts @@ -10,6 +10,7 @@ export * from './create-purchase-product-dto'; export * from './create-quotation-dto'; export * from './create-supplier-dto'; export * from './create-user-dto'; +export * from './get-customer-dto'; export * from './get-deliverer-dto'; export * from './get-delivery-note-dto'; export * from './get-price-dto'; From 027c36dc52038b8f2664200f2604cd7742116a87 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 14:39:50 +0100 Subject: [PATCH 108/127] Added modal to choice deliverer before creation of delivery note --- .../deliverer-choice/deliverer-choice.css | 0 .../deliverer-choice/deliverer-choice.html | 15 +++++++ .../deliverer-choice/deliverer-choice.ts | 45 +++++++++++++++++++ .../purchase-order-table.html | 14 ++++-- .../purchase-order-table.ts | 25 ++++++++--- 5 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 src/app/components/deliverer-choice/deliverer-choice.css create mode 100644 src/app/components/deliverer-choice/deliverer-choice.html create mode 100644 src/app/components/deliverer-choice/deliverer-choice.ts diff --git a/src/app/components/deliverer-choice/deliverer-choice.css b/src/app/components/deliverer-choice/deliverer-choice.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/components/deliverer-choice/deliverer-choice.html b/src/app/components/deliverer-choice/deliverer-choice.html new file mode 100644 index 0000000..296243f --- /dev/null +++ b/src/app/components/deliverer-choice/deliverer-choice.html @@ -0,0 +1,15 @@ + + + + Transporteur + + + + + @for (deliverer of deliverers(); track deliverer.id) { + + } + + + + diff --git a/src/app/components/deliverer-choice/deliverer-choice.ts b/src/app/components/deliverer-choice/deliverer-choice.ts new file mode 100644 index 0000000..3b8e009 --- /dev/null +++ b/src/app/components/deliverer-choice/deliverer-choice.ts @@ -0,0 +1,45 @@ +import {Component, inject, OnInit, output, signal} from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {DeliverersService, GetDelivererDto} from "../../services/api"; +import {firstValueFrom} from "rxjs"; +import {NzNotificationService} from "ng-zorro-antd/notification"; + +@Component({ + selector: 'app-deliverer-choice', + imports: [ + FormsModule, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormLabelComponent, + NzOptionComponent, + NzRowDirective, + NzSelectComponent, + ReactiveFormsModule + ], + templateUrl: './deliverer-choice.html', + styleUrl: './deliverer-choice.css', +}) +export class DelivererChoice implements OnInit { + private deliverersService = inject(DeliverersService); + private notificationService = inject(NzNotificationService); + + choiceDelivererForm: FormGroup = new FormGroup({ + delivererId: new FormControl(null, Validators.required), + }); + + deliverers = signal([]); + + async ngOnInit() { + try { + const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()); + this.deliverers.set(deliverers); + } catch { + this.notificationService.error('Erreur', 'Erreur lors de l\'affichage des livreurs'); + } + } +} diff --git a/src/app/components/purchase-order-table/purchase-order-table.html b/src/app/components/purchase-order-table/purchase-order-table.html index 35d3220..393511a 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.html +++ b/src/app/components/purchase-order-table/purchase-order-table.html @@ -66,7 +66,7 @@ -
    @@ -76,7 +76,7 @@ + + \ No newline at end of file diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 2a76c77..2e94905 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -16,6 +16,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; import {QuantityForm} from "../quantity-form/quantity-form"; +import {DelivererChoice} from "../deliverer-choice/deliverer-choice"; @Component({ selector: 'app-purchase-order-table', @@ -27,6 +28,7 @@ import {QuantityForm} from "../quantity-form/quantity-form"; PurchaseOrderForm, ModalButton, QuantityForm, + DelivererChoice, ], templateUrl: './purchase-order-table.html', styleUrl: './purchase-order-table.css', @@ -36,10 +38,13 @@ export class PurchaseOrderTable implements OnInit { private notificationService = inject(NzNotificationService); private fileService = inject(FileService); private deliveryNoteService = inject(DeliverynotesService); + purchaseOrders = signal([]); purchaseOrdersLoading = signal(false); + modal = viewChild.required('modalNav'); modalQuantity = viewChild.required('modalQuantity'); + modalDeliverer = viewChild.required('modalDeliverer'); async ngOnInit() { await this.fetchPurchaseOrder(); @@ -94,9 +99,11 @@ export class PurchaseOrderTable implements OnInit { this.purchaseOrdersLoading.set(false) } - async transfer(purchaseOrder: GetPurchaseOrderDto) { + async transfer(purchaseOrder: GetPurchaseOrderDto, delivererForm: DelivererChoice) { this.purchaseOrdersLoading.set(true); try { + const deliverer = delivererForm.choiceDelivererForm.getRawValue(); + const today = new Date(); const date = today.toISOString().split('T')[0]; // yyyy-mm-dd @@ -124,15 +131,14 @@ export class PurchaseOrderTable implements OnInit { trackingNumber: trackingValue, expeditionDate: date, estimateDeliveryDate: estimateDate, - delivererId: 1, + delivererId: deliverer.delivererId, productQuantities: productQuantities, supplierId: purchaseOrder.supplierId }; await firstValueFrom(this.deliveryNoteService.createDeliveryNoteEndpoint(deliveryNoteDto)); this.notificationService.success('Succès', 'Bon de livraison créé avec succès'); - } catch (e) { - console.error(e); + } catch { this.notificationService.error('Erreur', 'Erreur lors du transfert'); } this.purchaseOrdersLoading.set(false); @@ -189,9 +195,9 @@ export class PurchaseOrderTable implements OnInit { const quantity = updateQuantityComponent.quantityForm.getRawValue(); await firstValueFrom(this.purchaseOrdersService.patchPurchaseProductQuantityEndpoint(productId, purchaseOrderId, quantity)) - this.notificationService.success('Success', 'Quantité modifiée') - } catch (e) { - this.notificationService.error('Erreur', 'Erreur lors de la modification') + this.notificationService.success('Success', 'Quantité modifiée'); + } catch { + this.notificationService.error('Erreur', 'Erreur lors de la modification'); } } @@ -202,6 +208,11 @@ export class PurchaseOrderTable implements OnInit { this.modal().showModal(); } + openDelivererModal(purchaseOrder: GetPurchaseOrderDto) { + this.selectedPurchaseOrder = {...purchaseOrder}; + this.modalDeliverer().showModal(); + } + async onModalOk(id: number, updatePurchaseOrderComponent: PurchaseOrderForm, modal: ModalNav) { if (!this.selectedPurchaseOrder) return; From d8112facb4268700d7d71116f3bddd1613134f34 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 15:49:54 +0100 Subject: [PATCH 109/127] Added filter in creation of purchase order to see only stock of supplier among all checked products --- .../create-purchaseorder-form.html | 4 ++- .../create-purchaseorder-form.ts | 28 ++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html index 4b08f97..304b160 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.html @@ -15,7 +15,9 @@ - @for (supplier of suppliers(); track supplier.id) { diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts index 168325c..8673802 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts @@ -46,10 +46,18 @@ export class CreatePurchaseorderForm { bestSupplier = x; } }) - return bestSupplier; } + getProductsOfSupplier() { + const supplier = this.suppliers().find(x => x.id === this.createPurchaseOrderForm.value.supplierId); + if (!supplier) return []; + + const supplierProductIds = supplier.prices.map(x => x.productId); + + return this.products().filter(product => supplierProductIds.includes(product.id)); + } + createPurchaseOrderForm: FormGroup = new FormGroup({ purchaseConditions: new FormControl(null, Validators.required), lines: new FormArray([], Validators.required), @@ -61,19 +69,25 @@ export class CreatePurchaseorderForm { } addProductToForm() { + const supplierId = this.createPurchaseOrderForm.value.supplierId ?? this.getBestSupplier().id; + this.createPurchaseOrderForm.patchValue({ + supplierId + }); + + this.refresh(); + } + + refresh(){ this.lines.clear(); - this.products().forEach(x => { + + this.getProductsOfSupplier().forEach(x => { this.lines.push( new FormGroup({ productId: new FormControl(x.id), name: new FormControl(x.name), - quantity: new FormControl(1, [Validators.required, Validators.min(0)]) + quantity: new FormControl(1, [Validators.required, Validators.min(1)]) }) ); }); - - this.createPurchaseOrderForm.patchValue({ - supplierId: this.getBestSupplier().id, - }); } } From e66c95a65ea91340294869ae3a57c5784faea0c5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 17:31:10 +0100 Subject: [PATCH 110/127] Added automatic generation in dashboard when employees start application to generate product under limit during absence --- .../create-purchaseorder-form.ts | 2 +- .../deliverer-choice/deliverer-choice.ts | 54 +++++++-------- src/app/pages/welcome/welcome.ts | 19 +++-- src/app/services/stock.alert.ts | 69 +++++++++++++++++++ 4 files changed, 106 insertions(+), 38 deletions(-) create mode 100644 src/app/services/stock.alert.ts diff --git a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts index 8673802..58c1b0a 100644 --- a/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts +++ b/src/app/components/create-purchaseorder-form/create-purchaseorder-form.ts @@ -77,7 +77,7 @@ export class CreatePurchaseorderForm { this.refresh(); } - refresh(){ + refresh() { this.lines.clear(); this.getProductsOfSupplier().forEach(x => { diff --git a/src/app/components/deliverer-choice/deliverer-choice.ts b/src/app/components/deliverer-choice/deliverer-choice.ts index 3b8e009..51112b4 100644 --- a/src/app/components/deliverer-choice/deliverer-choice.ts +++ b/src/app/components/deliverer-choice/deliverer-choice.ts @@ -9,37 +9,37 @@ import {firstValueFrom} from "rxjs"; import {NzNotificationService} from "ng-zorro-antd/notification"; @Component({ - selector: 'app-deliverer-choice', - imports: [ - FormsModule, - NzColDirective, - NzFlexDirective, - NzFormControlComponent, - NzFormLabelComponent, - NzOptionComponent, - NzRowDirective, - NzSelectComponent, - ReactiveFormsModule - ], - templateUrl: './deliverer-choice.html', - styleUrl: './deliverer-choice.css', + selector: 'app-deliverer-choice', + imports: [ + FormsModule, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormLabelComponent, + NzOptionComponent, + NzRowDirective, + NzSelectComponent, + ReactiveFormsModule + ], + templateUrl: './deliverer-choice.html', + styleUrl: './deliverer-choice.css', }) export class DelivererChoice implements OnInit { - private deliverersService = inject(DeliverersService); - private notificationService = inject(NzNotificationService); + private deliverersService = inject(DeliverersService); + private notificationService = inject(NzNotificationService); - choiceDelivererForm: FormGroup = new FormGroup({ - delivererId: new FormControl(null, Validators.required), - }); + choiceDelivererForm: FormGroup = new FormGroup({ + delivererId: new FormControl(null, Validators.required), + }); - deliverers = signal([]); + deliverers = signal([]); - async ngOnInit() { - try { - const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()); - this.deliverers.set(deliverers); - } catch { - this.notificationService.error('Erreur', 'Erreur lors de l\'affichage des livreurs'); + async ngOnInit() { + try { + const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()); + this.deliverers.set(deliverers); + } catch { + this.notificationService.error('Erreur', 'Erreur lors de l\'affichage des livreurs'); + } } - } } diff --git a/src/app/pages/welcome/welcome.ts b/src/app/pages/welcome/welcome.ts index 8faebbb..124d0b9 100644 --- a/src/app/pages/welcome/welcome.ts +++ b/src/app/pages/welcome/welcome.ts @@ -2,8 +2,9 @@ import {Component, inject, signal} from '@angular/core'; import {InfoCard} from "../../components/info-card/info-card"; import {DeliveryValidator} from "../../components/delivery-validator/delivery-validator"; import {NzNotificationService} from "ng-zorro-antd/notification"; -import {DeliverersService, ProductsService, SuppliersService} from "../../services/api"; +import {DeliverersService, GetSupplierDto, ProductsService, SuppliersService} from "../../services/api"; import {firstValueFrom} from "rxjs"; +import {StockAlert} from "../../services/stock.alert"; @Component({ selector: 'app-welcome', @@ -20,32 +21,29 @@ export class Welcome { private deliverersService = inject(DeliverersService); private suppliersService = inject(SuppliersService); private notificationsService = inject(NzNotificationService); + private stockAlertService = inject(StockAlert); deliversCount = signal(0); suppliersCount = signal(0); productsUnderLimitCount = signal(0); + suppliers = signal([]); async getDeliverers() { try { const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()); this.deliversCount.set(deliverers.length); } catch (e) { - this.notificationsService.error( - 'Error', - 'Error while getting deliverers.', - ) + this.notificationsService.error('Error', 'Error while getting deliverers.'); } } async getSuppliers() { try { const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint()); + this.suppliers.set(suppliers); this.suppliersCount.set(suppliers.length); - } catch (e) { - this.notificationsService.error( - 'Error', - 'Error while getting suppliers.', - ) + } catch { + this.notificationsService.error('Error', 'Error while getting suppliers.'); } } @@ -53,6 +51,7 @@ export class Welcome { try { const products = await firstValueFrom(this.productsService.getAllProductsUnderLimitEndpoint()); this.productsUnderLimitCount.set(products.length); + await this.stockAlertService.generatePurchaseOrder(products, this.suppliers()); } catch (e) { this.notificationsService.error( 'Error', diff --git a/src/app/services/stock.alert.ts b/src/app/services/stock.alert.ts new file mode 100644 index 0000000..9d9ed74 --- /dev/null +++ b/src/app/services/stock.alert.ts @@ -0,0 +1,69 @@ +import {inject, Injectable} from '@angular/core'; +import {GetProductDto, GetSupplierDto, PurchaseordersService, WarehouseproductsService} from "./api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; + +@Injectable({ + providedIn: 'root', +}) +export class StockAlert { + private purchaseOrdersService = inject(PurchaseordersService); + private notificationsService = inject(NzNotificationService); + private wareHousseProductsService = inject(WarehouseproductsService); + + getBestSupplier(suppliers: GetSupplierDto[], products: GetProductDto[]) { + let bestSupplier: GetSupplierDto = suppliers[0]; + let maxProducts = 0; + + const selectedProducts = products.map(x => x.id); + + suppliers.forEach(x => { + const supplierProductsCount = x.prices.filter(p => selectedProducts.includes(p.productId)).length ?? 0; + + if (supplierProductsCount > maxProducts) { + maxProducts = supplierProductsCount; + bestSupplier = x; + } + }) + return bestSupplier; + } + + async generatePurchaseOrder(products: GetProductDto[], suppliers: GetSupplierDto[]) { + if (products.length) { + const supplier = this.getBestSupplier(suppliers, products); + + const productsWithQuantity = await Promise.all( + products.map(async (x) => { + try { + const quantity = await firstValueFrom(this.wareHousseProductsService.getTotalQuantityEndpoint(x.id)); + return { + ...x, + totalQuantity: quantity.totalQuantity ?? 0 + }; + } catch { + return { + ...x, + totalQuantity: 0 + }; + } + }) + ); + + try { + await firstValueFrom(this.purchaseOrdersService.createPurchaseOrder({ + purchaseConditions: "Non précisée - Commande automatique pour réapprovisionnement", + supplierId: supplier.id, + products: productsWithQuantity.map(x => { + const quantityAdded = (x.minimalQuantity - x.totalQuantity) + 10; + return { + productId: x.id, + quantity: quantityAdded + }; + }) + })); + } catch { + this.notificationsService.error('Erreur', 'Erreur lors de la génération du bon de commande.'); + } + } + } +} From c20a0c5daf026f2cf82dcaa7d8059155883aaea7 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 17:59:41 +0100 Subject: [PATCH 111/127] Added automatic generation in dashboard when employees start application to generate product under limit during absence --- .../purchase-order-table.ts | 7 +--- .../api/model/create-delivery-note-dto.ts | 2 -- src/app/services/stock.alert.ts | 34 +++++++++++++++++-- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 2e94905..2d87837 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -109,10 +109,6 @@ export class PurchaseOrderTable implements OnInit { const futureDate = new Date(today); futureDate.setMonth(today.getMonth() + 2); - const yyyy = futureDate.getFullYear(); - const mm = (futureDate.getMonth() + 1).toString().padStart(2, '0'); - const dd = futureDate.getDate().toString().padStart(2, '0'); - const estimateDate = `${yyyy}-${mm}-${dd}`; let trackingValue = 'TRK-'; const idStr = purchaseOrder.id?.toString() ?? ''; @@ -129,8 +125,6 @@ export class PurchaseOrderTable implements OnInit { const deliveryNoteDto: CreateDeliveryNoteDto = { trackingNumber: trackingValue, - expeditionDate: date, - estimateDeliveryDate: estimateDate, delivererId: deliverer.delivererId, productQuantities: productQuantities, supplierId: purchaseOrder.supplierId @@ -141,6 +135,7 @@ export class PurchaseOrderTable implements OnInit { } catch { this.notificationService.error('Erreur', 'Erreur lors du transfert'); } + this.onModalCancel(this.modalDeliverer()); this.purchaseOrdersLoading.set(false); } diff --git a/src/app/services/api/model/create-delivery-note-dto.ts b/src/app/services/api/model/create-delivery-note-dto.ts index 49498e7..52d718e 100644 --- a/src/app/services/api/model/create-delivery-note-dto.ts +++ b/src/app/services/api/model/create-delivery-note-dto.ts @@ -11,8 +11,6 @@ export interface CreateDeliveryNoteDto { trackingNumber?: string | null; - estimateDeliveryDate?: string; - expeditionDate?: string; delivererId?: number; supplierId?: number; productQuantities?: { [key: string]: number; } | null; diff --git a/src/app/services/stock.alert.ts b/src/app/services/stock.alert.ts index 9d9ed74..de81c50 100644 --- a/src/app/services/stock.alert.ts +++ b/src/app/services/stock.alert.ts @@ -1,5 +1,12 @@ import {inject, Injectable} from '@angular/core'; -import {GetProductDto, GetSupplierDto, PurchaseordersService, WarehouseproductsService} from "./api"; +import { + CreateDeliveryNoteDto, + DeliverynotesService, + GetProductDto, GetPurchaseOrderDto, + GetSupplierDto, + PurchaseordersService, + WarehouseproductsService +} from "./api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; @@ -8,6 +15,7 @@ import {firstValueFrom} from "rxjs"; }) export class StockAlert { private purchaseOrdersService = inject(PurchaseordersService); + private deliveryNotesService = inject(DeliverynotesService); private notificationsService = inject(NzNotificationService); private wareHousseProductsService = inject(WarehouseproductsService); @@ -50,7 +58,7 @@ export class StockAlert { ); try { - await firstValueFrom(this.purchaseOrdersService.createPurchaseOrder({ + const purchaseOrder: GetPurchaseOrderDto = await firstValueFrom(this.purchaseOrdersService.createPurchaseOrder({ purchaseConditions: "Non précisée - Commande automatique pour réapprovisionnement", supplierId: supplier.id, products: productsWithQuantity.map(x => { @@ -61,6 +69,28 @@ export class StockAlert { }; }) })); + + const date = new Date().toISOString().split('T')[0]; + + let trackingValue = 'TRK-AUTO-'; + const idStr = purchaseOrder.id?.toString() ?? ''; + if (idStr.length < 2) trackingValue += '00' + idStr + '-' + date; + else if (idStr.length < 3) trackingValue += '0' + idStr + '-' + date; + else trackingValue += idStr.substring(0, 3) + date.replace(/-/g, ''); + + const productQuantities: Record = {}; + purchaseOrder.products?.forEach(p => { + if (p.productId != null && p.quantity != null) { + productQuantities[p.productId] = p.quantity; + } + }); + + await firstValueFrom(this.deliveryNotesService.createDeliveryNoteEndpoint({ + trackingNumber: trackingValue, + supplierId: supplier.id, + delivererId: 1, + productQuantities: productQuantities + })); } catch { this.notificationsService.error('Erreur', 'Erreur lors de la génération du bon de commande.'); } From 7041c5335b5a9e5bb148332499a70f8e43b2761f Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 18:00:55 +0100 Subject: [PATCH 112/127] Cleaned code --- .../components/purchase-order-table/purchase-order-table.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/app/components/purchase-order-table/purchase-order-table.ts b/src/app/components/purchase-order-table/purchase-order-table.ts index 2d87837..4e58aea 100644 --- a/src/app/components/purchase-order-table/purchase-order-table.ts +++ b/src/app/components/purchase-order-table/purchase-order-table.ts @@ -104,11 +104,7 @@ export class PurchaseOrderTable implements OnInit { try { const deliverer = delivererForm.choiceDelivererForm.getRawValue(); - const today = new Date(); - const date = today.toISOString().split('T')[0]; // yyyy-mm-dd - - const futureDate = new Date(today); - futureDate.setMonth(today.getMonth() + 2); + const date = new Date().toISOString().split('T')[0]; // yyyy-mm-dd let trackingValue = 'TRK-'; const idStr = purchaseOrder.id?.toString() ?? ''; From d37ff4ace40e1034579cf87a198a9bfedd4d44e4 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Thu, 28 May 2026 10:52:46 +0100 Subject: [PATCH 113/127] Refactor code --- src/app/app.html | 2 +- src/app/app.routes.ts | 6 +- .../deliverer-choice/deliverer-choice.ts | 2 +- .../deliverer-table/deliverer-table.ts | 27 +++------ .../deliverery-note-form.html | 2 +- .../deliverery-note-form.ts | 2 +- .../deliverery-note-table.ts | 59 ++++++------------- .../delivery-validator/delivery-validator.ts | 27 ++------- .../components/modal-button/modal-button.ts | 2 +- src/app/components/modal-nav/modal-nav.ts | 2 +- src/app/components/price-form/price-form.ts | 2 +- .../components/product-form/product-form.html | 21 ------- .../components/product-form/product-form.ts | 29 --------- .../purchase-order-table.ts | 54 +++++------------ .../components/quantity-form/quantity-form.ts | 2 +- .../quotation-table/quotation-table.ts | 55 ++++++----------- .../components/setting-form/setting-form.ts | 7 +-- src/app/components/stock-form/stock-form.html | 2 +- src/app/components/stock-table/stock-table.ts | 6 +- .../supplier-table/supplier-table.html | 6 +- .../supplier-table/supplier-table.ts | 39 ++++-------- src/app/components/user-table/user-table.ts | 45 ++++---------- .../dashboard/dashboard.css} | 0 .../welcome.html => dashboard/dashboard.html} | 0 .../welcome.ts => dashboard/dashboard.ts} | 21 +++---- src/app/pages/deliverer/deliverer.ts | 19 ++---- src/app/pages/stock/stock.ts | 2 +- src/app/pages/supplier/supplier.ts | 19 ++---- src/app/pages/user/user.ts | 19 ++---- src/app/pages/welcome/welcome.css | 0 src/app/pages/welcome/welcome.routes.ts | 6 -- 31 files changed, 132 insertions(+), 353 deletions(-) delete mode 100644 src/app/components/product-form/product-form.html delete mode 100644 src/app/components/product-form/product-form.ts rename src/app/{components/product-form/product-form.css => pages/dashboard/dashboard.css} (100%) rename src/app/pages/{welcome/welcome.html => dashboard/dashboard.html} (100%) rename src/app/pages/{welcome/welcome.ts => dashboard/dashboard.ts} (80%) delete mode 100644 src/app/pages/welcome/welcome.css delete mode 100644 src/app/pages/welcome/welcome.routes.ts diff --git a/src/app/app.html b/src/app/app.html index 9087561..43a974e 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -3,7 +3,7 @@
    diff --git a/src/app/components/quotation-table/quotation-table.ts b/src/app/components/quotation-table/quotation-table.ts index c745387..4a3e000 100644 --- a/src/app/components/quotation-table/quotation-table.ts +++ b/src/app/components/quotation-table/quotation-table.ts @@ -14,6 +14,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {FileService} from "../../services/file.service"; import {QuantityForm} from "../quantity-form/quantity-form"; +import {AuthService} from "../../services/auth.service"; @Component({ selector: 'app-quotation-table', @@ -34,15 +35,18 @@ export class QuotationTable implements OnInit { private quotationsService = inject(QuotationsService); private notificationService = inject(NzNotificationService); private fileService = inject(FileService); + private authService = inject(AuthService); quotations = signal([]); quotationsLoading = signal(false); + admin = signal(false); modal = viewChild.required('modalNav'); modalQuantity = viewChild.required('modalQuantity'); async ngOnInit() { await this.fetchQuotations(); + this.admin.set(this.authService.isAdmin()); } async fetchQuotations() { diff --git a/src/app/components/setting-form/setting-form.html b/src/app/components/setting-form/setting-form.html index 6cb89bd..49fe210 100644 --- a/src/app/components/setting-form/setting-form.html +++ b/src/app/components/setting-form/setting-form.html @@ -10,15 +10,23 @@ }
    -
    - - Logo - - - - -
    + @if (admin()){ +
    + + Logo + + + + +
    + } @else { +
    + +

    Vous ne pouvez pas modifier le logo

    +
    +
    + }
    @@ -31,14 +39,22 @@ }
    -
    - - Signature - - - - -
    + @if (admin()) { +
    + + Signature + + + + +
    + } @else { +
    + +

    Vous ne pouvez pas modifier la signature

    +
    +
    + }
    diff --git a/src/app/components/setting-form/setting-form.ts b/src/app/components/setting-form/setting-form.ts index 8c7af92..cf93c09 100644 --- a/src/app/components/setting-form/setting-form.ts +++ b/src/app/components/setting-form/setting-form.ts @@ -8,6 +8,7 @@ import {firstValueFrom} from "rxjs"; import {GetSettingDto, SettingsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; import imageCompression from "browser-image-compression"; +import {AuthService} from "../../services/auth.service"; @Component({ selector: 'app-setting-form', @@ -27,8 +28,10 @@ import imageCompression from "browser-image-compression"; export class SettingForm implements OnInit { private settingsService = inject(SettingsService); private notificationService = inject(NzNotificationService); + private authService = inject(AuthService); settings = signal({}); + admin = signal(false); setting: SettingInfo = { logo: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png', @@ -42,6 +45,7 @@ export class SettingForm implements OnInit { async ngOnInit() { await this.fetchSettings(); + this.admin.set(this.authService.isAdmin()); } async fetchSettings() { diff --git a/src/app/components/stock-table/stock-table.html b/src/app/components/stock-table/stock-table.html index 55148da..ca04789 100644 --- a/src/app/components/stock-table/stock-table.html +++ b/src/app/components/stock-table/stock-table.html @@ -46,9 +46,11 @@
    - - + @if (admin()) { + + + }
    diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index 7ff4c81..4da3aa3 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -9,6 +9,7 @@ import {GetProductDto, ProductsService, WarehouseproductsService} from "../../se import {NzNotificationService} from "ng-zorro-antd/notification"; import {first, firstValueFrom} from "rxjs"; import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; +import {AuthService} from "../../services/auth.service"; interface ProductWithQuantity extends GetProductDto { totalQuantity?: number; @@ -34,9 +35,11 @@ export class StockTable implements OnInit { private productsService = inject(ProductsService); private wareHousseProductsService = inject(WarehouseproductsService) private notificationService = inject(NzNotificationService) + private authService = inject(AuthService); products = signal([]); productsLoading = signal(false); + admin = signal(false); modal = viewChild.required('modalNav'); @@ -50,6 +53,7 @@ export class StockTable implements OnInit { async ngOnInit() { await this.fetchProducts(); + this.admin.set(this.authService.isAdmin()); } async fetchProducts() { diff --git a/src/app/components/supplier-table/supplier-table.html b/src/app/components/supplier-table/supplier-table.html index a1987e3..576e468 100644 --- a/src/app/components/supplier-table/supplier-table.html +++ b/src/app/components/supplier-table/supplier-table.html @@ -46,10 +46,12 @@ - - + @if (admin()) { + + + }
    @@ -62,9 +64,11 @@
    - - + @if (admin()) { + + + }
    diff --git a/src/app/components/supplier-table/supplier-table.ts b/src/app/components/supplier-table/supplier-table.ts index 0cb4e3c..3d0d181 100644 --- a/src/app/components/supplier-table/supplier-table.ts +++ b/src/app/components/supplier-table/supplier-table.ts @@ -9,6 +9,7 @@ import {GetPriceDto, GetSupplierDto, PricesService, SuppliersService} from "../. import {NzNotificationService} from "ng-zorro-antd/notification"; import {firstValueFrom} from "rxjs"; import {PriceForm} from "../price-form/price-form"; +import {AuthService} from "../../services/auth.service"; @Component({ selector: 'app-supplier-table', @@ -29,9 +30,11 @@ export class SupplierTable implements OnInit { private suppliersService = inject(SuppliersService); private pricesService = inject(PricesService); private notificationService = inject(NzNotificationService); + private authService = inject(AuthService); suppliers = signal([]); suppliersLoading = signal(false); + admin = signal(false); supplierModal = viewChild.required('supplierModal'); productModal = viewChild.required('productModal'); @@ -42,6 +45,7 @@ export class SupplierTable implements OnInit { async ngOnInit() { await this.fetchSuppliers(); + this.admin.set(this.authService.isAdmin()); } async fetchSuppliers() { diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts index e909f1d..ab6317f 100644 --- a/src/app/guards/auth.guard.ts +++ b/src/app/guards/auth.guard.ts @@ -2,9 +2,13 @@ import { inject } from '@angular/core'; import { Router } from '@angular/router'; import { AuthService} from "../services/auth.service"; -export const authGuard = () => { +export const authGuard = async () => { const auth = inject(AuthService); const router = inject(Router); - return auth.isLoggedIn() ? true : router.parseUrl('/login'); + if(!auth.userAuthenticated()) { + await router.navigateByUrl('/login'); + return false; + } + return true }; \ No newline at end of file diff --git a/src/app/guards/role.guard.ts b/src/app/guards/role.guard.ts deleted file mode 100644 index 27d5488..0000000 --- a/src/app/guards/role.guard.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { inject } from '@angular/core'; -import { ActivatedRouteSnapshot, Router } from '@angular/router'; -import { AuthService} from "../services/auth.service"; - -export const roleGuard = (route: ActivatedRouteSnapshot) => { - const auth = inject(AuthService); - const router = inject(Router); - - const requiredRoles: string[] = route.data['roles']; - - return auth.hasRole(requiredRoles) ? true : router.parseUrl('/dashboard'); -}; \ No newline at end of file diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index bffd322..fec7fab 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -2,6 +2,7 @@ import {inject, Injectable} from '@angular/core'; import {firstValueFrom} from 'rxjs'; import {NzNotificationService} from 'ng-zorro-antd/notification'; import {UsersService} from "./api"; +import { jwtDecode } from "jwt-decode" ; @Injectable({ providedIn: 'root', @@ -10,12 +11,15 @@ export class AuthService { private usersService = inject(UsersService); private notificationService = inject(NzNotificationService); + private isAuthenticated: boolean = false; + async connectUser(name: string, password: string) { try { const loginDto = {name, password}; const res = await firstValueFrom(this.usersService.connectUserEndpoint(loginDto)); localStorage.setItem('jwt', res.token); - return true; + this.isAuthenticated = true; + return this.isAuthenticated; } catch { this.notificationService.error('Erreur', 'Identifiant invalide'); return false; @@ -31,39 +35,20 @@ export class AuthService { } logout() { + this.isAuthenticated = false; localStorage.removeItem('jwt'); } - decodeToken(): { sub?: string; role?: string; exp?: number } | null { - const token = this.getToken(); - if (!token) return null; - - try { - const payload = token.split('.')[1]; - return JSON.parse(atob(payload)); - } catch { - return null; - } + userAuthenticated() { + return this.isAuthenticated } - isLoggedIn(): boolean { - const token = this.getToken(); - if (!token) return false; - - const decoded = this.decodeToken(); - if (!decoded?.exp) return true; - - return decoded.exp * 1000 > Date.now(); + getRole() { + const jwtDecoded = jwtDecode(this.getToken()); + return jwtDecoded['role']; } - getRole(): string | null { - return this.decodeToken()?.role ?? null; + isAdmin(){ + return this.getRole() === 'Admin'; } - - hasRole(requiredRoles: string[]): boolean { - const role = this.getRole(); - if (!role) return false; - return requiredRoles.includes(role); - } - } From e29de8e167d231a5f31271bcf805175ea1b18ca8 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 1 Jun 2026 10:42:55 +0100 Subject: [PATCH 126/127] deleted unused import --- src/app/components/stock-table/stock-table.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/stock-table/stock-table.ts b/src/app/components/stock-table/stock-table.ts index 4da3aa3..ca7ab83 100644 --- a/src/app/components/stock-table/stock-table.ts +++ b/src/app/components/stock-table/stock-table.ts @@ -7,7 +7,7 @@ import {NzDividerComponent} from "ng-zorro-antd/divider"; import {FormsModule} from "@angular/forms"; import {GetProductDto, ProductsService, WarehouseproductsService} from "../../services/api"; import {NzNotificationService} from "ng-zorro-antd/notification"; -import {first, firstValueFrom} from "rxjs"; +import {firstValueFrom} from "rxjs"; import {NzCheckboxComponent} from "ng-zorro-antd/checkbox"; import {AuthService} from "../../services/auth.service"; From 09763ea7300b8fba21e22d582a10129d44aeceb9 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Mon, 1 Jun 2026 11:07:43 +0100 Subject: [PATCH 127/127] Added password rules --- src/app/pages/user/user.html | 10 ++++++++++ src/app/pages/user/user.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/pages/user/user.html b/src/app/pages/user/user.html index c02b772..5351683 100644 --- a/src/app/pages/user/user.html +++ b/src/app/pages/user/user.html @@ -7,6 +7,16 @@ size="35%"> +
    +

    Consignes du mot de passe :

    +
      +
    • 12 caractères
    • +
    • Au moins une majuscule
    • +
    • Au moins une minuscule
    • +
    • Au moins un chiffre
    • +
    • Au moins un caractère spécial
    • +
    +
    diff --git a/src/app/pages/user/user.ts b/src/app/pages/user/user.ts index b7e1776..6f5d9bd 100644 --- a/src/app/pages/user/user.ts +++ b/src/app/pages/user/user.ts @@ -45,7 +45,7 @@ export class User { this.notificationService.success('Success', 'Utilisateur crée') } catch { - this.notificationService.error('Erreur', 'Erreur d\'enregistrement') + this.notificationService.error('Erreur', 'Email ou mot de passe invalide') } } }