Compare commits

..

42 Commits

Author SHA1 Message Date
sanchezvem 675ca4ea09 Merge remote-tracking branch 'origin/develop' 2026-06-08 12:26:10 +01:00
sanchezvem 47b8765906 Changed method to see settings pictures 2026-06-05 11:55:31 +01:00
sanchezvem 3c8d8c5825 Merge branch 'develop' 2026-06-01 11:10:58 +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
sanchezvem 7e69cbd952 Fixed error with SupplierId on Delivery Note DTO 2026-05-25 16:33:03 +01:00
sanchezvem dbeb5b43ee Added settings 2026-05-25 15:41:40 +01:00
sanchezvem 561b8e5fc3 Fixed errors with price in all documents 2026-05-25 12:18:34 +01:00
sanchezvem 8afa2e6f06 Fixed errors with suppliers 2026-05-25 11:08:15 +01:00
sanchezvem 39a831b99b revert dcaf85a316
revert first commit of the day
2025-11-20 14:31:18 +01:00
sanchezvem 0d26ac2457 fix audit error 2025-11-20 14:20:33 +01:00
sanchezvem dcaf85a316 first commit of the day 2025-11-17 10:19:47 +01:00
sanchezvem df651fd052 first commit 2025-11-15 13:23:51 +01:00
161 changed files with 3542 additions and 3876 deletions
+128 -5
View File
@@ -17,8 +17,11 @@
"@openapitools/openapi-generator-cli": "^2.25.2",
"@tailwindcss/postcss": "^4.1.17",
"@tailwindcss/vite": "^4.1.17",
"browser-image-compression": "^2.0.2",
"jwt-decode": "^4.0.0",
"ng-zorro-antd": "^20.4.0",
"postcss": "^8.5.6",
"rimraf": "^6.1.3",
"rxjs": "~7.8.0",
"tailwindcss": "^4.1.17",
"tslib": "^2.3.0",
@@ -4432,6 +4435,15 @@
"node": ">=8"
}
},
"node_modules/browser-image-compression": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/browser-image-compression/-/browser-image-compression-2.0.2.tgz",
"integrity": "sha512-pBLlQyUf6yB8SmmngrcOw3EoS4RpQ1BcylI3T9Yqn7+4nrQTXJD4sJDe5ODnJdrvNMaio5OicFo75rDyJD2Ucw==",
"license": "MIT",
"dependencies": {
"uzip": "0.20201231.0"
}
},
"node_modules/browserslist": {
"version": "4.28.0",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz",
@@ -6901,6 +6913,15 @@
],
"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": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/less/-/less-4.4.2.tgz",
@@ -7584,10 +7605,10 @@
}
},
"node_modules/minipass": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
"license": "ISC",
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
"integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
"license": "BlueOak-1.0.0",
"engines": {
"node": ">=16 || 14 >=14.17"
}
@@ -8393,7 +8414,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
"dev": true,
"license": "BlueOak-1.0.0"
},
"node_modules/pacote": {
@@ -8928,6 +8948,103 @@
"dev": true,
"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": {
"version": "4.52.3",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.3.tgz",
@@ -9962,6 +10079,12 @@
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"license": "MIT"
},
"node_modules/uzip": {
"version": "0.20201231.0",
"resolved": "https://registry.npmjs.org/uzip/-/uzip-0.20201231.0.tgz",
"integrity": "sha512-OZeJfZP+R0z9D6TmBgLq2LHzSSptGMGDGigGiEe0pr8UBe/7fdflgHlHBNDASTXB5jnFuxHpNaJywSg8YFeGng==",
"license": "MIT"
},
"node_modules/validate-npm-package-license": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
+3
View File
@@ -31,8 +31,11 @@
"@openapitools/openapi-generator-cli": "^2.25.2",
"@tailwindcss/postcss": "^4.1.17",
"@tailwindcss/vite": "^4.1.17",
"browser-image-compression": "^2.0.2",
"jwt-decode": "^4.0.0",
"ng-zorro-antd": "^20.4.0",
"postcss": "^8.5.6",
"rimraf": "^6.1.3",
"rxjs": "~7.8.0",
"tailwindcss": "^4.1.17",
"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 fr from '@angular/common/locales/fr';
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);
@@ -14,6 +15,7 @@ export const appConfig: ApplicationConfig = {
providers: [
provideBrowserGlobalErrorListeners(),
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">
<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>
<router-outlet></router-outlet>
+58 -29
View File
@@ -1,41 +1,70 @@
import {Routes} from '@angular/router';
import {authGuard} from "./guards/auth.guard";
export const routes: Routes = [
{
path: '',
pathMatch: 'full',
redirectTo: '/welcome'
redirectTo: '/login'
},
{
path: 'welcome',
loadComponent: () => import('./pages/welcome/welcome').then(x => x.Welcome)
path: 'login',
loadComponent: () => import('./pages/login/login').then(x => x.Login)
},
{
path: 'stock',
loadComponent: () => import('./pages/stock/stock').then(x => x.Stock)
},
{
path: 'supplier',
loadComponent: () => import('./pages/supplier/supplier').then(x => x.Supplier)
},
{
path: 'deliverer',
loadComponent: () => import('./pages/deliverer/deliverer').then(x => x.Deliverer)
},
{
path: 'quotation',
loadComponent: () => import('./pages/quotation/quotation').then(x => x.Quotation)
},
{
path: 'purchase-order',
loadComponent: () => import('./pages/purchase-order/purchase-order').then(x => x.PurchaseOrder)
},
{
path: 'delivery-note',
loadComponent: () => import('./pages/delivery-note/delivery-note').then(x => x.DeliveryNote)
},
{
path: 'user',
loadComponent: () => import('./pages/user/user').then(x => x.User)
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',
loadComponent: () => import('./pages/stock/stock').then(m => m.Stock),
canActivate: [authGuard]
},
{
path: 'supplier',
loadComponent: () => import('./pages/supplier/supplier').then(m => m.Supplier),
canActivate: [authGuard]
},
{
path: 'deliverer',
loadComponent: () => import('./pages/deliverer/deliverer').then(m => m.Deliverer),
canActivate: [authGuard]
},
{
path: 'quotation',
loadComponent: () => import('./pages/quotation/quotation').then(m => m.Quotation),
canActivate: [authGuard]
},
{
path: 'purchase-order',
loadComponent: () => import('./pages/purchase-order/purchase-order').then(m => m.PurchaseOrder),
canActivate: [authGuard]
},
{
path: 'delivery-note',
loadComponent: () => import('./pages/delivery-note/delivery-note').then(m => m.DeliveryNote),
canActivate: [authGuard]
},
{
path: '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 {RouterLink, RouterLinkActive, RouterOutlet} from '@angular/router';
import {RouterOutlet} from '@angular/router';
import {NzLayoutModule} from 'ng-zorro-antd/layout';
import {NzMenuModule} from 'ng-zorro-antd/menu';
import {NzIconDirective} from "ng-zorro-antd/icon";
import {ModalNav} from "./components/modal-nav/modal-nav";
import {Profil} from "./components/profil/profil";
import {SettingForm} from "./components/setting-form/setting-form";
@Component({
selector: 'app-root',
imports: [RouterOutlet, NzLayoutModule, NzMenuModule, NzIconDirective, RouterLinkActive, RouterLink, ModalNav, Profil, SettingForm],
imports: [RouterOutlet, NzLayoutModule, NzMenuModule],
templateUrl: './app.html',
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-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">
<nz-table [nzBordered]="true" class="mx-auto text-center">
<thead>
@@ -18,7 +35,7 @@
</tr>
</thead>
<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">
<td class="text-center">{{ line.value.name }}</td>
<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 {GetProductDto} from '../../services/api';
import {GetProductDto, GetSupplierDto} from '../../services/api';
import {NzTableComponent} from "ng-zorro-antd/table";
import {NzInputNumberComponent} from "ng-zorro-antd/input-number";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {min} from "rxjs";
@Component({
selector: 'app-create-purchaseorder-form',
@@ -22,31 +24,70 @@ import {NzInputDirective} from "ng-zorro-antd/input";
NzFormItemComponent,
NzFormLabelComponent,
NzInputDirective,
NzOptionComponent,
NzSelectComponent,
]
})
export class CreatePurchaseorderForm {
createPurchaseOrderForm: FormGroup
suppliers = input.required<GetSupplierDto[]>();
products = input.required<GetProductDto[]>();
constructor(private fb: FormBuilder) {
this.createPurchaseOrderForm = this.fb.group({
purchaseConditions: new FormControl<string | null>(null, Validators.required),
lines: this.fb.array([])
});
getBestSupplier() {
let bestSupplier: GetSupplierDto = this.suppliers()[0];
let maxProducts = 0;
const selectedProducts = this.products().map(x => x.id);
this.suppliers().forEach(x => {
const supplierProductsCount = x.prices.filter(p => selectedProducts.includes(p.productId)).length ?? 0;
if (supplierProductsCount > maxProducts) {
maxProducts = supplierProductsCount;
bestSupplier = x;
}
})
return bestSupplier;
}
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 {
return this.createPurchaseOrderForm.get('lines') as FormArray;
}
// Ajouter des produits sélectionnés dans le formulaire
syncSelectedProducts(selectedProducts: GetProductDto[]) {
addProductToForm() {
const supplierId = this.createPurchaseOrderForm.value.supplierId ?? this.getBestSupplier().id;
this.createPurchaseOrderForm.patchValue({
supplierId
});
this.refresh();
}
refresh() {
this.lines.clear();
selectedProducts.forEach(p => {
this.lines.push(this.fb.group({
productId: [p.id],
name: [p.name],
quantity: [1, [Validators.required, Validators.min(1)]]
}));
this.getProductsOfSupplier().forEach(x => {
this.lines.push(
new FormGroup({
productId: new FormControl(x.id),
name: new FormControl(x.name),
quantity: new FormControl(1, [Validators.required, Validators.min(1)])
})
);
});
}
}
@@ -1,4 +1,20 @@
<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-label nzSpan="12" nzRequired>
Message
@@ -15,7 +31,7 @@
</nz-form-label>
<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-item>
@@ -28,7 +44,7 @@
</tr>
</thead>
<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">
<td class="text-center">{{ line.value.name }}</td>
<td class="text-center">
@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {Component, inject, input, OnInit, signal} from '@angular/core';
import {
FormArray,
FormBuilder,
@@ -14,7 +14,10 @@ import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzInputNumberComponent} from "ng-zorro-antd/input-number";
import {NzTableComponent} from "ng-zorro-antd/table";
import {GetProductDto} from "../../services/api";
import {CustomersService, GetCustomerDto, GetProductDto, GetSupplierDto} from "../../services/api";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {firstValueFrom} from "rxjs";
import {NzNotificationService} from "ng-zorro-antd/notification";
@Component({
selector: 'app-create-quotation-form',
@@ -28,35 +31,75 @@ import {GetProductDto} from "../../services/api";
NzInputDirective,
NzInputNumberComponent,
NzTableComponent,
ReactiveFormsModule
ReactiveFormsModule,
NzOptionComponent,
NzSelectComponent
],
templateUrl: './create-quotation-form.html',
styleUrl: './create-quotation-form.css',
})
export class CreateQuotationForm {
createQuotationForm: FormGroup
export class CreateQuotationForm implements OnInit {
private customersService = inject(CustomersService);
private notificationService = inject(NzNotificationService);
constructor(private fb: FormBuilder) {
this.createQuotationForm = this.fb.group({
message: new FormControl<string>(null, Validators.required),
purchaseConditions: new FormControl<string>(null, Validators.required),
lines: this.fb.array([])
});
suppliers = input.required<GetSupplierDto[]>();
products = input.required<GetProductDto[]>();
customers = signal<GetCustomerDto[]>([]);
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 {
return this.createQuotationForm.get('lines') as FormArray;
}
// Ajouter des produits sélectionnés dans le formulaire
syncSelectedProducts(selectedProducts: GetProductDto[]) {
getDefaultSupplier() {
let defaultSupplier: GetSupplierDto = this.suppliers()[0];
let maxProducts = 0;
const selectedProducts = this.products().map(x => x.id);
this.suppliers().forEach(x => {
const supplierProductsCount = x.prices.filter(p => selectedProducts.includes(p.productId)).length ?? 0;
if (supplierProductsCount > maxProducts) {
maxProducts = supplierProductsCount;
defaultSupplier = x;
}
})
return defaultSupplier;
}
addProductToForm() {
this.lines.clear();
selectedProducts.forEach(p => {
this.lines.push(this.fb.group({
productId: [p.id],
name: [p.name],
quantity: [1, [Validators.required, Validators.min(1)]]
}));
this.products().forEach(x => {
this.lines.push(
new FormGroup({
productId: new FormControl(x.id),
name: new FormControl(x.name),
quantity: new FormControl(1, [Validators.required, Validators.min(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">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(deliverer)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliverer.id)"
class="text-red-600 cursor-pointer"></nz-icon>
@if (admin()){
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliverer.id)"
class="text-red-600 cursor-pointer"></nz-icon>
}
</div>
</td>
</tr>
@@ -9,7 +9,7 @@ import {DelivererForm} from "../deliverer-form/deliverer-form";
import {DeliverersService, GetDelivererDto, GetSupplierDto} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
import {SupplierForm} from "../supplier-form/supplier-form";
import {AuthService} from "../../services/auth.service";
@Component({
selector: 'app-deliverer-table',
@@ -29,13 +29,17 @@ import {SupplierForm} from "../supplier-form/supplier-form";
export class DelivererTable implements OnInit {
private deliverersService = inject(DeliverersService);
private notificationService = inject(NzNotificationService)
private authService = inject(AuthService);
deliverers = signal<GetDelivererDto[]>([]);
deliverersLoading = signal<boolean>(false);
updateDeliverer = viewChild.required<DelivererForm>('delivererForm');
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav');
async ngOnInit() {
await this.fetchDeliverers();
this.admin.set(this.authService.isAdmin());
}
async fetchDeliverers() {
@@ -44,11 +48,8 @@ export class DelivererTable implements OnInit {
try {
const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint())
this.deliverers.set(deliverers);
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur de communication avec l\'API'
)
} catch {
this.notificationService.error('Erreur', 'Erreur lors du chargement des transporteurs');
}
this.deliverersLoading.set(false)
}
@@ -56,11 +57,8 @@ export class DelivererTable implements OnInit {
async delete(deliverer: number) {
try {
await firstValueFrom(this.deliverersService.deleteDelivererEndpoint(deliverer))
this.notificationService.success(
'Success',
'Suppression effectuée'
)
} catch (e) {
this.notificationService.success('Success', 'Suppression effectuée');
} catch {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
@@ -71,10 +69,7 @@ export class DelivererTable implements OnInit {
async edit(id: number, updateDelivererComponent: DelivererForm) {
if (updateDelivererComponent.delivererForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Formulaire invalide');
return;
}
@@ -83,7 +78,7 @@ export class DelivererTable implements OnInit {
await firstValueFrom(this.deliverersService.updateDelivererEndpoint(id, deliverers))
this.notificationService.success('Success', 'Transporteur modifié')
} catch (e) {
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification')
}
}
@@ -100,7 +95,7 @@ export class DelivererTable implements OnInit {
await this.edit(supplierId, updateDelivererComponent);
updateDelivererComponent.delivererForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchDeliverers();
}
@@ -5,8 +5,7 @@
</nz-form-label>
<nz-form-control nzSpan="9" nzErrorTip="Ce champ est requis">
<nz-select formControlName="delivererId" [nzPlaceHolder]="'Choisir un transporteur'" nzShowSearch
[nzFilterOption]="filter">
<nz-select formControlName="delivererId" nzPlaceHolder="Choisir un transporteur" nzShowSearch>
@for (deliverer of deliverers(); track deliverer.id) {
<nz-option [nzValue]="deliverer.id" [nzLabel]="deliverer.transporter"></nz-option>
}
@@ -31,19 +31,22 @@ export class DelivereryNoteForm implements OnInit {
trackingNumber: new FormControl<string>(null),
delivererId: new FormControl<number>(null, [Validators.required]),
expeditionDate: new FormControl(null, [Validators.required]),
estimatedDate: new FormControl(null),
estimatedDate: new FormControl(null, [Validators.required]),
realDeliveryDate: new FormControl(null)
})
private deliverersService = inject(DeliverersService);
private notificationService = inject(NzNotificationService);
deliverers = signal<GetDelivererDto[]>([]);
deliveryNote = input<GetDeliveryNoteDto>();
async fetchDeliverers() {
try {
const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint());
this.deliverers.set(deliverers);
} catch (e) {
} catch {
this.notificationService.error('Erreur', 'Impossible de récupérer les transporteurs');
}
}
@@ -52,12 +55,6 @@ export class DelivereryNoteForm implements OnInit {
await this.fetchDeliverers();
}
filter(input: string, option: any) {
return option.nzLabel.toLowerCase().includes(input.toLowerCase());
}
deliveryNote = input<GetDeliveryNoteDto>();
constructor() {
effect(() => {
if (this.deliveryNote()) {
@@ -9,6 +9,7 @@
<th>Date d'expédition</th>
<th>Date de livraison estimée</th>
<th>Date de livraison réelle</th>
<th>Statut</th>
<th>Action</th>
</tr>
</thead>
@@ -20,6 +21,15 @@
<td>{{ deliveryNote.expeditionDate | date: 'dd/MM/yyyy' }}</td>
<td>{{ deliveryNote.estimateDeliveryDate | 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>
<div style="justify-content: center; display: flex">
<nz-icon nzType="check" nzTheme="outline" (click)="validate(deliveryNote.id)"
@@ -28,9 +38,11 @@
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(deliveryNote)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliveryNote.id)"
class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider>
@if (admin()){
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliveryNote.id)"
class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider>
}
<nz-icon nzType="export" nzTheme="outline" (click)="export(deliveryNote.id)"
class="cursor-pointer text-green-700"/>
</div>
@@ -5,11 +5,12 @@ import {NzDividerComponent} from "ng-zorro-antd/divider";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzTableComponent} from "ng-zorro-antd/table";
import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form";
import {DeliverynotesService, GetDeliveryNoteDto} from "../../services/api";
import {DeliverynotesService, GetDeliveryNoteDto, UpdateDeliveryNoteDto} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
import {format} from "date-fns";
import {FileService} from "../../services/file.service";
import {AuthService} from "../../services/auth.service";
@Component({
selector: 'app-deliverery-note-table',
@@ -28,12 +29,19 @@ export class DelivereryNoteTable implements OnInit {
private deliveryNotesService = inject(DeliverynotesService);
private notificationService = inject(NzNotificationService);
private fileService = inject(FileService);
private authService = inject(AuthService);
deliveryNotes = signal<GetDeliveryNoteDto[]>([]);
deliveryNotesLoading = signal<boolean>(false);
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav');
date = new Date().toISOString().split('T')[0]; // yyyy-mm-dd
async ngOnInit() {
await this.fetchDeliveryNotes();
this.admin.set(this.authService.isAdmin());
}
async fetchDeliveryNotes() {
@@ -41,11 +49,8 @@ export class DelivereryNoteTable implements OnInit {
try {
const deliveryNotes = await firstValueFrom(this.deliveryNotesService.getAllDeliveryNoteEndpoint());
this.deliveryNotes.set(deliveryNotes);
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur de communication avec l\'API'
)
} catch {
this.notificationService.error('Erreur', 'Erreur lors du chargement des bons de livraison');
}
this.deliveryNotesLoading.set(false)
}
@@ -54,15 +59,9 @@ export class DelivereryNoteTable implements OnInit {
this.deliveryNotesLoading.set(true)
try {
await firstValueFrom(this.deliveryNotesService.deleteDeliveryNoteEndpoint(deliveryNote));
this.notificationService.success(
'Success',
'Suppression effectuée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
this.notificationService.success('Success', 'Suppression effectuée');
} catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne');
}
this.deliveryNotesLoading.set(false)
await this.fetchDeliveryNotes();
@@ -77,22 +76,12 @@ export class DelivereryNoteTable implements OnInit {
try {
await firstValueFrom(this.deliveryNotesService.patchRealDeliveryDateEndpoint(deliveryNote, PatchRealDate))
this.notificationService.success(
'Success',
'Date actualisée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'La date à déjà été actualisée'
)
this.notificationService.success('Success', 'Date actualisée');
} catch {
this.notificationService.error('Erreur', 'La date à déjà été actualisée');
}
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur d\'actualisation de la date'
)
} catch {
this.notificationService.error('Erreur', 'Erreur d\'actualisation de la date');
}
this.deliveryNotesLoading.set(false)
await this.fetchDeliveryNotes()
@@ -101,15 +90,10 @@ export class DelivereryNoteTable implements OnInit {
async export(deliveryNoteId: number) {
this.deliveryNotesLoading.set(true)
try {
const pdf = await firstValueFrom(
this.deliveryNotesService.getDeliveryNotePdfEndpoint(deliveryNoteId, "response")
);
const pdf = await firstValueFrom(this.deliveryNotesService.getDeliveryNotePdfEndpoint(deliveryNoteId, "response"));
this.fileService.downloadBlob(pdf)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de générer un PDF'
);
} catch {
this.notificationService.error('Erreur', 'Impossible de générer un PDF');
}
this.deliveryNotesLoading.set(false)
}
@@ -123,34 +107,20 @@ export class DelivereryNoteTable implements OnInit {
try {
const raw = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue();
// convertit proprement les dates (string OU Date)
const toIso = (val: any) => {
if (!val) return null;
const toIso = (val: any) =>
val ? new Date(val).toISOString().substring(0, 10) : null;
// si cest déjà un string ISO "yyyy-MM-dd", on renvoie tel quel
if (typeof val === 'string' && /^\d{4}-\d{2}-\d{2}/.test(val)) {
return val.substring(0, 10);
}
// sinon on reconstruit une Date
const d = new Date(val);
if (isNaN(d.getTime())) return null;
return d.toISOString().substring(0, 10); // yyyy-MM-dd
};
const deliveryNoteDto = {
const deliveryNoteDto: UpdateDeliveryNoteDto = {
trackingNumber: raw.trackingNumber,
delivererId: raw.delivererId,
expeditionDate: toIso(raw.expeditionDate),
estimatedDate: toIso(raw.estimatedDate),
estimateDeliveryDate: toIso(raw.estimatedDate),
realDeliveryDate: toIso(raw.realDeliveryDate)
};
await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNoteDto));
this.notificationService.success('Success', 'Bon de livraison modifié');
} catch (e) {
console.error(e);
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification');
}
}
@@ -167,7 +137,7 @@ export class DelivereryNoteTable implements OnInit {
await this.edit(id, updateDelivereryNoteComponent);
updateDelivereryNoteComponent.deliveryNoteForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchDeliveryNotes();
}
@@ -11,7 +11,6 @@
flex-direction: column;
align-items: flex-start;
/* Box shadow pour effet superposition */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06),
0 8px 20px rgba(0, 0, 0, 0.08),
0 16px 40px rgba(0, 0, 0, 0.06);
@@ -35,15 +34,13 @@
outline: none;
}
/* Liste scrollable */
.livraisons-list {
width: 100%;
max-height: 350px; /* hauteur max de la liste */
overflow-y: auto; /* scroll vertical activé */
padding-right: 10px; /* pour le scrollbar */
max-height: 500px;
overflow-y: auto;
padding-right: 10px;
}
/* Scrollbar personnalisée (optionnel) */
.livraisons-list::-webkit-scrollbar {
width: 8px;
}
@@ -57,7 +54,6 @@
background: #f3f4f6;
}
/* Carte de livraison */
.livraison-card {
background: #ffffff;
padding: 20px 22px;
@@ -76,7 +72,6 @@
box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}
/* Infos livraison */
.livraison-info h3 {
font-size: 17px;
margin: 0 0 4px;
@@ -88,26 +83,3 @@
font-size: 14px;
color: #6b7280;
}
/* Bouton valider */
.validate-btn {
padding: 10px 20px;
border-radius: 12px;
border: none;
cursor: pointer;
font-weight: 600;
background: #3b82f6;
color: white;
transition: all 0.3s ease;
}
.validate-btn:hover {
background: #2563eb;
}
.validate-btn.validated {
background: #9ca3af;
cursor: default;
color: #ffffff;
opacity: 0.9;
}
@@ -3,18 +3,55 @@
(input)="search.set($any($event.target).value)"/>
<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-info">
<h3>{{ deliveryItem.client }}</h3>
<p class="mr-5">Date d'expédition: {{ deliveryItem.date }}</p>
<p>Produits : {{ deliveryItem.produits }}</p>
<h3>{{ deliveryItem.delivererTransporter }}</h3>
<p class="mr-5">Date d'expédition: {{ deliveryItem.expeditionDate }}</p>
<p>Quantité livrée : {{ deliveryItem.products.length }}</p>
</div>
<button nz-button nzType="primary" [nzSize]="size" nzShape="round" (click)="validate(deliveryItem.id)">
<nz-icon nzType="check"/>
Valider
</button>
<app-modal-nav #modal name="Valider la livraison" nameIcon="check"
(click)="check(deliveryItem.id)"
(ok)="validate(deliveryItem.id, selectedWarehouseId!, modal)"
(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>
@@ -1,44 +1,105 @@
import {Component, computed, signal} from '@angular/core';
import {NzButtonComponent, NzButtonSize} from "ng-zorro-antd/button";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {Component, computed, inject, OnInit, signal} from '@angular/core';
import {
DeliverynotesService,
GetDeliveryNoteDto, GetWareHouseDto,
WarehouseproductsService,
WarehousesService
} from "../../services/api";
import {firstValueFrom} from "rxjs";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {NzTableComponent} from "ng-zorro-antd/table";
import {format} from "date-fns";
import {ModalNav} from "../modal-nav/modal-nav";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {FormsModule} from "@angular/forms";
@Component({
selector: 'app-delivery-validator',
imports: [
NzButtonComponent,
NzIconDirective
NzTableComponent,
ModalNav,
NzSelectComponent,
NzOptionComponent,
FormsModule
],
templateUrl: './delivery-validator.html',
styleUrl: './delivery-validator.css',
})
export class DeliveryValidator {
size: NzButtonSize = 'large';
search = signal('');
export class DeliveryValidator implements OnInit {
private deliveryNotesService = inject(DeliverynotesService);
private notificationService = inject(NzNotificationService);
private warehousesService = inject(WarehousesService);
private warehouseProductsService = inject(WarehouseproductsService);
livraisons = signal([
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12},
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8},
{id: 3, client: 'Auchan', date: '2025-02-05', produits: 23},
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12},
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8},
{id: 3, client: 'Auchan', date: '2025-02-05', produits: 23},
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12},
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8},
{id: 3, client: 'Auchan', date: '2025-02-05', produits: 23},
{id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12},
{id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8},
{id: 3, client: 'Auchan', date: '2025-02-05', produits: 23}
]);
search = signal<string>('');
deliveryNotes = signal<GetDeliveryNoteDto[]>([]);
wareHouses = signal<GetWareHouseDto[]>([]);
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();
return this.livraisons().filter(l =>
l.client.toLowerCase().includes(query) ||
l.date.includes(query)
return this.deliveryNotes().filter(l =>
l.delivererTransporter.toLowerCase().includes(query) ||
l.expeditionDate.includes(query)
);
});
validate(id: number) {
return
async check(id: number) {
try {
const PatchRealDate = {
realDeliveryDate: format(new Date(), 'yyyy-MM-dd')
};
await firstValueFrom(this.deliveryNotesService.patchRealDeliveryDateEndpoint(id, PatchRealDate));
} catch {
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 {
icon = input.required<string>()
value = input.required<string>()
value = input.required<number>()
description = 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 {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 {NzModalModule} from 'ng-zorro-antd/modal';
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 {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {GetPriceDto, GetSupplierDto} from "../../services/api";
import {GetPriceDto} from "../../services/api";
@Component({
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])
})
}
@@ -1,10 +0,0 @@
import {Component} from '@angular/core';
@Component({
selector: 'app-product-table',
imports: [],
templateUrl: './product-table.html',
styleUrl: './product-table.css',
})
export class ProductTable {
}
@@ -26,8 +26,7 @@
<nz-form-control nzSpan="12" nzErrorTip="Ce champ est requis">
<nz-select formControlName="fonction" [nzPlaceHolder]="'Choisir une fonction'">
<nz-option nzLabel="Admin" nzValue="Admin"></nz-option>
<nz-option nzLabel="Visiteur" nzValue="Visiteur"></nz-option>
<nz-option nzLabel="Partenaire" nzValue="Partenaire"></nz-option>
<nz-option nzLabel="Employé" nzValue="Employe"></nz-option>
</nz-select>
</nz-form-control>
</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">
{{ getInitial(data.name) }}
{{ getInitial(user().name) }}
</div>
<div class="mt-6">
<p class="text-3xl festive2 mx-auto flex items-center justify-center">{{ data.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">{{ data.fonction }}</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">{{ user().email }}</p>
<p class="text-xl festive2 mt-0 flex items-center justify-center">{{ user().fonction }}</p>
</div>
+19 -15
View File
@@ -1,24 +1,28 @@
import {Component} from '@angular/core';
import {UserInfo} from "../../interfaces/user.interface";
import {ProfilForm} from "../profil-form/profil-form";
import {ModalNav} from "../modal-nav/modal-nav";
import {Component, inject, OnInit, signal} from '@angular/core';
import {NzNotificationService} from "ng-zorro-antd/notification";
import {GetUserDto, UserService} from "../../services/api";
import {firstValueFrom} from "rxjs";
@Component({
selector: 'app-profil',
imports: [
ProfilForm,
ModalNav
],
imports: [],
templateUrl: './profil.html',
styleUrl: './profil.css',
})
export class Profil {
data: UserInfo =
{
name: 'Mathys Sanchez Vendé',
email: 'mathys.sanchez@vende.fr',
fonction: 'admin',
};
export class Profil implements OnInit {
private notificationService = inject(NzNotificationService);
private userService = inject(UserService);
user = signal<GetUserDto>({});
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 {
if (!name || name.trim() === '') return '?';
@@ -16,7 +16,7 @@
<tr>
<td>{{ purchaseOrder.id }}</td>
<td>{{ purchaseOrder.purchaseConditions }}</td>
<td>Fournisseur ???</td>
<td>{{ purchaseOrder.supplierName }}</td>
<td>
<app-modal-button type="link" name="Voir les produits" size="45%">
<div style="max-height: 400px; overflow-y: auto;">
@@ -36,7 +36,7 @@
<tr>
<td>{{ product.productName }}</td>
<td>{{ product.productReference }}</td>
<td>Prix €€€</td>
<td>{{ product.productPrice }} </td>
<td>{{ product.quantity }}</td>
<td>
<div style="justify-content: center; display: flex">
@@ -57,18 +57,18 @@
</td>
<td>
<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"
(click)="openEditModal(purchaseOrder)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(purchaseOrder.id)"
class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider>
@if (admin()) {
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(purchaseOrder.id)"
class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider>
}
<nz-icon nzType="export" nzTheme="outline" (click)="export(purchaseOrder.id)"
class="cursor-pointer text-green-700"/>
<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"/>
</div>
</td>
@@ -78,7 +78,7 @@
</nz-table>
<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)"
(cancel)="onModalCancel(modalNav)">
<app-purchase-order-form #purchaseOrderForm [purchaseOrder]="selectedPurchaseOrder"></app-purchase-order-form>
@@ -86,9 +86,17 @@
</div>
<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)"
(cancel)="onModalCancel(modalQuantity)">
<app-quantity-form #quantityForm [quantity]="selectedQuantity"></app-quantity-form>
</app-modal-nav>
</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 {FileService} from "../../services/file.service";
import {QuantityForm} from "../quantity-form/quantity-form";
import {DelivererChoice} from "../deliverer-choice/deliverer-choice";
import {AuthService} from "../../services/auth.service";
@Component({
selector: 'app-purchase-order-table',
@@ -27,6 +29,7 @@ import {QuantityForm} from "../quantity-form/quantity-form";
PurchaseOrderForm,
ModalButton,
QuantityForm,
DelivererChoice,
],
templateUrl: './purchase-order-table.html',
styleUrl: './purchase-order-table.css',
@@ -36,13 +39,19 @@ export class PurchaseOrderTable implements OnInit {
private notificationService = inject(NzNotificationService);
private fileService = inject(FileService);
private deliveryNoteService = inject(DeliverynotesService);
private authService = inject(AuthService);
purchaseOrders = signal<GetPurchaseOrderDto[]>([]);
purchaseOrdersLoading = signal<boolean>(false);
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav');
modalQuantity = viewChild.required<ModalNav>('modalQuantity');
modalDeliverer = viewChild.required<ModalNav>('modalDeliverer');
async ngOnInit() {
await this.fetchPurchaseOrder();
this.admin.set(this.authService.isAdmin());
}
async fetchPurchaseOrder() {
@@ -51,11 +60,8 @@ export class PurchaseOrderTable implements OnInit {
try {
const purchaseOrders = await firstValueFrom(this.purchaseOrdersService.getAllPurchaseOrderEndpoint())
this.purchaseOrders.set(purchaseOrders);
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur de communication avec l\'API'
)
} catch {
this.notificationService.error('Erreur', 'Erreur lors du chargement des bons de commande')
}
this.purchaseOrdersLoading.set(false)
}
@@ -64,15 +70,9 @@ export class PurchaseOrderTable implements OnInit {
this.purchaseOrdersLoading.set(true)
try {
await firstValueFrom(this.purchaseOrdersService.deletePurchaseOrderEndpoint(purchaseOrderId))
this.notificationService.success(
'Success',
'Suppression effectuée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
this.notificationService.success('Success', 'Suppression effectuée')
} catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
}
this.purchaseOrdersLoading.set(false)
await this.fetchPurchaseOrder();
@@ -85,27 +85,18 @@ export class PurchaseOrderTable implements OnInit {
this.purchaseOrdersService.getPurchaseOrderPdfEndpoint(purchaseOrderId, "response")
);
this.fileService.downloadBlob(pdf)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de générer un PDF'
);
} catch {
this.notificationService.error('Erreur', 'Impossible de générer un PDF');
}
this.purchaseOrdersLoading.set(false)
}
async transfer(purchaseOrder: GetPurchaseOrderDto) {
async transfer(purchaseOrder: GetPurchaseOrderDto, delivererForm: DelivererChoice) {
this.purchaseOrdersLoading.set(true);
try {
const today = new Date();
const date = today.toISOString().split('T')[0]; // yyyy-mm-dd
const deliverer = delivererForm.choiceDelivererForm.getRawValue();
const futureDate = new Date(today);
futureDate.setMonth(today.getMonth() + 2);
const yyyy = futureDate.getFullYear();
const mm = (futureDate.getMonth() + 1).toString().padStart(2, '0');
const dd = futureDate.getDate().toString().padStart(2, '0');
const estimateDate = `${yyyy}-${mm}-${dd}`;
const date = new Date().toISOString().split('T')[0]; // yyyy-mm-dd
let trackingValue = 'TRK-';
const idStr = purchaseOrder.id?.toString() ?? '';
@@ -122,28 +113,24 @@ export class PurchaseOrderTable implements OnInit {
const deliveryNoteDto: CreateDeliveryNoteDto = {
trackingNumber: trackingValue,
expeditionDate: date,
estimateDeliveryDate: estimateDate,
delivererId: 1,
productQuantities: productQuantities
delivererId: deliverer.delivererId,
productQuantities: productQuantities,
supplierId: purchaseOrder.supplierId
};
await firstValueFrom(this.deliveryNoteService.createDeliveryNoteEndpoint(deliveryNoteDto));
this.notificationService.success('Succès', 'Bon de livraison créé avec succès');
} catch (e) {
console.error(e);
} catch {
this.notificationService.error('Erreur', 'Erreur lors du transfert');
}
this.onModalCancel(this.modalDeliverer());
this.purchaseOrdersLoading.set(false);
}
async edit(id: number, updatePurchaseOrderComponent: PurchaseOrderForm) {
if (updatePurchaseOrderComponent.purchaseOrderForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Formulaire invalide')
return;
}
@@ -152,7 +139,7 @@ export class PurchaseOrderTable implements OnInit {
await firstValueFrom(this.purchaseOrdersService.patchPurchaseOrderPurchaseConditionsEndpoint(id, purchaseOrders))
this.notificationService.success('Success', 'Bon de commande modifié')
} catch (e) {
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification')
}
}
@@ -161,15 +148,9 @@ export class PurchaseOrderTable implements OnInit {
this.purchaseOrdersLoading.set(true)
try {
await firstValueFrom(this.purchaseOrdersService.deleteProductFromPurchaseOrderEndpoint(productId, purchaseOrderId))
this.notificationService.success(
'Success',
'Suppression effectuée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
this.notificationService.success('Success', 'Suppression effectuée')
} catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
}
this.purchaseOrdersLoading.set(false)
await this.fetchPurchaseOrder();
@@ -177,10 +158,7 @@ export class PurchaseOrderTable implements OnInit {
async editQuantity(productId: number, purchaseOrderId: number, updateQuantityComponent: QuantityForm) {
if (updateQuantityComponent.quantityForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Erreur d\'écriture dans le formulaire')
return;
}
@@ -188,9 +166,9 @@ export class PurchaseOrderTable implements OnInit {
const quantity = updateQuantityComponent.quantityForm.getRawValue();
await firstValueFrom(this.purchaseOrdersService.patchPurchaseProductQuantityEndpoint(productId, purchaseOrderId, quantity))
this.notificationService.success('Success', 'Quantité modifiée')
} catch (e) {
this.notificationService.error('Erreur', 'Erreur lors de la modification')
this.notificationService.success('Success', 'Quantité modifiée');
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification');
}
}
@@ -201,12 +179,17 @@ export class PurchaseOrderTable implements OnInit {
this.modal().showModal();
}
openDelivererModal(purchaseOrder: GetPurchaseOrderDto) {
this.selectedPurchaseOrder = {...purchaseOrder};
this.modalDeliverer().showModal();
}
async onModalOk(id: number, updatePurchaseOrderComponent: PurchaseOrderForm, modal: ModalNav) {
if (!this.selectedPurchaseOrder) return;
await this.edit(id, updatePurchaseOrderComponent);
updatePurchaseOrderComponent.purchaseOrderForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchPurchaseOrder();
}
@@ -226,7 +209,7 @@ export class PurchaseOrderTable implements OnInit {
await this.editQuantity(productId, purchaseOrderId, updateQuantityComponent);
updateQuantityComponent.quantityForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchPurchaseOrder();
}
}
@@ -4,7 +4,7 @@ import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {GetDelivererDto, GetPurchaseProductDto} from "../../services/api";
import {GetPurchaseProductDto} from "../../services/api";
@Component({
selector: 'app-quantity-form',
@@ -36,7 +36,7 @@
<tr>
<td>{{ product.productReference }}</td>
<td>{{ product.productName }}</td>
<td>Price ???</td>
<td>{{ product.productPrice }} €</td>
<td>{{ product.quantity }}</td>
<td>
<div style="justify-content: center; display: flex">
@@ -57,14 +57,14 @@
</td>
<td>
<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"
(click)="openEditModal(quotation)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700"
(click)="delete(quotation.id)"/>
<nz-divider nzType="vertical"></nz-divider>
@if (admin()) {
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700"
(click)="delete(quotation.id)"/>
<nz-divider nzType="vertical"></nz-divider>
}
<nz-icon nzType="export" (click)="export(quotation.id)" nzTheme="outline"
class="cursor-pointer text-green-700"/>
</div>
@@ -14,6 +14,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
import {FileService} from "../../services/file.service";
import {QuantityForm} from "../quantity-form/quantity-form";
import {AuthService} from "../../services/auth.service";
@Component({
selector: 'app-quotation-table',
@@ -34,13 +35,18 @@ export class QuotationTable implements OnInit {
private quotationsService = inject(QuotationsService);
private notificationService = inject(NzNotificationService);
private fileService = inject(FileService);
private authService = inject(AuthService);
quotations = signal<GetQuotationDto[]>([]);
quotationsLoading = signal<boolean>(false);
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav');
modalQuantity = viewChild.required<ModalNav>('modalQuantity');
async ngOnInit() {
await this.fetchQuotations();
this.admin.set(this.authService.isAdmin());
}
async fetchQuotations() {
@@ -49,11 +55,8 @@ export class QuotationTable implements OnInit {
try {
const quotations = await firstValueFrom(this.quotationsService.getAllQuotationEndpoint())
this.quotations.set(quotations);
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur de communication avec l\'API'
)
} catch {
this.notificationService.error('Erreur', 'Erreur lors du chargement des devis')
}
this.quotationsLoading.set(false)
}
@@ -62,15 +65,9 @@ export class QuotationTable implements OnInit {
this.quotationsLoading.set(true)
try {
await firstValueFrom(this.quotationsService.deleteQuotationEndpoint(quotation))
this.notificationService.success(
'Success',
'Suppression effectuée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
this.notificationService.success('Success', 'Suppression effectuée')
} catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
}
this.quotationsLoading.set(false)
await this.fetchQuotations();
@@ -83,12 +80,8 @@ export class QuotationTable implements OnInit {
this.quotationsService.getQuotationPdfEndpoint(quotationId, "response")
);
this.fileService.downloadBlob(pdf)
} catch (e) {
console.error(e);
this.notificationService.error(
'Erreur',
'Impossible de générer un PDF'
);
} catch {
this.notificationService.error('Erreur', 'Impossible de générer un PDF');
}
this.quotationsLoading.set(false)
}
@@ -103,8 +96,7 @@ export class QuotationTable implements OnInit {
const quotations = updateQuotationComponent.quotationForm.getRawValue();
await firstValueFrom(this.quotationsService.updateQuotationEndpoint(id, quotations));
this.notificationService.success('Success', 'Devis modifié')
} catch (e) {
console.error(e)
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification')
}
}
@@ -113,15 +105,9 @@ export class QuotationTable implements OnInit {
this.quotationsLoading.set(true)
try {
await firstValueFrom(this.quotationsService.deleteProductFromQuotationEndpoint(productId, quotationId))
this.notificationService.success(
'Success',
'Suppression effectuée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
this.notificationService.success('Success', 'Suppression effectuée')
} catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
}
this.quotationsLoading.set(false)
await this.fetchQuotations();
@@ -129,10 +115,7 @@ export class QuotationTable implements OnInit {
async editQuantity(productId: number, quotationId: number, updateQuantityComponent: QuantityForm) {
if (updateQuantityComponent.quantityForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Formulaire invalide')
return;
}
@@ -141,7 +124,7 @@ export class QuotationTable implements OnInit {
await firstValueFrom(this.quotationsService.patchQuotationProductQuantityEndpoint(productId, quotationId, quantity))
this.notificationService.success('Success', 'Quantité modifiée')
} catch (e) {
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification')
}
}
@@ -158,7 +141,7 @@ export class QuotationTable implements OnInit {
await this.edit(id, updateQuotationComponent);
updateQuotationComponent.quotationForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchQuotations();
}
@@ -178,7 +161,7 @@ export class QuotationTable implements OnInit {
await this.editQuantity(productId, quotationId, updateQuantityComponent);
updateQuantityComponent.quantityForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
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);
}
}
@@ -1,35 +1,60 @@
<form nz-form nzLayout="horizontal" [formGroup]="settingForm" (ngSubmit)="submitForm()">
<form nz-form nzLayout="horizontal" [formGroup]="settingForm">
<!-- Logo -->
<div class="row">
<div class="row-left">
<img [src]="setting.logo" alt="logo">
@if (settings().logo) {
<img [src]="settings().logo" alt=""/>
} @else {
<img [src]="setting.logo" alt="logo">
}
</div>
<div class="row-right">
<nz-form-item>
<nz-form-label nzSpan="9">Logo</nz-form-label>
<nz-form-control nzSpan="25">
<input nz-input type="file" formControlName="logo"/>
</nz-form-control>
</nz-form-item>
</div>
@if (admin()){
<div class="row-right">
<nz-form-item>
<nz-form-label nzSpan="9">Logo</nz-form-label>
<nz-form-control nzErrorTip="Ce champ est requis">
<input #fileInputLogo nz-input type="file" placeholder="Déposer"
(change)="onFileChange('logo', fileInputLogo.files)">
</nz-form-control>
</nz-form-item>
</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>
<!-- Signature -->
<div class="row">
<div class="row-left">
<img [src]="setting.signature" alt="logo">
@if (settings().electronicSignature) {
<img [src]="settings().electronicSignature" alt=""/>
} @else {
<img [src]="setting.electronicSignature" alt="logo">
}
</div>
<div class="row-right">
<nz-form-item>
<nz-form-label nzSpan="9">Signature</nz-form-label>
<nz-form-control nzSpan="25">
<input nz-input type="file" formControlName="signature"/>
</nz-form-control>
</nz-form-item>
</div>
@if (admin()) {
<div class="row-right">
<nz-form-item>
<nz-form-label nzSpan="9">Signature</nz-form-label>
<nz-form-control nzErrorTip="Ce champ est requis">
<input #fileInputSignature nz-input type="file" placeholder="Déposer"
(change)="onFileChange('electronicSignature', fileInputSignature.files)">
</nz-form-control>
</nz-form-item>
</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>
</form>
+61 -18
View File
@@ -1,9 +1,14 @@
import {Component} from '@angular/core';
import {Component, inject, OnInit, signal} from '@angular/core';
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from "@angular/forms";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {SettingInfo} from "../../interfaces/setting.interface";
import {firstValueFrom} from "rxjs";
import {GetSettingDto, SettingsService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import imageCompression from "browser-image-compression";
import {AuthService} from "../../services/auth.service";
@Component({
selector: 'app-setting-form',
@@ -15,30 +20,68 @@ import {SettingInfo} from "../../interfaces/setting.interface";
NzFormItemComponent,
NzFormLabelComponent,
NzInputDirective,
ReactiveFormsModule
ReactiveFormsModule,
],
templateUrl: './setting-form.html',
styleUrl: './setting-form.css',
})
export class SettingForm {
settingForm: FormGroup = new FormGroup({
logo: new FormControl<string>(null),
signature: new FormControl<string>(null)
})
export class SettingForm implements OnInit {
private settingsService = inject(SettingsService);
private notificationService = inject(NzNotificationService);
private authService = inject(AuthService);
submitForm() {
// Pour annuler si le formulaire est invalide
if (this.settingForm.invalid) return;
// Pour obtenir la valeur du formulaire
console.log(this.settingForm.getRawValue())
// Pour vider le formulaire
this.settingForm.reset()
}
settings = signal<GetSettingDto>({});
admin = signal<boolean>(false);
setting: SettingInfo = {
logo: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png',
signature: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png'
electronicSignature: 'https://www.pyro-fetes.com/wp-content/themes/pcptheme/img/logo-pyro-fetes-OR-top.png'
}
settingForm: FormGroup = new FormGroup({
logo: new FormControl<string>(null),
electronicSignature: new FormControl<string>(null)
})
async ngOnInit() {
await this.fetchSettings();
this.admin.set(this.authService.isAdmin());
}
async fetchSettings() {
try {
const settingsPicture = await firstValueFrom(this.settingsService.getSettingEndpoint());
this.settings.set(settingsPicture);
} catch {
this.notificationService.error('Erreur', 'Aucun paramètre défini')
}
}
async onFileChange(control: string, files?: FileList | null) {
if (!files?.length) return;
const file = files[0];
const options = {
maxSizeMB: 1,
maxWidthOrHeight: 1080,
useWebWorker: true,
fileType: 'image/jpeg'
}
const compressed = await imageCompression(file, options);
try {
if (control === 'logo') {
await firstValueFrom(this.settingsService.patchSettingLogoEndpoint(compressed));
} else {
await firstValueFrom(this.settingsService.patchSettingElectronicSignatureEndpoint(compressed));
}
await this.fetchSettings();
} catch {
this.notificationService.error('Erreur', 'Impossible de changer les paramètres actuellement');
}
this.settingForm.reset();
}
}
@@ -6,7 +6,7 @@
</nz-form-label>
<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-item>
</form>
+13 -14
View File
@@ -1,18 +1,16 @@
<nz-table
[nzData]="filteredProducts()"
[nzData]="products()"
[nzFrontPagination]="false"
[nzLoading]="productsLoading()"
(nzCurrentPageDataChange)="onCurrentPageDataChange($event)"
>
<thead>
<tr class="text-center">
<th nzWidth="40px">
<label
nz-checkbox
[(ngModel)]="checked"
[nzIndeterminate]="indeterminate"
(ngModelChange)="onAllChecked($event)"
></label>
<label nz-checkbox
[(ngModel)]="checked"
[nzIndeterminate]="indeterminate"
(ngModelChange)="allCheck($event)">
</label>
</th>
<th>Nom</th>
<th>Référence</th>
@@ -27,16 +25,15 @@
</thead>
<tbody class="text-center">
@for (product of filteredProducts(); track product.id) {
@for (product of products(); track product.id) {
<tr>
<td nzWidth="40px">
<label
nz-checkbox
[ngModel]="setOfCheckedId.has(product.id)"
[ngModel]="selectedIds.includes(product.id)"
(ngModelChange)="onItemChecked(product.id, $event)"
></label>
</td>
<td>{{ product.name }}</td>
<td>{{ product.references }}</td>
<td>{{ product.nec }}</td>
@@ -49,9 +46,11 @@
<div style="justify-content: center; display: flex">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(product)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(product.id)"
class="text-red-600 cursor-pointer"></nz-icon>
@if (admin()) {
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(product.id)"
class="text-red-600 cursor-pointer"></nz-icon>
}
</div>
</td>
</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 {ModalNav} from "../modal-nav/modal-nav";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {StockForm} from "../stock-form/stock-form";
import {NzDividerComponent} from "ng-zorro-antd/divider";
import {FormsModule} from "@angular/forms";
import {NzCheckboxComponent} from "ng-zorro-antd/checkbox";
import {GetProductDto, ProductsService, WarehouseproductsService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
import {NzCheckboxComponent} from "ng-zorro-antd/checkbox";
import {AuthService} from "../../services/auth.service";
interface ProductWithQuantity extends GetProductDto {
totalQuantity?: number;
@@ -23,8 +24,8 @@ interface ProductWithQuantity extends GetProductDto {
StockForm,
NzDividerComponent,
FormsModule,
NzCheckboxComponent,
NzThMeasureDirective,
NzCheckboxComponent,
],
templateUrl: './stock-table.html',
styleUrl: './stock-table.css',
@@ -34,109 +35,52 @@ export class StockTable implements OnInit {
private productsService = inject(ProductsService);
private wareHousseProductsService = inject(WarehouseproductsService)
private notificationService = inject(NzNotificationService)
private authService = inject(AuthService);
products = signal<ProductWithQuantity[]>([]);
productsLoading = signal<boolean>(false);
updateProduct = viewChild.required<StockForm>('stockForm');
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav');
checked = false;
indeterminate = false;
setOfCheckedId = new Set<number>();
selectionChange = output<boolean>()
currentPageData: GetProductDto[] = [];
selectionChange = output<number[]>();
productsTables = output<GetProductDto[]>();
private searchQuery = signal<string>('');
filteredProducts = computed(() => {
const q = this.searchQuery().toLowerCase().trim();
if (!q) return this.products();
return this.products().filter(s => {
const name = (s.name ?? '').toLowerCase();
return name.includes(q);
});
});
applySearch(query: string) {
this.searchQuery.set(query);
}
get hasSelection(): boolean {
return this.setOfCheckedId.size > 0;
}
updateCheckedSet(id: number, checked: boolean): void {
if (checked) this.setOfCheckedId.add(id);
else this.setOfCheckedId.delete(id);
}
onItemChecked(id: number, checked: boolean): void {
this.updateCheckedSet(id, checked);
this.refreshCheckedStatus();
}
onAllChecked(checked: boolean): void {
this.currentPageData.forEach(item =>
this.updateCheckedSet(item.id, checked)
);
this.refreshCheckedStatus();
}
onCurrentPageDataChange($event: GetProductDto[]): void {
this.currentPageData = $event;
this.refreshCheckedStatus();
}
refreshCheckedStatus(): void {
const total = this.currentPageData.length;
const checkedCount = this.currentPageData.filter(p => this.setOfCheckedId.has(p.id)).length;
this.checked = checkedCount === total;
this.indeterminate = checkedCount > 0 && checkedCount < total;
setTimeout(() => this.selectionChange.emit(this.hasSelection));
}
get selectedIds() {
return Array.from(this.setOfCheckedId);
}
selectedProduct: GetProductDto | null = null;
checked: boolean = false;
indeterminate: boolean = false;
selectedIds: number[] = [];
async ngOnInit() {
await this.fetchProducts();
}
async fetchTotalQuantity(product: ProductWithQuantity) {
try {
const res = await firstValueFrom(
this.wareHousseProductsService.getTotalQuantityEndpoint(product.id)
);
product.totalQuantity = res.totalQuantity;
} catch (e) {
product.totalQuantity = 0;
}
this.admin.set(this.authService.isAdmin());
}
async fetchProducts() {
this.productsLoading.set(true);
try {
const products = await firstValueFrom(this.productsService.getAllProductsEndpoint());
this.productsTables.emit(products);
// transforme chaque produit en ProductWithQuantity
const productsWithQuantity: ProductWithQuantity[] = products.map(p => ({...p}));
this.products.set(productsWithQuantity);
// récupérer la quantité pour chaque produit en parallèle
await Promise.all(productsWithQuantity.map(p => this.fetchTotalQuantity(p)));
// déclencher la mise à jour du signal
this.products.set([...productsWithQuantity]);
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur de communication avec l\'API'
const productsWithQuantity = await Promise.all(
products.map(async (x) => {
try {
const quantity = await firstValueFrom(this.wareHousseProductsService.getTotalQuantityEndpoint(x.id));
return {
...x,
totalQuantity: quantity.totalQuantity ?? 0
};
} catch {
return {
...x,
totalQuantity: 0
};
}
})
);
this.products.set(productsWithQuantity);
} catch {
this.notificationService.error('Erreur', 'Impossible de charger le catalogue');
}
this.productsLoading.set(false);
}
@@ -144,48 +88,28 @@ export class StockTable implements OnInit {
async delete(productId: number) {
try {
await firstValueFrom(this.productsService.deleteProductEndpoint(productId))
this.notificationService.success(
'Success',
'Suppression effectuée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
this.notificationService.success('Success', 'Suppression effectuée');
} catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne');
}
await this.fetchProducts();
}
async edit(id: number, updateProductComponent: StockForm) {
if (updateProductComponent.stockForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Formulaire invalide')
return;
}
try {
const products = updateProductComponent.stockForm.getRawValue();
await firstValueFrom(this.productsService.patchProductMinimalStockEndpoint(id, products))
this.notificationService.success(
'Success',
'Limite de stock modifiée'
)
} catch (e) {
console.error(e);
this.notificationService.error(
'Erreur',
'Erreur lors de la modification'
)
await firstValueFrom(this.productsService.patchProductMinimalStockEndpoint(id, products));
await this.fetchProducts();
this.notificationService.success('Success', 'Limite de stock modifiée');
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification');
}
}
selectedProduct: GetProductDto | null = null;
openEditModal(product: GetProductDto) {
this.selectedProduct = {...product};
this.modal().showModal();
@@ -193,14 +117,43 @@ export class StockTable implements OnInit {
async onModalOk(productId: number, updateProductComponent: StockForm, modal: ModalNav) {
if (!this.selectedProduct) return;
await this.edit(productId, updateProductComponent);
updateProductComponent.stockForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchProducts();
}
onModalCancel(modal: ModalNav) {
modal.isVisible = false;
}
updateCheck(id: number, checked: boolean) {
if (checked) {
if (!this.selectedIds.includes(id)) {
this.selectedIds.push(id);
}
} else this.selectedIds = this.selectedIds.filter(x => x !== id);
}
refreshCheckStatus() {
const total = this.products().length;
const checkedCount = this.selectedIds.length;
this.checked = checkedCount === total;
this.indeterminate = checkedCount > 0 && checkedCount < total;
this.selectionChange.emit(this.selectedIds);
}
allCheck(checked: boolean) {
this.products().forEach(x =>
this.updateCheck(x.id, checked)
);
this.refreshCheckStatus();
}
onItemChecked(id: number, checked: boolean): void {
this.updateCheck(id, checked);
this.refreshCheckStatus();
}
}
@@ -22,6 +22,8 @@ import {GetSupplierDto} from "../../services/api";
styleUrl: './supplier-form.css',
})
export class SupplierForm {
supplier = input<GetSupplierDto>();
supplierForm: FormGroup = new FormGroup({
name: new FormControl<string>(null, [Validators.required]),
email: new FormControl<string>(null, [Validators.required]),
@@ -33,8 +35,6 @@ export class SupplierForm {
})
supplier = input<GetSupplierDto>();
constructor() {
effect(() => {
if (this.supplier()) {
@@ -1,4 +1,4 @@
<nz-table [nzData]="filteredSuppliers()"
<nz-table [nzData]="suppliers()"
[nzLoading]="suppliersLoading()"
[nzFrontPagination]="false">
<thead>
@@ -15,7 +15,7 @@
</tr>
</thead>
<tbody style="text-align: center">
@for (supplier of filteredSuppliers(); track supplier.id) {
@for (supplier of suppliers(); track supplier.id) {
<tr>
<td>{{ supplier.name }}</td>
<td>{{ supplier.phone }}</td>
@@ -26,7 +26,7 @@
<td>{{ supplier.deliveryDelay }} jours</td>
<td>
<app-modal-button type="link" [name]="'Voir les produits'" size="45%">
<nz-table [nzData]="filteredSuppliers()" [nzFrontPagination]="false">
<nz-table [nzData]="suppliers()" [nzFrontPagination]="false">
<thead>
<tr class="text-center">
<th>Produit</th>
@@ -36,20 +36,22 @@
</tr>
</thead>
<tbody class="text-center">
@for (product of supplier.prices; track product.id) {
@for (product of supplier.prices; track product.productId) {
<tr>
<td>{{ product.productName }}</td>
<td>{{ product.productReferences }}</td>
<td>{{ product.productReference }}</td>
<td>{{ product.sellingPrice }}€</td>
<td>
<div class="flex items-center justify-center space-x-2">
<nz-icon nzType="edit" nzTheme="outline"
class="cursor-pointer text-gray-600 hover:text-gray-900"
(click)="openEditProductModal(product, supplier.id)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline"
class="cursor-pointer text-red-600 hover:text-red-800"
(click)="deleteProduct(product.productId, product.supplierId)"></nz-icon>
@if (admin()) {
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline"
class="cursor-pointer text-red-600 hover:text-red-800"
(click)="deleteProduct(product.productId, supplier.id)"></nz-icon>
}
</div>
</td>
</tr>
@@ -62,9 +64,11 @@
<div style="display: flex; align-items: center;">
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer"
(click)="openEditModal(supplier)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(supplier.id)"
class="text-red-600 cursor-pointer"></nz-icon>
@if (admin()) {
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(supplier.id)"
class="text-red-600 cursor-pointer"></nz-icon>
}
</div>
</td>
</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 {NzDividerComponent} from "ng-zorro-antd/divider";
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 {firstValueFrom} from "rxjs";
import {PriceForm} from "../price-form/price-form";
import {AuthService} from "../../services/auth.service";
@Component({
selector: 'app-supplier-table',
@@ -29,34 +30,22 @@ export class SupplierTable implements OnInit {
private suppliersService = inject(SuppliersService);
private pricesService = inject(PricesService);
private notificationService = inject(NzNotificationService);
private authService = inject(AuthService);
suppliers = signal<GetSupplierDto[]>([]);
suppliersLoading = signal<boolean>(false);
updateSupplier = viewChild.required<SupplierForm>('supplierForm');
admin = signal<boolean>(false);
supplierModal = viewChild.required<ModalNav>('supplierModal');
productModal = viewChild.required<ModalNav>('productModal');
selectedSupplier: GetSupplierDto | null = null;
selectedProduct: GetPriceDto | null = null;
selectedProductSupplierId: number | null = null;
async ngOnInit() {
await this.fetchSuppliers();
}
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);
this.admin.set(this.authService.isAdmin());
}
async fetchSuppliers() {
@@ -64,7 +53,7 @@ export class SupplierTable implements OnInit {
try {
const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint());
this.suppliers.set(suppliers);
} catch (e) {
} catch {
this.notificationService.error('Erreur', 'Erreur de communication avec l\'API');
}
this.suppliersLoading.set(false);
@@ -79,8 +68,7 @@ export class SupplierTable implements OnInit {
const suppliers = updateSupplierComponent.supplierForm.getRawValue();
await firstValueFrom(this.suppliersService.updateSupplierEndpoint(id, suppliers));
this.notificationService.success('Success', 'Fournisseur modifié');
} catch (e) {
console.error(e);
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification');
}
}
@@ -90,7 +78,7 @@ export class SupplierTable implements OnInit {
await firstValueFrom(this.suppliersService.deleteSupplierEndpoint(supplier));
this.notificationService.success('Succès', 'Suppression effectuée');
await this.fetchSuppliers();
} catch (e) {
} catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne');
}
}
@@ -122,13 +110,13 @@ export class SupplierTable implements OnInit {
modal: ModalNav
) {
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;
}
await this.editPrice(productId, supplierId, updateProductComponent);
updateProductComponent.priceForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchSuppliers();
}
@@ -150,8 +138,7 @@ export class SupplierTable implements OnInit {
};
await firstValueFrom(this.pricesService.patchPriceEndpoint(productId, supplierId, body));
this.notificationService.success('Success', 'Prix modifié');
} catch (e) {
console.error(e);
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification');
}
}
@@ -159,10 +146,10 @@ export class SupplierTable implements OnInit {
async deleteProduct(idProduct: number, idSupplier: number) {
try {
await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idProduct, idSupplier));
await firstValueFrom(this.suppliersService.deleteProductToSupplierEndpoint(idSupplier, idProduct));
this.notificationService.success('Succès', 'Produit supprimé');
await this.fetchSuppliers();
} catch (e) {
} catch {
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 {
private usersService = inject(UsersService);
private notificationService = inject(NzNotificationService)
users = signal<GetUserDto[]>([]);
usersLoading = signal<boolean>(false);
updateUser = viewChild.required<ProfilForm>('profilForm');
modal = viewChild.required<ModalNav>('modalNav');
async ngOnInit() {
@@ -38,11 +39,8 @@ export class UserTable implements OnInit {
try {
const users = await firstValueFrom(this.usersService.getAllUsersEndpoint())
this.users.set(users);
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur de communication avec l\'API'
)
} catch {
this.notificationService.error('Erreur', 'Impossible de charger les utilisateurs')
}
this.usersLoading.set(false)
}
@@ -50,25 +48,16 @@ export class UserTable implements OnInit {
async delete(user: number) {
try {
await firstValueFrom(this.usersService.deleteUserEndpoint(user))
this.notificationService.success(
'Success',
'Suppression effectuée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Impossible de supprimer la ligne'
)
this.notificationService.success('Success', 'Suppression effectuée')
} catch {
this.notificationService.error('Erreur', 'Impossible de supprimer la ligne')
}
await this.fetchUsers();
}
async edit(id: number, updateUserComponent: ProfilForm) {
if (updateUserComponent.profilForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Formulaire invalide')
return;
}
@@ -76,15 +65,9 @@ export class UserTable implements OnInit {
const users = updateUserComponent.profilForm.getRawValue();
await firstValueFrom(this.usersService.updateUserEndpoint(id, users))
this.notificationService.success(
'Success',
'Utilisateur modifié'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur lors de la modification'
)
this.notificationService.success('Success', 'Utilisateur modifié')
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la modification')
}
}
@@ -100,15 +83,11 @@ export class UserTable implements OnInit {
await this.edit(userId, updateUserComponent);
updateUserComponent.profilForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchUsers();
}
onModalCancel(modal: ModalNav) {
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);
})
);
};
+1 -1
View File
@@ -1,4 +1,4 @@
export interface SettingInfo {
logo: string;
signature: string;
electronicSignature: string;
}
-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-modal-button>
<div class="ml-95 w-150">
<app-search class="w-full"></app-search>
</div>
</div>
<div class="mt-1">
<div class="mt-4">
<app-deliverer-table #delivererTable></app-deliverer-table>
</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 {DelivererTable} from "../../components/deliverer-table/deliverer-table";
import {DelivererForm} from "../../components/deliverer-form/deliverer-form";
import {Search} from "../../components/search/search";
import {DeliverersService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
@@ -13,7 +12,6 @@ import {firstValueFrom} from "rxjs";
ModalButton,
DelivererTable,
DelivererForm,
Search
],
templateUrl: './deliverer.html',
styleUrl: './deliverer.css',
@@ -28,7 +26,7 @@ export class Deliverer {
async onModalOk() {
await this.addDeliverer()
this.createDeliverer().delivererForm.reset();
this.modal().isVisible = false;
this.onModalCancel();
await this.delivererTable().fetchDeliverers()
}
@@ -38,24 +36,15 @@ export class Deliverer {
async addDeliverer() {
if (this.createDeliverer().delivererForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Formulaire invalide')
}
try {
const deliverers = this.createDeliverer().delivererForm.getRawValue();
await firstValueFrom(this.deliverersService.createDelivererEndpoint(deliverers))
this.notificationService.success(
'Success',
'Transporteur enregistré'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur d\'enregistrement'
)
this.notificationService.success('Success', 'Transporteur enregistré')
} catch {
this.notificationService.error('Erreur', 'Erreur d\'enregistrement')
}
}
}
@@ -1,9 +1,3 @@
<div class="flex mt-2">
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<div class="mt-2">
<app-deliverery-note-table></app-deliverery-note-table>
</div>
@@ -1,14 +1,10 @@
import {Component} from '@angular/core';
import {DelivereryNoteTable} from "../../components/deliverery-note-table/deliverery-note-table";
import {ModalButton} from "../../components/modal-button/modal-button";
import {DelivereryNoteForm} from "../../components/deliverery-note-form/deliverery-note-form";
import {Search} from "../../components/search/search";
@Component({
selector: 'app-delivery-note',
imports: [
DelivereryNoteTable,
Search
],
templateUrl: './delivery-note.html',
styleUrl: './delivery-note.css',
+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="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<div class="mt-2">
<app-purchase-order-table></app-purchase-order-table>
</div>
@@ -1,11 +1,9 @@
import {Component} from '@angular/core';
import {Search} from "../../components/search/search";
import {PurchaseOrderTable} from "../../components/purchase-order-table/purchase-order-table";
@Component({
selector: 'app-purchase-order',
imports: [
Search,
PurchaseOrderTable,
],
templateUrl: './purchase-order.html',
+1 -7
View File
@@ -1,9 +1,3 @@
<div class="flex mt-2">
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<div class="mt-2">
<app-quotation-table></app-quotation-table>
</div>
-2
View File
@@ -1,11 +1,9 @@
import {Component} from '@angular/core';
import {Search} from "../../components/search/search";
import {QuotationTable} from "../../components/quotation-table/quotation-table";
@Component({
selector: 'app-quotation',
imports: [
Search,
QuotationTable
],
templateUrl: './quotation.html',
+29 -12
View File
@@ -1,14 +1,17 @@
<div class="flex mt-2">
@if (hasSelection) {
@if (productIds().length) {
<app-modal-button #modalButtonPurchaseOrder
(click)="openPurchaseOrderForm()"
(ok)="onModalOk()"
(cancel)="onModalCancel()"
(ok)="onModalPurchaseOrderOk()"
(cancel)="onModalPurchaseOrderCancel()"
type="default"
name="Créer un bon de commande"
size="35%"
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 #modalButtonQuotation
@@ -19,16 +22,30 @@
(click)="openQuotationForm()"
(ok)="onModalQuotationOk()"
(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>
}
<div class="ml-95 w-150">
<app-search (searchEvent)="onProductSearch($event)"></app-search>
</div>
</div>
<div class="mt-1">
<app-stock-table #stockTable (selectionChange)="onSelectionChange($event)"></app-stock-table>
<div class="mt-4">
<app-stock-table (selectionChange)="onSelectionChange($event)"
(productsTables)="products.set($event)">
</app-stock-table>
</div>
+133 -61
View File
@@ -1,138 +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 {Search} from "../../components/search/search";
import {ModalButton} from "../../components/modal-button/modal-button";
import {QuotationForm} from "../../components/quotation-form/quotation-form";
import {PurchaseordersService, QuotationsService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
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 {AddProductSupplierForm} from "../../components/add-product-supplier-form/add-product-supplier-form";
@Component({
selector: 'app-stock',
imports: [
StockTable,
Search,
ModalButton,
CreatePurchaseorderForm,
CreateQuotationForm,
AddProductSupplierForm,
],
templateUrl: './stock.html',
styleUrl: './stock.css',
})
export class Stock {
export class Stock implements OnInit {
createPurchaseOrder = viewChild.required<CreatePurchaseorderForm>('purchaseOrderForm');
createQuotation = viewChild.required<CreateQuotationForm>('quotationForm');
productTable = viewChild.required<StockTable>('stockTable');
private purchaseordersService = inject(PurchaseordersService)
private quotationsService = inject(QuotationsService)
private notificationService = inject(NzNotificationService)
addProduct = viewChild.required<AddProductSupplierForm>('supplierForm');
modalButtonPurchaseOrder = viewChild.required<ModalButton>('modalButtonPurchaseOrder');
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) {
this.hasSelection = value;
products = signal<GetProductDto[]>([]);
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) {
this.productTable().applySearch(query);
onSelectionChange(ids: number[]) {
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() {
const form = this.createPurchaseOrder().createPurchaseOrderForm;
if (form.invalid) {
this.notificationService.error('Erreur', 'Formulaire invalide');
return;
}
const orderLines = this.createPurchaseOrder().lines.value.map(line => ({
const orderLines = this.createPurchaseOrder().lines.value.map((line: { productId: any; quantity: any; }) => ({
productId: line.productId,
quantity: line.quantity
}));
if (orderLines.length === 0) {
if (!orderLines.length) {
this.notificationService.error('Erreur', 'Aucun produit sélectionné');
return;
}
const purchaseOrder = {
purchaseConditions: form.get('purchaseConditions')!.value,
products: orderLines
const purchaseOrder: CreatePurchaseOrderDto = {
purchaseConditions: form.value.purchaseConditions,
products: orderLines,
supplierId: form.value.supplierId
};
try {
await firstValueFrom(
this.purchaseordersService.createPurchaseOrder(purchaseOrder)
);
await firstValueFrom(this.purchaseOrdersService.createPurchaseOrder(purchaseOrder));
this.notificationService.success('Succès', 'Bon de commande créé');
} catch (e) {
} catch {
this.notificationService.error('Erreur', 'Erreur lors de la création du bon de commande.');
}
}
async onModalOk() {
await this.addPurchaseOrder();
this.createPurchaseOrder().createPurchaseOrderForm.reset();
this.modalButtonPurchaseOrder().isVisible = false;
await this.productTable().fetchProducts();
}
onModalCancel() {
this.modalButtonPurchaseOrder().isVisible = false;
}
openPurchaseOrderForm() {
const selectedProducts = this.productTable().products().filter(p =>
this.productTable().selectedIds.includes(p.id)
);
this.createPurchaseOrder().syncSelectedProducts(selectedProducts);
}
async addQuotation() {
if (this.createQuotation().createQuotationForm.invalid) {
const form = this.createQuotation().createQuotationForm;
if (form.invalid) {
this.notificationService.error('Erreur', 'Formulaire invalide');
return;
}
const orderLines = this.createQuotation().lines.value.map(line => ({
const orderLines = this.createQuotation().lines.value.map((line: { productId: any; quantity: any; }) => ({
productId: line.productId,
quantity: line.quantity
}));
if (orderLines.length === 0) {
if (!orderLines.length) {
this.notificationService.error('Erreur', 'Aucun produit sélectionné');
return;
}
const quotation = {
message: this.createQuotation().createQuotationForm.get('message')!.value,
purchaseConditions: this.createQuotation().createQuotationForm.get('purchaseConditions')!.value,
const quotation: CreateQuotationDto = {
message: this.createQuotation().createQuotationForm.value.message,
conditionsSale: this.createQuotation().createQuotationForm.value.conditionsSale,
customerId: this.createQuotation().createQuotationForm.value.customerId,
supplierId: this.createQuotation().createQuotationForm.value.supplierId,
products: orderLines
};
try {
await firstValueFrom(
this.quotationsService.createQuotationEndpoint(quotation)
);
await firstValueFrom(this.quotationsService.createQuotationEndpoint(quotation));
this.notificationService.success('Succès', 'Devis créé');
} catch (e) {
} catch {
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() {
await this.addQuotation();
this.createQuotation().createQuotationForm.reset();
this.modalButtonQuotation().isVisible = false;
await this.productTable().fetchProducts();
this.onModalQuotationCancel();
}
onModalQuotationCancel() {
this.modalButtonQuotation().isVisible = false;
}
openQuotationForm() {
const selectedProducts = this.productTable().products().filter(p =>
this.productTable().selectedIds.includes(p.id)
);
this.createQuotation().syncSelectedProducts(selectedProducts);
async onModalSupplierOk() {
await this.addProductFromSupplier();
this.addProduct().addProductForm.reset();
this.modalButtonSupplier().isVisible = false;
this.onModalSupplierCancel();
}
onModalSupplierCancel() {
this.modalButtonSupplier().isVisible = false;
}
}
+1 -4
View File
@@ -8,11 +8,8 @@
<app-supplier-form #supplierForm></app-supplier-form>
</app-modal-button>
<div class="ml-95 w-150">
<app-search (searchEvent)="onSupplierSearch($event)"></app-search>
</div>
</div>
<div class="mt-1">
<div class="mt-4">
<app-supplier-table #supplierTable></app-supplier-table>
</div>
+5 -20
View File
@@ -1,5 +1,4 @@
import {Component, inject, viewChild} from '@angular/core';
import {Search} from "../../components/search/search";
import {ModalButton} from "../../components/modal-button/modal-button";
import {SupplierTable} from "../../components/supplier-table/supplier-table";
import {SupplierForm} from "../../components/supplier-form/supplier-form";
@@ -10,7 +9,6 @@ import {firstValueFrom} from "rxjs";
@Component({
selector: 'app-supplier',
imports: [
Search,
SupplierForm,
SupplierTable,
ModalButton
@@ -28,7 +26,7 @@ export class Supplier {
async onModalOk() {
await this.addSupplier()
this.createSupplier().supplierForm.reset();
this.modal().isVisible = false;
this.onModalCancel();
await this.supplierTable().fetchSuppliers()
}
@@ -36,30 +34,17 @@ export class Supplier {
this.modal().isVisible = false;
}
onSupplierSearch(query: string) {
this.supplierTable().applySearch(query);
}
async addSupplier() {
if (this.createSupplier().supplierForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Formulaire invalide')
}
try {
const suppliers = this.createSupplier().supplierForm.getRawValue();
await firstValueFrom(this.suppliersService.createSupplierEndpoint(suppliers))
this.notificationService.success(
'Success',
'Fournisseur enregistré'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur d\'enregistrement'
)
this.notificationService.success('Success', 'Fournisseur enregistré')
} catch {
this.notificationService.error('Erreur', 'Erreur d\'enregistrement')
}
}
}
+11 -5
View File
@@ -7,13 +7,19 @@
size="35%">
<app-profil-form #profilForm></app-profil-form>
<div class="text-[12px] text-gray-400 flex justify-center items-center flex-col">
<p>Consignes du mot de passe :</p>
<ul class="ml-10">
<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>
</app-modal-button>
<div class="ml-95 w-150">
<app-search></app-search>
</div>
</div>
<div class="mt-1">
<div class="mt-4">
<app-user-table #userTable></app-user-table>
</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 {ModalButton} from "../../components/modal-button/modal-button";
import {ProfilForm} from "../../components/profil-form/profil-form";
import {Search} from "../../components/search/search";
import {UsersService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
@@ -13,7 +12,6 @@ import {firstValueFrom} from "rxjs";
UserTable,
ModalButton,
ProfilForm,
Search
],
templateUrl: './user.html',
styleUrl: './user.css',
@@ -22,13 +20,14 @@ export class User {
modal = viewChild.required<ModalButton>('modalButton');
createUser = viewChild.required<ProfilForm>('profilForm');
usersTable = viewChild.required<UserTable>('userTable');
private usersService = inject(UsersService);
private notificationService = inject(NzNotificationService)
async onModalOk() {
await this.addUser()
this.createUser().profilForm.reset();
this.modal().isVisible = false;
this.onModalCancel();
await this.usersTable().fetchUsers()
}
@@ -38,24 +37,15 @@ export class User {
async addUser() {
if (this.createUser().profilForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
this.notificationService.error('Erreur', 'Formulaire invalide')
}
try {
const users = this.createUser().profilForm.getRawValue();
await firstValueFrom(this.usersService.createUserEndpoint(users))
this.notificationService.success(
'Success',
'Utilisateur crée'
)
} catch (e) {
this.notificationService.error(
'Erreur',
'Erreur d\'enregistrement'
)
this.notificationService.success('Success', 'Utilisateur crée')
} catch {
this.notificationService.error('Erreur', 'Email ou mot de passe invalide')
}
}
}
-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.module.ts
api/api.ts
api/customers.service.ts
api/deliverers.service.ts
api/deliverynotes.service.ts
api/prices.service.ts
api/products.service.ts
api/purchaseorders.service.ts
api/quotations.service.ts
api/refresh.service.ts
api/settings.service.ts
api/suppliers.service.ts
api/user.service.ts
api/users.service.ts
api/warehouseproducts.service.ts
api/warehouses.service.ts
configuration.ts
encoder.ts
git_push.sh
@@ -28,9 +32,9 @@ model/create-purchase-order-dto.ts
model/create-purchase-order-product-dto.ts
model/create-purchase-product-dto.ts
model/create-quotation-dto.ts
model/create-setting-dto.ts
model/create-supplier-dto.ts
model/create-user-dto.ts
model/get-customer-dto.ts
model/get-deliverer-dto.ts
model/get-delivery-note-dto.ts
model/get-price-dto.ts
@@ -40,11 +44,13 @@ model/get-purchase-order-dto.ts
model/get-purchase-product-dto.ts
model/get-quotation-dto.ts
model/get-quotation-product-dto.ts
model/get-refresh-token-dto.ts
model/get-setting-dto.ts
model/get-supplier-dto.ts
model/get-token-dto.ts
model/get-total-quantity-dto.ts
model/get-user-dto.ts
model/get-ware-house-dto.ts
model/get-ware-house-product-dto.ts
model/models.ts
model/patch-delivery-note-real-delivery-date-dto.ts
@@ -55,11 +61,10 @@ model/patch-purchase-product-quantity-dto.ts
model/patch-quotation-conditions-sale-dto.ts
model/patch-quotation-message-dto.ts
model/patch-quotation-product-quantity-dto.ts
model/patch-setting-electronic-signature-dto.ts
model/patch-setting-logo-dto.ts
model/patch-supplier-delivery-delay-dto.ts
model/patch-user-password-dto.ts
model/patch-ware-house-product-quantity-dto.ts
model/refresh-token-dto.ts
model/update-deliverer-dto.ts
model/update-delivery-note-dto.ts
model/update-product-dto.ts
+4 -8
View File
@@ -59,9 +59,9 @@ In your Angular project:
```typescript
import {ApplicationConfig} from '@angular/core';
import {provideHttpClient} from '@angular/common/http';
import {provideApi} from '';
import { ApplicationConfig } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { provideApi } from '';
export const appConfig: ApplicationConfig = {
providers: [
@@ -73,9 +73,7 @@ export const appConfig: ApplicationConfig = {
```
**NOTE**
If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you
can still import an Angular module:
If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module:
```typescript
import { ApiModule } from '';
```
@@ -183,7 +181,5 @@ new Configuration({
```
[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values
[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander
+4 -4
View File
@@ -7,9 +7,9 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import {HttpHeaders, HttpParams, HttpParameterCodec} from '@angular/common/http';
import {CustomHttpParameterCodec} from './encoder';
import {Configuration} from './configuration';
import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http';
import { CustomHttpParameterCodec } from './encoder';
import { Configuration } from './configuration';
export class BaseService {
protected basePath = 'http://localhost:5298';
@@ -17,7 +17,7 @@ export class BaseService {
public configuration: Configuration;
public encoder: HttpParameterCodec;
constructor(basePath?: string | string[], configuration?: Configuration) {
constructor(basePath?: string|string[], configuration?: Configuration) {
this.configuration = configuration || new Configuration();
if (typeof this.configuration.basePath !== 'string') {
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
+11 -11
View File
@@ -1,30 +1,30 @@
import {NgModule, ModuleWithProviders, SkipSelf, Optional} from '@angular/core';
import {Configuration} from './configuration';
import {HttpClient} from '@angular/common/http';
import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
import { Configuration } from './configuration';
import { HttpClient } from '@angular/common/http';
@NgModule({
imports: [],
declarations: [],
exports: [],
providers: []
imports: [],
declarations: [],
exports: [],
providers: []
})
export class ApiModule {
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders<ApiModule> {
return {
ngModule: ApiModule,
providers: [{provide: Configuration, useFactory: configurationFactory}]
providers: [ { provide: Configuration, useFactory: configurationFactory } ]
};
}
constructor(@Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient) {
constructor( @Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient) {
if (parentModule) {
throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
}
if (!http) {
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
'See also https://github.com/angular/angular/issues/20575');
'See also https://github.com/angular/angular/issues/20575');
}
}
}
+19 -21
View File
@@ -1,31 +1,29 @@
export * from './customers.service';
import { CustomersService } from './customers.service';
export * from './deliverers.service';
import {DeliverersService} from './deliverers.service';
import { DeliverersService } from './deliverers.service';
export * from './deliverynotes.service';
import {DeliverynotesService} from './deliverynotes.service';
import { DeliverynotesService } from './deliverynotes.service';
export * from './prices.service';
import {PricesService} from './prices.service';
import { PricesService } from './prices.service';
export * from './products.service';
import {ProductsService} from './products.service';
import { ProductsService } from './products.service';
export * from './purchaseorders.service';
import {PurchaseordersService} from './purchaseorders.service';
import { PurchaseordersService } from './purchaseorders.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';
import {SettingsService} from './settings.service';
import { SettingsService } from './settings.service';
export * from './suppliers.service';
import {SuppliersService} from './suppliers.service';
import { SuppliersService } from './suppliers.service';
export * from './user.service';
import { UserService } from './user.service';
export * from './users.service';
import {UsersService} from './users.service';
import { UsersService } from './users.service';
export * from './warehouseproducts.service';
import {WarehouseproductsService} from './warehouseproducts.service';
export const APIS = [DeliverersService, DeliverynotesService, PricesService, ProductsService, PurchaseordersService, QuotationsService, SettingsService, SuppliersService, UsersService, WarehouseproductsService];
import { WarehouseproductsService } from './warehouseproducts.service';
export * from './warehouses.service';
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
}
);
}
}
+70 -158
View File
@@ -9,33 +9,33 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core';
import {
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder';
import {Observable} from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import {CreateDelivererDto} from '../model/create-deliverer-dto';
import { CreateDelivererDto } from '../model/create-deliverer-dto';
// @ts-ignore
import {GetDelivererDto} from '../model/get-deliverer-dto';
import { GetDelivererDto } from '../model/get-deliverer-dto';
// @ts-ignore
import {UpdateDelivererDto} from '../model/update-deliverer-dto';
import { UpdateDelivererDto } from '../model/update-deliverer-dto';
// @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
import {Configuration} from '../configuration';
import {BaseService} from '../api.base.service';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class DeliverersService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
@@ -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 reportProgress flag to report request and response progress.
*/
public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public createDelivererEndpoint(createDelivererDto: CreateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter createDelivererDto was null or undefined when calling createDelivererEndpoint.');
}
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'
]);
@@ -104,16 +91,16 @@ export class DeliverersService extends BaseService {
}
let localVarPath = `/API/deliverers`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetDelivererDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createDelivererDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public deleteDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public deleteDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter delivererId was null or undefined when calling deleteDelivererEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -172,24 +147,16 @@ export class DeliverersService extends BaseService {
}
}
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({
name: "delivererId",
value: delivererId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "delivererId", value: delivererId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getAllDelivererEndpoint(observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): 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> {
public getAllDelivererEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -247,15 +201,15 @@ export class DeliverersService extends BaseService {
}
let localVarPath = `/API/deliverers`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetDelivererDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public getDelivererEndpoint(delivererId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter delivererId was null or undefined when calling getDelivererEndpoint.');
}
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'
]);
@@ -316,24 +257,16 @@ export class DeliverersService extends BaseService {
}
}
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({
name: "delivererId",
value: delivererId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "delivererId", value: delivererId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetDelivererDto>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public updateDelivererEndpoint(id: number, updateDelivererDto: UpdateDelivererDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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) {
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;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -407,25 +327,17 @@ export class DeliverersService extends BaseService {
}
}
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/deliverers/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetDelivererDto>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: updateDelivererDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
+157 -231
View File
@@ -9,35 +9,35 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core';
import {
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder';
import {Observable} from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import {CreateDeliveryNoteDto} from '../model/create-delivery-note-dto';
import { CreateDeliveryNoteDto } from '../model/create-delivery-note-dto';
// @ts-ignore
import {GetDeliveryNoteDto} from '../model/get-delivery-note-dto';
import { GetDeliveryNoteDto } from '../model/get-delivery-note-dto';
// @ts-ignore
import {PatchDeliveryNoteRealDeliveryDateDto} from '../model/patch-delivery-note-real-delivery-date-dto';
import { PatchDeliveryNoteRealDeliveryDateDto } from '../model/patch-delivery-note-real-delivery-date-dto';
// @ts-ignore
import {UpdateDeliveryNoteDto} from '../model/update-delivery-note-dto';
import { UpdateDeliveryNoteDto } from '../model/update-delivery-note-dto';
// @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
import {Configuration} from '../configuration';
import {BaseService} from '../api.base.service';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class DeliverynotesService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
@@ -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 reportProgress flag to report request and response progress.
*/
public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public createDeliveryNoteEndpoint(createDeliveryNoteDto: CreateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter createDeliveryNoteDto was null or undefined when calling createDeliveryNoteEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -104,16 +92,16 @@ export class DeliverynotesService extends BaseService {
}
let localVarPath = `/API/deliveryNotes`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createDeliveryNoteDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public deleteDeliveryNoteEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public deleteDeliveryNoteEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling deleteDeliveryNoteEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -172,24 +148,16 @@ export class DeliverynotesService extends BaseService {
}
}
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getAllDeliveryNoteEndpoint(observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): 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> {
public getAllDeliveryNoteEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -247,52 +202,35 @@ export class DeliverynotesService extends BaseService {
}
let localVarPath = `/API/deliveryNotes`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetDeliveryNoteDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/deliveryNotes/{deliveryNoteId}
* @param deliveryNoteId
* @endpoint get /API/deliveryNotes/validation
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public 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.');
}
public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetDeliveryNoteDto>>;
public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetDeliveryNoteDto>>>;
public getAllDeliveryNotesNotArrivedEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetDeliveryNoteDto>>>;
public getAllDeliveryNotesNotArrivedEndpoint(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'
]);
@@ -316,24 +254,73 @@ export class DeliverynotesService extends BaseService {
}
}
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({
name: "deliveryNoteId",
value: deliveryNoteId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/deliveryNotes/validation`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetDeliveryNoteDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/deliveryNotes/{deliveryNoteId}
* @param deliveryNoteId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getDeliveryNoteEndpoint(deliveryNoteId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getDeliveryNotePdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public getDeliveryNotePdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling getDeliveryNotePdfEndpoint.');
}
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/pdf'
]);
@@ -383,24 +357,16 @@ export class DeliverynotesService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/pdf`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: "blob",
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
@@ -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 reportProgress flag to report request and response progress.
*/
public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public patchRealDeliveryDateEndpoint(id: number, patchDeliveryNoteRealDeliveryDateDto: PatchDeliveryNoteRealDeliveryDateDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -472,25 +426,17 @@ export class DeliverynotesService extends BaseService {
}
}
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchDeliveryNoteRealDeliveryDateDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -562,25 +496,17 @@ export class DeliverynotesService extends BaseService {
}
}
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: updateDeliveryNoteDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
+26 -54
View File
@@ -9,29 +9,29 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core';
import {
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder';
import {Observable} from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import {PatchPriceSellingPriceDto} from '../model/patch-price-selling-price-dto';
import { PatchPriceSellingPriceDto } from '../model/patch-price-selling-price-dto';
// @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
import {Configuration} from '../configuration';
import {BaseService} from '../api.base.service';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class PricesService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
@@ -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 reportProgress flag to report request and response progress.
*/
public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public patchPriceEndpoint(productId: number, supplierId: number, patchPriceSellingPriceDto: PatchPriceSellingPriceDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -105,33 +93,17 @@ export class PricesService extends BaseService {
}
}
let localVarPath = `/API/prices/${this.configuration.encodeParam({
name: "productId",
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/${this.configuration.encodeParam({
name: "supplierId",
value: supplierId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/SellingPrice`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/prices/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "supplierId", value: supplierId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/SellingPrice`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchPriceSellingPriceDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
+85 -192
View File
@@ -9,33 +9,33 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core';
import {
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder';
import {Observable} from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import {GetProductDto} from '../model/get-product-dto';
import { GetProductDto } from '../model/get-product-dto';
// @ts-ignore
import {PatchProductMinimalStockDto} from '../model/patch-product-minimal-stock-dto';
import { PatchProductMinimalStockDto } from '../model/patch-product-minimal-stock-dto';
// @ts-ignore
import {UpdateProductDto} from '../model/update-product-dto';
import { UpdateProductDto } from '../model/update-product-dto';
// @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
import {Configuration} from '../configuration';
import {BaseService} from '../api.base.service';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class ProductsService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
@@ -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 reportProgress flag to report request and response progress.
*/
public deleteProductEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public deleteProductEndpoint(productId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter productId was null or undefined when calling deleteProductEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -92,24 +80,16 @@ export class ProductsService extends BaseService {
}
}
let localVarPath = `/API/products/${this.configuration.encodeParam({
name: "productId",
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/products/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getAllProductsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): 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> {
public getAllProductsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -167,15 +134,15 @@ export class ProductsService extends BaseService {
}
let localVarPath = `/API/products`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetProductDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): 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> {
public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -233,15 +187,15 @@ export class ProductsService extends BaseService {
}
let localVarPath = `/API/products/underLimit`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetProductDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getProductEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public getProductEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling getProductEndpoint.');
}
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'
]);
@@ -302,24 +243,16 @@ export class ProductsService extends BaseService {
}
}
let localVarPath = `/API/products/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetProductDto>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public patchProductMinimalStockEndpoint(id: number, patchProductMinimalStockDto: PatchProductMinimalStockDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -391,25 +312,17 @@ export class ProductsService extends BaseService {
}
}
let localVarPath = `/API/products/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/MinimalStock`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/MinimalStock`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchProductMinimalStockDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public updateProductEndpoint(id: number, updateProductDto: UpdateProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -481,25 +382,17 @@ export class ProductsService extends BaseService {
}
}
let localVarPath = `/API/products/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/products/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: updateProductDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
+128 -318
View File
@@ -9,37 +9,37 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core';
import {
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder';
import {Observable} from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import {CreatePurchaseOrderDto} from '../model/create-purchase-order-dto';
import { CreatePurchaseOrderDto } from '../model/create-purchase-order-dto';
// @ts-ignore
import {CreatePurchaseProductDto} from '../model/create-purchase-product-dto';
import { CreatePurchaseProductDto } from '../model/create-purchase-product-dto';
// @ts-ignore
import {GetPurchaseOrderDto} from '../model/get-purchase-order-dto';
import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto';
// @ts-ignore
import {PatchPurchaseOrderPurchaseConditionsDto} from '../model/patch-purchase-order-purchase-conditions-dto';
import { PatchPurchaseOrderPurchaseConditionsDto } from '../model/patch-purchase-order-purchase-conditions-dto';
// @ts-ignore
import {PatchPurchaseProductQuantityDto} from '../model/patch-purchase-product-quantity-dto';
import { PatchPurchaseProductQuantityDto } from '../model/patch-purchase-product-quantity-dto';
// @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
import {Configuration} from '../configuration';
import {BaseService} from '../api.base.service';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class PurchaseordersService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
@@ -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 reportProgress flag to report request and response progress.
*/
public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public addProductFromPurchaseOrderEndpoint(purchaseOrderId: number, productId: number, createPurchaseProductDto: CreatePurchaseProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -113,33 +101,17 @@ export class PurchaseordersService extends BaseService {
}
}
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({
name: "purchaseOrderId",
value: purchaseOrderId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/${this.configuration.encodeParam({
name: "productId",
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "purchaseOrderId", value: purchaseOrderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createPurchaseProductDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetPurchaseOrderDto>;
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetPurchaseOrderDto>>;
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetPurchaseOrderDto>>;
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (createPurchaseOrderDto === null || createPurchaseOrderDto === undefined) {
throw new Error('Required parameter createPurchaseOrderDto was null or undefined when calling createPurchaseOrder.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
// 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);
}
@@ -208,16 +169,16 @@ export class PurchaseordersService extends BaseService {
}
let localVarPath = `/API/purchaseOrders`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetPurchaseOrderDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createPurchaseOrderDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public deleteProductFromPurchaseOrderEndpoint(productId: number, purchaseOrderId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -280,32 +229,16 @@ export class PurchaseordersService extends BaseService {
}
}
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({
name: "productId",
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/${this.configuration.encodeParam({
name: "purchaseOrderId",
value: purchaseOrderId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "purchaseOrderId", value: purchaseOrderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public deletePurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public deletePurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling deletePurchaseOrderEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -364,24 +285,16 @@ export class PurchaseordersService extends BaseService {
}
}
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getAllPurchaseOrderEndpoint(observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): 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> {
public getAllPurchaseOrderEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -439,15 +339,15 @@ export class PurchaseordersService extends BaseService {
}
let localVarPath = `/API/purchaseOrders`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetPurchaseOrderDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getPurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public getPurchaseOrderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderEndpoint.');
}
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'
]);
@@ -508,24 +395,16 @@ export class PurchaseordersService extends BaseService {
}
}
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetPurchaseOrderDto>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getPurchaseOrderPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public getPurchaseOrderPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling getPurchaseOrderPdfEndpoint.');
}
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/pdf'
]);
@@ -575,24 +441,16 @@ export class PurchaseordersService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/pdf`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: "blob",
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
@@ -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 reportProgress flag to report request and response progress.
*/
public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public patchPurchaseOrderPurchaseConditionsEndpoint(id: number, patchPurchaseOrderPurchaseConditionsDto: PatchPurchaseOrderPurchaseConditionsDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -664,25 +510,17 @@ export class PurchaseordersService extends BaseService {
}
}
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/PurchaseConditions`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/PurchaseConditions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchPurchaseOrderPurchaseConditionsDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public patchPurchaseProductQuantityEndpoint(productId: number, purchaseOrderId: number, patchPurchaseProductQuantityDto: PatchPurchaseProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -758,33 +584,17 @@ export class PurchaseordersService extends BaseService {
}
}
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({
name: "productId",
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/${this.configuration.encodeParam({
name: "purchaseOrderId",
value: purchaseOrderId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/Quantity`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/purchaseOrders/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "purchaseOrderId", value: purchaseOrderId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/Quantity`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchPurchaseProductQuantityDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
+154 -377
View File
@@ -9,41 +9,41 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core';
import {
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder';
import {Observable} from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import {AddQuotationProductDto} from '../model/add-quotation-product-dto';
import { AddQuotationProductDto } from '../model/add-quotation-product-dto';
// @ts-ignore
import {CreateQuotationDto} from '../model/create-quotation-dto';
import { CreateQuotationDto } from '../model/create-quotation-dto';
// @ts-ignore
import {GetQuotationDto} from '../model/get-quotation-dto';
import { GetQuotationDto } from '../model/get-quotation-dto';
// @ts-ignore
import {PatchQuotationConditionsSaleDto} from '../model/patch-quotation-conditions-sale-dto';
import { PatchQuotationConditionsSaleDto } from '../model/patch-quotation-conditions-sale-dto';
// @ts-ignore
import {PatchQuotationMessageDto} from '../model/patch-quotation-message-dto';
import { PatchQuotationMessageDto } from '../model/patch-quotation-message-dto';
// @ts-ignore
import {PatchQuotationProductQuantityDto} from '../model/patch-quotation-product-quantity-dto';
import { PatchQuotationProductQuantityDto } from '../model/patch-quotation-product-quantity-dto';
// @ts-ignore
import {UpdateQuotationDto} from '../model/update-quotation-dto';
import { UpdateQuotationDto } from '../model/update-quotation-dto';
// @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
import {Configuration} from '../configuration';
import {BaseService} from '../api.base.service';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class QuotationsService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
@@ -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 reportProgress flag to report request and response progress.
*/
public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public addProductoToQuotationEndpoint(productId: number, addQuotationProductDto: AddQuotationProductDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -113,25 +101,17 @@ export class QuotationsService extends BaseService {
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "productId",
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/products`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/products`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: addQuotationProductDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter createQuotationDto was null or undefined when calling createQuotationEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -200,16 +168,16 @@ export class QuotationsService extends BaseService {
}
let localVarPath = `/API/quotations`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createQuotationDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public deleteProductFromQuotationEndpoint(productId: number, quotationId: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -272,32 +228,16 @@ export class QuotationsService extends BaseService {
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "productId",
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/${this.configuration.encodeParam({
name: "quotationId",
value: quotationId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "quotationId", value: quotationId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public deleteQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public deleteQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling deleteQuotationEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -356,24 +284,16 @@ export class QuotationsService extends BaseService {
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getAllQuotationEndpoint(observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): 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> {
public getAllQuotationEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -431,15 +338,15 @@ export class QuotationsService extends BaseService {
}
let localVarPath = `/API/quotations`;
const {basePath, withCredentials} = this.configuration;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetQuotationDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public getQuotationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling getQuotationEndpoint.');
}
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'
]);
@@ -500,24 +394,16 @@ export class QuotationsService extends BaseService {
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetQuotationDto>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public getQuotationPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/pdf',
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public getQuotationPdfEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/pdf', context?: HttpContext, transferCache?: boolean}): 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) {
throw new Error('Required parameter id was null or undefined when calling getQuotationPdfEndpoint.');
}
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/pdf'
]);
@@ -567,24 +440,16 @@ export class QuotationsService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/pdf`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/pdf`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: "blob",
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
@@ -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 reportProgress flag to report request and response progress.
*/
public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public patchQuotationConditionsSaleEndpoint(id: number, patchQuotationConditionsSaleDto: PatchQuotationConditionsSaleDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -656,25 +509,17 @@ export class QuotationsService extends BaseService {
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/saleConditions`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/saleConditions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchQuotationConditionsSaleDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public patchQuotationMessageEndpoint(id: number, patchQuotationMessageDto: PatchQuotationMessageDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -746,25 +579,17 @@ export class QuotationsService extends BaseService {
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/message`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/message`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchQuotationMessageDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<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> {
public patchQuotationProductQuantityEndpoint(productId: number, quotationId: number, patchQuotationProductQuantityDto: PatchQuotationProductQuantityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -840,33 +653,17 @@ export class QuotationsService extends BaseService {
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "productId",
value: productId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/${this.configuration.encodeParam({
name: "quotationId",
value: quotationId,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/Quantity`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "productId", value: productId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/${this.configuration.encodeParam({name: "quotationId", value: quotationId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/Quantity`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchQuotationProductQuantityDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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 reportProgress flag to report request and response progress.
*/
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): 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> {
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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) {
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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -938,25 +723,17 @@ export class QuotationsService extends BaseService {
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: updateQuotationDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
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
}
);
}
}
+92 -305
View File
@@ -9,223 +9,46 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import {Inject, Injectable, Optional} from '@angular/core';
import {
HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import {CustomHttpParameterCodec} from '../encoder';
import {Observable} from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import {CreateSettingDto} from '../model/create-setting-dto';
// @ts-ignore
import {GetSettingDto} from '../model/get-setting-dto';
// @ts-ignore
import {PatchSettingElectronicSignatureDto} from '../model/patch-setting-electronic-signature-dto';
// @ts-ignore
import {PatchSettingLogoDto} from '../model/patch-setting-logo-dto';
import { GetSettingDto } from '../model/get-setting-dto';
// @ts-ignore
import {BASE_PATH, COLLECTION_FORMATS} from '../variables';
import {Configuration} from '../configuration';
import {BaseService} from '../api.base.service';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class SettingsService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/settings
* @param createSettingDto
* @endpoint get /API/settings
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any>;
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public createSettingEndpoint(createSettingDto: CreateSettingDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (createSettingDto === null || createSettingDto === undefined) {
throw new Error('Required parameter createSettingDto was null or undefined when calling createSettingEndpoint.');
}
public getSettingEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): 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;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/settings`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createSettingDto,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/settings/{id}
* @param id
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public deleteSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any>;
public deleteSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public deleteSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public deleteSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling deleteSettingEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/settings/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/settings/{id}
* @param id
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getSettingEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<GetSettingDto>;
public getSettingEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<GetSettingDto>>;
public getSettingEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<GetSettingDto>>;
public getSettingEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: 'application/json',
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getSettingEndpoint.');
}
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'
@@ -250,66 +73,39 @@ export class SettingsService extends BaseService {
}
}
let localVarPath = `/API/settings/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/settings`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetSettingDto>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/settings/{id}/ElectronicSignature
* @param id
* @param patchSettingElectronicSignatureDto
* @endpoint patch /API/settings/electronicSignature
* @param electronicSignature
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any>;
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchSettingElectronicSignatureEndpoint(id: number, patchSettingElectronicSignatureDto: PatchSettingElectronicSignatureDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchSettingElectronicSignatureEndpoint.');
}
if (patchSettingElectronicSignatureDto === null || patchSettingElectronicSignatureDto === undefined) {
throw new Error('Required parameter patchSettingElectronicSignatureDto was null or undefined when calling patchSettingElectronicSignatureEndpoint.');
}
public patchSettingElectronicSignatureEndpoint(electronicSignature?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -318,14 +114,27 @@ export class SettingsService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
'multipart/form-data'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
const canConsumeForm = this.canConsumeForm(consumes);
let localVarFormParams: { append(param: string, value: any): any; };
let localVarUseForm = false;
let localVarConvertFormParamsToString = false;
// use FormData to transmit files using content-type "multipart/form-data"
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
localVarUseForm = canConsumeForm;
if (localVarUseForm) {
localVarFormParams = new FormData();
} else {
localVarFormParams = new HttpParams({encoder: this.encoder});
}
if (electronicSignature !== undefined) {
localVarFormParams = localVarFormParams.append('electronicSignature', <any>electronicSignature) as any || localVarFormParams;
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
@@ -339,67 +148,40 @@ export class SettingsService extends BaseService {
}
}
let localVarPath = `/API/settings/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/ElectronicSignature`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/settings/electronicSignature`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchSettingElectronicSignatureDto,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint patch /API/settings/{id}/logo
* @param id
* @param patchSettingLogoDto
* @endpoint patch /API/settings/logo
* @param logo
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'body', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any>;
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'response', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpResponse<any>>;
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe?: 'events', reportProgress?: boolean, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<HttpEvent<any>>;
public patchSettingLogoEndpoint(id: number, patchSettingLogoDto: PatchSettingLogoDto, observe: any = 'body', reportProgress: boolean = false, options?: {
httpHeaderAccept?: undefined,
context?: HttpContext,
transferCache?: boolean
}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchSettingLogoEndpoint.');
}
if (patchSettingLogoDto === null || patchSettingLogoDto === undefined) {
throw new Error('Required parameter patchSettingLogoDto was null or undefined when calling patchSettingLogoEndpoint.');
}
public patchSettingLogoEndpoint(logo?: Blob, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): 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;
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) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
@@ -408,14 +190,27 @@ export class SettingsService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
'multipart/form-data'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
const canConsumeForm = this.canConsumeForm(consumes);
let localVarFormParams: { append(param: string, value: any): any; };
let localVarUseForm = false;
let localVarConvertFormParamsToString = false;
// use FormData to transmit files using content-type "multipart/form-data"
// see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data
localVarUseForm = canConsumeForm;
if (localVarUseForm) {
localVarFormParams = new FormData();
} else {
localVarFormParams = new HttpParams({encoder: this.encoder});
}
if (logo !== undefined) {
localVarFormParams = localVarFormParams.append('logo', <any>logo) as any || localVarFormParams;
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
@@ -429,25 +224,17 @@ export class SettingsService extends BaseService {
}
}
let localVarPath = `/API/settings/${this.configuration.encodeParam({
name: "id",
value: id,
in: "path",
style: "simple",
explode: false,
dataType: "number",
dataFormat: "int32"
})}/logo`;
const {basePath, withCredentials} = this.configuration;
let localVarPath = `/API/settings/logo`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchSettingLogoDto,
body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams,
responseType: <any>responseType_,
...(withCredentials ? {withCredentials} : {}),
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? {transferCache: localVarTransferCache} : {}),
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);

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