Compare commits

...

32 Commits

Author SHA1 Message Date
sanchezvem 47b8765906 Changed method to see settings pictures 2026-06-05 11:55:31 +01:00
sanchezvem 09763ea730 Added password rules 2026-06-01 11:07:43 +01:00
sanchezvem e29de8e167 deleted unused import 2026-06-01 10:42:55 +01:00
sanchezvem 80b4726004 Added conditions to check role after connexion and changed guards 2026-06-01 10:41:50 +01:00
Cristiano cf53e4c8ef Merge remote-tracking branch 'origin/develop' into develop 2026-05-30 15:00:14 +02:00
sanchezvem 670dd561cc Fixed form error with status in delivery note table 2026-05-30 13:57:11 +01:00
Cristiano 9b898432c0 Mask user for employee on navbar 2026-05-29 14:17:45 +02:00
Cristiano d0e98482b9 Added guards for auth and role 2026-05-29 14:07:42 +02:00
sanchezvem 04b08e76c4 Fixed form error in update profil page 2026-05-28 16:38:26 +01:00
Cristiano d8d36d5c1e OpenAPI with updated backend 2026-05-28 16:23:30 +02:00
sanchezvem fdb728cd25 Fixed interceptor error 2026-05-28 16:17:19 +01:00
sanchezvem 7f56bb4cf8 Fixed error with redirect of login page 2026-05-28 15:54:05 +01:00
sanchezvem 24f82742f7 Fixed error with redirect of login page 2026-05-28 15:09:20 +01:00
sanchezvem caff8aa312 Added disconnect button 2026-05-28 14:35:57 +01:00
sanchezvem 82aef7da0a Added login page 2026-05-28 14:27:46 +01:00
sanchezvem 4de58d6f6e Declare type for line in map of orderlines 2026-05-28 10:53:48 +01:00
sanchezvem d37ff4ace4 Refactor code 2026-05-28 10:52:46 +01:00
sanchezvem 7041c5335b Cleaned code 2026-05-27 18:00:55 +01:00
sanchezvem c20a0c5daf Added automatic generation in dashboard when employees start application to generate product under limit during absence 2026-05-27 17:59:41 +01:00
sanchezvem e66c95a65e Added automatic generation in dashboard when employees start application to generate product under limit during absence 2026-05-27 17:31:10 +01:00
sanchezvem d8112facb4 Added filter in creation of purchase order to see only stock of supplier among all checked products 2026-05-27 15:49:54 +01:00
sanchezvem 027c36dc52 Added modal to choice deliverer before creation of delivery note 2026-05-27 14:39:50 +01:00
sanchezvem 0aec0be1d4 Fixed error to function to create quotation 2026-05-27 13:05:54 +01:00
sanchezvem a7ef707388 Fixed error to function to create purchase order 2026-05-27 12:20:25 +01:00
sanchezvem 56d3d1bea7 Added supplier in purchase order form 2026-05-26 19:17:40 +01:00
sanchezvem 14d3d25217 Fixed error with code to check product 2026-05-26 18:57:41 +01:00
sanchezvem 961551e926 Added checkbox in stock page 2026-05-26 18:35:44 +01:00
sanchezvem 4dd1d7e81d Fixed error with estimateDeliveryDate in form to update the raw 2026-05-26 14:57:36 +01:00
sanchezvem f233c46853 Deleted search bar 2026-05-26 14:09:09 +01:00
sanchezvem 6e9daf3e60 Reorganized dashboard 2026-05-26 12:27:06 +01:00
sanchezvem 2d8104aeae Added function to manage deliveries 2026-05-26 12:07:08 +01:00
sanchezvem c10a0a7c2f Added function to manage deliveries 2026-05-26 11:52:31 +01:00
159 changed files with 3442 additions and 3611 deletions
+112 -5
View File
@@ -18,8 +18,10 @@
"@tailwindcss/postcss": "^4.1.17", "@tailwindcss/postcss": "^4.1.17",
"@tailwindcss/vite": "^4.1.17", "@tailwindcss/vite": "^4.1.17",
"browser-image-compression": "^2.0.2", "browser-image-compression": "^2.0.2",
"jwt-decode": "^4.0.0",
"ng-zorro-antd": "^20.4.0", "ng-zorro-antd": "^20.4.0",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"rimraf": "^6.1.3",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tailwindcss": "^4.1.17", "tailwindcss": "^4.1.17",
"tslib": "^2.3.0", "tslib": "^2.3.0",
@@ -6911,6 +6913,15 @@
], ],
"license": "MIT" "license": "MIT"
}, },
"node_modules/jwt-decode": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz",
"integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/less": { "node_modules/less": {
"version": "4.4.2", "version": "4.4.2",
"resolved": "https://registry.npmjs.org/less/-/less-4.4.2.tgz", "resolved": "https://registry.npmjs.org/less/-/less-4.4.2.tgz",
@@ -7594,10 +7605,10 @@
} }
}, },
"node_modules/minipass": { "node_modules/minipass": {
"version": "7.1.2", "version": "7.1.3",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
"license": "ISC", "license": "BlueOak-1.0.0",
"engines": { "engines": {
"node": ">=16 || 14 >=14.17" "node": ">=16 || 14 >=14.17"
} }
@@ -8403,7 +8414,6 @@
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
"dev": true,
"license": "BlueOak-1.0.0" "license": "BlueOak-1.0.0"
}, },
"node_modules/pacote": { "node_modules/pacote": {
@@ -8938,6 +8948,103 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/rimraf": {
"version": "6.1.3",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz",
"integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==",
"license": "BlueOak-1.0.0",
"dependencies": {
"glob": "^13.0.3",
"package-json-from-dist": "^1.0.1"
},
"bin": {
"rimraf": "dist/esm/bin.mjs"
},
"engines": {
"node": "20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf/node_modules/balanced-match": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
"integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
"license": "MIT",
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/rimraf/node_modules/brace-expansion": {
"version": "5.0.6",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",
"integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
}
},
"node_modules/rimraf/node_modules/glob": {
"version": "13.0.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz",
"integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==",
"license": "BlueOak-1.0.0",
"dependencies": {
"minimatch": "^10.2.2",
"minipass": "^7.1.3",
"path-scurry": "^2.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf/node_modules/lru-cache": {
"version": "11.5.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz",
"integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==",
"license": "BlueOak-1.0.0",
"engines": {
"node": "20 || >=22"
}
},
"node_modules/rimraf/node_modules/minimatch": {
"version": "10.2.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
"integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.5"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rimraf/node_modules/path-scurry": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz",
"integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==",
"license": "BlueOak-1.0.0",
"dependencies": {
"lru-cache": "^11.0.0",
"minipass": "^7.1.2"
},
"engines": {
"node": "18 || 20 || >=22"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/rollup": { "node_modules/rollup": {
"version": "4.52.3", "version": "4.52.3",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.3.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.3.tgz",
+2
View File
@@ -32,8 +32,10 @@
"@tailwindcss/postcss": "^4.1.17", "@tailwindcss/postcss": "^4.1.17",
"@tailwindcss/vite": "^4.1.17", "@tailwindcss/vite": "^4.1.17",
"browser-image-compression": "^2.0.2", "browser-image-compression": "^2.0.2",
"jwt-decode": "^4.0.0",
"ng-zorro-antd": "^20.4.0", "ng-zorro-antd": "^20.4.0",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"rimraf": "^6.1.3",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tailwindcss": "^4.1.17", "tailwindcss": "^4.1.17",
"tslib": "^2.3.0", "tslib": "^2.3.0",
+4 -2
View File
@@ -6,7 +6,8 @@ import {fr_FR, provideNzI18n} from 'ng-zorro-antd/i18n';
import {registerLocaleData} from '@angular/common'; import {registerLocaleData} from '@angular/common';
import fr from '@angular/common/locales/fr'; import fr from '@angular/common/locales/fr';
import {provideAnimationsAsync} from '@angular/platform-browser/animations/async'; import {provideAnimationsAsync} from '@angular/platform-browser/animations/async';
import {provideHttpClient} from '@angular/common/http'; import {provideHttpClient, withInterceptors} from '@angular/common/http';
import {authInterceptor} from "./interceptors/auth-interceptor";
registerLocaleData(fr); registerLocaleData(fr);
@@ -14,6 +15,7 @@ export const appConfig: ApplicationConfig = {
providers: [ providers: [
provideBrowserGlobalErrorListeners(), provideBrowserGlobalErrorListeners(),
provideZoneChangeDetection({eventCoalescing: true}), provideZoneChangeDetection({eventCoalescing: true}),
provideRouter(routes), provideNzI18n(fr_FR), provideAnimationsAsync(), provideHttpClient() provideRouter(routes), provideNzI18n(fr_FR), provideAnimationsAsync(), provideHttpClient(),
provideHttpClient(withInterceptors([authInterceptor]))
] ]
}; };
-113
View File
@@ -1,113 +0,0 @@
:host {
display: flex;
}
.app-layout {
height: 100vh;
}
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;
}
.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;
gap: 20px;
color: #fff;
font-size: 18px;
cursor: pointer;
}
.right-icons app-modal-nav {
transition: transform 0.2s ease, color 0.2s ease;
}
.right-icons app-modal-nav:hover {
color: #40a9ff;
transform: scale(1.2);
}
/* --- CONTENU --- */
nz-content {
padding: 24px 50px;
}
.inner-content {
padding: 24px;
background: #fff;
height: 100%;
}
+1 -87
View File
@@ -1,87 +1 @@
<nz-layout class="app-layout"> <router-outlet></router-outlet>
<nz-header>
<div class="header-container">
<!-- LOGO -->
<div class="logo">
<a routerLink="/welcome">
<img
src="https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png"
alt="logo"
style="width: 100px; height: auto"
/>
<h1 class="text-amber-300">PYRO FÊTES</h1>
</a>
</div>
<!-- MENU PRINCIPAL -->
<ul nz-menu class="top-nav" nzTheme="dark" nzMode="horizontal">
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/stock">
<nz-icon nzType="stock"></nz-icon>
<span>Stock</span>
</a>
</li>
<li nz-submenu nzTitle="Partenaires" nzIcon="team">
<ul>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/supplier">
<nz-icon nzType="shop"></nz-icon>
<span>Fournisseurs</span>
</a>
</li>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/deliverer">
<nz-icon nzType="car"></nz-icon>
<span>Livreurs</span>
</a>
</li>
</ul>
</li>
<li nz-submenu nzTitle="Recettes" nzIcon="euro-circle">
<ul>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/quotation">
<nz-icon nzType="file"></nz-icon>
<span>Devis</span>
</a>
</li>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/purchase-order">
<nz-icon nzType="file"></nz-icon>
<span>Bon de commande</span>
</a>
</li>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/delivery-note">
<nz-icon nzType="file"></nz-icon>
<span>Bon de livraison</span>
</a>
</li>
</ul>
</li>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/user">
<nz-icon nzType="user"></nz-icon>
<span>Utilisateur</span>
</a>
</li>
</ul>
<!-- ICONES À DROITE -->
<div class="right-icons">
<app-modal-nav nameIcon="user" name="Profil">
<app-profil></app-profil>
</app-modal-nav>
<app-modal-nav nameIcon="setting" name="Paramètres">
<app-setting-form></app-setting-form>
</app-modal-nav>
</div>
</div>
</nz-header>
<nz-content>
<div class="inner-content overflow-auto">
<router-outlet></router-outlet>
</div>
</nz-content>
</nz-layout>
+39 -10
View File
@@ -1,41 +1,70 @@
import {Routes} from '@angular/router'; import {Routes} from '@angular/router';
import {authGuard} from "./guards/auth.guard";
export const routes: Routes = [ export const routes: Routes = [
{ {
path: '', path: '',
pathMatch: 'full', pathMatch: 'full',
redirectTo: '/welcome' redirectTo: '/login'
}, },
{ {
path: 'welcome', path: 'login',
loadComponent: () => import('./pages/welcome/welcome').then(x => x.Welcome) loadComponent: () => import('./pages/login/login').then(x => x.Login)
},
{
path: '',
loadComponent: () =>
import('./components/layout/layout').then(m => m.Layout),
children: [
{
path: '',
pathMatch: 'full',
redirectTo: '/dashboard'
},
{
path: 'dashboard',
loadComponent: () => import('./pages/dashboard/dashboard').then(m => m.Dashboard),
canActivate: [authGuard]
}, },
{ {
path: 'stock', path: 'stock',
loadComponent: () => import('./pages/stock/stock').then(x => x.Stock) loadComponent: () => import('./pages/stock/stock').then(m => m.Stock),
canActivate: [authGuard]
}, },
{ {
path: 'supplier', path: 'supplier',
loadComponent: () => import('./pages/supplier/supplier').then(x => x.Supplier) loadComponent: () => import('./pages/supplier/supplier').then(m => m.Supplier),
canActivate: [authGuard]
}, },
{ {
path: 'deliverer', path: 'deliverer',
loadComponent: () => import('./pages/deliverer/deliverer').then(x => x.Deliverer) loadComponent: () => import('./pages/deliverer/deliverer').then(m => m.Deliverer),
canActivate: [authGuard]
}, },
{ {
path: 'quotation', path: 'quotation',
loadComponent: () => import('./pages/quotation/quotation').then(x => x.Quotation) loadComponent: () => import('./pages/quotation/quotation').then(m => m.Quotation),
canActivate: [authGuard]
}, },
{ {
path: 'purchase-order', path: 'purchase-order',
loadComponent: () => import('./pages/purchase-order/purchase-order').then(x => x.PurchaseOrder) loadComponent: () => import('./pages/purchase-order/purchase-order').then(m => m.PurchaseOrder),
canActivate: [authGuard]
}, },
{ {
path: 'delivery-note', path: 'delivery-note',
loadComponent: () => import('./pages/delivery-note/delivery-note').then(x => x.DeliveryNote) loadComponent: () => import('./pages/delivery-note/delivery-note').then(m => m.DeliveryNote),
canActivate: [authGuard]
}, },
{ {
path: 'user', path: 'user',
loadComponent: () => import('./pages/user/user').then(x => x.User) loadComponent: () => import('./pages/user/user').then(m => m.User),
canActivate: [authGuard],
},
{
path: '**',
redirectTo: 'dashboard'
}
]
} }
]; ];
+2 -6
View File
@@ -1,15 +1,11 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {RouterLink, RouterLinkActive, RouterOutlet} from '@angular/router'; import {RouterOutlet} from '@angular/router';
import {NzLayoutModule} from 'ng-zorro-antd/layout'; import {NzLayoutModule} from 'ng-zorro-antd/layout';
import {NzMenuModule} from 'ng-zorro-antd/menu'; 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 {SettingForm} from "./components/setting-form/setting-form";
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav, Profil, SettingForm], imports: [RouterOutlet, NzLayoutModule, NzMenuModule],
templateUrl: './app.html', templateUrl: './app.html',
styleUrl: './app.css' styleUrl: './app.css'
}) })
@@ -0,0 +1,40 @@
<form [formGroup]="addProductForm">
<nz-form-item nz-flex>
<nz-form-label nzSpan="12" nzRequired>
Fournisseur
</nz-form-label>
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
<nz-select formControlName="supplierId" nzPlaceHolder="Choisir un fournisseur" nzShowSearch>
@for (supplier of suppliers(); track supplier.id) {
<nz-option [nzLabel]="supplier.name" [nzValue]="supplier.id"></nz-option>
}
</nz-select>
</nz-form-control>
</nz-form-item>
<div class="overflow-x-auto mt-6">
<nz-table [nzBordered]="true" class="mx-auto text-center">
<thead>
<tr>
<th class="text-center">Produit</th>
<th class="text-center">Prix</th>
</tr>
</thead>
<tbody formArrayName="lines">
@for (line of lines.controls; let i = $index; track i) {
<tr [formGroupName]="i" class="text-center">
<td class="text-center">{{ line.value.name }}</td>
<td class="text-center">
<nz-input-number
formControlName="price"
[nzMin]="0"
[nzStep]="1">
</nz-input-number>
</td>
</tr>
}
</tbody>
</nz-table>
</div>
</form>
@@ -0,0 +1,54 @@
import {Component, input} from '@angular/core';
import {FormArray, FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
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";
@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 {
addProductForm: FormGroup = new FormGroup({
supplierId: new FormControl<number>(null, Validators.required),
lines: new FormArray([], Validators.required),
});
suppliers = input.required<GetSupplierDto[]>();
products = input.required<GetProductDto[]>();
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)])
})
);
});
}
}
@@ -9,6 +9,23 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item nz-flex>
<nz-form-label nzSpan="12" nzRequired>
Fournisseur
</nz-form-label>
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
<nz-select formControlName="supplierId"
(ngModelChange)="refresh()"
[nzPlaceHolder]="getBestSupplier().name ?? 'Choisir un fournisseur'"
nzShowSearch>
@for (supplier of suppliers(); track supplier.id) {
<nz-option [nzLabel]="supplier.name" [nzValue]="supplier.id"></nz-option>
}
</nz-select>
</nz-form-control>
</nz-form-item>
<div class="overflow-x-auto"> <div class="overflow-x-auto">
<nz-table [nzBordered]="true" class="mx-auto text-center"> <nz-table [nzBordered]="true" class="mx-auto text-center">
<thead> <thead>
@@ -18,7 +35,7 @@
</tr> </tr>
</thead> </thead>
<tbody formArrayName="lines"> <tbody formArrayName="lines">
@for (line of lines.controls.slice(); let i = $index; track i) { @for (line of lines.controls; let i = $index; track i) {
<tr [formGroupName]="i" class="text-center"> <tr [formGroupName]="i" class="text-center">
<td class="text-center">{{ line.value.name }}</td> <td class="text-center">{{ line.value.name }}</td>
<td class="text-center"> <td class="text-center">
@@ -1,12 +1,14 @@
import {Component} from '@angular/core'; import {Component, input, OnInit, signal} from '@angular/core';
import {FormBuilder, FormGroup, FormArray, Validators, ReactiveFormsModule, FormControl} from '@angular/forms'; 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 {NzTableComponent} from "ng-zorro-antd/table";
import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number";
import {NzColDirective} from "ng-zorro-antd/grid"; import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input"; import {NzInputDirective} from "ng-zorro-antd/input";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {min} from "rxjs";
@Component({ @Component({
selector: 'app-create-purchaseorder-form', selector: 'app-create-purchaseorder-form',
@@ -22,31 +24,70 @@ import {NzInputDirective} from "ng-zorro-antd/input";
NzFormItemComponent, NzFormItemComponent,
NzFormLabelComponent, NzFormLabelComponent,
NzInputDirective, NzInputDirective,
NzOptionComponent,
NzSelectComponent,
] ]
}) })
export class CreatePurchaseorderForm { export class CreatePurchaseorderForm {
createPurchaseOrderForm: FormGroup suppliers = input.required<GetSupplierDto[]>();
products = input.required<GetProductDto[]>();
constructor(private fb: FormBuilder) { getBestSupplier() {
this.createPurchaseOrderForm = this.fb.group({ let bestSupplier: GetSupplierDto = this.suppliers()[0];
purchaseConditions: new FormControl<string | null>(null, Validators.required), let maxProducts = 0;
lines: this.fb.array([])
}); 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;
}
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<string | null>(null, Validators.required),
lines: new FormArray([], Validators.required),
supplierId: new FormControl<number>(null, Validators.required),
})
get lines(): FormArray { get lines(): FormArray {
return this.createPurchaseOrderForm.get('lines') as FormArray; return this.createPurchaseOrderForm.get('lines') as FormArray;
} }
// Ajouter des produits sélectionnés dans le formulaire addProductToForm() {
syncSelectedProducts(selectedProducts: GetProductDto[]) { const supplierId = this.createPurchaseOrderForm.value.supplierId ?? this.getBestSupplier().id;
this.createPurchaseOrderForm.patchValue({
supplierId
});
this.refresh();
}
refresh() {
this.lines.clear(); this.lines.clear();
selectedProducts.forEach(p => {
this.lines.push(this.fb.group({ this.getProductsOfSupplier().forEach(x => {
productId: [p.id], this.lines.push(
name: [p.name], new FormGroup({
quantity: [1, [Validators.required, Validators.min(1)]] productId: new FormControl(x.id),
})); name: new FormControl(x.name),
quantity: new FormControl(1, [Validators.required, Validators.min(1)])
})
);
}); });
} }
} }
@@ -1,4 +1,20 @@
<form [formGroup]="createQuotationForm"> <form [formGroup]="createQuotationForm">
<nz-form-item nz-flex>
<nz-form-label nzSpan="12" nzRequired>
Client
</nz-form-label>
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
<nz-select formControlName="customerId" nzPlaceHolder="Choisir un client"
nzShowSearch>
@for (customer of customers(); track customer.id) {
<nz-option [nzLabel]="customer.note" [nzValue]="customer.id"></nz-option>
}
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item nz-flex> <nz-form-item nz-flex>
<nz-form-label nzSpan="12" nzRequired> <nz-form-label nzSpan="12" nzRequired>
Message Message
@@ -15,7 +31,7 @@
</nz-form-label> </nz-form-label>
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis"> <nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
<input nz-input placeholder="Conditions générales de vente" formControlName="purchaseConditions"> <input nz-input placeholder="Conditions générales de vente" formControlName="conditionsSale">
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
@@ -28,7 +44,7 @@
</tr> </tr>
</thead> </thead>
<tbody formArrayName="lines"> <tbody formArrayName="lines">
@for (line of lines.controls.slice(); let i = $index; track i) { @for (line of lines.controls; let i = $index; track i) {
<tr [formGroupName]="i" class="text-center"> <tr [formGroupName]="i" class="text-center">
<td class="text-center">{{ line.value.name }}</td> <td class="text-center">{{ line.value.name }}</td>
<td class="text-center"> <td class="text-center">
@@ -1,4 +1,4 @@
import {Component} from '@angular/core'; import {Component, inject, input, OnInit, signal} from '@angular/core';
import { import {
FormArray, FormArray,
FormBuilder, FormBuilder,
@@ -14,7 +14,10 @@ import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from
import {NzInputDirective} from "ng-zorro-antd/input"; import {NzInputDirective} from "ng-zorro-antd/input";
import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number";
import {NzTableComponent} from "ng-zorro-antd/table"; 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({ @Component({
selector: 'app-create-quotation-form', selector: 'app-create-quotation-form',
@@ -28,35 +31,75 @@ import {GetProductDto} from "../../services/api";
NzInputDirective, NzInputDirective,
NzInputNumberComponent, NzInputNumberComponent,
NzTableComponent, NzTableComponent,
ReactiveFormsModule ReactiveFormsModule,
NzOptionComponent,
NzSelectComponent
], ],
templateUrl: './create-quotation-form.html', templateUrl: './create-quotation-form.html',
styleUrl: './create-quotation-form.css', styleUrl: './create-quotation-form.css',
}) })
export class CreateQuotationForm { export class CreateQuotationForm implements OnInit {
createQuotationForm: FormGroup private customersService = inject(CustomersService);
private notificationService = inject(NzNotificationService);
constructor(private fb: FormBuilder) { suppliers = input.required<GetSupplierDto[]>();
this.createQuotationForm = this.fb.group({ products = input.required<GetProductDto[]>();
message: new FormControl<string>(null, Validators.required),
purchaseConditions: new FormControl<string>(null, Validators.required), customers = signal<GetCustomerDto[]>([]);
lines: this.fb.array([])
}); 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<string>(null, Validators.required),
conditionsSale: new FormControl<string>(null, Validators.required),
supplierId: new FormControl<number>(null, Validators.required),
customerId: new FormControl<number>(null, Validators.required),
lines: new FormArray([], Validators.required),
})
get lines(): FormArray { get lines(): FormArray {
return this.createQuotationForm.get('lines') as FormArray; return this.createQuotationForm.get('lines') as FormArray;
} }
// Ajouter des produits sélectionnés dans le formulaire getDefaultSupplier() {
syncSelectedProducts(selectedProducts: GetProductDto[]) { 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.lines.clear();
selectedProducts.forEach(p => { this.products().forEach(x => {
this.lines.push(this.fb.group({ this.lines.push(
productId: [p.id], new FormGroup({
name: [p.name], productId: new FormControl(x.id),
quantity: [1, [Validators.required, Validators.min(1)]] name: new FormControl(x.name),
})); quantity: new FormControl(1, [Validators.required, Validators.min(1)])
})
);
});
this.createQuotationForm.patchValue({
supplierId: this.getDefaultSupplier().id,
}); });
} }
} }
@@ -0,0 +1,15 @@
<form [formGroup]="choiceDelivererForm">
<nz-form-item nz-flex>
<nz-form-label nzSpan="12" nzRequired>
Transporteur
</nz-form-label>
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
<nz-select formControlName="delivererId" nzPlaceHolder="Choisir un transporteur" nzShowSearch>
@for (deliverer of deliverers(); track deliverer.id) {
<nz-option [nzLabel]="deliverer.transporter" [nzValue]="deliverer.id"></nz-option>
}
</nz-select>
</nz-form-control>
</nz-form-item>
</form>
@@ -0,0 +1,45 @@
import {Component, inject, OnInit, 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<number>(null, Validators.required),
});
deliverers = signal<GetDelivererDto[]>([]);
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');
}
}
}
@@ -43,9 +43,11 @@
<div style="justify-content: center; display: flex"> <div style="justify-content: center; display: flex">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" <nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(deliverer)"></nz-icon> (click)="openEditModal(deliverer)"></nz-icon>
@if (admin()){
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliverer.id)" <nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliverer.id)"
class="text-red-600 cursor-pointer"></nz-icon> class="text-red-600 cursor-pointer"></nz-icon>
}
</div> </div>
</td> </td>
</tr> </tr>
@@ -9,7 +9,7 @@ import {DelivererForm} from "../deliverer-form/deliverer-form";
import {DeliverersService, GetDelivererDto, GetSupplierDto} from "../../services/api"; import {DeliverersService, GetDelivererDto, GetSupplierDto} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification"; import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs"; import {firstValueFrom} from "rxjs";
import {SupplierForm} from "../supplier-form/supplier-form"; import {AuthService} from "../../services/auth.service";
@Component({ @Component({
selector: 'app-deliverer-table', selector: 'app-deliverer-table',
@@ -29,13 +29,17 @@ import {SupplierForm} from "../supplier-form/supplier-form";
export class DelivererTable implements OnInit { export class DelivererTable implements OnInit {
private deliverersService = inject(DeliverersService); private deliverersService = inject(DeliverersService);
private notificationService = inject(NzNotificationService) private notificationService = inject(NzNotificationService)
private authService = inject(AuthService);
deliverers = signal<GetDelivererDto[]>([]); deliverers = signal<GetDelivererDto[]>([]);
deliverersLoading = signal<boolean>(false); deliverersLoading = signal<boolean>(false);
updateDeliverer = viewChild.required<DelivererForm>('delivererForm'); admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav'); modal = viewChild.required<ModalNav>('modalNav');
async ngOnInit() { async ngOnInit() {
await this.fetchDeliverers(); await this.fetchDeliverers();
this.admin.set(this.authService.isAdmin());
} }
async fetchDeliverers() { async fetchDeliverers() {
@@ -44,11 +48,8 @@ export class DelivererTable implements OnInit {
try { try {
const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()) const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint())
this.deliverers.set(deliverers); this.deliverers.set(deliverers);
} catch (e) { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Erreur lors du chargement des transporteurs');
'Erreur',
'Erreur de communication avec l\'API'
)
} }
this.deliverersLoading.set(false) this.deliverersLoading.set(false)
} }
@@ -56,11 +57,8 @@ export class DelivererTable implements OnInit {
async delete(deliverer: number) { async delete(deliverer: number) {
try { try {
await firstValueFrom(this.deliverersService.deleteDelivererEndpoint(deliverer)) await firstValueFrom(this.deliverersService.deleteDelivererEndpoint(deliverer))
this.notificationService.success( this.notificationService.success('Success', 'Suppression effectuée');
'Success', } catch {
'Suppression effectuée'
)
} catch (e) {
this.notificationService.error( this.notificationService.error(
'Erreur', 'Erreur',
'Impossible de supprimer la ligne' 'Impossible de supprimer la ligne'
@@ -71,10 +69,7 @@ export class DelivererTable implements OnInit {
async edit(id: number, updateDelivererComponent: DelivererForm) { async edit(id: number, updateDelivererComponent: DelivererForm) {
if (updateDelivererComponent.delivererForm.invalid) { if (updateDelivererComponent.delivererForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Formulaire invalide');
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
return; return;
} }
@@ -83,7 +78,7 @@ export class DelivererTable implements OnInit {
await firstValueFrom(this.deliverersService.updateDelivererEndpoint(id, deliverers)) await firstValueFrom(this.deliverersService.updateDelivererEndpoint(id, deliverers))
this.notificationService.success('Success', 'Transporteur modifié') this.notificationService.success('Success', 'Transporteur modifié')
} catch (e) { } catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification') this.notificationService.error('Erreur', 'Erreur lors de la modification')
} }
} }
@@ -100,7 +95,7 @@ export class DelivererTable implements OnInit {
await this.edit(supplierId, updateDelivererComponent); await this.edit(supplierId, updateDelivererComponent);
updateDelivererComponent.delivererForm.reset(); updateDelivererComponent.delivererForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchDeliverers(); await this.fetchDeliverers();
} }
@@ -5,8 +5,7 @@
</nz-form-label> </nz-form-label>
<nz-form-control nzSpan="9" nzErrorTip="Ce champ est requis"> <nz-form-control nzSpan="9" nzErrorTip="Ce champ est requis">
<nz-select formControlName="delivererId" [nzPlaceHolder]="'Choisir un transporteur'" nzShowSearch <nz-select formControlName="delivererId" nzPlaceHolder="Choisir un transporteur" nzShowSearch>
[nzFilterOption]="filter">
@for (deliverer of deliverers(); track deliverer.id) { @for (deliverer of deliverers(); track deliverer.id) {
<nz-option [nzValue]="deliverer.id" [nzLabel]="deliverer.transporter"></nz-option> <nz-option [nzValue]="deliverer.id" [nzLabel]="deliverer.transporter"></nz-option>
} }
@@ -31,19 +31,22 @@ export class DelivereryNoteForm implements OnInit {
trackingNumber: new FormControl<string>(null), trackingNumber: new FormControl<string>(null),
delivererId: new FormControl<number>(null, [Validators.required]), delivererId: new FormControl<number>(null, [Validators.required]),
expeditionDate: 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) realDeliveryDate: new FormControl(null)
}) })
private deliverersService = inject(DeliverersService); private deliverersService = inject(DeliverersService);
private notificationService = inject(NzNotificationService); private notificationService = inject(NzNotificationService);
deliverers = signal<GetDelivererDto[]>([]); deliverers = signal<GetDelivererDto[]>([]);
deliveryNote = input<GetDeliveryNoteDto>();
async fetchDeliverers() { async fetchDeliverers() {
try { try {
const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint()); const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint());
this.deliverers.set(deliverers); this.deliverers.set(deliverers);
} catch (e) { } catch {
this.notificationService.error('Erreur', 'Impossible de récupérer les transporteurs'); this.notificationService.error('Erreur', 'Impossible de récupérer les transporteurs');
} }
} }
@@ -52,12 +55,6 @@ export class DelivereryNoteForm implements OnInit {
await this.fetchDeliverers(); await this.fetchDeliverers();
} }
filter(input: string, option: any) {
return option.nzLabel.toLowerCase().includes(input.toLowerCase());
}
deliveryNote = input<GetDeliveryNoteDto>();
constructor() { constructor() {
effect(() => { effect(() => {
if (this.deliveryNote()) { if (this.deliveryNote()) {
@@ -9,6 +9,7 @@
<th>Date d'expédition</th> <th>Date d'expédition</th>
<th>Date de livraison estimée</th> <th>Date de livraison estimée</th>
<th>Date de livraison réelle</th> <th>Date de livraison réelle</th>
<th>Statut</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
@@ -20,6 +21,15 @@
<td>{{ deliveryNote.expeditionDate | date: 'dd/MM/yyyy' }}</td> <td>{{ deliveryNote.expeditionDate | date: 'dd/MM/yyyy' }}</td>
<td>{{ deliveryNote.estimateDeliveryDate | date: 'dd/MM/yyyy' }}</td> <td>{{ deliveryNote.estimateDeliveryDate | date: 'dd/MM/yyyy' }}</td>
<td>{{ deliveryNote.realDeliveryDate | date: 'dd/MM/yyyy' }}</td> <td>{{ deliveryNote.realDeliveryDate | date: 'dd/MM/yyyy' }}</td>
<td>
@if (deliveryNote.estimateDeliveryDate >= date && deliveryNote.realDeliveryDate == null) {
<p class="text-blue-900 font-semibold">En cours</p>
} @else if (deliveryNote.realDeliveryDate == null) {
<p class="text-red-600 font-semibold">En retard</p>
} @else {
<p class="text-green-800 font-semibold">Terminée</p>
}
</td>
<td> <td>
<div style="justify-content: center; display: flex"> <div style="justify-content: center; display: flex">
<nz-icon nzType="check" nzTheme="outline" (click)="validate(deliveryNote.id)" <nz-icon nzType="check" nzTheme="outline" (click)="validate(deliveryNote.id)"
@@ -28,9 +38,11 @@
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" <nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(deliveryNote)"></nz-icon> (click)="openEditModal(deliveryNote)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
@if (admin()){
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliveryNote.id)" <nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliveryNote.id)"
class="cursor-pointer text-red-700"/> class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
}
<nz-icon nzType="export" nzTheme="outline" (click)="export(deliveryNote.id)" <nz-icon nzType="export" nzTheme="outline" (click)="export(deliveryNote.id)"
class="cursor-pointer text-green-700"/> class="cursor-pointer text-green-700"/>
</div> </div>
@@ -5,11 +5,12 @@ import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzTableComponent} from "ng-zorro-antd/table"; import {NzTableComponent} from "ng-zorro-antd/table";
import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form"; import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form";
import {DeliverynotesService, GetDeliveryNoteDto} from "../../services/api"; import {DeliverynotesService, GetDeliveryNoteDto, UpdateDeliveryNoteDto} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification"; import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs"; import {firstValueFrom} from "rxjs";
import {format} from "date-fns"; import {format} from "date-fns";
import {FileService} from "../../services/file.service"; import {FileService} from "../../services/file.service";
import {AuthService} from "../../services/auth.service";
@Component({ @Component({
selector: 'app-deliverery-note-table', selector: 'app-deliverery-note-table',
@@ -28,12 +29,19 @@ export class DelivereryNoteTable implements OnInit {
private deliveryNotesService = inject(DeliverynotesService); private deliveryNotesService = inject(DeliverynotesService);
private notificationService = inject(NzNotificationService); private notificationService = inject(NzNotificationService);
private fileService = inject(FileService); private fileService = inject(FileService);
private authService = inject(AuthService);
deliveryNotes = signal<GetDeliveryNoteDto[]>([]); deliveryNotes = signal<GetDeliveryNoteDto[]>([]);
deliveryNotesLoading = signal<boolean>(false); deliveryNotesLoading = signal<boolean>(false);
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav'); modal = viewChild.required<ModalNav>('modalNav');
date = new Date().toISOString().split('T')[0]; // yyyy-mm-dd
async ngOnInit() { async ngOnInit() {
await this.fetchDeliveryNotes(); await this.fetchDeliveryNotes();
this.admin.set(this.authService.isAdmin());
} }
async fetchDeliveryNotes() { async fetchDeliveryNotes() {
@@ -41,11 +49,8 @@ export class DelivereryNoteTable implements OnInit {
try { try {
const deliveryNotes = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNoteEndpoint()); const deliveryNotes = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNoteEndpoint());
this.deliveryNotes.set(deliveryNotes); this.deliveryNotes.set(deliveryNotes);
} catch (e) { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Erreur lors du chargement des bons de livraison');
'Erreur',
'Erreur de communication avec l\'API'
)
} }
this.deliveryNotesLoading.set(false) this.deliveryNotesLoading.set(false)
} }
@@ -54,15 +59,9 @@ export class DelivereryNoteTable implements OnInit {
this.deliveryNotesLoading.set(true) this.deliveryNotesLoading.set(true)
try { try {
await firstValueFrom(this.deliveryNotesService.deleteDeliveryNoteEndpoint(deliveryNote)); await firstValueFrom(this.deliveryNotesService.deleteDeliveryNoteEndpoint(deliveryNote));
this.notificationService.success( this.notificationService.success('Success', 'Suppression effectuée');
'Success', } catch {
'Suppression effectuée' this.notificationService.error('Erreur', 'Impossible de supprimer la ligne');
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
} }
this.deliveryNotesLoading.set(false) this.deliveryNotesLoading.set(false)
await this.fetchDeliveryNotes(); await this.fetchDeliveryNotes();
@@ -77,22 +76,12 @@ export class DelivereryNoteTable implements OnInit {
try { try {
await firstValueFrom(this.deliveryNotesService.patchRealDeliveryDateEndpoint(deliveryNote, PatchRealDate)) await firstValueFrom(this.deliveryNotesService.patchRealDeliveryDateEndpoint(deliveryNote, PatchRealDate))
this.notificationService.success('Success', 'Date actualisée');
this.notificationService.success( } catch {
'Success', this.notificationService.error('Erreur', 'La date à déjà été actualisée');
'Date actualisée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'La date à déjà été actualisée'
)
} }
} catch (e) { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Erreur d\'actualisation de la date');
'Erreur',
'Erreur d\'actualisation de la date'
)
} }
this.deliveryNotesLoading.set(false) this.deliveryNotesLoading.set(false)
await this.fetchDeliveryNotes() await this.fetchDeliveryNotes()
@@ -101,15 +90,10 @@ export class DelivereryNoteTable implements OnInit {
async export(deliveryNoteId: number) { async export(deliveryNoteId: number) {
this.deliveryNotesLoading.set(true) this.deliveryNotesLoading.set(true)
try { try {
const pdf = await firstValueFrom( const pdf = await firstValueFrom(this.deliveryNotesService.getDeliveryNotePdfEndpoint(deliveryNoteId, "response"));
this.deliveryNotesService.getDeliveryNotePdfEndpoint(deliveryNoteId, "response")
);
this.fileService.downloadBlob(pdf) this.fileService.downloadBlob(pdf)
} catch (e) { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Impossible de générer un PDF');
'Erreur',
'Impossible de générer un PDF'
);
} }
this.deliveryNotesLoading.set(false) this.deliveryNotesLoading.set(false)
} }
@@ -123,34 +107,20 @@ export class DelivereryNoteTable implements OnInit {
try { try {
const raw = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue(); const raw = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue();
// convertit proprement les dates (string OU Date) const toIso = (val: any) =>
const toIso = (val: any) => { val ? new Date(val).toISOString().substring(0, 10) : null;
if (!val) return null;
// si cest déjà un string ISO "yyyy-MM-dd", on renvoie tel quel const deliveryNoteDto: UpdateDeliveryNoteDto = {
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 = {
trackingNumber: raw.trackingNumber, trackingNumber: raw.trackingNumber,
delivererId: raw.delivererId, delivererId: raw.delivererId,
expeditionDate: toIso(raw.expeditionDate), expeditionDate: toIso(raw.expeditionDate),
estimatedDate: toIso(raw.estimatedDate), estimateDeliveryDate: toIso(raw.estimatedDate),
realDeliveryDate: toIso(raw.realDeliveryDate) realDeliveryDate: toIso(raw.realDeliveryDate)
}; };
await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNoteDto)); await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNoteDto));
this.notificationService.success('Success', 'Bon de livraison modifié'); this.notificationService.success('Success', 'Bon de livraison modifié');
} catch (e) { } catch {
console.error(e);
this.notificationService.error('Erreur', 'Erreur lors de la modification'); this.notificationService.error('Erreur', 'Erreur lors de la modification');
} }
} }
@@ -167,7 +137,7 @@ export class DelivereryNoteTable implements OnInit {
await this.edit(id, updateDelivereryNoteComponent); await this.edit(id, updateDelivereryNoteComponent);
updateDelivereryNoteComponent.deliveryNoteForm.reset(); updateDelivereryNoteComponent.deliveryNoteForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchDeliveryNotes(); await this.fetchDeliveryNotes();
} }
@@ -11,7 +11,6 @@
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
/* Box shadow pour effet superposition */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06), box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06),
0 8px 20px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.08),
0 16px 40px rgba(0, 0, 0, 0.06); 0 16px 40px rgba(0, 0, 0, 0.06);
@@ -35,15 +34,13 @@
outline: none; outline: none;
} }
/* Liste scrollable */
.livraisons-list { .livraisons-list {
width: 100%; width: 100%;
max-height: 350px; /* hauteur max de la liste */ max-height: 500px;
overflow-y: auto; /* scroll vertical activé */ overflow-y: auto;
padding-right: 10px; /* pour le scrollbar */ padding-right: 10px;
} }
/* Scrollbar personnalisée (optionnel) */
.livraisons-list::-webkit-scrollbar { .livraisons-list::-webkit-scrollbar {
width: 8px; width: 8px;
} }
@@ -57,7 +54,6 @@
background: #f3f4f6; background: #f3f4f6;
} }
/* Carte de livraison */
.livraison-card { .livraison-card {
background: #ffffff; background: #ffffff;
padding: 20px 22px; padding: 20px 22px;
@@ -76,7 +72,6 @@
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
} }
/* Infos livraison */
.livraison-info h3 { .livraison-info h3 {
font-size: 17px; font-size: 17px;
margin: 0 0 4px; margin: 0 0 4px;
@@ -88,26 +83,3 @@
font-size: 14px; font-size: 14px;
color: #6b7280; 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;
}
@@ -3,18 +3,55 @@
(input)="search.set($any($event.target).value)"/> (input)="search.set($any($event.target).value)"/>
<div class="livraisons-list"> <div class="livraisons-list">
@for (deliveryItem of filteredLivraisons(); track deliveryItem.id) { @for (deliveryItem of filteredDeliveries(); track deliveryItem.id) {
<div class="livraison-card"> <div class="livraison-card">
<div class="livraison-info"> <div class="livraison-info">
<h3>{{ deliveryItem.client }}</h3> <h3>{{ deliveryItem.delivererTransporter }}</h3>
<p class="mr-5">Date d'expédition: {{ deliveryItem.date }}</p> <p class="mr-5">Date d'expédition: {{ deliveryItem.expeditionDate }}</p>
<p>Produits : {{ deliveryItem.produits }}</p> <p>Quantité livrée : {{ deliveryItem.products.length }}</p>
</div> </div>
<button nz-button nzType="primary" [nzSize]="size" nzShape="round" (click)="validate(deliveryItem.id)"> <app-modal-nav #modal name="Valider la livraison" nameIcon="check"
<nz-icon nzType="check"/> (click)="check(deliveryItem.id)"
Valider (ok)="validate(deliveryItem.id, selectedWarehouseId!, modal)"
</button> (cancel)="reject(modal)">
<div class="mb-4 flex justify-center">
<nz-select
[(ngModel)]="selectedWarehouseId"
nzPlaceHolder="Sélectionner un entrepôt"
required
class="w-64">
@for (wareHouse of wareHouses(); track wareHouse.id) {
<nz-option [nzValue]="wareHouse.id" [nzLabel]="wareHouse.name"/>
}
</nz-select>
</div>
<div style="max-height: 400px; overflow-y: auto;">
<nz-table [nzData]="filteredDeliveries()"
[nzFrontPagination]="false">
<thead>
<tr class="text-center">
<th>Réference</th>
<th>Nom</th>
<th>Quantité</th>
</tr>
</thead>
<tbody class="text-center">
@for (product of deliveryItem.products; track product.productId) {
<tr>
<td>{{ product.productReference }}</td>
<td>{{ product.productName }}</td>
<td>{{ product.quantity }}</td>
</tr>
}
</tbody>
</nz-table>
</div>
</app-modal-nav>
</div> </div>
} }
</div> </div>
@@ -1,44 +1,105 @@
import {Component, computed, signal} from '@angular/core'; import {Component, computed, inject, OnInit, signal} from '@angular/core';
import {NzButtonComponent, NzButtonSize} from "ng-zorro-antd/button"; import {
import {NzIconDirective} from "ng-zorro-antd/icon"; 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({ @Component({
selector: 'app-delivery-validator', selector: 'app-delivery-validator',
imports: [ imports: [
NzButtonComponent, NzTableComponent,
NzIconDirective ModalNav,
NzSelectComponent,
NzOptionComponent,
FormsModule
], ],
templateUrl: './delivery-validator.html', templateUrl: './delivery-validator.html',
styleUrl: './delivery-validator.css', styleUrl: './delivery-validator.css',
}) })
export class DeliveryValidator { export class DeliveryValidator implements OnInit {
size: NzButtonSize = 'large'; private deliveryNotesService = inject(DeliverynotesService);
search = signal(''); private notificationService = inject(NzNotificationService);
private warehousesService = inject(WarehousesService);
private warehouseProductsService = inject(WarehouseproductsService);
livraisons = signal([ search = signal<string>('');
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12}, deliveryNotes = signal<GetDeliveryNoteDto[]>([]);
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8}, wareHouses = signal<GetWareHouseDto[]>([]);
{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(() => { 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 lors du chargement des quantitées')
}
}
async fetchDeliveryNotes() {
try {
const deliveries = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNotesNotArrivedEndpoint());
this.deliveryNotes.set(deliveries);
} catch {
this.notificationService.error('Erreur', 'Erreur lors du chargement des bon de livraison')
}
}
filteredDeliveries = computed(() => {
const query = this.search().toLowerCase(); const query = this.search().toLowerCase();
return this.livraisons().filter(l => return this.deliveryNotes().filter(l =>
l.client.toLowerCase().includes(query) || l.delivererTransporter.toLowerCase().includes(query) ||
l.date.includes(query) l.expeditionDate.includes(query)
); );
}); });
validate(id: number) { async check(id: number) {
return try {
const PatchRealDate = {
realDeliveryDate: format(new Date(), 'yyyy-MM-dd')
};
await firstValueFrom(this.deliveryNotesService.patchRealDeliveryDateEndpoint(id, PatchRealDate));
} catch {
this.notificationService.error('Erreur', 'Impossible d\'actualiser la date')
}
}
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();
} }
} }
+1 -1
View File
@@ -13,7 +13,7 @@ import {NgStyle} from "@angular/common";
}) })
export class InfoCard { export class InfoCard {
icon = input.required<string>() icon = input.required<string>()
value = input.required<string>() value = input.required<number>()
description = input.required<string>() description = input.required<string>()
color = input.required<string>() color = input.required<string>()
} }
@@ -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 lespace 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;
}
@@ -1,11 +0,0 @@
<div class="documents-section">
<h1>Documents récents</h1>
<div class="content">
@for (doc of purchaseOrder(); track doc.id) {
<div>
<img src="https://cdn-icons-png.flaticon.com/512/337/337946.png" alt="pdf">
<p>{{ doc.name }}</p>
</div>
}
</div>
</div>
@@ -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;
}
}
+122
View File
@@ -0,0 +1,122 @@
:host {
display: flex;
}
.app-layout {
height: 100vh;
}
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;
}
.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;
gap: 20px;
color: #fff;
font-size: 18px;
cursor: pointer;
}
.right-icons app-modal-nav {
transition: transform 0.2s ease, color 0.2s ease;
}
.disconnect {
transition: transform 0.2s ease, color 0.2s ease;
}
.disconnect:hover {
color: #40a9ff;
transform: scale(1.2);
}
.right-icons app-modal-nav:hover {
color: #40a9ff;
transform: scale(1.2);
}
/* --- CONTENU --- */
nz-content {
padding: 24px 50px;
}
.inner-content {
padding: 24px;
background: #fff;
height: 100%;
}
+90
View File
@@ -0,0 +1,90 @@
<nz-layout class="app-layout">
<nz-header>
<div class="header-container">
<!-- LOGO -->
<div class="logo">
<a routerLink="/dashboard">
<img
src="https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png"
alt="logo"
style="width: 100px; height: auto"
/>
<h1 class="text-amber-300">PYRO FÊTES</h1>
</a>
</div>
<!-- MENU PRINCIPAL -->
<ul nz-menu class="top-nav" nzTheme="dark" nzMode="horizontal">
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/stock">
<nz-icon nzType="stock"></nz-icon>
<span>Stock</span>
</a>
</li>
<li nz-submenu nzTitle="Partenaires" nzIcon="team">
<ul>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/supplier">
<nz-icon nzType="shop"></nz-icon>
<span>Fournisseurs</span>
</a>
</li>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/deliverer">
<nz-icon nzType="car"></nz-icon>
<span>Livreurs</span>
</a>
</li>
</ul>
</li>
<li nz-submenu nzTitle="Recettes" nzIcon="euro-circle">
<ul>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/quotation">
<nz-icon nzType="file"></nz-icon>
<span>Devis</span>
</a>
</li>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/purchase-order">
<nz-icon nzType="file"></nz-icon>
<span>Bon de commande</span>
</a>
</li>
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/delivery-note">
<nz-icon nzType="file"></nz-icon>
<span>Bon de livraison</span>
</a>
</li>
</ul>
</li>
@if (admin()) {
<li nz-menu-item routerLinkActive="ant-menu-item-selected">
<a routerLink="/user">
<nz-icon nzType="user"></nz-icon>
<span>Utilisateur</span>
</a>
</li>
}
</ul>
<!-- ICONES À DROITE -->
<div class="right-icons">
<nz-icon nzType="logout" nzTheme="outline" class="disconnect" (click)="disconnect()"/>
<app-modal-nav nameIcon="user" name="Profil">
<app-profil></app-profil>
</app-modal-nav>
<app-modal-nav nameIcon="setting" name="Paramètres">
<app-setting-form></app-setting-form>
</app-modal-nav>
</div>
</div>
</nz-header>
<nz-content>
<div class="inner-content overflow-auto">
<router-outlet></router-outlet>
</div>
</nz-content>
</nz-layout>
+45
View File
@@ -0,0 +1,45 @@
import {Component, inject, OnInit, signal} from '@angular/core';
import {ModalNav} from "../modal-nav/modal-nav";
import {NzContentComponent, NzHeaderComponent, NzLayoutComponent} from "ng-zorro-antd/layout";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzMenuDirective, NzMenuItemComponent, NzSubMenuComponent} from "ng-zorro-antd/menu";
import {Profil} from "../profil/profil";
import {Router, RouterLink, RouterLinkActive, RouterOutlet} from "@angular/router";
import {SettingForm} from "../setting-form/setting-form";
import {AuthService} from "../../services/auth.service";
@Component({
selector: 'app-layout',
imports: [
ModalNav,
NzContentComponent,
NzHeaderComponent,
NzIconDirective,
NzLayoutComponent,
NzMenuDirective,
NzMenuItemComponent,
NzSubMenuComponent,
Profil,
RouterLink,
RouterLinkActive,
RouterOutlet,
SettingForm
],
templateUrl: './layout.html',
styleUrl: './layout.css',
})
export class Layout implements OnInit {
private authService = inject(AuthService);
private router = inject(Router);
admin = signal<boolean>(false);
ngOnInit() {
this.admin.set(this.authService.isAdmin());
}
async disconnect() {
this.authService.logout();
await this.router.navigate(['/login']);
}
}
@@ -1,4 +1,4 @@
import {Component, input, Input, output} from '@angular/core'; import {Component, input, output} from '@angular/core';
import {NzModalComponent} from "ng-zorro-antd/modal"; import {NzModalComponent} from "ng-zorro-antd/modal";
import {NzButtonComponent} from "ng-zorro-antd/button"; import {NzButtonComponent} from "ng-zorro-antd/button";
+1 -1
View File
@@ -1,4 +1,4 @@
import {Component, Input, input, output} from '@angular/core'; import {Component, input, output} from '@angular/core';
import {NzButtonModule} from 'ng-zorro-antd/button'; import {NzButtonModule} from 'ng-zorro-antd/button';
import {NzModalModule} from 'ng-zorro-antd/modal'; import {NzModalModule} from 'ng-zorro-antd/modal';
import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzIconDirective} from "ng-zorro-antd/icon";
+1 -1
View File
@@ -4,7 +4,7 @@ import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input"; import {NzInputDirective} from "ng-zorro-antd/input";
import {GetPriceDto, GetSupplierDto} from "../../services/api"; import {GetPriceDto} from "../../services/api";
@Component({ @Component({
selector: 'app-price-form', selector: 'app-price-form',
@@ -1,21 +0,0 @@
<form nz-form nzLayout="horizontal" [formGroup]="productForm">
<nz-form-item nz-flex>
<nz-form-label nzSpan="9" nzRequired>
Prix
</nz-form-label>
<nz-form-control nzSpan="8" nzErrorTip="Ce champ est requis">
<input nz-input placeholder="Prix" formControlName="price">
</nz-form-control>
</nz-form-item>
<nz-form-item nz-flex>
<nz-form-label nzSpan="9" nzRequired>
Quantité
</nz-form-label>
<nz-form-control nzSpan="8" nzErrorTip="Ce champ est requis">
<input nz-input placeholder="Quantité" formControlName="quantity">
</nz-form-control>
</nz-form-item>
</form>
@@ -1,29 +0,0 @@
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<string>(null, [Validators.required]),
quantity: new FormControl<string>(null, [Validators.required])
})
}
@@ -26,8 +26,7 @@
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis"> <nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
<nz-select formControlName="fonction" [nzPlaceHolder]="'Choisir une fonction'"> <nz-select formControlName="fonction" [nzPlaceHolder]="'Choisir une fonction'">
<nz-option nzLabel="Admin" nzValue="Admin"></nz-option> <nz-option nzLabel="Admin" nzValue="Admin"></nz-option>
<nz-option nzLabel="Visiteur" nzValue="Visiteur"></nz-option> <nz-option nzLabel="Employé" nzValue="Employe"></nz-option>
<nz-option nzLabel="Partenaire" nzValue="Partenaire"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
+4 -10
View File
@@ -1,15 +1,9 @@
<div class="ml-110 cursor-pointer">
<app-modal-nav nameIcon="edit" name="Modification du profil">
<app-profil-form [user]=""></app-profil-form>
</app-modal-nav>
</div>
<div class="mx-auto flex items-center justify-center w-30 h-30 rounded-full bg-blue-900 text-white text-6xl fontProfil"> <div class="mx-auto flex items-center justify-center w-30 h-30 rounded-full bg-blue-900 text-white text-6xl fontProfil">
{{ getInitial(data.name) }} {{ getInitial(user().name) }}
</div> </div>
<div class="mt-6"> <div class="mt-6">
<p class="text-3xl festive2 mx-auto flex items-center justify-center">{{ data.name }}</p> <p class="text-3xl festive2 mx-auto flex items-center justify-center">{{ user().name }}</p>
<p class="text-xl festive2 mt-0 flex items-center justify-center">{{ data.email }}</p> <p class="text-xl festive2 mt-0 flex items-center justify-center">{{ user().email }}</p>
<p class="text-xl festive2 mt-0 flex items-center justify-center">{{ data.fonction }}</p> <p class="text-xl festive2 mt-0 flex items-center justify-center">{{ user().fonction }}</p>
</div> </div>
+19 -15
View File
@@ -1,24 +1,28 @@
import {Component} from '@angular/core'; import {Component, inject, OnInit, signal} from '@angular/core';
import {UserInfo} from "../../interfaces/user.interface"; import {NzNotificationService} from "ng-zorro-antd/notification";
import {ProfilForm} from "../profil-form/profil-form"; import {GetUserDto, UserService} from "../../services/api";
import {ModalNav} from "../modal-nav/modal-nav"; import {firstValueFrom} from "rxjs";
@Component({ @Component({
selector: 'app-profil', selector: 'app-profil',
imports: [ imports: [],
ProfilForm,
ModalNav
],
templateUrl: './profil.html', templateUrl: './profil.html',
styleUrl: './profil.css', styleUrl: './profil.css',
}) })
export class Profil { export class Profil implements OnInit {
data: UserInfo = private notificationService = inject(NzNotificationService);
{ private userService = inject(UserService);
name: 'Mathys Sanchez Vendé',
email: 'mathys.sanchez@vende.fr', user = signal<GetUserDto>({});
fonction: 'admin',
}; async ngOnInit() {
try {
const user = await firstValueFrom(this.userService.getUserEndpoint());
this.user.set(user);
} catch {
this.notificationService.error('Erreur', 'Impossible de charger l\'utilisateur');
}
}
getInitial(name: string): string { getInitial(name: string): string {
if (!name || name.trim() === '') return '?'; if (!name || name.trim() === '') return '?';
@@ -57,18 +57,18 @@
</td> </td>
<td> <td>
<div style="justify-content: center; display: flex"> <div style="justify-content: center; display: flex">
<nz-icon nzType="plus-circle" nzTheme="outline" class="cursor-pointer text-green-700"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" <nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(purchaseOrder)"></nz-icon> (click)="openEditModal(purchaseOrder)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
@if (admin()) {
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(purchaseOrder.id)" <nz-icon nzType="delete" nzTheme="outline" (click)="delete(purchaseOrder.id)"
class="cursor-pointer text-red-700"/> class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
}
<nz-icon nzType="export" nzTheme="outline" (click)="export(purchaseOrder.id)" <nz-icon nzType="export" nzTheme="outline" (click)="export(purchaseOrder.id)"
class="cursor-pointer text-green-700"/> class="cursor-pointer text-green-700"/>
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="interaction" nzTheme="outline" (click)="transfer(purchaseOrder)" <nz-icon nzType="interaction" nzTheme="outline" (click)="openDelivererModal(purchaseOrder)"
class="cursor-pointer text-blue-700"/> class="cursor-pointer text-blue-700"/>
</div> </div>
</td> </td>
@@ -78,7 +78,7 @@
</nz-table> </nz-table>
<div class="hidden"> <div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modification des conditions de vente'" <app-modal-nav #modalNav nameIcon="edit" name="Modification des conditions de vente"
(ok)="onModalOk(selectedPurchaseOrder.id, purchaseOrderForm, modalNav)" (ok)="onModalOk(selectedPurchaseOrder.id, purchaseOrderForm, modalNav)"
(cancel)="onModalCancel(modalNav)"> (cancel)="onModalCancel(modalNav)">
<app-purchase-order-form #purchaseOrderForm [purchaseOrder]="selectedPurchaseOrder"></app-purchase-order-form> <app-purchase-order-form #purchaseOrderForm [purchaseOrder]="selectedPurchaseOrder"></app-purchase-order-form>
@@ -86,9 +86,17 @@
</div> </div>
<div class="hidden"> <div class="hidden">
<app-modal-nav #modalQuantity nameIcon="edit" [name]="'Modification de la quantité'" <app-modal-nav #modalQuantity nameIcon="edit" name="Modification de la quantité"
(ok)="onModalQuantityOk(selectedQuantity.productId, selectedQuantity.purchaseOrderId, quantityForm, modalQuantity)" (ok)="onModalQuantityOk(selectedQuantity.productId, selectedQuantity.purchaseOrderId, quantityForm, modalQuantity)"
(cancel)="onModalCancel(modalQuantity)"> (cancel)="onModalCancel(modalQuantity)">
<app-quantity-form #quantityForm [quantity]="selectedQuantity"></app-quantity-form> <app-quantity-form #quantityForm [quantity]="selectedQuantity"></app-quantity-form>
</app-modal-nav> </app-modal-nav>
</div> </div>
<div class="hidden">
<app-modal-nav #modalDeliverer nameIcon="edit" name="Choix du transporteur"
(ok)="transfer(selectedPurchaseOrder, delivererChoice)"
(cancel)="onModalCancel(modalDeliverer)">
<app-deliverer-choice #delivererChoice></app-deliverer-choice>
</app-modal-nav>
</div>
@@ -16,6 +16,8 @@ import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs"; import {firstValueFrom} from "rxjs";
import {FileService} from "../../services/file.service"; import {FileService} from "../../services/file.service";
import {QuantityForm} from "../quantity-form/quantity-form"; import {QuantityForm} from "../quantity-form/quantity-form";
import {DelivererChoice} from "../deliverer-choice/deliverer-choice";
import {AuthService} from "../../services/auth.service";
@Component({ @Component({
selector: 'app-purchase-order-table', selector: 'app-purchase-order-table',
@@ -27,6 +29,7 @@ import {QuantityForm} from "../quantity-form/quantity-form";
PurchaseOrderForm, PurchaseOrderForm,
ModalButton, ModalButton,
QuantityForm, QuantityForm,
DelivererChoice,
], ],
templateUrl: './purchase-order-table.html', templateUrl: './purchase-order-table.html',
styleUrl: './purchase-order-table.css', styleUrl: './purchase-order-table.css',
@@ -36,13 +39,19 @@ export class PurchaseOrderTable implements OnInit {
private notificationService = inject(NzNotificationService); private notificationService = inject(NzNotificationService);
private fileService = inject(FileService); private fileService = inject(FileService);
private deliveryNoteService = inject(DeliverynotesService); private deliveryNoteService = inject(DeliverynotesService);
private authService = inject(AuthService);
purchaseOrders = signal<GetPurchaseOrderDto[]>([]); purchaseOrders = signal<GetPurchaseOrderDto[]>([]);
purchaseOrdersLoading = signal<boolean>(false); purchaseOrdersLoading = signal<boolean>(false);
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav'); modal = viewChild.required<ModalNav>('modalNav');
modalQuantity = viewChild.required<ModalNav>('modalQuantity'); modalQuantity = viewChild.required<ModalNav>('modalQuantity');
modalDeliverer = viewChild.required<ModalNav>('modalDeliverer');
async ngOnInit() { async ngOnInit() {
await this.fetchPurchaseOrder(); await this.fetchPurchaseOrder();
this.admin.set(this.authService.isAdmin());
} }
async fetchPurchaseOrder() { async fetchPurchaseOrder() {
@@ -51,11 +60,8 @@ export class PurchaseOrderTable implements OnInit {
try { try {
const purchaseOrders = await firstValueFrom(this.purchaseOrdersService.getAllPurchaseOrderEndpoint()) const purchaseOrders = await firstValueFrom(this.purchaseOrdersService.getAllPurchaseOrderEndpoint())
this.purchaseOrders.set(purchaseOrders); this.purchaseOrders.set(purchaseOrders);
} catch (e) { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Erreur lors du chargement des bons de commande')
'Erreur',
'Erreur de communication avec l\'API'
)
} }
this.purchaseOrdersLoading.set(false) this.purchaseOrdersLoading.set(false)
} }
@@ -64,15 +70,9 @@ export class PurchaseOrderTable implements OnInit {
this.purchaseOrdersLoading.set(true) this.purchaseOrdersLoading.set(true)
try { try {
await firstValueFrom(this.purchaseOrdersService.deletePurchaseOrderEndpoint(purchaseOrderId)) await firstValueFrom(this.purchaseOrdersService.deletePurchaseOrderEndpoint(purchaseOrderId))
this.notificationService.success( this.notificationService.success('Success', 'Suppression effectuée')
'Success', } catch {
'Suppression effectuée' this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
} }
this.purchaseOrdersLoading.set(false) this.purchaseOrdersLoading.set(false)
await this.fetchPurchaseOrder(); await this.fetchPurchaseOrder();
@@ -85,27 +85,18 @@ export class PurchaseOrderTable implements OnInit {
this.purchaseOrdersService.getPurchaseOrderPdfEndpoint(purchaseOrderId, "response") this.purchaseOrdersService.getPurchaseOrderPdfEndpoint(purchaseOrderId, "response")
); );
this.fileService.downloadBlob(pdf) this.fileService.downloadBlob(pdf)
} catch (e) { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Impossible de générer un PDF');
'Erreur',
'Impossible de générer un PDF'
);
} }
this.purchaseOrdersLoading.set(false) this.purchaseOrdersLoading.set(false)
} }
async transfer(purchaseOrder: GetPurchaseOrderDto) { async transfer(purchaseOrder: GetPurchaseOrderDto, delivererForm: DelivererChoice) {
this.purchaseOrdersLoading.set(true); this.purchaseOrdersLoading.set(true);
try { try {
const today = new Date(); const deliverer = delivererForm.choiceDelivererForm.getRawValue();
const date = today.toISOString().split('T')[0]; // yyyy-mm-dd
const futureDate = new Date(today); const date = new Date().toISOString().split('T')[0]; // yyyy-mm-dd
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-'; let trackingValue = 'TRK-';
const idStr = purchaseOrder.id?.toString() ?? ''; const idStr = purchaseOrder.id?.toString() ?? '';
@@ -122,29 +113,24 @@ export class PurchaseOrderTable implements OnInit {
const deliveryNoteDto: CreateDeliveryNoteDto = { const deliveryNoteDto: CreateDeliveryNoteDto = {
trackingNumber: trackingValue, trackingNumber: trackingValue,
expeditionDate: date, delivererId: deliverer.delivererId,
estimateDeliveryDate: estimateDate,
delivererId: 1,
productQuantities: productQuantities, productQuantities: productQuantities,
supplierId: purchaseOrder.supplierId supplierId: purchaseOrder.supplierId
}; };
await firstValueFrom(this.deliveryNoteService.createDeliveryNoteEndpoint(deliveryNoteDto)); await firstValueFrom(this.deliveryNoteService.createDeliveryNoteEndpoint(deliveryNoteDto));
this.notificationService.success('Succès', 'Bon de livraison créé avec succès'); this.notificationService.success('Succès', 'Bon de livraison créé avec succès');
} catch (e) { } catch {
console.error(e);
this.notificationService.error('Erreur', 'Erreur lors du transfert'); this.notificationService.error('Erreur', 'Erreur lors du transfert');
} }
this.onModalCancel(this.modalDeliverer());
this.purchaseOrdersLoading.set(false); this.purchaseOrdersLoading.set(false);
} }
async edit(id: number, updatePurchaseOrderComponent: PurchaseOrderForm) { async edit(id: number, updatePurchaseOrderComponent: PurchaseOrderForm) {
if (updatePurchaseOrderComponent.purchaseOrderForm.invalid) { if (updatePurchaseOrderComponent.purchaseOrderForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Formulaire invalide')
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
return; return;
} }
@@ -153,7 +139,7 @@ export class PurchaseOrderTable implements OnInit {
await firstValueFrom(this.purchaseOrdersService.patchPurchaseOrderPurchaseConditionsEndpoint(id, purchaseOrders)) await firstValueFrom(this.purchaseOrdersService.patchPurchaseOrderPurchaseConditionsEndpoint(id, purchaseOrders))
this.notificationService.success('Success', 'Bon de commande modifié') this.notificationService.success('Success', 'Bon de commande modifié')
} catch (e) { } catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification') this.notificationService.error('Erreur', 'Erreur lors de la modification')
} }
} }
@@ -162,15 +148,9 @@ export class PurchaseOrderTable implements OnInit {
this.purchaseOrdersLoading.set(true) this.purchaseOrdersLoading.set(true)
try { try {
await firstValueFrom(this.purchaseOrdersService.deleteProductFromPurchaseOrderEndpoint(productId, purchaseOrderId)) await firstValueFrom(this.purchaseOrdersService.deleteProductFromPurchaseOrderEndpoint(productId, purchaseOrderId))
this.notificationService.success( this.notificationService.success('Success', 'Suppression effectuée')
'Success', } catch {
'Suppression effectuée' this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
} }
this.purchaseOrdersLoading.set(false) this.purchaseOrdersLoading.set(false)
await this.fetchPurchaseOrder(); await this.fetchPurchaseOrder();
@@ -178,10 +158,7 @@ export class PurchaseOrderTable implements OnInit {
async editQuantity(productId: number, purchaseOrderId: number, updateQuantityComponent: QuantityForm) { async editQuantity(productId: number, purchaseOrderId: number, updateQuantityComponent: QuantityForm) {
if (updateQuantityComponent.quantityForm.invalid) { if (updateQuantityComponent.quantityForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Erreur d\'écriture dans le formulaire')
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
return; return;
} }
@@ -189,9 +166,9 @@ export class PurchaseOrderTable implements OnInit {
const quantity = updateQuantityComponent.quantityForm.getRawValue(); const quantity = updateQuantityComponent.quantityForm.getRawValue();
await firstValueFrom(this.purchaseOrdersService.patchPurchaseProductQuantityEndpoint(productId, purchaseOrderId, quantity)) await firstValueFrom(this.purchaseOrdersService.patchPurchaseProductQuantityEndpoint(productId, purchaseOrderId, quantity))
this.notificationService.success('Success', 'Quantité modifiée') this.notificationService.success('Success', 'Quantité modifiée');
} catch (e) { } catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification') this.notificationService.error('Erreur', 'Erreur lors de la modification');
} }
} }
@@ -202,12 +179,17 @@ export class PurchaseOrderTable implements OnInit {
this.modal().showModal(); this.modal().showModal();
} }
openDelivererModal(purchaseOrder: GetPurchaseOrderDto) {
this.selectedPurchaseOrder = {...purchaseOrder};
this.modalDeliverer().showModal();
}
async onModalOk(id: number, updatePurchaseOrderComponent: PurchaseOrderForm, modal: ModalNav) { async onModalOk(id: number, updatePurchaseOrderComponent: PurchaseOrderForm, modal: ModalNav) {
if (!this.selectedPurchaseOrder) return; if (!this.selectedPurchaseOrder) return;
await this.edit(id, updatePurchaseOrderComponent); await this.edit(id, updatePurchaseOrderComponent);
updatePurchaseOrderComponent.purchaseOrderForm.reset(); updatePurchaseOrderComponent.purchaseOrderForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchPurchaseOrder(); await this.fetchPurchaseOrder();
} }
@@ -227,7 +209,7 @@ export class PurchaseOrderTable implements OnInit {
await this.editQuantity(productId, purchaseOrderId, updateQuantityComponent); await this.editQuantity(productId, purchaseOrderId, updateQuantityComponent);
updateQuantityComponent.quantityForm.reset(); updateQuantityComponent.quantityForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchPurchaseOrder(); await this.fetchPurchaseOrder();
} }
} }
@@ -4,7 +4,7 @@ import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex"; import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input"; import {NzInputDirective} from "ng-zorro-antd/input";
import {GetDelivererDto, GetPurchaseProductDto} from "../../services/api"; import {GetPurchaseProductDto} from "../../services/api";
@Component({ @Component({
selector: 'app-quantity-form', selector: 'app-quantity-form',
@@ -57,14 +57,14 @@
</td> </td>
<td> <td>
<div style="justify-content: center; display: flex"> <div style="justify-content: center; display: flex">
<nz-icon nzType="plus-circle" nzTheme="outline" class="cursor-pointer text-green-700"/>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" <nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(quotation)"></nz-icon> (click)="openEditModal(quotation)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
@if (admin()) {
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700" <nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700"
(click)="delete(quotation.id)"/> (click)="delete(quotation.id)"/>
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
}
<nz-icon nzType="export" (click)="export(quotation.id)" nzTheme="outline" <nz-icon nzType="export" (click)="export(quotation.id)" nzTheme="outline"
class="cursor-pointer text-green-700"/> class="cursor-pointer text-green-700"/>
</div> </div>
@@ -14,6 +14,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs"; import {firstValueFrom} from "rxjs";
import {FileService} from "../../services/file.service"; import {FileService} from "../../services/file.service";
import {QuantityForm} from "../quantity-form/quantity-form"; import {QuantityForm} from "../quantity-form/quantity-form";
import {AuthService} from "../../services/auth.service";
@Component({ @Component({
selector: 'app-quotation-table', selector: 'app-quotation-table',
@@ -34,13 +35,18 @@ export class QuotationTable implements OnInit {
private quotationsService = inject(QuotationsService); private quotationsService = inject(QuotationsService);
private notificationService = inject(NzNotificationService); private notificationService = inject(NzNotificationService);
private fileService = inject(FileService); private fileService = inject(FileService);
private authService = inject(AuthService);
quotations = signal<GetQuotationDto[]>([]); quotations = signal<GetQuotationDto[]>([]);
quotationsLoading = signal<boolean>(false); quotationsLoading = signal<boolean>(false);
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav'); modal = viewChild.required<ModalNav>('modalNav');
modalQuantity = viewChild.required<ModalNav>('modalQuantity'); modalQuantity = viewChild.required<ModalNav>('modalQuantity');
async ngOnInit() { async ngOnInit() {
await this.fetchQuotations(); await this.fetchQuotations();
this.admin.set(this.authService.isAdmin());
} }
async fetchQuotations() { async fetchQuotations() {
@@ -49,11 +55,8 @@ export class QuotationTable implements OnInit {
try { try {
const quotations = await firstValueFrom(this.quotationsService.getAllQuotationEndpoint()) const quotations = await firstValueFrom(this.quotationsService.getAllQuotationEndpoint())
this.quotations.set(quotations); this.quotations.set(quotations);
} catch (e) { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Erreur lors du chargement des devis')
'Erreur',
'Erreur de communication avec l\'API'
)
} }
this.quotationsLoading.set(false) this.quotationsLoading.set(false)
} }
@@ -62,15 +65,9 @@ export class QuotationTable implements OnInit {
this.quotationsLoading.set(true) this.quotationsLoading.set(true)
try { try {
await firstValueFrom(this.quotationsService.deleteQuotationEndpoint(quotation)) await firstValueFrom(this.quotationsService.deleteQuotationEndpoint(quotation))
this.notificationService.success( this.notificationService.success('Success', 'Suppression effectuée')
'Success', } catch {
'Suppression effectuée' this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
} }
this.quotationsLoading.set(false) this.quotationsLoading.set(false)
await this.fetchQuotations(); await this.fetchQuotations();
@@ -83,12 +80,8 @@ export class QuotationTable implements OnInit {
this.quotationsService.getQuotationPdfEndpoint(quotationId, "response") this.quotationsService.getQuotationPdfEndpoint(quotationId, "response")
); );
this.fileService.downloadBlob(pdf) this.fileService.downloadBlob(pdf)
} catch (e) { } catch {
console.error(e); this.notificationService.error('Erreur', 'Impossible de générer un PDF');
this.notificationService.error(
'Erreur',
'Impossible de générer un PDF'
);
} }
this.quotationsLoading.set(false) this.quotationsLoading.set(false)
} }
@@ -103,8 +96,7 @@ export class QuotationTable implements OnInit {
const quotations = updateQuotationComponent.quotationForm.getRawValue(); const quotations = updateQuotationComponent.quotationForm.getRawValue();
await firstValueFrom(this.quotationsService.updateQuotationEndpoint(id, quotations)); await firstValueFrom(this.quotationsService.updateQuotationEndpoint(id, quotations));
this.notificationService.success('Success', 'Devis modifié') this.notificationService.success('Success', 'Devis modifié')
} catch (e) { } catch {
console.error(e)
this.notificationService.error('Erreur', 'Erreur lors de la modification') this.notificationService.error('Erreur', 'Erreur lors de la modification')
} }
} }
@@ -113,15 +105,9 @@ export class QuotationTable implements OnInit {
this.quotationsLoading.set(true) this.quotationsLoading.set(true)
try { try {
await firstValueFrom(this.quotationsService.deleteProductFromQuotationEndpoint(productId, quotationId)) await firstValueFrom(this.quotationsService.deleteProductFromQuotationEndpoint(productId, quotationId))
this.notificationService.success( this.notificationService.success('Success', 'Suppression effectuée')
'Success', } catch {
'Suppression effectuée' this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
} }
this.quotationsLoading.set(false) this.quotationsLoading.set(false)
await this.fetchQuotations(); await this.fetchQuotations();
@@ -129,10 +115,7 @@ export class QuotationTable implements OnInit {
async editQuantity(productId: number, quotationId: number, updateQuantityComponent: QuantityForm) { async editQuantity(productId: number, quotationId: number, updateQuantityComponent: QuantityForm) {
if (updateQuantityComponent.quantityForm.invalid) { if (updateQuantityComponent.quantityForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Formulaire invalide')
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
return; return;
} }
@@ -141,7 +124,7 @@ export class QuotationTable implements OnInit {
await firstValueFrom(this.quotationsService.patchQuotationProductQuantityEndpoint(productId, quotationId, quantity)) await firstValueFrom(this.quotationsService.patchQuotationProductQuantityEndpoint(productId, quotationId, quantity))
this.notificationService.success('Success', 'Quantité modifiée') this.notificationService.success('Success', 'Quantité modifiée')
} catch (e) { } catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification') this.notificationService.error('Erreur', 'Erreur lors de la modification')
} }
} }
@@ -158,7 +141,7 @@ export class QuotationTable implements OnInit {
await this.edit(id, updateQuotationComponent); await this.edit(id, updateQuotationComponent);
updateQuotationComponent.quotationForm.reset(); updateQuotationComponent.quotationForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchQuotations(); await this.fetchQuotations();
} }
@@ -178,7 +161,7 @@ export class QuotationTable implements OnInit {
await this.editQuantity(productId, quotationId, updateQuantityComponent); await this.editQuantity(productId, quotationId, updateQuantityComponent);
updateQuantityComponent.quantityForm.reset(); updateQuantityComponent.quantityForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchQuotations(); await this.fetchQuotations();
} }
} }
-36
View File
@@ -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);
}
-10
View File
@@ -1,10 +0,0 @@
<form nz-form nzLayout="horizontal" [formGroup]="searchForm">
<nz-form-item nz-flex>
<nz-form-control nzSpan="12">
<div class="group">
<nz-icon nzType="search" nzTheme="outline" class="mr-2 text-xl" (click)="OnSearch()"></nz-icon>
<input class="input" placeholder="Rechercher" formControlName="searchValue" (input)="OnSearch()"/>
</div>
</nz-form-control>
</nz-form-item>
</form>
-35
View File
@@ -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<string>(null)
})
searchEvent = output<string>();
OnSearch(): void {
const raw = this.searchForm.controls['searchValue'].value ?? '';
const value = String(raw).trim();
this.searchEvent.emit(value);
}
}
@@ -4,12 +4,13 @@
<div class="row"> <div class="row">
<div class="row-left"> <div class="row-left">
@if (settings().logo) { @if (settings().logo) {
<img [src]="'data:image/jpeg;base64,' + settings().logo" alt=""/> <img [src]="settings().logo" alt=""/>
} @else { } @else {
<img [src]="setting.logo" alt="logo"> <img [src]="setting.logo" alt="logo">
} }
</div> </div>
@if (admin()){
<div class="row-right"> <div class="row-right">
<nz-form-item> <nz-form-item>
<nz-form-label nzSpan="9">Logo</nz-form-label> <nz-form-label nzSpan="9">Logo</nz-form-label>
@@ -19,18 +20,26 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
} @else {
<div class="row-right">
<nz-form-item>
<p class="text-red-600">Vous ne pouvez pas modifier le logo</p>
</nz-form-item>
</div>
}
</div> </div>
<!-- Signature --> <!-- Signature -->
<div class="row"> <div class="row">
<div class="row-left"> <div class="row-left">
@if (settings().electronicSignature) { @if (settings().electronicSignature) {
<img [src]="'data:image/jpeg;base64,' + settings().electronicSignature" alt=""/> <img [src]="settings().electronicSignature" alt=""/>
} @else { } @else {
<img [src]="setting.electronicSignature" alt="logo"> <img [src]="setting.electronicSignature" alt="logo">
} }
</div> </div>
@if (admin()) {
<div class="row-right"> <div class="row-right">
<nz-form-item> <nz-form-item>
<nz-form-label nzSpan="9">Signature</nz-form-label> <nz-form-label nzSpan="9">Signature</nz-form-label>
@@ -40,5 +49,12 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
} @else {
<div class="row-right">
<nz-form-item>
<p class="text-red-600">Vous ne pouvez pas modifier la signature</p>
</nz-form-item>
</div>
}
</div> </div>
</form> </form>
@@ -8,6 +8,7 @@ import {firstValueFrom} from "rxjs";
import {GetSettingDto, SettingsService} from "../../services/api"; import {GetSettingDto, SettingsService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification"; import {NzNotificationService} from "ng-zorro-antd/notification";
import imageCompression from "browser-image-compression"; import imageCompression from "browser-image-compression";
import {AuthService} from "../../services/auth.service";
@Component({ @Component({
selector: 'app-setting-form', selector: 'app-setting-form',
@@ -27,8 +28,10 @@ import imageCompression from "browser-image-compression";
export class SettingForm implements OnInit { export class SettingForm implements OnInit {
private settingsService = inject(SettingsService); private settingsService = inject(SettingsService);
private notificationService = inject(NzNotificationService); private notificationService = inject(NzNotificationService);
private authService = inject(AuthService);
settings = signal<GetSettingDto>({}); settings = signal<GetSettingDto>({});
admin = signal<boolean>(false);
setting: SettingInfo = { setting: SettingInfo = {
logo: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png', 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() { async ngOnInit() {
await this.fetchSettings(); await this.fetchSettings();
this.admin.set(this.authService.isAdmin());
} }
async fetchSettings() { async fetchSettings() {
@@ -49,10 +53,7 @@ export class SettingForm implements OnInit {
const settingsPicture = await firstValueFrom(this.settingsService.getSettingEndpoint()); const settingsPicture = await firstValueFrom(this.settingsService.getSettingEndpoint());
this.settings.set(settingsPicture); this.settings.set(settingsPicture);
} catch { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Aucun paramètre défini')
'Erreur',
'Aucun paramètre défini'
)
} }
} }
@@ -78,7 +79,7 @@ export class SettingForm implements OnInit {
} }
await this.fetchSettings(); await this.fetchSettings();
} catch { } catch {
this.notificationService.error('Erreur', "Erreur de communication avec l'API"); this.notificationService.error('Erreur', 'Impossible de changer les paramètres actuellement');
} }
this.settingForm.reset(); this.settingForm.reset();
@@ -6,7 +6,7 @@
</nz-form-label> </nz-form-label>
<nz-form-control nzSpan="4" nzErrorTip="Requis"> <nz-form-control nzSpan="4" nzErrorTip="Requis">
<input nz-input type="number" placeholder="12345" formControlName="minimalQuantity"> <input nz-input type="number" placeholder="0" formControlName="minimalQuantity">
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</form> </form>
@@ -1,18 +1,16 @@
<nz-table <nz-table
[nzData]="filteredProducts()" [nzData]="products()"
[nzFrontPagination]="false" [nzFrontPagination]="false"
[nzLoading]="productsLoading()" [nzLoading]="productsLoading()"
(nzCurrentPageDataChange)="onCurrentPageDataChange($event)"
> >
<thead> <thead>
<tr class="text-center"> <tr class="text-center">
<th nzWidth="40px"> <th nzWidth="40px">
<label <label nz-checkbox
nz-checkbox
[(ngModel)]="checked" [(ngModel)]="checked"
[nzIndeterminate]="indeterminate" [nzIndeterminate]="indeterminate"
(ngModelChange)="onAllChecked($event)" (ngModelChange)="allCheck($event)">
></label> </label>
</th> </th>
<th>Nom</th> <th>Nom</th>
<th>Référence</th> <th>Référence</th>
@@ -27,16 +25,15 @@
</thead> </thead>
<tbody class="text-center"> <tbody class="text-center">
@for (product of filteredProducts(); track product.id) { @for (product of products(); track product.id) {
<tr> <tr>
<td nzWidth="40px"> <td nzWidth="40px">
<label <label
nz-checkbox nz-checkbox
[ngModel]="setOfCheckedId.has(product.id)" [ngModel]="selectedIds.includes(product.id)"
(ngModelChange)="onItemChecked(product.id, $event)" (ngModelChange)="onItemChecked(product.id, $event)"
></label> ></label>
</td> </td>
<td>{{ product.name }}</td> <td>{{ product.name }}</td>
<td>{{ product.references }}</td> <td>{{ product.references }}</td>
<td>{{ product.nec }}</td> <td>{{ product.nec }}</td>
@@ -49,9 +46,11 @@
<div style="justify-content: center; display: flex"> <div style="justify-content: center; display: flex">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" <nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(product)"></nz-icon> (click)="openEditModal(product)"></nz-icon>
@if (admin()) {
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(product.id)" <nz-icon nzType="delete" nzTheme="outline" (click)="delete(product.id)"
class="text-red-600 cursor-pointer"></nz-icon> class="text-red-600 cursor-pointer"></nz-icon>
}
</div> </div>
</td> </td>
</tr> </tr>
+74 -121
View File
@@ -1,14 +1,15 @@
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 {NzTableComponent, NzThMeasureDirective} from "ng-zorro-antd/table";
import {ModalNav} from "../modal-nav/modal-nav"; import {ModalNav} from "../modal-nav/modal-nav";
import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzIconDirective} from "ng-zorro-antd/icon";
import {StockForm} from "../stock-form/stock-form"; import {StockForm} from "../stock-form/stock-form";
import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzDividerComponent} from "ng-zorro-antd/divider";
import {FormsModule} from "@angular/forms"; import {FormsModule} from "@angular/forms";
import {NzCheckboxComponent} from "ng-zorro-antd/checkbox";
import {GetProductDto, ProductsService, WarehouseproductsService} from "../../services/api"; import {GetProductDto, ProductsService, WarehouseproductsService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification"; import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs"; import {firstValueFrom} from "rxjs";
import {NzCheckboxComponent} from "ng-zorro-antd/checkbox";
import {AuthService} from "../../services/auth.service";
interface ProductWithQuantity extends GetProductDto { interface ProductWithQuantity extends GetProductDto {
totalQuantity?: number; totalQuantity?: number;
@@ -23,8 +24,8 @@ interface ProductWithQuantity extends GetProductDto {
StockForm, StockForm,
NzDividerComponent, NzDividerComponent,
FormsModule, FormsModule,
NzCheckboxComponent,
NzThMeasureDirective, NzThMeasureDirective,
NzCheckboxComponent,
], ],
templateUrl: './stock-table.html', templateUrl: './stock-table.html',
styleUrl: './stock-table.css', styleUrl: './stock-table.css',
@@ -34,109 +35,52 @@ export class StockTable implements OnInit {
private productsService = inject(ProductsService); private productsService = inject(ProductsService);
private wareHousseProductsService = inject(WarehouseproductsService) private wareHousseProductsService = inject(WarehouseproductsService)
private notificationService = inject(NzNotificationService) private notificationService = inject(NzNotificationService)
private authService = inject(AuthService);
products = signal<ProductWithQuantity[]>([]); products = signal<ProductWithQuantity[]>([]);
productsLoading = signal<boolean>(false); productsLoading = signal<boolean>(false);
updateProduct = viewChild.required<StockForm>('stockForm'); admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav'); modal = viewChild.required<ModalNav>('modalNav');
checked = false; selectionChange = output<number[]>();
indeterminate = false; productsTables = output<GetProductDto[]>();
setOfCheckedId = new Set<number>();
selectionChange = output<boolean>()
currentPageData: GetProductDto[] = [];
private searchQuery = signal<string>(''); selectedProduct: GetProductDto | null = null;
checked: boolean = false;
filteredProducts = computed(() => { indeterminate: boolean = false;
const q = this.searchQuery().toLowerCase().trim(); selectedIds: number[] = [];
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);
}
async ngOnInit() { async ngOnInit() {
await this.fetchProducts(); await this.fetchProducts();
} this.admin.set(this.authService.isAdmin());
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() { async fetchProducts() {
this.productsLoading.set(true); this.productsLoading.set(true);
try { try {
const products = await firstValueFrom(this.productsService.getAllProductsEndpoint()); const products = await firstValueFrom(this.productsService.getAllProductsEndpoint());
this.productsTables.emit(products);
// transforme chaque produit en ProductWithQuantity const productsWithQuantity = await Promise.all(
const productsWithQuantity: ProductWithQuantity[] = products.map(p => ({...p})); products.map(async (x) => {
try {
this.products.set(productsWithQuantity); const quantity = await firstValueFrom(this.wareHousseProductsService.getTotalQuantityEndpoint(x.id));
return {
// récupérer la quantité pour chaque produit en parallèle ...x,
await Promise.all(productsWithQuantity.map(p => this.fetchTotalQuantity(p))); totalQuantity: quantity.totalQuantity ?? 0
};
// déclencher la mise à jour du signal } catch {
this.products.set([...productsWithQuantity]); return {
} catch (e) { ...x,
this.notificationService.error( totalQuantity: 0
'Erreur', };
'Erreur de communication avec l\'API' }
})
); );
this.products.set(productsWithQuantity);
} catch {
this.notificationService.error('Erreur', 'Impossible de charger le catalogue');
} }
this.productsLoading.set(false); this.productsLoading.set(false);
} }
@@ -144,48 +88,28 @@ export class StockTable implements OnInit {
async delete(productId: number) { async delete(productId: number) {
try { try {
await firstValueFrom(this.productsService.deleteProductEndpoint(productId)) await firstValueFrom(this.productsService.deleteProductEndpoint(productId))
this.notificationService.success( this.notificationService.success('Success', 'Suppression effectuée');
'Success', } catch {
'Suppression effectuée' this.notificationService.error('Erreur', 'Impossible de supprimer la ligne');
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
} }
await this.fetchProducts(); await this.fetchProducts();
} }
async edit(id: number, updateProductComponent: StockForm) { async edit(id: number, updateProductComponent: StockForm) {
if (updateProductComponent.stockForm.invalid) { if (updateProductComponent.stockForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Formulaire invalide')
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
return; return;
} }
try { try {
const products = updateProductComponent.stockForm.getRawValue(); const products = updateProductComponent.stockForm.getRawValue();
await firstValueFrom(this.productsService.patchProductMinimalStockEndpoint(id, products)) await firstValueFrom(this.productsService.patchProductMinimalStockEndpoint(id, products));
await this.fetchProducts();
this.notificationService.success( this.notificationService.success('Success', 'Limite de stock modifiée');
'Success', } catch {
'Limite de stock modifiée' this.notificationService.error('Erreur', 'Erreur lors de la modification');
)
} catch (e) {
console.error(e);
this.notificationService.error(
'Erreur',
'Erreur lors de la modification'
)
} }
} }
selectedProduct: GetProductDto | null = null;
openEditModal(product: GetProductDto) { openEditModal(product: GetProductDto) {
this.selectedProduct = {...product}; this.selectedProduct = {...product};
this.modal().showModal(); this.modal().showModal();
@@ -193,14 +117,43 @@ export class StockTable implements OnInit {
async onModalOk(productId: number, updateProductComponent: StockForm, modal: ModalNav) { async onModalOk(productId: number, updateProductComponent: StockForm, modal: ModalNav) {
if (!this.selectedProduct) return; if (!this.selectedProduct) return;
await this.edit(productId, updateProductComponent); await this.edit(productId, updateProductComponent);
updateProductComponent.stockForm.reset(); updateProductComponent.stockForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchProducts(); await this.fetchProducts();
} }
onModalCancel(modal: ModalNav) { onModalCancel(modal: ModalNav) {
modal.isVisible = false; 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();
}
} }
@@ -22,6 +22,8 @@ import {GetSupplierDto} from "../../services/api";
styleUrl: './supplier-form.css', styleUrl: './supplier-form.css',
}) })
export class SupplierForm { export class SupplierForm {
supplier = input<GetSupplierDto>();
supplierForm: FormGroup = new FormGroup({ supplierForm: FormGroup = new FormGroup({
name: new FormControl<string>(null, [Validators.required]), name: new FormControl<string>(null, [Validators.required]),
email: new FormControl<string>(null, [Validators.required]), email: new FormControl<string>(null, [Validators.required]),
@@ -33,8 +35,6 @@ export class SupplierForm {
}) })
supplier = input<GetSupplierDto>();
constructor() { constructor() {
effect(() => { effect(() => {
if (this.supplier()) { if (this.supplier()) {
@@ -1,4 +1,4 @@
<nz-table [nzData]="filteredSuppliers()" <nz-table [nzData]="suppliers()"
[nzLoading]="suppliersLoading()" [nzLoading]="suppliersLoading()"
[nzFrontPagination]="false"> [nzFrontPagination]="false">
<thead> <thead>
@@ -15,7 +15,7 @@
</tr> </tr>
</thead> </thead>
<tbody style="text-align: center"> <tbody style="text-align: center">
@for (supplier of filteredSuppliers(); track supplier.id) { @for (supplier of suppliers(); track supplier.id) {
<tr> <tr>
<td>{{ supplier.name }}</td> <td>{{ supplier.name }}</td>
<td>{{ supplier.phone }}</td> <td>{{ supplier.phone }}</td>
@@ -26,7 +26,7 @@
<td>{{ supplier.deliveryDelay }} jours</td> <td>{{ supplier.deliveryDelay }} jours</td>
<td> <td>
<app-modal-button type="link" [name]="'Voir les produits'" size="45%"> <app-modal-button type="link" [name]="'Voir les produits'" size="45%">
<nz-table [nzData]="filteredSuppliers()" [nzFrontPagination]="false"> <nz-table [nzData]="suppliers()" [nzFrontPagination]="false">
<thead> <thead>
<tr class="text-center"> <tr class="text-center">
<th>Produit</th> <th>Produit</th>
@@ -46,10 +46,12 @@
<nz-icon nzType="edit" nzTheme="outline" <nz-icon nzType="edit" nzTheme="outline"
class="cursor-pointer text-gray-600 hover:text-gray-900" class="cursor-pointer text-gray-600 hover:text-gray-900"
(click)="openEditProductModal(product, supplier.id)"></nz-icon> (click)="openEditProductModal(product, supplier.id)"></nz-icon>
@if (admin()) {
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" <nz-icon nzType="delete" nzTheme="outline"
class="cursor-pointer text-red-600 hover:text-red-800" class="cursor-pointer text-red-600 hover:text-red-800"
(click)="deleteProduct(product.productId, supplier.id)"></nz-icon> (click)="deleteProduct(product.productId, supplier.id)"></nz-icon>
}
</div> </div>
</td> </td>
</tr> </tr>
@@ -62,9 +64,11 @@
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" <nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(supplier)"></nz-icon> (click)="openEditModal(supplier)"></nz-icon>
@if (admin()) {
<nz-divider nzType="vertical"></nz-divider> <nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(supplier.id)" <nz-icon nzType="delete" nzTheme="outline" (click)="delete(supplier.id)"
class="text-red-600 cursor-pointer"></nz-icon> class="text-red-600 cursor-pointer"></nz-icon>
}
</div> </div>
</td> </td>
</tr> </tr>
@@ -1,4 +1,4 @@
import {Component, computed, inject, OnInit, signal, viewChild} from '@angular/core'; import {Component, inject, OnInit, signal, viewChild} from '@angular/core';
import {ModalNav} from "../modal-nav/modal-nav"; import {ModalNav} from "../modal-nav/modal-nav";
import {NzDividerComponent} from "ng-zorro-antd/divider"; import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzIconDirective} from "ng-zorro-antd/icon"; import {NzIconDirective} from "ng-zorro-antd/icon";
@@ -9,6 +9,7 @@ import {GetPriceDto, GetSupplierDto, PricesService, SuppliersService} from "../.
import {NzNotificationService} from "ng-zorro-antd/notification"; import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs"; import {firstValueFrom} from "rxjs";
import {PriceForm} from "../price-form/price-form"; import {PriceForm} from "../price-form/price-form";
import {AuthService} from "../../services/auth.service";
@Component({ @Component({
selector: 'app-supplier-table', selector: 'app-supplier-table',
@@ -29,34 +30,22 @@ export class SupplierTable implements OnInit {
private suppliersService = inject(SuppliersService); private suppliersService = inject(SuppliersService);
private pricesService = inject(PricesService); private pricesService = inject(PricesService);
private notificationService = inject(NzNotificationService); private notificationService = inject(NzNotificationService);
private authService = inject(AuthService);
suppliers = signal<GetSupplierDto[]>([]); suppliers = signal<GetSupplierDto[]>([]);
suppliersLoading = signal<boolean>(false); suppliersLoading = signal<boolean>(false);
updateSupplier = viewChild.required<SupplierForm>('supplierForm'); admin = signal<boolean>(false);
supplierModal = viewChild.required<ModalNav>('supplierModal'); supplierModal = viewChild.required<ModalNav>('supplierModal');
productModal = viewChild.required<ModalNav>('productModal'); productModal = viewChild.required<ModalNav>('productModal');
selectedSupplier: GetSupplierDto | null = null; selectedSupplier: GetSupplierDto | null = null;
selectedProduct: GetPriceDto | null = null; selectedProduct: GetPriceDto | null = null;
selectedProductSupplierId: number | null = null; selectedProductSupplierId: number | null = null;
async ngOnInit() { async ngOnInit() {
await this.fetchSuppliers(); await this.fetchSuppliers();
} this.admin.set(this.authService.isAdmin());
private searchQuery = signal<string>('');
filteredSuppliers = computed(() => {
const q = this.searchQuery().toLowerCase().trim();
if (!q) return this.suppliers();
return this.suppliers().filter(s => {
const name = (s.name ?? '').toLowerCase();
return name.includes(q);
});
});
applySearch(query: string) {
this.searchQuery.set(query);
} }
async fetchSuppliers() { async fetchSuppliers() {
@@ -64,7 +53,7 @@ export class SupplierTable implements OnInit {
try { try {
const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint()); const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint());
this.suppliers.set(suppliers); this.suppliers.set(suppliers);
} catch (e) { } catch {
this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); this.notificationService.error('Erreur', 'Erreur de communication avec l\'API');
} }
this.suppliersLoading.set(false); this.suppliersLoading.set(false);
@@ -79,8 +68,7 @@ export class SupplierTable implements OnInit {
const suppliers = updateSupplierComponent.supplierForm.getRawValue(); const suppliers = updateSupplierComponent.supplierForm.getRawValue();
await firstValueFrom(this.suppliersService.updateSupplierEndpoint(id, suppliers)); await firstValueFrom(this.suppliersService.updateSupplierEndpoint(id, suppliers));
this.notificationService.success('Success', 'Fournisseur modifié'); this.notificationService.success('Success', 'Fournisseur modifié');
} catch (e) { } catch {
console.error(e);
this.notificationService.error('Erreur', 'Erreur lors de la modification'); this.notificationService.error('Erreur', 'Erreur lors de la modification');
} }
} }
@@ -90,7 +78,7 @@ export class SupplierTable implements OnInit {
await firstValueFrom(this.suppliersService.deleteSupplierEndpoint(supplier)); await firstValueFrom(this.suppliersService.deleteSupplierEndpoint(supplier));
this.notificationService.success('Succès', 'Suppression effectuée'); this.notificationService.success('Succès', 'Suppression effectuée');
await this.fetchSuppliers(); await this.fetchSuppliers();
} catch (e) { } catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne'); this.notificationService.error('Erreur', 'Impossible de supprimer la ligne');
} }
} }
@@ -122,13 +110,13 @@ export class SupplierTable implements OnInit {
modal: ModalNav modal: ModalNav
) { ) {
if (productId == null || supplierId == null || !this.selectedProduct) { if (productId == null || supplierId == null || !this.selectedProduct) {
this.notificationService.error('Erreur', 'Identifiants produit/fournisseur manquants'); this.notificationService.error('Erreur', 'Identifiants produit ou fournisseur manquants');
return; return;
} }
await this.editPrice(productId, supplierId, updateProductComponent); await this.editPrice(productId, supplierId, updateProductComponent);
updateProductComponent.priceForm.reset(); updateProductComponent.priceForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchSuppliers(); await this.fetchSuppliers();
} }
@@ -150,8 +138,7 @@ export class SupplierTable implements OnInit {
}; };
await firstValueFrom(this.pricesService.patchPriceEndpoint(productId, supplierId, body)); await firstValueFrom(this.pricesService.patchPriceEndpoint(productId, supplierId, body));
this.notificationService.success('Success', 'Prix modifié'); this.notificationService.success('Success', 'Prix modifié');
} catch (e) { } catch {
console.error(e);
this.notificationService.error('Erreur', 'Erreur lors de la modification'); this.notificationService.error('Erreur', 'Erreur lors de la modification');
} }
} }
@@ -162,7 +149,7 @@ export class SupplierTable implements OnInit {
await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idSupplier, idProduct)); await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idSupplier, idProduct));
this.notificationService.success('Succès', 'Produit supprimé'); this.notificationService.success('Succès', 'Produit supprimé');
await this.fetchSuppliers(); await this.fetchSuppliers();
} catch (e) { } catch {
this.notificationService.error('Erreur', 'Impossible de supprimer le produit'); this.notificationService.error('Erreur', 'Impossible de supprimer le produit');
} }
} }
+12 -33
View File
@@ -23,9 +23,10 @@ import {firstValueFrom} from "rxjs";
export class UserTable implements OnInit { export class UserTable implements OnInit {
private usersService = inject(UsersService); private usersService = inject(UsersService);
private notificationService = inject(NzNotificationService) private notificationService = inject(NzNotificationService)
users = signal<GetUserDto[]>([]); users = signal<GetUserDto[]>([]);
usersLoading = signal<boolean>(false); usersLoading = signal<boolean>(false);
updateUser = viewChild.required<ProfilForm>('profilForm');
modal = viewChild.required<ModalNav>('modalNav'); modal = viewChild.required<ModalNav>('modalNav');
async ngOnInit() { async ngOnInit() {
@@ -38,11 +39,8 @@ export class UserTable implements OnInit {
try { try {
const users = await firstValueFrom(this.usersService.getAllUsersEndpoint()) const users = await firstValueFrom(this.usersService.getAllUsersEndpoint())
this.users.set(users); this.users.set(users);
} catch (e) { } catch {
this.notificationService.error( this.notificationService.error('Erreur', 'Impossible de charger les utilisateurs')
'Erreur',
'Erreur de communication avec l\'API'
)
} }
this.usersLoading.set(false) this.usersLoading.set(false)
} }
@@ -50,25 +48,16 @@ export class UserTable implements OnInit {
async delete(user: number) { async delete(user: number) {
try { try {
await firstValueFrom(this.usersService.deleteUserEndpoint(user)) await firstValueFrom(this.usersService.deleteUserEndpoint(user))
this.notificationService.success( this.notificationService.success('Success', 'Suppression effectuée')
'Success', } catch {
'Suppression effectuée' this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
} }
await this.fetchUsers(); await this.fetchUsers();
} }
async edit(id: number, updateUserComponent: ProfilForm) { async edit(id: number, updateUserComponent: ProfilForm) {
if (updateUserComponent.profilForm.invalid) { if (updateUserComponent.profilForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Formulaire invalide')
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
return; return;
} }
@@ -76,15 +65,9 @@ export class UserTable implements OnInit {
const users = updateUserComponent.profilForm.getRawValue(); const users = updateUserComponent.profilForm.getRawValue();
await firstValueFrom(this.usersService.updateUserEndpoint(id, users)) await firstValueFrom(this.usersService.updateUserEndpoint(id, users))
this.notificationService.success( this.notificationService.success('Success', 'Utilisateur modifié')
'Success', } catch {
'Utilisateur modifié' this.notificationService.error('Erreur', 'Erreur lors de la modification')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur lors de la modification'
)
} }
} }
@@ -100,15 +83,11 @@ export class UserTable implements OnInit {
await this.edit(userId, updateUserComponent); await this.edit(userId, updateUserComponent);
updateUserComponent.profilForm.reset(); updateUserComponent.profilForm.reset();
modal.isVisible = false; this.onModalCancel(modal);
await this.fetchUsers(); await this.fetchUsers();
} }
onModalCancel(modal: ModalNav) { onModalCancel(modal: ModalNav) {
modal.isVisible = false; modal.isVisible = false;
} }
filterUser(input: string, option: any) {
return option.nzLabel.toLowerCase().includes(input.toLowerCase());
}
} }
+14
View File
@@ -0,0 +1,14 @@
import { inject } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService} from "../services/auth.service";
export const authGuard = async () => {
const auth = inject(AuthService);
const router = inject(Router);
if(!auth.userAuthenticated()) {
await router.navigateByUrl('/login');
return false;
}
return true
};
+48
View File
@@ -0,0 +1,48 @@
import {HttpInterceptorFn, HttpErrorResponse, HttpRequest, HttpHandlerFn} from '@angular/common/http';
import {inject} from '@angular/core';
import {AuthService} from '../services/auth.service';
import {RefreshService} from '../services/api';
import {NzNotificationService} from 'ng-zorro-antd/notification';
import {catchError, switchMap, throwError} from 'rxjs';
export const authInterceptor: HttpInterceptorFn = (req: HttpRequest<any>, next: HttpHandlerFn) => {
const authService = inject(AuthService);
const refreshService = inject(RefreshService);
const notification = inject(NzNotificationService);
const token = authService.getToken();
let authReq = req;
if (token) {
authReq = req.clone({
setHeaders: {Authorization: `Bearer ${token}`}
});
}
return next(authReq).pipe(
catchError((error: HttpErrorResponse) => {
if (error.status === 401 && token) {
return refreshService.refreshTokenEndpoint({token})
.pipe(
switchMap((res: any) => {
authService.setToken(res.token);
const newReq = req.clone({
setHeaders: {Authorization: `Bearer ${res.token}`}
});
return next(newReq);
}),
catchError((refreshErr) => {
authService.logout();
notification.error('Session expirée', 'Veuillez vous reconnecter.');
return throwError(() => refreshErr);
})
);
}
if (error.status === 403) {
notification.error('Accès refusé', 'Vous navez pas les droits pour cette action.');
}
return throwError(() => error);
})
);
};
-5
View File
@@ -1,5 +0,0 @@
export interface UserInfo {
name: string;
email: string;
fonction: string;
}
+27
View File
@@ -0,0 +1,27 @@
<div class="flex w-full px-4 gap-4 items-start mt-6">
<div class="w-1/2">
<app-delivery-validator></app-delivery-validator>
</div>
<div class="w-1/2 mt-10 flex flex-col gap-4">
<p class="text-2xl font-bold">Tableau de bord</p>
<div class="grid grid-cols-2 gap-4">
<app-info-card color="#f59e0b" icon="inbox"
[value]="productsUnderLimitCount()"
description="Produits sous le seuil minimal.">
</app-info-card>
<app-info-card color="#3b82f6" icon="team"
[value]="deliversCount()+suppliersCount()"
description="Partenaires actifs.">
</app-info-card>
<app-info-card color="#10b981" icon="truck"
[value]="deliversCount()"
description="Livreurs partenaires.">
</app-info-card>
<app-info-card color="#ef4444" icon="shop"
[value]="suppliersCount()"
description="Fournisseurs partenaires.">
</app-info-card>
</div>
</div>
</div>
+65
View File
@@ -0,0 +1,65 @@
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, GetSupplierDto, ProductsService, SuppliersService} from "../../services/api";
import {firstValueFrom} from "rxjs";
import {StockAlert} from "../../services/stock.alert";
@Component({
selector: 'app-dashboard',
imports: [
InfoCard,
DeliveryValidator,
],
templateUrl: './dashboard.html',
styleUrl: './dashboard.css'
})
export class Dashboard {
private productsService = inject(ProductsService);
private deliverersService = inject(DeliverersService);
private suppliersService = inject(SuppliersService);
private notificationsService = inject(NzNotificationService);
private stockAlertService = inject(StockAlert);
deliversCount = signal<number>(0);
suppliersCount = signal<number>(0);
productsUnderLimitCount = signal<number>(0);
suppliers = signal<GetSupplierDto[]>([]);
async getDeliverers() {
try {
const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint());
this.deliversCount.set(deliverers.length);
} catch {
this.notificationsService.error('Erreur', 'Impossible de charger les transporteurs');
}
}
async getSuppliers() {
try {
const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint());
this.suppliers.set(suppliers);
this.suppliersCount.set(suppliers.length);
} catch {
this.notificationsService.error('Erreur', 'Impossible de charger les fournisseurs');
}
}
async getProductsUnderLimit() {
try {
const products = await firstValueFrom(this.productsService.getAllProductsUnderLimitEndpoint());
this.productsUnderLimitCount.set(products.length);
await this.stockAlertService.generatePurchaseOrder(products, this.suppliers());
} catch {
this.notificationsService.error('Error', 'Impossible de charger les produits.');
}
}
async ngOnInit() {
await this.getDeliverers();
await this.getSuppliers();
await this.getProductsUnderLimit();
}
}
+1 -5
View File
@@ -8,12 +8,8 @@
<app-deliverer-form #delivererForm></app-deliverer-form> <app-deliverer-form #delivererForm></app-deliverer-form>
</app-modal-button> </app-modal-button>
<div class="ml-95 w-150">
<app-search class="w-full"></app-search>
</div>
</div> </div>
<div class="mt-1"> <div class="mt-4">
<app-deliverer-table #delivererTable></app-deliverer-table> <app-deliverer-table #delivererTable></app-deliverer-table>
</div> </div>
+5 -16
View File
@@ -2,7 +2,6 @@ import {Component, inject, viewChild} from '@angular/core';
import {ModalButton} from "../../components/modal-button/modal-button"; import {ModalButton} from "../../components/modal-button/modal-button";
import {DelivererTable} from "../../components/deliverer-table/deliverer-table"; import {DelivererTable} from "../../components/deliverer-table/deliverer-table";
import {DelivererForm} from "../../components/deliverer-form/deliverer-form"; import {DelivererForm} from "../../components/deliverer-form/deliverer-form";
import {Search} from "../../components/search/search";
import {DeliverersService} from "../../services/api"; import {DeliverersService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification"; import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs"; import {firstValueFrom} from "rxjs";
@@ -13,7 +12,6 @@ import {firstValueFrom} from "rxjs";
ModalButton, ModalButton,
DelivererTable, DelivererTable,
DelivererForm, DelivererForm,
Search
], ],
templateUrl: './deliverer.html', templateUrl: './deliverer.html',
styleUrl: './deliverer.css', styleUrl: './deliverer.css',
@@ -28,7 +26,7 @@ export class Deliverer {
async onModalOk() { async onModalOk() {
await this.addDeliverer() await this.addDeliverer()
this.createDeliverer().delivererForm.reset(); this.createDeliverer().delivererForm.reset();
this.modal().isVisible = false; this.onModalCancel();
await this.delivererTable().fetchDeliverers() await this.delivererTable().fetchDeliverers()
} }
@@ -38,24 +36,15 @@ export class Deliverer {
async addDeliverer() { async addDeliverer() {
if (this.createDeliverer().delivererForm.invalid) { if (this.createDeliverer().delivererForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Formulaire invalide')
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
} }
try { try {
const deliverers = this.createDeliverer().delivererForm.getRawValue(); const deliverers = this.createDeliverer().delivererForm.getRawValue();
await firstValueFrom(this.deliverersService.createDelivererEndpoint(deliverers)) await firstValueFrom(this.deliverersService.createDelivererEndpoint(deliverers))
this.notificationService.success( this.notificationService.success('Success', 'Transporteur enregistré')
'Success', } catch {
'Transporteur enregistré' this.notificationService.error('Erreur', 'Erreur d\'enregistrement')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur d\'enregistrement'
)
} }
} }
} }
@@ -1,9 +1,3 @@
<div class="flex mt-2"> <div class="mt-2">
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<app-deliverery-note-table></app-deliverery-note-table> <app-deliverery-note-table></app-deliverery-note-table>
</div> </div>
@@ -1,14 +1,10 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table"; 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({ @Component({
selector: 'app-delivery-note', selector: 'app-delivery-note',
imports: [ imports: [
DelivereryNoteTable, DelivereryNoteTable,
Search
], ],
templateUrl: './delivery-note.html', templateUrl: './delivery-note.html',
styleUrl: './delivery-note.css', styleUrl: './delivery-note.css',
View File
+46
View File
@@ -0,0 +1,46 @@
<div class="grid grid-cols-9 min-h-screen bg-blue-950">
<div class="col-span-6 w-full h-full border rounded-r-4xl overflow-hidden">
<img src="https://www.pyro-fetes.com/wp-content/uploads/2023/03/5I9A3180-scaled.jpg"
class="w-full h-full object-cover"
alt=""
/>
</div>
<div class="col-span-3 w-full flex items-center justify-center">
<div class="flex flex-col items-center">
<img src="https://www.pyro-fetes.com/wp-content/uploads/2020/10/PyroFetes-logo-OR.png"
class="w-9/12 mb-10"
alt=""
/>
<div class="bg-white border rounded-2xl p-8 w-80 shadow-lg">
<form nz-form nzLayout="vertical" [formGroup]="loginForm">
<nz-form-item>
<nz-form-label nzRequired>
Nom d'utilisateur
</nz-form-label>
<nz-form-control nzErrorTip="Ce champ est requis">
<input nz-input placeholder="Nom d'utilisateur" formControlName="name">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label nzRequired class="mt-3">
Mot de passe
</nz-form-label>
<nz-form-control nzErrorTip="Ce champ est requis">
<input nz-input type="password" placeholder="Mot de passe" formControlName="password">
</nz-form-control>
</nz-form-item>
<button class="mt-4 rounded-xl w-full" nz-button nzType="primary" (click)="connectUser()">
Connexion
</button>
</form>
</div>
</div>
</div>
</div>
+43
View File
@@ -0,0 +1,43 @@
import {Component, inject, OnInit} from '@angular/core';
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 {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {AuthService} from "../../services/auth.service";
import {Router} from "@angular/router";
@Component({
selector: 'app-login',
imports: [
NzColDirective,
NzFormControlComponent,
NzFormDirective,
NzFormItemComponent,
NzFormLabelComponent,
NzInputDirective,
ReactiveFormsModule,
NzButtonComponent
],
templateUrl: './login.html',
styleUrl: './login.css',
})
export class Login implements OnInit {
private authService = inject(AuthService);
private router = inject(Router);
ngOnInit() {
this.authService.logout();
}
loginForm: FormGroup = new FormGroup({
name: new FormControl<string>(null, [Validators.required]),
password: new FormControl<string>(null, [Validators.required])
})
async connectUser() {
if (this.loginForm.invalid) return;
const ok = await this.authService.connectUser(this.loginForm.value.name, this.loginForm.value.password);
if (ok) await this.router.navigate(['/dashboard']);
}
}
@@ -1,10 +1,4 @@
<div class="flex mt-2"> <div class="mt-2">
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<app-purchase-order-table></app-purchase-order-table> <app-purchase-order-table></app-purchase-order-table>
</div> </div>
@@ -1,11 +1,9 @@
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"; import {PurchaseOrderTable} from "../../components/purchase-order-table/purchase-order-table";
@Component({ @Component({
selector: 'app-purchase-order', selector: 'app-purchase-order',
imports: [ imports: [
Search,
PurchaseOrderTable, PurchaseOrderTable,
], ],
templateUrl: './purchase-order.html', templateUrl: './purchase-order.html',
+1 -7
View File
@@ -1,9 +1,3 @@
<div class="flex mt-2"> <div class="mt-2">
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<app-quotation-table></app-quotation-table> <app-quotation-table></app-quotation-table>
</div> </div>
-2
View File
@@ -1,11 +1,9 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {Search} from "../../components/search/search";
import {QuotationTable} from "../../components/quotation-table/quotation-table"; import {QuotationTable} from "../../components/quotation-table/quotation-table";
@Component({ @Component({
selector: 'app-quotation', selector: 'app-quotation',
imports: [ imports: [
Search,
QuotationTable QuotationTable
], ],
templateUrl: './quotation.html', templateUrl: './quotation.html',
+29 -12
View File
@@ -1,14 +1,17 @@
<div class="flex mt-2"> <div class="flex mt-2">
@if (hasSelection) { @if (productIds().length) {
<app-modal-button #modalButtonPurchaseOrder <app-modal-button #modalButtonPurchaseOrder
(click)="openPurchaseOrderForm()" (click)="openPurchaseOrderForm()"
(ok)="onModalOk()" (ok)="onModalPurchaseOrderOk()"
(cancel)="onModalCancel()" (cancel)="onModalPurchaseOrderCancel()"
type="default" type="default"
name="Créer un bon de commande" name="Créer un bon de commande"
size="35%" size="35%"
class="ml-4"> class="ml-4">
<app-create-purchaseorder-form #purchaseOrderForm></app-create-purchaseorder-form> <app-create-purchaseorder-form #purchaseOrderForm
[suppliers]="suppliers()"
[products]="selectedProducts()">
</app-create-purchaseorder-form>
</app-modal-button> </app-modal-button>
<app-modal-button #modalButtonQuotation <app-modal-button #modalButtonQuotation
@@ -19,16 +22,30 @@
(click)="openQuotationForm()" (click)="openQuotationForm()"
(ok)="onModalQuotationOk()" (ok)="onModalQuotationOk()"
(cancel)="onModalQuotationCancel()"> (cancel)="onModalQuotationCancel()">
<app-create-quotation-form #quotationForm></app-create-quotation-form> <app-create-quotation-form #quotationForm
[suppliers]="suppliers()"
[products]="selectedProducts()">
</app-create-quotation-form>
</app-modal-button>
<app-modal-button #modalButtonSupplier
type="default"
name="Associer à un fournisseur"
size="35%"
class="ml-4"
(click)="openSupplierForm()"
(ok)="onModalSupplierOk()"
(cancel)="onModalSupplierCancel()">
<app-add-product-supplier-form #supplierForm
[suppliers]="suppliers()"
[products]="selectedProducts()">
</app-add-product-supplier-form>
</app-modal-button> </app-modal-button>
} }
<div class="ml-95 w-150">
<app-search (searchEvent)="onProductSearch($event)"></app-search>
</div>
</div> </div>
<div class="mt-1"> <div class="mt-4">
<app-stock-table #stockTable (selectionChange)="onSelectionChange($event)"></app-stock-table> <app-stock-table (selectionChange)="onSelectionChange($event)"
(productsTables)="products.set($event)">
</app-stock-table>
</div> </div>
+133 -62
View File
@@ -1,139 +1,210 @@
import {Component, inject, viewChild} from '@angular/core'; import {Component, inject, OnInit, signal, viewChild} from '@angular/core';
import {StockTable} from "../../components/stock-table/stock-table"; import {StockTable} from "../../components/stock-table/stock-table";
import {Search} from "../../components/search/search";
import {ModalButton} from "../../components/modal-button/modal-button"; 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 {CreatePurchaseorderForm} from "../../components/create-purchaseorder-form/create-purchaseorder-form";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {
CreatePurchaseOrderDto, CreateQuotationDto,
GetProductDto,
GetSupplierDto,
PurchaseordersService,
QuotationsService,
SuppliersService
} from "../../services/api";
import {firstValueFrom} from "rxjs";
import {CreateQuotationForm} from "../../components/create-quotation-form/create-quotation-form"; import {CreateQuotationForm} from "../../components/create-quotation-form/create-quotation-form";
import {AddProductSupplierForm} from "../../components/add-product-supplier-form/add-product-supplier-form";
@Component({ @Component({
selector: 'app-stock', selector: 'app-stock',
imports: [ imports: [
StockTable, StockTable,
Search,
ModalButton, ModalButton,
CreatePurchaseorderForm, CreatePurchaseorderForm,
CreateQuotationForm, CreateQuotationForm,
AddProductSupplierForm,
], ],
templateUrl: './stock.html', templateUrl: './stock.html',
styleUrl: './stock.css', styleUrl: './stock.css',
}) })
export class Stock { export class Stock implements OnInit {
createPurchaseOrder = viewChild.required<CreatePurchaseorderForm>('purchaseOrderForm'); createPurchaseOrder = viewChild.required<CreatePurchaseorderForm>('purchaseOrderForm');
createQuotation = viewChild.required<CreateQuotationForm>('quotationForm'); createQuotation = viewChild.required<CreateQuotationForm>('quotationForm');
productTable = viewChild.required<StockTable>('stockTable'); addProduct = viewChild.required<AddProductSupplierForm>('supplierForm');
private purchaseordersService = inject(PurchaseordersService)
private quotationsService = inject(QuotationsService)
private notificationService = inject(NzNotificationService)
modalButtonPurchaseOrder = viewChild.required<ModalButton>('modalButtonPurchaseOrder'); modalButtonPurchaseOrder = viewChild.required<ModalButton>('modalButtonPurchaseOrder');
modalButtonQuotation = viewChild.required<ModalButton>('modalButtonQuotation'); modalButtonQuotation = viewChild.required<ModalButton>('modalButtonQuotation');
modalButtonSupplier = viewChild.required<ModalButton>('modalButtonSupplier');
hasSelection = false; private purchaseOrdersService = inject(PurchaseordersService);
private quotationsService = inject(QuotationsService);
private suppliersService = inject(SuppliersService);
private notificationService = inject(NzNotificationService);
onSelectionChange(value: boolean) { products = signal<GetProductDto[]>([]);
this.hasSelection = value; suppliers = signal<GetSupplierDto[]>([]);
selectedProducts = signal([]);
productIds = signal<number[]>([]);
async ngOnInit() {
try {
const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint());
this.suppliers.set(suppliers);
} catch {
this.notificationService.error('Erreur', 'Impossible de charger les fournisseurs');
}
} }
onProductSearch(query: string) { onSelectionChange(ids: number[]) {
this.productTable().applySearch(query); this.productIds.set(ids);
this.selectedProducts.set(this.products().filter(x => ids.includes(x.id)));
}
openPurchaseOrderForm() {
this.createPurchaseOrder().addProductToForm();
}
openQuotationForm() {
this.createQuotation().addProductToForm();
}
openSupplierForm() {
this.addProduct().addProductToForm();
} }
async addPurchaseOrder() { async addPurchaseOrder() {
const form = this.createPurchaseOrder().createPurchaseOrderForm; const form = this.createPurchaseOrder().createPurchaseOrderForm;
if (form.invalid) { if (form.invalid) {
this.notificationService.error('Erreur', 'Formulaire invalide'); this.notificationService.error('Erreur', 'Formulaire invalide');
return; return;
} }
const orderLines = this.createPurchaseOrder().lines.value.map(line => ({
const orderLines = this.createPurchaseOrder().lines.value.map((line: { productId: any; quantity: any; }) => ({
productId: line.productId, productId: line.productId,
quantity: line.quantity quantity: line.quantity
})); }));
if (orderLines.length === 0) {
if (!orderLines.length) {
this.notificationService.error('Erreur', 'Aucun produit sélectionné'); this.notificationService.error('Erreur', 'Aucun produit sélectionné');
return; return;
} }
const purchaseOrder = {
purchaseConditions: form.get('purchaseConditions')!.value, const purchaseOrder: CreatePurchaseOrderDto = {
products: orderLines purchaseConditions: form.value.purchaseConditions,
products: orderLines,
supplierId: form.value.supplierId
}; };
try { try {
await firstValueFrom( await firstValueFrom(this.purchaseOrdersService.createPurchaseOrder(purchaseOrder));
this.purchaseordersService.createPurchaseOrder(purchaseOrder)
);
this.notificationService.success('Succès', 'Bon de commande créé'); 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.'); 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() { async addQuotation() {
if (this.createQuotation().createQuotationForm.invalid) { const form = this.createQuotation().createQuotationForm;
if (form.invalid) {
this.notificationService.error('Erreur', 'Formulaire invalide'); this.notificationService.error('Erreur', 'Formulaire invalide');
return; return;
} }
const orderLines = this.createQuotation().lines.value.map(line => ({
const orderLines = this.createQuotation().lines.value.map((line: { productId: any; quantity: any; }) => ({
productId: line.productId, productId: line.productId,
quantity: line.quantity quantity: line.quantity
})); }));
if (orderLines.length === 0) {
if (!orderLines.length) {
this.notificationService.error('Erreur', 'Aucun produit sélectionné'); this.notificationService.error('Erreur', 'Aucun produit sélectionné');
return; return;
} }
const quotation = {
message: this.createQuotation().createQuotationForm.get('message')!.value, const quotation: CreateQuotationDto = {
purchaseConditions: this.createQuotation().createQuotationForm.get('purchaseConditions')!.value, 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 products: orderLines
}; };
try { try {
await firstValueFrom( await firstValueFrom(this.quotationsService.createQuotationEndpoint(quotation));
this.quotationsService.createQuotationEndpoint(quotation)
);
this.notificationService.success('Succès', 'Devis créé'); this.notificationService.success('Succès', 'Devis créé');
} catch (e) { } catch {
console.log(this.createQuotation());
this.notificationService.error('Erreur', 'Erreur lors de la création du devis.'); this.notificationService.error('Erreur', 'Erreur lors de la création du devis.');
} }
}
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() { async onModalQuotationOk() {
console.log(this.createQuotation().createQuotationForm.getRawValue());
await this.addQuotation(); await this.addQuotation();
this.createQuotation().createQuotationForm.reset(); this.createQuotation().createQuotationForm.reset();
this.modalButtonQuotation().isVisible = false; this.modalButtonQuotation().isVisible = false;
await this.productTable().fetchProducts(); this.onModalQuotationCancel();
} }
onModalQuotationCancel() { onModalQuotationCancel() {
this.modalButtonQuotation().isVisible = false; this.modalButtonQuotation().isVisible = false;
} }
openQuotationForm() { async onModalSupplierOk() {
const selectedProducts = this.productTable().products().filter(p => await this.addProductFromSupplier();
this.productTable().selectedIds.includes(p.id) this.addProduct().addProductForm.reset();
); this.modalButtonSupplier().isVisible = false;
this.createQuotation().syncSelectedProducts(selectedProducts); this.onModalSupplierCancel();
}
onModalSupplierCancel() {
this.modalButtonSupplier().isVisible = false;
} }
} }
+1 -4
View File
@@ -8,11 +8,8 @@
<app-supplier-form #supplierForm></app-supplier-form> <app-supplier-form #supplierForm></app-supplier-form>
</app-modal-button> </app-modal-button>
<div class="ml-95 w-150">
<app-search (searchEvent)="onSupplierSearch($event)"></app-search>
</div>
</div> </div>
<div class="mt-1"> <div class="mt-4">
<app-supplier-table #supplierTable></app-supplier-table> <app-supplier-table #supplierTable></app-supplier-table>
</div> </div>
+5 -20
View File
@@ -1,5 +1,4 @@
import {Component, inject, viewChild} 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 {ModalButton} from "../../components/modal-button/modal-button";
import {SupplierTable} from "../../components/supplier-table/supplier-table"; import {SupplierTable} from "../../components/supplier-table/supplier-table";
import {SupplierForm} from "../../components/supplier-form/supplier-form"; import {SupplierForm} from "../../components/supplier-form/supplier-form";
@@ -10,7 +9,6 @@ import {firstValueFrom} from "rxjs";
@Component({ @Component({
selector: 'app-supplier', selector: 'app-supplier',
imports: [ imports: [
Search,
SupplierForm, SupplierForm,
SupplierTable, SupplierTable,
ModalButton ModalButton
@@ -28,7 +26,7 @@ export class Supplier {
async onModalOk() { async onModalOk() {
await this.addSupplier() await this.addSupplier()
this.createSupplier().supplierForm.reset(); this.createSupplier().supplierForm.reset();
this.modal().isVisible = false; this.onModalCancel();
await this.supplierTable().fetchSuppliers() await this.supplierTable().fetchSuppliers()
} }
@@ -36,30 +34,17 @@ export class Supplier {
this.modal().isVisible = false; this.modal().isVisible = false;
} }
onSupplierSearch(query: string) {
this.supplierTable().applySearch(query);
}
async addSupplier() { async addSupplier() {
if (this.createSupplier().supplierForm.invalid) { if (this.createSupplier().supplierForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Formulaire invalide')
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
} }
try { try {
const suppliers = this.createSupplier().supplierForm.getRawValue(); const suppliers = this.createSupplier().supplierForm.getRawValue();
await firstValueFrom(this.suppliersService.createSupplierEndpoint(suppliers)) await firstValueFrom(this.suppliersService.createSupplierEndpoint(suppliers))
this.notificationService.success( this.notificationService.success('Success', 'Fournisseur enregistré')
'Success', } catch {
'Fournisseur enregistré' this.notificationService.error('Erreur', 'Erreur d\'enregistrement')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur d\'enregistrement'
)
} }
} }
} }
+11 -5
View File
@@ -7,13 +7,19 @@
size="35%"> size="35%">
<app-profil-form #profilForm></app-profil-form> <app-profil-form #profilForm></app-profil-form>
</app-modal-button> <div class="text-[12px] text-gray-400 flex justify-center items-center flex-col">
<p>Consignes du mot de passe :</p>
<div class="ml-95 w-150"> <ul class="ml-10">
<app-search></app-search> <li>12 caractères</li>
<li>Au moins une majuscule</li>
<li>Au moins une minuscule</li>
<li>Au moins un chiffre</li>
<li>Au moins un caractère spécial</li>
</ul>
</div> </div>
</app-modal-button>
</div> </div>
<div class="mt-1"> <div class="mt-4">
<app-user-table #userTable></app-user-table> <app-user-table #userTable></app-user-table>
</div> </div>
+6 -16
View File
@@ -2,7 +2,6 @@ import {Component, inject, viewChild} from '@angular/core';
import {UserTable} from "../../components/user-table/user-table"; import {UserTable} from "../../components/user-table/user-table";
import {ModalButton} from "../../components/modal-button/modal-button"; import {ModalButton} from "../../components/modal-button/modal-button";
import {ProfilForm} from "../../components/profil-form/profil-form"; import {ProfilForm} from "../../components/profil-form/profil-form";
import {Search} from "../../components/search/search";
import {UsersService} from "../../services/api"; import {UsersService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification"; import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs"; import {firstValueFrom} from "rxjs";
@@ -13,7 +12,6 @@ import {firstValueFrom} from "rxjs";
UserTable, UserTable,
ModalButton, ModalButton,
ProfilForm, ProfilForm,
Search
], ],
templateUrl: './user.html', templateUrl: './user.html',
styleUrl: './user.css', styleUrl: './user.css',
@@ -22,13 +20,14 @@ export class User {
modal = viewChild.required<ModalButton>('modalButton'); modal = viewChild.required<ModalButton>('modalButton');
createUser = viewChild.required<ProfilForm>('profilForm'); createUser = viewChild.required<ProfilForm>('profilForm');
usersTable = viewChild.required<UserTable>('userTable'); usersTable = viewChild.required<UserTable>('userTable');
private usersService = inject(UsersService); private usersService = inject(UsersService);
private notificationService = inject(NzNotificationService) private notificationService = inject(NzNotificationService)
async onModalOk() { async onModalOk() {
await this.addUser() await this.addUser()
this.createUser().profilForm.reset(); this.createUser().profilForm.reset();
this.modal().isVisible = false; this.onModalCancel();
await this.usersTable().fetchUsers() await this.usersTable().fetchUsers()
} }
@@ -38,24 +37,15 @@ export class User {
async addUser() { async addUser() {
if (this.createUser().profilForm.invalid) { if (this.createUser().profilForm.invalid) {
this.notificationService.error( this.notificationService.error('Erreur', 'Formulaire invalide')
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
} }
try { try {
const users = this.createUser().profilForm.getRawValue(); const users = this.createUser().profilForm.getRawValue();
await firstValueFrom(this.usersService.createUserEndpoint(users)) await firstValueFrom(this.usersService.createUserEndpoint(users))
this.notificationService.success( this.notificationService.success('Success', 'Utilisateur crée')
'Success', } catch {
'Utilisateur crée' this.notificationService.error('Erreur', 'Email ou mot de passe invalide')
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur d\'enregistrement'
)
} }
} }
} }
-13
View File
@@ -1,13 +0,0 @@
<div class="flex gap-17 ml-20">
<app-info-card color="#f59e0b" icon="inbox" value="15"
description="Produits sous le seuil minimal."></app-info-card>
<app-info-card color="#3b82f6" icon="team" value="56" description="Partenaires actifs."></app-info-card>
<app-info-card color="#10b981" icon="truck" value="8" description="Livreurs partenaires."></app-info-card>
<app-info-card color="#ef4444" icon="shop" value="48"
description="Fournisseurs travaillant avec nous."></app-info-card>
</div>
<div class="mt-10 flex gap-30">
<app-delivery-validator></app-delivery-validator>
<app-info-table></app-info-table>
</div>
-6
View File
@@ -1,6 +0,0 @@
import {Routes} from '@angular/router';
import {Welcome} from './welcome';
export const WELCOME_ROUTES: Routes = [
{path: '', component: Welcome},
];
-19
View File
@@ -1,19 +0,0 @@
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',
imports: [
InfoCard,
DeliveryValidator,
InfoTable,
],
templateUrl: './welcome.html',
styleUrl: './welcome.css'
})
export class Welcome {
}
@@ -4,16 +4,20 @@ README.md
api.base.service.ts api.base.service.ts
api.module.ts api.module.ts
api/api.ts api/api.ts
api/customers.service.ts
api/deliverers.service.ts api/deliverers.service.ts
api/deliverynotes.service.ts api/deliverynotes.service.ts
api/prices.service.ts api/prices.service.ts
api/products.service.ts api/products.service.ts
api/purchaseorders.service.ts api/purchaseorders.service.ts
api/quotations.service.ts api/quotations.service.ts
api/refresh.service.ts
api/settings.service.ts api/settings.service.ts
api/suppliers.service.ts api/suppliers.service.ts
api/user.service.ts
api/users.service.ts api/users.service.ts
api/warehouseproducts.service.ts api/warehouseproducts.service.ts
api/warehouses.service.ts
configuration.ts configuration.ts
encoder.ts encoder.ts
git_push.sh git_push.sh
@@ -30,6 +34,7 @@ model/create-purchase-product-dto.ts
model/create-quotation-dto.ts model/create-quotation-dto.ts
model/create-supplier-dto.ts model/create-supplier-dto.ts
model/create-user-dto.ts model/create-user-dto.ts
model/get-customer-dto.ts
model/get-deliverer-dto.ts model/get-deliverer-dto.ts
model/get-delivery-note-dto.ts model/get-delivery-note-dto.ts
model/get-price-dto.ts model/get-price-dto.ts
@@ -39,11 +44,13 @@ model/get-purchase-order-dto.ts
model/get-purchase-product-dto.ts model/get-purchase-product-dto.ts
model/get-quotation-dto.ts model/get-quotation-dto.ts
model/get-quotation-product-dto.ts model/get-quotation-product-dto.ts
model/get-refresh-token-dto.ts
model/get-setting-dto.ts model/get-setting-dto.ts
model/get-supplier-dto.ts model/get-supplier-dto.ts
model/get-token-dto.ts model/get-token-dto.ts
model/get-total-quantity-dto.ts model/get-total-quantity-dto.ts
model/get-user-dto.ts model/get-user-dto.ts
model/get-ware-house-dto.ts
model/get-ware-house-product-dto.ts model/get-ware-house-product-dto.ts
model/models.ts model/models.ts
model/patch-delivery-note-real-delivery-date-dto.ts model/patch-delivery-note-real-delivery-date-dto.ts
@@ -57,6 +64,7 @@ model/patch-quotation-product-quantity-dto.ts
model/patch-supplier-delivery-delay-dto.ts model/patch-supplier-delivery-delay-dto.ts
model/patch-user-password-dto.ts model/patch-user-password-dto.ts
model/patch-ware-house-product-quantity-dto.ts model/patch-ware-house-product-quantity-dto.ts
model/refresh-token-dto.ts
model/update-deliverer-dto.ts model/update-deliverer-dto.ts
model/update-delivery-note-dto.ts model/update-delivery-note-dto.ts
model/update-product-dto.ts model/update-product-dto.ts
+4 -8
View File
@@ -59,9 +59,9 @@ In your Angular project:
```typescript ```typescript
import {ApplicationConfig} from '@angular/core'; import { ApplicationConfig } from '@angular/core';
import {provideHttpClient} from '@angular/common/http'; import { provideHttpClient } from '@angular/common/http';
import {provideApi} from ''; import { provideApi } from '';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [ providers: [
@@ -73,9 +73,7 @@ export const appConfig: ApplicationConfig = {
``` ```
**NOTE** **NOTE**
If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module:
can still import an Angular module:
```typescript ```typescript
import { ApiModule } from ''; import { ApiModule } from '';
``` ```
@@ -183,7 +181,5 @@ new Configuration({
``` ```
[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations [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 [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 [@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
+4 -4
View File
@@ -7,9 +7,9 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
import {HttpHeaders, HttpParams, HttpParameterCodec} from '@angular/common/http'; import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http';
import {CustomHttpParameterCodec} from './encoder'; import { CustomHttpParameterCodec } from './encoder';
import {Configuration} from './configuration'; import { Configuration } from './configuration';
export class BaseService { export class BaseService {
protected basePath = 'http://localhost:5298'; protected basePath = 'http://localhost:5298';
@@ -17,7 +17,7 @@ export class BaseService {
public configuration: Configuration; public configuration: Configuration;
public encoder: HttpParameterCodec; public encoder: HttpParameterCodec;
constructor(basePath?: string | string[], configuration?: Configuration) { constructor(basePath?: string|string[], configuration?: Configuration) {
this.configuration = configuration || new Configuration(); this.configuration = configuration || new Configuration();
if (typeof this.configuration.basePath !== 'string') { if (typeof this.configuration.basePath !== 'string') {
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
+5 -5
View File
@@ -1,6 +1,6 @@
import {NgModule, ModuleWithProviders, SkipSelf, Optional} from '@angular/core'; import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
import {Configuration} from './configuration'; import { Configuration } from './configuration';
import {HttpClient} from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
@NgModule({ @NgModule({
@@ -13,11 +13,11 @@ export class ApiModule {
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders<ApiModule> { public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders<ApiModule> {
return { return {
ngModule: ApiModule, ngModule: ApiModule,
providers: [{provide: Configuration, useFactory: configurationFactory}] providers: [ { provide: Configuration, useFactory: configurationFactory } ]
}; };
} }
constructor(@Optional() @SkipSelf() parentModule: ApiModule, constructor( @Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient) { @Optional() http: HttpClient) {
if (parentModule) { if (parentModule) {
throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
+19 -21
View File
@@ -1,31 +1,29 @@
export * from './customers.service';
import { CustomersService } from './customers.service';
export * from './deliverers.service'; export * from './deliverers.service';
import {DeliverersService} from './deliverers.service'; import { DeliverersService } from './deliverers.service';
export * from './deliverynotes.service'; export * from './deliverynotes.service';
import {DeliverynotesService} from './deliverynotes.service'; import { DeliverynotesService } from './deliverynotes.service';
export * from './prices.service'; export * from './prices.service';
import {PricesService} from './prices.service'; import { PricesService } from './prices.service';
export * from './products.service'; export * from './products.service';
import {ProductsService} from './products.service'; import { ProductsService } from './products.service';
export * from './purchaseorders.service'; export * from './purchaseorders.service';
import {PurchaseordersService} from './purchaseorders.service'; import { PurchaseordersService } from './purchaseorders.service';
export * from './quotations.service'; export * from './quotations.service';
import {QuotationsService} from './quotations.service'; import { QuotationsService } from './quotations.service';
export * from './refresh.service';
import { RefreshService } from './refresh.service';
export * from './settings.service'; export * from './settings.service';
import {SettingsService} from './settings.service'; import { SettingsService } from './settings.service';
export * from './suppliers.service'; export * from './suppliers.service';
import {SuppliersService} from './suppliers.service'; import { SuppliersService } from './suppliers.service';
export * from './user.service';
import { UserService } from './user.service';
export * from './users.service'; export * from './users.service';
import {UsersService} from './users.service'; import { UsersService } from './users.service';
export * from './warehouseproducts.service'; export * from './warehouseproducts.service';
import {WarehouseproductsService} from './warehouseproducts.service'; import { WarehouseproductsService } from './warehouseproducts.service';
export * from './warehouses.service';
export const APIS = [DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService]; import { WarehousesService } from './warehouses.service';
export const APIS = [CustomersService, DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, QuotationsService, RefreshService, SettingsService, SuppliersService, UserService, UsersService, WarehouseproductsService, WarehousesService];
@@ -0,0 +1,91 @@
/**
* 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<Array<GetCustomerDto>>;
public getAllCustomersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetCustomerDto>>>;
public getAllCustomersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetCustomerDto>>>;
public getAllCustomersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
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<Array<GetCustomerDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+68 -156
View File
@@ -9,25 +9,25 @@
*/ */
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core'; import { Inject, Injectable, Optional } from '@angular/core';
import { import { HttpClient, HttpHeaders, HttpParams,
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http'; } from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import {Observable} from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore // @ts-ignore
import {CreateDelivererDto} from '../model/create-deliverer-dto'; import { CreateDelivererDto } from '../model/create-deliverer-dto';
// @ts-ignore // @ts-ignore
import {GetDelivererDto} from '../model/get-deliverer-dto'; import { GetDelivererDto } from '../model/get-deliverer-dto';
// @ts-ignore // @ts-ignore
import {UpdateDelivererDto} from '../model/update-deliverer-dto'; import { UpdateDelivererDto } from '../model/update-deliverer-dto';
// @ts-ignore // @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import {Configuration} from '../configuration'; import { Configuration } from '../configuration';
import {BaseService} from '../api.base.service'; import { BaseService } from '../api.base.service';
@Injectable({ @Injectable({
@@ -35,7 +35,7 @@ import {BaseService} from '../api.base.service';
}) })
export class DeliverersService extends BaseService { 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); super(basePath, configuration);
} }
@@ -45,32 +45,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: { public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetDelivererDto>;
httpHeaderAccept?: 'application/json', public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetDelivererDto>>;
context?: HttpContext, public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetDelivererDto>>;
transferCache?: boolean public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetDelivererDto>;
public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetDelivererDto>>;
public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetDelivererDto>>;
public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (createDelivererDto === null || createDelivererDto === undefined) { if (createDelivererDto === null || createDelivererDto === undefined) {
throw new Error('Required parameter createDelivererDto was null or undefined when calling createDelivererEndpoint.'); throw new Error('Required parameter createDelivererDto was null or undefined when calling createDelivererEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -104,16 +91,16 @@ export class DeliverersService extends BaseService {
} }
let localVarPath = `/API/deliverers`; let localVarPath = `/API/deliverers`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetDelivererDto>('post', `${basePath}${localVarPath}`, return this.httpClient.request<GetDelivererDto>('post', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: createDelivererDto, body: createDelivererDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -125,33 +112,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deleteDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: { public deleteDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deleteDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deleteDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deleteDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deleteDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (delivererId === null || delivererId === undefined) { if (delivererId === null || delivererId === undefined) {
throw new Error('Required parameter delivererId was null or undefined when calling deleteDelivererEndpoint.'); throw new Error('Required parameter delivererId was null or undefined when calling deleteDelivererEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -172,24 +147,16 @@ export class DeliverersService extends BaseService {
} }
} }
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({ let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "delivererId", value: delivererId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "delivererId", const { basePath, withCredentials } = this.configuration;
value: delivererId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -200,29 +167,16 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getAllDelivererEndpoint(observe?: 'body', reportProgress?: boolean, options?: { public getAllDelivererEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetDelivererDto>>;
httpHeaderAccept?: 'application/json', public getAllDelivererEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetDelivererDto>>>;
context?: HttpContext, public getAllDelivererEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetDelivererDto>>>;
transferCache?: boolean public getAllDelivererEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Array<GetDelivererDto>>;
public getAllDelivererEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Array<GetDelivererDto>>>;
public getAllDelivererEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Array<GetDelivererDto>>>;
public getAllDelivererEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -247,15 +201,15 @@ export class DeliverersService extends BaseService {
} }
let localVarPath = `/API/deliverers`; let localVarPath = `/API/deliverers`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetDelivererDto>>('get', `${basePath}${localVarPath}`, return this.httpClient.request<Array<GetDelivererDto>>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -267,32 +221,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: { public getDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetDelivererDto>;
httpHeaderAccept?: 'application/json', public getDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetDelivererDto>>;
context?: HttpContext, public getDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetDelivererDto>>;
transferCache?: boolean public getDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetDelivererDto>;
public getDelivererEndpoint(delivererId: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetDelivererDto>>;
public getDelivererEndpoint(delivererId: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetDelivererDto>>;
public getDelivererEndpoint(delivererId: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (delivererId === null || delivererId === undefined) { if (delivererId === null || delivererId === undefined) {
throw new Error('Required parameter delivererId was null or undefined when calling getDelivererEndpoint.'); throw new Error('Required parameter delivererId was null or undefined when calling getDelivererEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -316,24 +257,16 @@ export class DeliverersService extends BaseService {
} }
} }
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({ let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "delivererId", value: delivererId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "delivererId", const { basePath, withCredentials } = this.configuration;
value: delivererId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<GetDelivererDto>('get', `${basePath}${localVarPath}`, return this.httpClient.request<GetDelivererDto>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -346,26 +279,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: { public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetDelivererDto>;
httpHeaderAccept?: 'application/json', public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetDelivererDto>>;
context?: HttpContext, public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetDelivererDto>>;
transferCache?: boolean public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetDelivererDto>;
public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetDelivererDto>>;
public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetDelivererDto>>;
public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling updateDelivererEndpoint.'); throw new Error('Required parameter id was null or undefined when calling updateDelivererEndpoint.');
} }
@@ -375,6 +292,9 @@ export class DeliverersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -407,25 +327,17 @@ export class DeliverersService extends BaseService {
} }
} }
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({ let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<GetDelivererDto>('put', `${basePath}${localVarPath}`, return this.httpClient.request<GetDelivererDto>('put', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: updateDelivererDto, body: updateDelivererDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
+155 -229
View File
@@ -9,27 +9,27 @@
*/ */
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core'; import { Inject, Injectable, Optional } from '@angular/core';
import { import { HttpClient, HttpHeaders, HttpParams,
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http'; } from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import {Observable} from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore // @ts-ignore
import {CreateDeliveryNoteDto} from '../model/create-delivery-note-dto'; import { CreateDeliveryNoteDto } from '../model/create-delivery-note-dto';
// @ts-ignore // @ts-ignore
import {GetDeliveryNoteDto} from '../model/get-delivery-note-dto'; import { GetDeliveryNoteDto } from '../model/get-delivery-note-dto';
// @ts-ignore // @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 // @ts-ignore
import {UpdateDeliveryNoteDto} from '../model/update-delivery-note-dto'; import { UpdateDeliveryNoteDto } from '../model/update-delivery-note-dto';
// @ts-ignore // @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import {Configuration} from '../configuration'; import { Configuration } from '../configuration';
import {BaseService} from '../api.base.service'; import { BaseService } from '../api.base.service';
@Injectable({ @Injectable({
@@ -37,7 +37,7 @@ import {BaseService} from '../api.base.service';
}) })
export class DeliverynotesService extends BaseService { 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); super(basePath, configuration);
} }
@@ -47,33 +47,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: { public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (createDeliveryNoteDto === null || createDeliveryNoteDto === undefined) { if (createDeliveryNoteDto === null || createDeliveryNoteDto === undefined) {
throw new Error('Required parameter createDeliveryNoteDto was null or undefined when calling createDeliveryNoteEndpoint.'); throw new Error('Required parameter createDeliveryNoteDto was null or undefined when calling createDeliveryNoteEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -104,16 +92,16 @@ export class DeliverynotesService extends BaseService {
} }
let localVarPath = `/API/deliveryNotes`; let localVarPath = `/API/deliveryNotes`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`, return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: createDeliveryNoteDto, body: createDeliveryNoteDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -125,33 +113,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deleteDeliveryNoteEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public deleteDeliveryNoteEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deleteDeliveryNoteEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deleteDeliveryNoteEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deleteDeliveryNoteEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deleteDeliveryNoteEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteDeliveryNoteEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteDeliveryNoteEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling deleteDeliveryNoteEndpoint.'); throw new Error('Required parameter id was null or undefined when calling deleteDeliveryNoteEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -172,24 +148,16 @@ export class DeliverynotesService extends BaseService {
} }
} }
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -200,29 +168,16 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getAllDeliveryNoteEndpoint(observe?: 'body', reportProgress?: boolean, options?: { public getAllDeliveryNoteEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetDeliveryNoteDto>>;
httpHeaderAccept?: 'application/json', public getAllDeliveryNoteEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetDeliveryNoteDto>>>;
context?: HttpContext, public getAllDeliveryNoteEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetDeliveryNoteDto>>>;
transferCache?: boolean public getAllDeliveryNoteEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Array<GetDeliveryNoteDto>>;
public getAllDeliveryNoteEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Array<GetDeliveryNoteDto>>>;
public getAllDeliveryNoteEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Array<GetDeliveryNoteDto>>>;
public getAllDeliveryNoteEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -247,52 +202,35 @@ export class DeliverynotesService extends BaseService {
} }
let localVarPath = `/API/deliveryNotes`; let localVarPath = `/API/deliveryNotes`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetDeliveryNoteDto>>('get', `${basePath}${localVarPath}`, return this.httpClient.request<Array<GetDeliveryNoteDto>>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
} }
/** /**
* @endpoint get /API/deliveryNotes/{deliveryNoteId} * @endpoint get /API/deliveryNotes/validation
* @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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'body', reportProgress?: boolean, options?: { public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetDeliveryNoteDto>>;
httpHeaderAccept?: 'application/json', public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetDeliveryNoteDto>>>;
context?: HttpContext, public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetDeliveryNoteDto>>>;
transferCache?: boolean public getAllDeliveryNotesNotArrivedEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetDeliveryNoteDto>;
public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetDeliveryNoteDto>>;
public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetDeliveryNoteDto>>;
public getDeliveryNoteEndpoint(deliveryNoteId: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (deliveryNoteId === null || deliveryNoteId === undefined) {
throw new Error('Required parameter deliveryNoteId was null or undefined when calling getDeliveryNoteEndpoint.');
}
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -316,24 +254,73 @@ export class DeliverynotesService extends BaseService {
} }
} }
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ let localVarPath = `/API/deliveryNotes/validation`;
name: "deliveryNoteId", const { basePath, withCredentials } = this.configuration;
value: deliveryNoteId, return this.httpClient.request<Array<GetDeliveryNoteDto>>('get', `${basePath}${localVarPath}`,
in: "path", {
style: "simple", context: localVarHttpContext,
explode: false, responseType: <any>responseType_,
dataType: "number", ...(withCredentials ? { withCredentials } : {}),
dataFormat: "int32" headers: localVarHeaders,
})}`; observe: observe,
const {basePath, withCredentials} = this.configuration; ...(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<GetDeliveryNoteDto>;
public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetDeliveryNoteDto>>;
public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetDeliveryNoteDto>>;
public getDeliveryNoteEndpoint(deliveryNoteId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (deliveryNoteId === null || deliveryNoteId === undefined) {
throw new Error('Required parameter deliveryNoteId was null or undefined when calling getDeliveryNoteEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
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<GetDeliveryNoteDto>('get', `${basePath}${localVarPath}`, return this.httpClient.request<GetDeliveryNoteDto>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -345,32 +332,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getDeliveryNotePdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public getDeliveryNotePdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<Blob>;
httpHeaderAccept?: 'application/pdf', public getDeliveryNotePdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Blob>>;
context?: HttpContext, public getDeliveryNotePdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Blob>>;
transferCache?: boolean public getDeliveryNotePdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Blob>;
public getDeliveryNotePdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Blob>>;
public getDeliveryNotePdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Blob>>;
public getDeliveryNotePdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getDeliveryNotePdfEndpoint.'); throw new Error('Required parameter id was null or undefined when calling getDeliveryNotePdfEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/pdf' 'application/pdf'
]); ]);
@@ -383,24 +357,16 @@ export class DeliverynotesService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true; const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`;
name: "id", const { basePath, withCredentials } = this.configuration;
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}`, return this.httpClient.request('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: "blob", responseType: "blob",
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -413,26 +379,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'body', reportProgress?: boolean, options?: { public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchRealDeliveryDateEndpoint.'); throw new Error('Required parameter id was null or undefined when calling patchRealDeliveryDateEndpoint.');
} }
@@ -442,7 +392,11 @@ export class DeliverynotesService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -472,25 +426,17 @@ export class DeliverynotesService extends BaseService {
} }
} }
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchDeliveryNoteRealDeliveryDateDto, body: patchDeliveryNoteRealDeliveryDateDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -503,26 +449,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: { public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling updateDeliveryNoteEndpoint.'); throw new Error('Required parameter id was null or undefined when calling updateDeliveryNoteEndpoint.');
} }
@@ -532,7 +462,11 @@ export class DeliverynotesService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -562,25 +496,17 @@ export class DeliverynotesService extends BaseService {
} }
} }
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({ let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`, return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: updateDeliveryNoteDto, body: updateDeliveryNoteDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
+24 -52
View File
@@ -9,21 +9,21 @@
*/ */
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core'; import { Inject, Injectable, Optional } from '@angular/core';
import { import { HttpClient, HttpHeaders, HttpParams,
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http'; } from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import {Observable} from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore // @ts-ignore
import {PatchPriceSellingPriceDto} from '../model/patch-price-selling-price-dto'; import { PatchPriceSellingPriceDto } from '../model/patch-price-selling-price-dto';
// @ts-ignore // @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import {Configuration} from '../configuration'; import { Configuration } from '../configuration';
import {BaseService} from '../api.base.service'; import { BaseService } from '../api.base.service';
@Injectable({ @Injectable({
@@ -31,7 +31,7 @@ import {BaseService} from '../api.base.service';
}) })
export class PricesService extends BaseService { 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); super(basePath, configuration);
} }
@@ -43,26 +43,10 @@ export class PricesService 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'body', reportProgress?: boolean, options?: { public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (productId === null || productId === undefined) { if (productId === null || productId === undefined) {
throw new Error('Required parameter productId was null or undefined when calling patchPriceEndpoint.'); throw new Error('Required parameter productId was null or undefined when calling patchPriceEndpoint.');
} }
@@ -75,7 +59,11 @@ export class PricesService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -105,33 +93,17 @@ export class PricesService extends BaseService {
} }
} }
let localVarPath = `/API/prices/${this.configuration.encodeParam({ 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`;
name: "productId", const { basePath, withCredentials } = this.configuration;
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<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchPriceSellingPriceDto, body: patchPriceSellingPriceDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
+83 -190
View File
@@ -9,25 +9,25 @@
*/ */
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core'; import { Inject, Injectable, Optional } from '@angular/core';
import { import { HttpClient, HttpHeaders, HttpParams,
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http'; } from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import {Observable} from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore // @ts-ignore
import {GetProductDto} from '../model/get-product-dto'; import { GetProductDto } from '../model/get-product-dto';
// @ts-ignore // @ts-ignore
import {PatchProductMinimalStockDto} from '../model/patch-product-minimal-stock-dto'; import { PatchProductMinimalStockDto } from '../model/patch-product-minimal-stock-dto';
// @ts-ignore // @ts-ignore
import {UpdateProductDto} from '../model/update-product-dto'; import { UpdateProductDto } from '../model/update-product-dto';
// @ts-ignore // @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import {Configuration} from '../configuration'; import { Configuration } from '../configuration';
import {BaseService} from '../api.base.service'; import { BaseService } from '../api.base.service';
@Injectable({ @Injectable({
@@ -35,7 +35,7 @@ import {BaseService} from '../api.base.service';
}) })
export class ProductsService extends BaseService { 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); super(basePath, configuration);
} }
@@ -45,33 +45,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deleteProductEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: { public deleteProductEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deleteProductEndpoint(productId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deleteProductEndpoint(productId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deleteProductEndpoint(productId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deleteProductEndpoint(productId: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteProductEndpoint(productId: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteProductEndpoint(productId: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (productId === null || productId === undefined) { if (productId === null || productId === undefined) {
throw new Error('Required parameter productId was null or undefined when calling deleteProductEndpoint.'); throw new Error('Required parameter productId was null or undefined when calling deleteProductEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -92,24 +80,16 @@ export class ProductsService extends BaseService {
} }
} }
let localVarPath = `/API/products/${this.configuration.encodeParam({ let localVarPath = `/API/products/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "productId", const { basePath, withCredentials } = this.configuration;
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -120,29 +100,16 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getAllProductsEndpoint(observe?: 'body', reportProgress?: boolean, options?: { public getAllProductsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetProductDto>>;
httpHeaderAccept?: 'application/json', public getAllProductsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetProductDto>>>;
context?: HttpContext, public getAllProductsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetProductDto>>>;
transferCache?: boolean public getAllProductsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Array<GetProductDto>>;
public getAllProductsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Array<GetProductDto>>>;
public getAllProductsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Array<GetProductDto>>>;
public getAllProductsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -167,15 +134,15 @@ export class ProductsService extends BaseService {
} }
let localVarPath = `/API/products`; let localVarPath = `/API/products`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetProductDto>>('get', `${basePath}${localVarPath}`, return this.httpClient.request<Array<GetProductDto>>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -186,29 +153,16 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: { public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetProductDto>>;
httpHeaderAccept?: 'application/json', public getAllProductsUnderLimitEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetProductDto>>>;
context?: HttpContext, public getAllProductsUnderLimitEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetProductDto>>>;
transferCache?: boolean public getAllProductsUnderLimitEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Array<GetProductDto>>;
public getAllProductsUnderLimitEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Array<GetProductDto>>>;
public getAllProductsUnderLimitEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Array<GetProductDto>>>;
public getAllProductsUnderLimitEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -233,15 +187,15 @@ export class ProductsService extends BaseService {
} }
let localVarPath = `/API/products/underLimit`; let localVarPath = `/API/products/underLimit`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetProductDto>>('get', `${basePath}${localVarPath}`, return this.httpClient.request<Array<GetProductDto>>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -253,32 +207,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getProductEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public getProductEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetProductDto>;
httpHeaderAccept?: 'application/json', public getProductEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetProductDto>>;
context?: HttpContext, public getProductEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetProductDto>>;
transferCache?: boolean public getProductEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetProductDto>;
public getProductEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetProductDto>>;
public getProductEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetProductDto>>;
public getProductEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getProductEndpoint.'); throw new Error('Required parameter id was null or undefined when calling getProductEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -302,24 +243,16 @@ export class ProductsService extends BaseService {
} }
} }
let localVarPath = `/API/products/${this.configuration.encodeParam({ let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<GetProductDto>('get', `${basePath}${localVarPath}`, return this.httpClient.request<GetProductDto>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -332,26 +265,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'body', reportProgress?: boolean, options?: { public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchProductMinimalStockEndpoint.'); throw new Error('Required parameter id was null or undefined when calling patchProductMinimalStockEndpoint.');
} }
@@ -361,7 +278,11 @@ export class ProductsService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -391,25 +312,17 @@ export class ProductsService extends BaseService {
} }
} }
let localVarPath = `/API/products/${this.configuration.encodeParam({ let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/MinimalStock`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/MinimalStock`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchProductMinimalStockDto, body: patchProductMinimalStockDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -422,26 +335,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'body', reportProgress?: boolean, options?: { public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling updateProductEndpoint.'); throw new Error('Required parameter id was null or undefined when calling updateProductEndpoint.');
} }
@@ -451,7 +348,11 @@ export class ProductsService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -481,25 +382,17 @@ export class ProductsService extends BaseService {
} }
} }
let localVarPath = `/API/products/${this.configuration.encodeParam({ let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`, return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: updateProductDto, body: updateProductDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
+126 -316
View File
@@ -9,29 +9,29 @@
*/ */
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core'; import { Inject, Injectable, Optional } from '@angular/core';
import { import { HttpClient, HttpHeaders, HttpParams,
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http'; } from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import {Observable} from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore // @ts-ignore
import {CreatePurchaseOrderDto} from '../model/create-purchase-order-dto'; import { CreatePurchaseOrderDto } from '../model/create-purchase-order-dto';
// @ts-ignore // @ts-ignore
import {CreatePurchaseProductDto} from '../model/create-purchase-product-dto'; import { CreatePurchaseProductDto } from '../model/create-purchase-product-dto';
// @ts-ignore // @ts-ignore
import {GetPurchaseOrderDto} from '../model/get-purchase-order-dto'; import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto';
// @ts-ignore // @ts-ignore
import {PatchPurchaseOrderPurchaseConditionsDto} from '../model/patch-purchase-order-purchase-conditions-dto'; import { PatchPurchaseOrderPurchaseConditionsDto } from '../model/patch-purchase-order-purchase-conditions-dto';
// @ts-ignore // @ts-ignore
import {PatchPurchaseProductQuantityDto} from '../model/patch-purchase-product-quantity-dto'; import { PatchPurchaseProductQuantityDto } from '../model/patch-purchase-product-quantity-dto';
// @ts-ignore // @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import {Configuration} from '../configuration'; import { Configuration } from '../configuration';
import {BaseService} from '../api.base.service'; import { BaseService } from '../api.base.service';
@Injectable({ @Injectable({
@@ -39,7 +39,7 @@ import {BaseService} from '../api.base.service';
}) })
export class PurchaseordersService extends BaseService { 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); super(basePath, configuration);
} }
@@ -51,26 +51,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'body', reportProgress?: boolean, options?: { public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (purchaseOrderId === null || purchaseOrderId === undefined) { if (purchaseOrderId === null || purchaseOrderId === undefined) {
throw new Error('Required parameter purchaseOrderId was null or undefined when calling addProductFromPurchaseOrderEndpoint.'); throw new Error('Required parameter purchaseOrderId was null or undefined when calling addProductFromPurchaseOrderEndpoint.');
} }
@@ -83,7 +67,11 @@ export class PurchaseordersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -113,33 +101,17 @@ export class PurchaseordersService extends BaseService {
} }
} }
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ 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"})}`;
name: "purchaseOrderId", const { basePath, withCredentials } = this.configuration;
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<any>('post', `${basePath}${localVarPath}`, return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: createPurchaseProductDto, body: createPurchaseProductDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -151,33 +123,22 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: { public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetPurchaseOrderDto>;
httpHeaderAccept?: undefined, public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetPurchaseOrderDto>>;
context?: HttpContext, public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetPurchaseOrderDto>>;
transferCache?: boolean public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (createPurchaseOrderDto === null || createPurchaseOrderDto === undefined) { if (createPurchaseOrderDto === null || createPurchaseOrderDto === undefined) {
throw new Error('Required parameter createPurchaseOrderDto was null or undefined when calling createPurchaseOrder.'); throw new Error('Required parameter createPurchaseOrderDto was null or undefined when calling createPurchaseOrder.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -208,16 +169,16 @@ export class PurchaseordersService extends BaseService {
} }
let localVarPath = `/API/purchaseOrders`; let localVarPath = `/API/purchaseOrders`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`, return this.httpClient.request<GetPurchaseOrderDto>('post', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: createPurchaseOrderDto, body: createPurchaseOrderDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -230,26 +191,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'body', reportProgress?: boolean, options?: { public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (productId === null || productId === undefined) { if (productId === null || productId === undefined) {
throw new Error('Required parameter productId was null or undefined when calling deleteProductFromPurchaseOrderEndpoint.'); throw new Error('Required parameter productId was null or undefined when calling deleteProductFromPurchaseOrderEndpoint.');
} }
@@ -259,7 +204,11 @@ export class PurchaseordersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -280,32 +229,16 @@ export class PurchaseordersService extends BaseService {
} }
} }
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ 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"})}`;
name: "productId", const { basePath, withCredentials } = this.configuration;
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<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -317,33 +250,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deletePurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public deletePurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deletePurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deletePurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deletePurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deletePurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deletePurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deletePurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling deletePurchaseOrderEndpoint.'); throw new Error('Required parameter id was null or undefined when calling deletePurchaseOrderEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -364,24 +285,16 @@ export class PurchaseordersService extends BaseService {
} }
} }
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -392,29 +305,16 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getAllPurchaseOrderEndpoint(observe?: 'body', reportProgress?: boolean, options?: { public getAllPurchaseOrderEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetPurchaseOrderDto>>;
httpHeaderAccept?: 'application/json', public getAllPurchaseOrderEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetPurchaseOrderDto>>>;
context?: HttpContext, public getAllPurchaseOrderEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetPurchaseOrderDto>>>;
transferCache?: boolean public getAllPurchaseOrderEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Array<GetPurchaseOrderDto>>;
public getAllPurchaseOrderEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Array<GetPurchaseOrderDto>>>;
public getAllPurchaseOrderEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Array<GetPurchaseOrderDto>>>;
public getAllPurchaseOrderEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -439,15 +339,15 @@ export class PurchaseordersService extends BaseService {
} }
let localVarPath = `/API/purchaseOrders`; let localVarPath = `/API/purchaseOrders`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetPurchaseOrderDto>>('get', `${basePath}${localVarPath}`, return this.httpClient.request<Array<GetPurchaseOrderDto>>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -459,32 +359,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getPurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public getPurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetPurchaseOrderDto>;
httpHeaderAccept?: 'application/json', public getPurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetPurchaseOrderDto>>;
context?: HttpContext, public getPurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetPurchaseOrderDto>>;
transferCache?: boolean public getPurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetPurchaseOrderDto>;
public getPurchaseOrderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetPurchaseOrderDto>>;
public getPurchaseOrderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetPurchaseOrderDto>>;
public getPurchaseOrderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderEndpoint.'); throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -508,24 +395,16 @@ export class PurchaseordersService extends BaseService {
} }
} }
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<GetPurchaseOrderDto>('get', `${basePath}${localVarPath}`, return this.httpClient.request<GetPurchaseOrderDto>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -537,32 +416,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getPurchaseOrderPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public getPurchaseOrderPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<Blob>;
httpHeaderAccept?: 'application/pdf', public getPurchaseOrderPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Blob>>;
context?: HttpContext, public getPurchaseOrderPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Blob>>;
transferCache?: boolean public getPurchaseOrderPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Blob>;
public getPurchaseOrderPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Blob>>;
public getPurchaseOrderPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Blob>>;
public getPurchaseOrderPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderPdfEndpoint.'); throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderPdfEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/pdf' 'application/pdf'
]); ]);
@@ -575,24 +441,16 @@ export class PurchaseordersService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true; const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`;
name: "id", const { basePath, withCredentials } = this.configuration;
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}`, return this.httpClient.request('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: "blob", responseType: "blob",
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -605,26 +463,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'body', reportProgress?: boolean, options?: { public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchPurchaseOrderPurchaseConditionsEndpoint.'); throw new Error('Required parameter id was null or undefined when calling patchPurchaseOrderPurchaseConditionsEndpoint.');
} }
@@ -634,7 +476,11 @@ export class PurchaseordersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -664,25 +510,17 @@ export class PurchaseordersService extends BaseService {
} }
} }
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/PurchaseConditions`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/PurchaseConditions`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchPurchaseOrderPurchaseConditionsDto, body: patchPurchaseOrderPurchaseConditionsDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -696,26 +534,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: { public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (productId === null || productId === undefined) { if (productId === null || productId === undefined) {
throw new Error('Required parameter productId was null or undefined when calling patchPurchaseProductQuantityEndpoint.'); throw new Error('Required parameter productId was null or undefined when calling patchPurchaseProductQuantityEndpoint.');
} }
@@ -728,7 +550,11 @@ export class PurchaseordersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -758,33 +584,17 @@ export class PurchaseordersService extends BaseService {
} }
} }
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({ 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`;
name: "productId", const { basePath, withCredentials } = this.configuration;
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<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchPurchaseProductQuantityDto, body: patchPurchaseProductQuantityDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
+152 -375
View File
@@ -9,33 +9,33 @@
*/ */
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core'; import { Inject, Injectable, Optional } from '@angular/core';
import { import { HttpClient, HttpHeaders, HttpParams,
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http'; } from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import {Observable} from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore // @ts-ignore
import {AddQuotationProductDto} from '../model/add-quotation-product-dto'; import { AddQuotationProductDto } from '../model/add-quotation-product-dto';
// @ts-ignore // @ts-ignore
import {CreateQuotationDto} from '../model/create-quotation-dto'; import { CreateQuotationDto } from '../model/create-quotation-dto';
// @ts-ignore // @ts-ignore
import {GetQuotationDto} from '../model/get-quotation-dto'; import { GetQuotationDto } from '../model/get-quotation-dto';
// @ts-ignore // @ts-ignore
import {PatchQuotationConditionsSaleDto} from '../model/patch-quotation-conditions-sale-dto'; import { PatchQuotationConditionsSaleDto } from '../model/patch-quotation-conditions-sale-dto';
// @ts-ignore // @ts-ignore
import {PatchQuotationMessageDto} from '../model/patch-quotation-message-dto'; import { PatchQuotationMessageDto } from '../model/patch-quotation-message-dto';
// @ts-ignore // @ts-ignore
import {PatchQuotationProductQuantityDto} from '../model/patch-quotation-product-quantity-dto'; import { PatchQuotationProductQuantityDto } from '../model/patch-quotation-product-quantity-dto';
// @ts-ignore // @ts-ignore
import {UpdateQuotationDto} from '../model/update-quotation-dto'; import { UpdateQuotationDto } from '../model/update-quotation-dto';
// @ts-ignore // @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import {Configuration} from '../configuration'; import { Configuration } from '../configuration';
import {BaseService} from '../api.base.service'; import { BaseService } from '../api.base.service';
@Injectable({ @Injectable({
@@ -43,7 +43,7 @@ import {BaseService} from '../api.base.service';
}) })
export class QuotationsService extends BaseService { 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); super(basePath, configuration);
} }
@@ -54,26 +54,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'body', reportProgress?: boolean, options?: { public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (productId === null || productId === undefined) { if (productId === null || productId === undefined) {
throw new Error('Required parameter productId was null or undefined when calling addProductoToQuotationEndpoint.'); throw new Error('Required parameter productId was null or undefined when calling addProductoToQuotationEndpoint.');
} }
@@ -83,7 +67,11 @@ export class QuotationsService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -113,25 +101,17 @@ export class QuotationsService extends BaseService {
} }
} }
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/products`;
name: "productId", const { basePath, withCredentials } = this.configuration;
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/products`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`, return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: addQuotationProductDto, body: addQuotationProductDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -143,33 +123,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: { public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (createQuotationDto === null || createQuotationDto === undefined) { if (createQuotationDto === null || createQuotationDto === undefined) {
throw new Error('Required parameter createQuotationDto was null or undefined when calling createQuotationEndpoint.'); throw new Error('Required parameter createQuotationDto was null or undefined when calling createQuotationEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -200,16 +168,16 @@ export class QuotationsService extends BaseService {
} }
let localVarPath = `/API/quotations`; let localVarPath = `/API/quotations`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`, return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: createQuotationDto, body: createQuotationDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -222,26 +190,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'body', reportProgress?: boolean, options?: { public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (productId === null || productId === undefined) { if (productId === null || productId === undefined) {
throw new Error('Required parameter productId was null or undefined when calling deleteProductFromQuotationEndpoint.'); throw new Error('Required parameter productId was null or undefined when calling deleteProductFromQuotationEndpoint.');
} }
@@ -251,7 +203,11 @@ export class QuotationsService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -272,32 +228,16 @@ export class QuotationsService extends BaseService {
} }
} }
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ 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"})}`;
name: "productId", const { basePath, withCredentials } = this.configuration;
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<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -309,33 +249,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deleteQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public deleteQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deleteQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deleteQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deleteQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deleteQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling deleteQuotationEndpoint.'); throw new Error('Required parameter id was null or undefined when calling deleteQuotationEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -356,24 +284,16 @@ export class QuotationsService extends BaseService {
} }
} }
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -384,29 +304,16 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getAllQuotationEndpoint(observe?: 'body', reportProgress?: boolean, options?: { public getAllQuotationEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetQuotationDto>>;
httpHeaderAccept?: 'application/json', public getAllQuotationEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetQuotationDto>>>;
context?: HttpContext, public getAllQuotationEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetQuotationDto>>>;
transferCache?: boolean public getAllQuotationEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Array<GetQuotationDto>>;
public getAllQuotationEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Array<GetQuotationDto>>>;
public getAllQuotationEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Array<GetQuotationDto>>>;
public getAllQuotationEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -431,15 +338,15 @@ export class QuotationsService extends BaseService {
} }
let localVarPath = `/API/quotations`; let localVarPath = `/API/quotations`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetQuotationDto>>('get', `${basePath}${localVarPath}`, return this.httpClient.request<Array<GetQuotationDto>>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -451,32 +358,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public getQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetQuotationDto>;
httpHeaderAccept?: 'application/json', public getQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetQuotationDto>>;
context?: HttpContext, public getQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetQuotationDto>>;
transferCache?: boolean public getQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetQuotationDto>;
public getQuotationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetQuotationDto>>;
public getQuotationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetQuotationDto>>;
public getQuotationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getQuotationEndpoint.'); throw new Error('Required parameter id was null or undefined when calling getQuotationEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -500,24 +394,16 @@ export class QuotationsService extends BaseService {
} }
} }
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<GetQuotationDto>('get', `${basePath}${localVarPath}`, return this.httpClient.request<GetQuotationDto>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -529,32 +415,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getQuotationPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public getQuotationPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<Blob>;
httpHeaderAccept?: 'application/pdf', public getQuotationPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Blob>>;
context?: HttpContext, public getQuotationPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Blob>>;
transferCache?: boolean public getQuotationPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Blob>;
public getQuotationPdfEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Blob>>;
public getQuotationPdfEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Blob>>;
public getQuotationPdfEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getQuotationPdfEndpoint.'); throw new Error('Required parameter id was null or undefined when calling getQuotationPdfEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/pdf' 'application/pdf'
]); ]);
@@ -567,24 +440,16 @@ export class QuotationsService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true; const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`;
name: "id", const { basePath, withCredentials } = this.configuration;
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}`, return this.httpClient.request('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: "blob", responseType: "blob",
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -597,26 +462,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'body', reportProgress?: boolean, options?: { public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchQuotationConditionsSaleEndpoint.'); throw new Error('Required parameter id was null or undefined when calling patchQuotationConditionsSaleEndpoint.');
} }
@@ -626,7 +475,11 @@ export class QuotationsService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -656,25 +509,17 @@ export class QuotationsService extends BaseService {
} }
} }
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/saleConditions`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/saleConditions`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchQuotationConditionsSaleDto, body: patchQuotationConditionsSaleDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -687,26 +532,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'body', reportProgress?: boolean, options?: { public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchQuotationMessageEndpoint.'); throw new Error('Required parameter id was null or undefined when calling patchQuotationMessageEndpoint.');
} }
@@ -716,7 +545,11 @@ export class QuotationsService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -746,25 +579,17 @@ export class QuotationsService extends BaseService {
} }
} }
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/message`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/message`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchQuotationMessageDto, body: patchQuotationMessageDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -778,26 +603,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: { public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (productId === null || productId === undefined) { if (productId === null || productId === undefined) {
throw new Error('Required parameter productId was null or undefined when calling patchQuotationProductQuantityEndpoint.'); throw new Error('Required parameter productId was null or undefined when calling patchQuotationProductQuantityEndpoint.');
} }
@@ -810,7 +619,11 @@ export class QuotationsService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -840,33 +653,17 @@ export class QuotationsService extends BaseService {
} }
} }
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ 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`;
name: "productId", const { basePath, withCredentials } = this.configuration;
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<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchQuotationProductQuantityDto, body: patchQuotationProductQuantityDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -879,26 +676,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: { public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling updateQuotationEndpoint.'); throw new Error('Required parameter id was null or undefined when calling updateQuotationEndpoint.');
} }
@@ -908,7 +689,11 @@ export class QuotationsService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -938,25 +723,17 @@ export class QuotationsService extends BaseService {
} }
} }
let localVarPath = `/API/quotations/${this.configuration.encodeParam({ let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`, return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: updateQuotationDto, body: updateQuotationDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
+104
View File
@@ -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 { GetRefreshTokenDto } from '../model/get-refresh-token-dto';
// @ts-ignore
import { RefreshTokenDto } from '../model/refresh-token-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 RefreshService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/refresh
* @param refreshTokenDto
* @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 refreshTokenEndpoint(refreshTokenDto: RefreshTokenDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetRefreshTokenDto>;
public refreshTokenEndpoint(refreshTokenDto: RefreshTokenDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetRefreshTokenDto>>;
public refreshTokenEndpoint(refreshTokenDto: RefreshTokenDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetRefreshTokenDto>>;
public refreshTokenEndpoint(refreshTokenDto: RefreshTokenDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (refreshTokenDto === null || refreshTokenDto === undefined) {
throw new Error('Required parameter refreshTokenDto was null or undefined when calling refreshTokenEndpoint.');
}
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/refresh`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetRefreshTokenDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: refreshTokenDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+45 -82
View File
@@ -9,21 +9,21 @@
*/ */
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core'; import { Inject, Injectable, Optional } from '@angular/core';
import { import { HttpClient, HttpHeaders, HttpParams,
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http'; } from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import {Observable} from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore // @ts-ignore
import {GetSettingDto} from '../model/get-setting-dto'; import { GetSettingDto } from '../model/get-setting-dto';
// @ts-ignore // @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import {Configuration} from '../configuration'; import { Configuration } from '../configuration';
import {BaseService} from '../api.base.service'; import { BaseService } from '../api.base.service';
@Injectable({ @Injectable({
@@ -31,7 +31,7 @@ import {BaseService} from '../api.base.service';
}) })
export class SettingsService extends BaseService { 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); super(basePath, configuration);
} }
@@ -40,29 +40,16 @@ export class SettingsService 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getSettingEndpoint(observe?: 'body', reportProgress?: boolean, options?: { public getSettingEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetSettingDto>;
httpHeaderAccept?: 'application/json', public getSettingEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetSettingDto>>;
context?: HttpContext, public getSettingEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetSettingDto>>;
transferCache?: boolean public getSettingEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetSettingDto>;
public getSettingEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetSettingDto>>;
public getSettingEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetSettingDto>>;
public getSettingEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -87,15 +74,15 @@ export class SettingsService extends BaseService {
} }
let localVarPath = `/API/settings`; let localVarPath = `/API/settings`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetSettingDto>('get', `${basePath}${localVarPath}`, return this.httpClient.request<GetSettingDto>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -107,30 +94,18 @@ export class SettingsService 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'body', reportProgress?: boolean, options?: { public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -174,16 +149,16 @@ export class SettingsService extends BaseService {
} }
let localVarPath = `/API/settings/electronicSignature`; let localVarPath = `/API/settings/electronicSignature`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -195,30 +170,18 @@ export class SettingsService 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchSettingLogoEndpoint(logo?: Blob, observe?: 'body', reportProgress?: boolean, options?: { public patchSettingLogoEndpoint(logo?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchSettingLogoEndpoint(logo?: Blob, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchSettingLogoEndpoint(logo?: Blob, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchSettingLogoEndpoint(logo?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchSettingLogoEndpoint(logo?: Blob, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchSettingLogoEndpoint(logo?: Blob, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchSettingLogoEndpoint(logo?: Blob, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -262,16 +225,16 @@ export class SettingsService extends BaseService {
} }
let localVarPath = `/API/settings/logo`; let localVarPath = `/API/settings/logo`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
+113 -275
View File
@@ -9,29 +9,29 @@
*/ */
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core'; import { Inject, Injectable, Optional } from '@angular/core';
import { import { HttpClient, HttpHeaders, HttpParams,
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http'; } from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import {Observable} from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore // @ts-ignore
import {CreatePriceDto} from '../model/create-price-dto'; import { CreatePriceDto } from '../model/create-price-dto';
// @ts-ignore // @ts-ignore
import {CreateSupplierDto} from '../model/create-supplier-dto'; import { CreateSupplierDto } from '../model/create-supplier-dto';
// @ts-ignore // @ts-ignore
import {GetSupplierDto} from '../model/get-supplier-dto'; import { GetSupplierDto } from '../model/get-supplier-dto';
// @ts-ignore // @ts-ignore
import {PatchSupplierDeliveryDelayDto} from '../model/patch-supplier-delivery-delay-dto'; import { PatchSupplierDeliveryDelayDto } from '../model/patch-supplier-delivery-delay-dto';
// @ts-ignore // @ts-ignore
import {UpdateSupplierDto} from '../model/update-supplier-dto'; import { UpdateSupplierDto } from '../model/update-supplier-dto';
// @ts-ignore // @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import {Configuration} from '../configuration'; import { Configuration } from '../configuration';
import {BaseService} from '../api.base.service'; import { BaseService } from '../api.base.service';
@Injectable({ @Injectable({
@@ -39,7 +39,7 @@ import {BaseService} from '../api.base.service';
}) })
export class SuppliersService extends BaseService { 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); super(basePath, configuration);
} }
@@ -51,26 +51,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'body', reportProgress?: boolean, options?: { public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public addProductToSupplierEndpoint(supplierId: number, productId: number, createPriceDto: CreatePriceDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (supplierId === null || supplierId === undefined) { if (supplierId === null || supplierId === undefined) {
throw new Error('Required parameter supplierId was null or undefined when calling addProductToSupplierEndpoint.'); throw new Error('Required parameter supplierId was null or undefined when calling addProductToSupplierEndpoint.');
} }
@@ -83,7 +67,11 @@ export class SuppliersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -113,33 +101,17 @@ export class SuppliersService extends BaseService {
} }
} }
let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ 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"})}`;
name: "supplierId", const { basePath, withCredentials } = this.configuration;
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<any>('post', `${basePath}${localVarPath}`, return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: createPriceDto, body: createPriceDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -151,33 +123,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: { public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public createSupplierEndpoint(createSupplierDto: CreateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (createSupplierDto === null || createSupplierDto === undefined) { if (createSupplierDto === null || createSupplierDto === undefined) {
throw new Error('Required parameter createSupplierDto was null or undefined when calling createSupplierEndpoint.'); throw new Error('Required parameter createSupplierDto was null or undefined when calling createSupplierEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -208,16 +168,16 @@ export class SuppliersService extends BaseService {
} }
let localVarPath = `/API/suppliers`; let localVarPath = `/API/suppliers`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`, return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: createSupplierDto, body: createSupplierDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -230,26 +190,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'body', reportProgress?: boolean, options?: { public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteProductToSupplierEndpoint(supplierId: number, productId: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (supplierId === null || supplierId === undefined) { if (supplierId === null || supplierId === undefined) {
throw new Error('Required parameter supplierId was null or undefined when calling deleteProductToSupplierEndpoint.'); throw new Error('Required parameter supplierId was null or undefined when calling deleteProductToSupplierEndpoint.');
} }
@@ -259,7 +203,11 @@ export class SuppliersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -280,32 +228,16 @@ export class SuppliersService extends BaseService {
} }
} }
let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ 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"})}`;
name: "supplierId", const { basePath, withCredentials } = this.configuration;
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<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -317,33 +249,21 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public deleteSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public deleteSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public deleteSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public deleteSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public deleteSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public deleteSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling deleteSupplierEndpoint.'); throw new Error('Required parameter id was null or undefined when calling deleteSupplierEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -364,24 +284,16 @@ export class SuppliersService extends BaseService {
} }
} }
let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`, return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -392,29 +304,16 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getAllSuppliersEndpoint(observe?: 'body', reportProgress?: boolean, options?: { public getAllSuppliersEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetSupplierDto>>;
httpHeaderAccept?: 'application/json', public getAllSuppliersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetSupplierDto>>>;
context?: HttpContext, public getAllSuppliersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetSupplierDto>>>;
transferCache?: boolean public getAllSuppliersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<Array<GetSupplierDto>>;
public getAllSuppliersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<Array<GetSupplierDto>>>;
public getAllSuppliersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<Array<GetSupplierDto>>>;
public getAllSuppliersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -439,15 +338,15 @@ export class SuppliersService extends BaseService {
} }
let localVarPath = `/API/suppliers`; let localVarPath = `/API/suppliers`;
const {basePath, withCredentials} = this.configuration; const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetSupplierDto>>('get', `${basePath}${localVarPath}`, return this.httpClient.request<Array<GetSupplierDto>>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -459,32 +358,19 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public getSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: { public getSupplierEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetSupplierDto>;
httpHeaderAccept?: 'application/json', public getSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetSupplierDto>>;
context?: HttpContext, public getSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetSupplierDto>>;
transferCache?: boolean public getSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<GetSupplierDto>;
public getSupplierEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetSupplierDto>>;
public getSupplierEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetSupplierDto>>;
public getSupplierEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getSupplierEndpoint.'); throw new Error('Required parameter id was null or undefined when calling getSupplierEndpoint.');
} }
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json' 'application/json'
]); ]);
@@ -508,24 +394,16 @@ export class SuppliersService extends BaseService {
} }
} }
let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<GetSupplierDto>('get', `${basePath}${localVarPath}`, return this.httpClient.request<GetSupplierDto>('get', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -538,26 +416,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'body', reportProgress?: boolean, options?: { public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchSupplierDeliveryDelayEndpoint(id: number, patchSupplierDeliveryDelayDto: PatchSupplierDeliveryDelayDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchSupplierDeliveryDelayEndpoint.'); throw new Error('Required parameter id was null or undefined when calling patchSupplierDeliveryDelayEndpoint.');
} }
@@ -567,7 +429,11 @@ export class SuppliersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -597,25 +463,17 @@ export class SuppliersService extends BaseService {
} }
} }
let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/deliveryDelay`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/deliveryDelay`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`, return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: patchSupplierDeliveryDelayDto, body: patchSupplierDeliveryDelayDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
@@ -628,26 +486,10 @@ 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 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. * @param reportProgress flag to report request and response progress.
*/ */
public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: { public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
httpHeaderAccept?: undefined, public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
context?: HttpContext, public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
transferCache?: boolean public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
}): Observable<any>;
public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public updateSupplierEndpoint(id: number, updateSupplierDto: UpdateSupplierDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) { if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling updateSupplierEndpoint.'); throw new Error('Required parameter id was null or undefined when calling updateSupplierEndpoint.');
} }
@@ -657,7 +499,11 @@ export class SuppliersService extends BaseService {
let localVarHeaders = this.defaultHeaders; let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]); // authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) { if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
} }
@@ -687,25 +533,17 @@ export class SuppliersService extends BaseService {
} }
} }
let localVarPath = `/API/suppliers/${this.configuration.encodeParam({ let localVarPath = `/API/suppliers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
name: "id", const { basePath, withCredentials } = this.configuration;
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`, return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{ {
context: localVarHttpContext, context: localVarHttpContext,
body: updateSupplierDto, body: updateSupplierDto,
responseType: <any>responseType_, responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}), ...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders, headers: localVarHeaders,
observe: observe, observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}), ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress reportProgress: reportProgress
} }
); );
+91
View File
@@ -0,0 +1,91 @@
/**
* 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 { GetUserDto } from '../model/get-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 UserService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint get /API/user
* @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(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetUserDto>;
public getUserEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetUserDto>>;
public getUserEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetUserDto>>;
public getUserEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
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/user`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetUserDto>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}

Some files were not shown because too many files have changed in this diff Show More