11 Commits

Author SHA1 Message Date
750a0da817 added edit function 2025-12-12 21:46:16 +01:00
a707a33a87 first commit 2025-12-12 21:19:39 +01:00
3c8abbb600 fix error in user page 2025-12-12 21:18:46 +01:00
d160a29a56 updated delivery note 2025-12-11 19:30:46 +01:00
586c9458b1 update delivery note form 2025-12-11 17:48:54 +01:00
dfaea894e4 Merge remote-tracking branch 'origin/develop' into develop 2025-12-11 17:19:55 +01:00
35f1909ca0 update delivery note form 2025-12-11 17:19:48 +01:00
Enzo
b71a9d5d6e Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	src/app/services/api/api/deliverynotes.service.ts
#	src/app/services/api/api/purchaseorders.service.ts
#	src/app/services/api/api/quotations.service.ts
2025-12-11 17:17:27 +01:00
Enzo
8d98a01c22 update searchbar on supplier and stock 2025-12-11 17:14:23 +01:00
a3a6b6d626 update delivery note components 2025-12-11 15:30:12 +01:00
Enzo
25de3eae4b first commit 2025-12-04 16:42:37 +01:00
42 changed files with 299 additions and 486 deletions

29
package-lock.json generated
View File

@@ -500,6 +500,7 @@
"resolved": "https://registry.npmjs.org/@angular/common/-/common-20.3.11.tgz",
"integrity": "sha512-zQ8xlyUBS+UDAUKk7z/hhWdTtQU2oc/Dwo7jXpyrYlz9y2X1A6sAZpUigdYpbrBkIaNs3MplJevgMiCm3kmN8g==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
@@ -516,6 +517,7 @@
"resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-20.3.11.tgz",
"integrity": "sha512-3O0iMPttD8a4QQQrjVfIjboiZZ17ErkZuqK8BXJBTn2rplpkq1m3kVhgsmzN2OANRR05GF9Ed1dTf8ycTrO1yg==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
@@ -529,6 +531,7 @@
"integrity": "sha512-u6T8kxj7LzK3btEln6Vd8y7p+O1eNXrLiGwqPuRF/QoyjBrRkTYufZ1I4TvzUxdd0ot6mPDRfdmiD15q//Y+oQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/core": "7.28.3",
"@jridgewell/sourcemap-codec": "^1.4.14",
@@ -561,6 +564,7 @@
"resolved": "https://registry.npmjs.org/@angular/core/-/core-20.3.11.tgz",
"integrity": "sha512-tOXlxG0SI9Yy1b/ntGyBahfffDpFg7vAbAt+9riOb5ZZ8GYyyOzg78Lqa/lrdBVEG0PXdDjEa0MV93qCyqwYlg==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
@@ -586,6 +590,7 @@
"resolved": "https://registry.npmjs.org/@angular/forms/-/forms-20.3.11.tgz",
"integrity": "sha512-jXDvW6a9HUzmLmvgPE+hVoZzc6QJBtQ1kYNn/FZDhbtmjRThJtaMW9YfS0Vz/a9KT9cxBf+8O8Q+yspvgsh3fg==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
@@ -604,6 +609,7 @@
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-20.3.11.tgz",
"integrity": "sha512-hh+8O8m4QzYYlQr9WGew472P37GF1u64NF3HfHmUKJ0xSqqTOHfpni3utev8upJAFJXBKOUZETgeHu2JRcGavg==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
@@ -626,6 +632,7 @@
"resolved": "https://registry.npmjs.org/@angular/router/-/router-20.3.11.tgz",
"integrity": "sha512-kuv7Yso7GY3tfRtQN0kW4v2Or4NUEBdjxTz5C8YuAhGDpiKXxDNkXzFliYTVWpJkr3EkTuR9mt9IAc+wxof3Pw==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
@@ -707,6 +714,7 @@
"integrity": "sha512-yDBHV9kQNcr2/sUr9jghVyz9C3Y5G2zUM2H2lo+9mKv4sFgbA8s8Z9t8D1jiTkGoO/NoIfKMyKWr4s6CN23ZwQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.27.1",
@@ -1648,6 +1656,7 @@
"integrity": "sha512-nqhDw2ZcAUrKNPwhjinJny903bRhI0rQhiDz1LksjeRxqa36i3l75+4iXbOy0rlDpLJGxqtgoPavQjmmyS5UJw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@inquirer/checkbox": "^4.2.1",
"@inquirer/confirm": "^5.1.14",
@@ -2507,6 +2516,7 @@
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.9.tgz",
"integrity": "sha512-zDntUTReRbAThIfSp3dQZ9kKqI+LjgLp5YZN5c1bgNRDuoeLySAoZg46Bg1a+uV8TMgIRziHocglKGNzr6l+bQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"file-type": "21.1.0",
"iterare": "1.2.1",
@@ -4270,6 +4280,7 @@
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz",
"integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==",
"license": "MIT",
"peer": true,
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.4",
@@ -4437,6 +4448,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.8.25",
"caniuse-lite": "^1.0.30001754",
@@ -5635,6 +5647,7 @@
"integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"accepts": "^2.0.0",
"body-parser": "^2.2.0",
@@ -6890,6 +6903,7 @@
"integrity": "sha512-j1n1IuTX1VQjIy3tT7cyGbX7nvQOsFLoIqobZv4ttI5axP923gA44zUj6miiA6R5Aoms4sEGVIIcucXUbRI14g==",
"devOptional": true,
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"copy-anything": "^2.0.1",
"parse-node-version": "^1.0.1",
@@ -7177,6 +7191,7 @@
"integrity": "sha512-SL0JY3DaxylDuo/MecFeiC+7pedM0zia33zl0vcjgwcq1q1FWWF1To9EIauPbl8GbMCU0R2e0uJ8bZunhYKD2g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"cli-truncate": "^4.0.0",
"colorette": "^2.0.20",
@@ -8832,7 +8847,8 @@
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
"integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==",
"license": "Apache-2.0"
"license": "Apache-2.0",
"peer": true
},
"node_modules/require-directory": {
"version": "2.1.1",
@@ -8980,6 +8996,7 @@
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
"integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"tslib": "^2.1.0"
}
@@ -9016,6 +9033,7 @@
"integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==",
"devOptional": true,
"license": "MIT",
"peer": true,
"dependencies": {
"chokidar": "^4.0.0",
"immutable": "^5.0.2",
@@ -9764,7 +9782,8 @@
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD"
"license": "0BSD",
"peer": true
},
"node_modules/tuf-js": {
"version": "3.1.0",
@@ -9814,6 +9833,7 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -9974,6 +9994,7 @@
"resolved": "https://registry.npmjs.org/vite/-/vite-7.1.11.tgz",
"integrity": "sha512-uzcxnSDVjAopEUjljkWh8EIrg6tlzrjFUfMcR1EVsRDGwf/ccef0qQPRyOrROwhrTDaApueq+ja+KLPlzR/zdg==",
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.5.0",
@@ -10361,6 +10382,7 @@
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
"dev": true,
"license": "MIT",
"peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
@@ -10379,7 +10401,8 @@
"version": "0.15.1",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz",
"integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==",
"license": "MIT"
"license": "MIT",
"peer": true
}
}
}

View File

@@ -79,20 +79,12 @@ export class DelivererTable implements OnInit {
}
try {
const deliverers = updateDelivererComponent.delivererForm.getRawValue();
await firstValueFrom(this.deliverersService.updateDelivererEndpoint(id, deliverers))
this.notificationService.success(
'Success',
'Transporteur modifié'
)
this.notificationService.success('Success', 'Transporteur modifié')
} catch (e) {
console.error(e);
this.notificationService.error(
'Erreur',
'Erreur lors de la modification'
)
this.notificationService.error('Erreur', 'Erreur lors de la modification')
}
}

View File

@@ -5,7 +5,7 @@
</nz-form-label>
<nz-form-control nzSpan="9" nzErrorTip="Ce champ est requis">
<nz-select formControlName="deliverer" [nzPlaceHolder]="'Choisir un transporteur'" nzShowSearch [nzFilterOption]="filter">
<nz-select formControlName="delivererId" [nzPlaceHolder]="'Choisir un transporteur'" nzShowSearch [nzFilterOption]="filter">
@for (deliverer of deliverers(); track deliverer.id) {
<nz-option [nzValue]="deliverer.id" [nzLabel]="deliverer.transporter"></nz-option>
}

View File

@@ -1,11 +1,11 @@
import {Component, inject, signal} from '@angular/core';
import {Component, effect, inject, input, OnInit, signal} from '@angular/core';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {DeliverersService, GetDelivererDto} from "../../services/api";
import {DeliverersService, GetDelivererDto, GetDeliveryNoteDto} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
@@ -21,14 +21,15 @@ import {firstValueFrom} from "rxjs";
ReactiveFormsModule,
NzDatePickerComponent,
NzSelectComponent,
NzOptionComponent
NzOptionComponent,
],
templateUrl: './deliverery-note-form.html',
styleUrl: './deliverery-note-form.css',
})
export class DelivereryNoteForm {
export class DelivereryNoteForm implements OnInit {
deliveryNoteForm: FormGroup = new FormGroup({
deliverer: new FormControl<string>(null,[Validators.required]),
trackingNumber: new FormControl<string>(null),
delivererId: new FormControl<number>(null,[Validators.required]),
expeditionDate: new FormControl(null,[Validators.required]),
estimatedDate: new FormControl(null),
realDeliveryDate: new FormControl(null)
@@ -54,4 +55,20 @@ export class DelivereryNoteForm {
filter(input: string, option: any) {
return option.nzLabel.toLowerCase().includes(input.toLowerCase());
}
deliveryNote= input<GetDeliveryNoteDto>();
constructor() {
effect(() => {
if (this.deliveryNote()) {
this.deliveryNoteForm.patchValue({
trackingNumber: this.deliveryNote().trackingNumber,
expeditionDate: this.deliveryNote().expeditionDate,
realDeliveryDate: this.deliveryNote().expeditionDate,
estimatedDate: this.deliveryNote().expeditionDate,
delivererId: this.deliveryNote().delivererId
});
}
});
}
}

View File

@@ -48,24 +48,22 @@
</td>
<td>
<div style="justify-content: center; display: flex">
<div>
<nz-icon nzType="check" nzTheme="outline" (click)="validate(deliveryNote.id)" class="cursor-pointer text-green-700"/>
</div>
<nz-icon nzType="check" nzTheme="outline" (click)="validate(deliveryNote.id)" class="cursor-pointer text-green-700"/>
<nz-divider nzType="vertical"></nz-divider>
<app-modal-nav nameIcon="edit" name="Modification du bon de livraison" class="cursor-pointer">
<app-deliverery-note-form></app-deliverery-note-form>
</app-modal-nav>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(deliveryNote)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<div>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliveryNote.id)" class="cursor-pointer text-red-700"/>
</div>
<nz-icon nzType="delete" nzTheme="outline" (click)="delete(deliveryNote.id)" class="cursor-pointer text-red-700"/>
<nz-divider nzType="vertical"></nz-divider>
<div>
<nz-icon nzType="export" nzTheme="outline" (click)="export(deliveryNote.id)" class="cursor-pointer text-green-700"/>
</div>
<nz-icon nzType="export" nzTheme="outline" (click)="export(deliveryNote.id)" class="cursor-pointer text-green-700"/>
</div>
</td>
</tr>
}
</tbody>
</nz-table>
<div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modifier un bon de livraison'" (ok)="onModalOk(selectedDeliveryNote.id, deliveryNoteForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-deliverery-note-form #deliveryNoteForm [deliveryNote]="selectedDeliveryNote"></app-deliverery-note-form>
</app-modal-nav>
</div>

View File

@@ -1,4 +1,4 @@
import {Component, inject, OnInit, signal} from '@angular/core';
import {Component, inject, OnInit, signal, viewChild} from '@angular/core';
import {DatePipe} from "@angular/common";
import {ModalButton} from "../modal-button/modal-button";
import {ModalNav} from "../modal-nav/modal-nav";
@@ -32,6 +32,7 @@ export class DelivereryNoteTable implements OnInit {
private fileService = inject(FileService);
deliveryNotes = signal<GetDeliveryNoteDto[]>([]);
deliveryNotesLoading = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav');
async ngOnInit() {
await this.fetchDeliveryNotes();
@@ -107,7 +108,6 @@ export class DelivereryNoteTable implements OnInit {
);
this.fileService.downloadBlob(pdf)
} catch (e) {
console.error(e);
this.notificationService.error(
'Erreur',
'Impossible de générer un PDF'
@@ -115,4 +115,64 @@ export class DelivereryNoteTable implements OnInit {
}
this.deliveryNotesLoading.set(false)
}
async edit(id: number, updateDelivereryNoteComponent: DelivereryNoteForm) {
if (updateDelivereryNoteComponent.deliveryNoteForm.invalid) {
this.notificationService.error('Erreur', 'Formulaire invalide');
return;
}
try {
const raw = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue();
// convertit proprement les dates (string OU Date)
const toIso = (val: any) => {
if (!val) return 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 = {
trackingNumber: raw.trackingNumber,
delivererId: raw.delivererId,
expeditionDate: toIso(raw.expeditionDate),
estimatedDate: toIso(raw.estimatedDate),
realDeliveryDate: toIso(raw.realDeliveryDate)
};
await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNoteDto));
this.notificationService.success('Success', 'Bon de livraison modifié');
} catch (e) {
console.error(e);
this.notificationService.error('Erreur', 'Erreur lors de la modification');
}
}
selectedDeliveryNote: GetDeliveryNoteDto | null = null;
openEditModal(deliveryNote: GetDeliveryNoteDto) {
this.selectedDeliveryNote = { ...deliveryNote };
this.modal().showModal();
}
async onModalOk(id: number, updateDelivereryNoteComponent: DelivereryNoteForm, modal: ModalNav) {
if (!this.selectedDeliveryNote) return;
await this.edit(id, updateDelivereryNoteComponent);
updateDelivereryNoteComponent.deliveryNoteForm.reset();
modal.isVisible = false;
await this.fetchDeliveryNotes();
}
onModalCancel(modal: ModalNav) {
modal.isVisible = false;
}
}

View File

@@ -2,40 +2,18 @@
<input type="text" placeholder="Rechercher une livraison" class="search-input" (input)="search.set($any($event.target).value)"/>
<div class="livraisons-list">
@for (deliveryItem of filteredDeliveries(); track deliveryItem.id) {
@for (deliveryItem of filteredLivraisons(); track deliveryItem.id) {
<div class="livraison-card">
<div class="livraison-info">
<h3>{{ deliveryItem.delivererTransporter }}</h3>
<p class="mr-5">Date d'expédition: {{ deliveryItem.expeditionDate }}</p>
<p>Produits : {{ deliveryItem.products }}</p>
<h3>{{ deliveryItem.client }}</h3>
<p class="mr-5">Date d'expédition: {{ deliveryItem.date }}</p>
<p>Produits : {{ deliveryItem.produits }}</p>
</div>
<app-modal-nav name="Valider la livraison" nameIcon="check" (click)="validate(deliveryItem.id)">
<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>
<button nz-button nzType="primary" [nzSize]="size" nzShape="round" (click)="validate(deliveryItem.id)">
<nz-icon nzType="check" />
Valider
</button>
</div>
}
</div>

View File

@@ -1,78 +1,44 @@
import {Component, computed, inject, OnInit, signal} from '@angular/core';
import {Component, computed, signal} from '@angular/core';
import {NzButtonComponent, NzButtonSize} from "ng-zorro-antd/button";
import {NzIconDirective} from "ng-zorro-antd/icon";
import {DeliverynotesService, GetDeliveryNoteDto} from "../../services/api";
import {firstValueFrom} from "rxjs";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {ModalButton} from "../modal-button/modal-button";
import {ModalNav} from "../modal-nav/modal-nav";
import {NzTableComponent} from "ng-zorro-antd/table";
import {format} from "date-fns";
@Component({
selector: 'app-delivery-validator',
imports: [
NzButtonComponent,
NzIconDirective,
ModalButton,
ModalNav,
NzTableComponent
NzIconDirective
],
templateUrl: './delivery-validator.html',
styleUrl: './delivery-validator.css',
})
export class DeliveryValidator implements OnInit {
private deliveriesService = inject(DeliverynotesService);
private notificationsService = inject(NzNotificationService);
export class DeliveryValidator {
size: NzButtonSize = 'large';
search = signal('');
deliveries = signal<GetDeliveryNoteDto[]>(null);
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 }
]);
async fetchDeliveries(){
try{
const deliveries = await firstValueFrom(this.deliveriesService.getAllDeliveryNoteEndpoint());
this.deliveries.set(deliveries);
}catch(e) {
this.notificationsService.error(
'Error',
'Error fetching deliveries',
)
}
}
async ngOnInit(){
await this.fetchDeliveries();
}
filteredDeliveries = computed(() => {
if(this.deliveries() == null){
return
}
filteredLivraisons = computed(() => {
const query = this.search().toLowerCase();
return this.deliveries().filter(l =>
l.delivererTransporter.toLowerCase().includes(query) ||
l.estimateDeliveryDate.includes(query)
return this.livraisons().filter(l =>
l.client.toLowerCase().includes(query) ||
l.date.includes(query)
);
});
async validate(id) {
try{
const PatchRealDate = {
realDeliveryDate: format(new Date(), 'yyyy-MM-dd')
};
await firstValueFrom(this.deliveriesService.patchRealDeliveryDateEndpoint(id, PatchRealDate));
}
catch(e) {
this.notificationsService.error(
'Error',
'Error validateing delivery',
)
}
validate(id: number) {
return
}
}

View File

@@ -13,7 +13,7 @@ import {NgStyle} from "@angular/common";
})
export class InfoCard {
icon = input.required<string>()
value = input.required<number>()
value = input.required<string>()
description = input.required<string>()
color = input.required<string>()
}

View File

@@ -1,11 +1,11 @@
<form nz-form nzLayout="horizontal" [formGroup]="QuotationForm">
<form nz-form nzLayout="horizontal" [formGroup]="quotationForm">
<nz-form-item nz-flex>
<nz-form-label nzSpan="9">
Message du devis
</nz-form-label>
<nz-form-control nzSpan="12">
<input nz-input placeholder="Message du devis" formControlName="quotationMessage">
<input nz-input placeholder="Message du devis" formControlName="message">
</nz-form-control>
</nz-form-item>
@@ -15,7 +15,7 @@
</nz-form-label>
<nz-form-control nzSpan="12">
<input nz-input placeholder="Conditions de vente" formControlName="quotationConditionsSale">
<input nz-input placeholder="Conditions de vente" formControlName="conditionsSale">
</nz-form-control>
</nz-form-item>
</form>

View File

@@ -1,10 +1,10 @@
import { Component } from '@angular/core';
import {Component, effect, input} from '@angular/core';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {NzInputDirective} from "ng-zorro-antd/input";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
import {GetQuotationDto} from "../../services/api";
@Component({
selector: 'app-quotation-form',
@@ -22,8 +22,20 @@ import {NzDatePickerComponent} from "ng-zorro-antd/date-picker";
styleUrl: './quotation-form.css',
})
export class QuotationForm {
QuotationForm: FormGroup = new FormGroup({
quotationMessage: new FormControl<string>(null),
quotationConditionsSale: new FormControl<string>(null),
quotationForm: FormGroup = new FormGroup({
message: new FormControl<string>(null, [Validators.required]),
conditionsSale: new FormControl<string>(null, [Validators.required]),
})
quotation= input<GetQuotationDto>();
constructor() {
effect(() => {
if (this.quotation()) {
this.quotationForm.patchValue({
message: this.quotation().message,
conditionsSale: this.quotation().conditionsSale,
});
}
});
}
}

View File

@@ -52,21 +52,13 @@
</td>
<td>
<div style="justify-content: center; display: flex">
<div>
<nz-icon nzType="plus-circle" nzTheme="outline" class="cursor-pointer text-green-700" />
</div>
<nz-icon nzType="plus-circle" nzTheme="outline" class="cursor-pointer text-green-700" />
<nz-divider nzType="vertical"></nz-divider>
<app-modal-nav nameIcon="edit" name="Modification du devis" class="cursor-pointer">
<app-quotation-form></app-quotation-form>
</app-modal-nav>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(quotation)"></nz-icon>
<nz-divider nzType="vertical"></nz-divider>
<div>
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700" (click)="delete(quotation.id)"/>
</div>
<nz-icon nzType="delete" nzTheme="outline" class="cursor-pointer text-red-700" (click)="delete(quotation.id)"/>
<nz-divider nzType="vertical"></nz-divider>
<div>
<nz-icon nzType="export" (click)="export(quotation.id)" nzTheme="outline" class="cursor-pointer text-green-700"/>
</div>
<nz-icon nzType="export" (click)="export(quotation.id)" nzTheme="outline" class="cursor-pointer text-green-700"/>
</div>
</td>
</tr>
@@ -74,3 +66,8 @@
</tbody>
</nz-table>
<div class="hidden">
<app-modal-nav #modalNav nameIcon="edit" [name]="'Modification du devis'" (ok)="onModalOk(selectedQuotation.id, quotationForm, modalNav)" (cancel)="onModalCancel(modalNav)">
<app-quotation-form #quotationForm [quotation]="selectedQuotation"></app-quotation-form>
</app-modal-nav>
</div>

View File

@@ -1,4 +1,4 @@
import {Component, inject, OnInit, signal} from '@angular/core';
import {Component, inject, OnInit, signal, viewChild} from '@angular/core';
import {NzTableComponent} from "ng-zorro-antd/table";
import {ModalButton} from "../modal-button/modal-button";
import {ModalNav} from "../modal-nav/modal-nav";
@@ -9,6 +9,7 @@ import {GetQuotationDto, QuotationsService} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
import {FileService} from "../../services/file.service";
import {DelivereryNoteForm} from "../deliverery-note-form/deliverery-note-form";
@Component({
selector: 'app-quotation-table',
@@ -19,6 +20,7 @@ import {FileService} from "../../services/file.service";
NzIconDirective,
NzTableComponent,
QuotationForm,
DelivereryNoteForm,
],
templateUrl: './quotation-table.html',
styleUrl: './quotation-table.css',
@@ -30,6 +32,7 @@ export class QuotationTable implements OnInit {
private fileService = inject(FileService);
quotations = signal<GetQuotationDto[]>([]);
quotationsLoading = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav');
async ngOnInit() {
await this.fetchQuotations();
@@ -84,5 +87,40 @@ export class QuotationTable implements OnInit {
}
this.quotationsLoading.set(false)
}
async edit(id: number, updateQuotationComponent: QuotationForm) {
if (updateQuotationComponent.quotationForm.invalid) {
this.notificationService.error('Erreur', 'Formulaire invalide');
return;
}
try {
const quotations = updateQuotationComponent.quotationForm.getRawValue();
await firstValueFrom(this.quotationsService.updateQuotationEndpoint(id, quotations));
this.notificationService.success('Success', 'Devis modifié')
} catch (e) {
console.error(e)
this.notificationService.error('Erreur', 'Erreur lors de la modification')
}
}
selectedQuotation: GetQuotationDto | null = null;
openEditModal(quotation: GetQuotationDto) {
this.selectedQuotation = { ...quotation };
this.modal().showModal();
}
async onModalOk(id: number, updateQuotationComponent: QuotationForm, modal: ModalNav) {
if (!this.selectedQuotation) return;
await this.edit(id, updateQuotationComponent);
updateQuotationComponent.quotationForm.reset();
modal.isVisible = false;
await this.fetchQuotations();
}
onModalCancel(modal: ModalNav) {
modal.isVisible = false;
}
}

View File

@@ -1,9 +1,9 @@
<form nz-form nzLayout="horizontal" [formGroup]="searchForm" (ngSubmit)="submitForm()">
<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"></nz-icon>
<input class="input" placeholder="Rechercher" formControlName="searchValue"/>
<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>

View File

@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, output } from '@angular/core';
import {NzIconDirective} from "ng-zorro-antd/icon";
import {NzColDirective} from "ng-zorro-antd/grid";
import {NzFlexDirective} from "ng-zorro-antd/flex";
@@ -24,14 +24,12 @@ export class Search {
searchValue: new FormControl<string>(null)
})
submitForm() {
// Pour annuler si le formulaire est invalide
if (this.searchForm.invalid) return;
searchEvent = output<string>();
// Pour obtenir la valeur du formulaire
console.log(this.searchForm.getRawValue())
OnSearch(): void {
const raw = this.searchForm.controls['searchValue'].value ?? '';
const value = String(raw).trim();
this.searchEvent.emit(value);
// Pour vider le formulaire
this.searchForm.reset()
}
}

View File

@@ -1,5 +1,5 @@
<nz-table
[nzData]="products()"
[nzData]="filteredProducts()"
[nzFrontPagination]="false"
[nzLoading]="productsLoading()"
(nzCurrentPageDataChange)="onCurrentPageDataChange($event)"
@@ -27,7 +27,7 @@
</thead>
<tbody class="text-center">
@for (product of products(); track product.id) {
@for (product of filteredProducts(); track product.id) {
<tr>
<td nzWidth="40px">
<label

View File

@@ -1,4 +1,4 @@
import {Component, inject, OnInit, output, signal, viewChild} from '@angular/core';
import {Component, computed, 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";
@@ -45,6 +45,22 @@ export class StockTable implements OnInit {
selectionChange = output<boolean>()
currentPageData: 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;
}

View File

@@ -1,4 +1,4 @@
<nz-table [nzData]="suppliers()"
<nz-table [nzData]="filteredSuppliers()"
[nzLoading]="suppliersLoading()"
[nzFrontPagination]="false">
<thead>
@@ -15,7 +15,7 @@
</tr>
</thead>
<tbody style="text-align: center">
@for (supplier of suppliers(); track supplier.id) {
@for (supplier of filteredSuppliers(); 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]="suppliers()" [nzFrontPagination]="false">
<nz-table [nzData]="filteredSuppliers()" [nzFrontPagination]="false">
<thead>
<tr class="text-center">
<th>Produit</th>

View File

@@ -1,4 +1,4 @@
import {Component, inject, OnInit, signal, viewChild} from '@angular/core';
import {Component, computed, 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";
@@ -42,6 +42,23 @@ export class SupplierTable implements OnInit {
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);
}
async fetchSuppliers() {
this.suppliersLoading.set(true);
try {

View File

@@ -105,4 +105,7 @@ export class UserTable implements OnInit {
onModalCancel(modal: ModalNav) {
modal.isVisible = false;
}
filterUser(input: string, option: any) {
return option.nzLabel.toLowerCase().includes(input.toLowerCase());
}
}

View File

@@ -10,7 +10,8 @@
}
<div class="ml-95 w-150">
<app-search class="w-full"></app-search>
<app-search (searchEvent)="onProductSearch($event)"></app-search>
</div>
</div>

View File

@@ -29,6 +29,9 @@ export class Stock {
private productsService = inject(ProductsService);
private notificationService = inject(NzNotificationService)
onProductSearch(query: string) {
this.productTable().applySearch(query);
}
// async onModalOk() {
// await this.addSupplier()
// this.createSupplier().supplierForm.reset();

View File

@@ -8,9 +8,8 @@
<app-supplier-form #supplierForm></app-supplier-form>
</app-modal-button>
<div class="ml-95 w-150">
<app-search></app-search>
<app-search (searchEvent)="onSupplierSearch($event)"></app-search>
</div>
</div>

View File

@@ -36,6 +36,10 @@ export class Supplier {
this.modal().isVisible = false;
}
onSupplierSearch(query: string) {
this.supplierTable().applySearch(query);
}
async addSupplier() {
if (this.createSupplier().supplierForm.invalid)
{

View File

@@ -3,7 +3,8 @@
type="primary"
name="Ajouter un utilisateur"
(ok)="onModalOk()"
(cancel)="onModalCancel()">
(cancel)="onModalCancel()"
size="35%">
<app-profil-form #profilForm></app-profil-form>
</app-modal-button>

View File

@@ -1,8 +1,8 @@
<div class="flex gap-17 ml-20">
<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>
<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">

View File

@@ -1,10 +1,7 @@
import {Component, inject, OnInit, signal} from '@angular/core';
import { Component } from '@angular/core';
import {InfoCard} from "../../components/info-card/info-card";
import {DeliveryValidator} from "../../components/delivery-validator/delivery-validator";
import {InfoTable} from "../../components/info-table/info-table";
import {DeliverersService, ProductsService, SuppliersService} from "../../services/api";
import {firstValueFrom} from "rxjs";
import {NzNotificationService} from "ng-zorro-antd/notification";
@Component({
selector: 'app-welcome',
@@ -17,55 +14,6 @@ import {NzNotificationService} from "ng-zorro-antd/notification";
styleUrl: './welcome.css'
})
export class Welcome implements OnInit {
private productsService = inject(ProductsService);
private deliverersService = inject(DeliverersService);
private suppliersService = inject(SuppliersService);
private notificationsService = inject(NzNotificationService);
export class Welcome {
deliversCount = signal<number>(0);
suppliersCount = signal<number>(0);
productsUnderLimitCount = signal<number>(0);
async getDeliverers() {
try{
const deliverers = await firstValueFrom(this.deliverersService.getAllDelivererEndpoint());
this.deliversCount.set(deliverers.length);
}catch(e){
this.notificationsService.error(
'Error',
'Error while getting deliverers.',
)
}
}
async getSuppliers() {
try{
const suppliers = await firstValueFrom(this.suppliersService.getAllSuppliersEndpoint());
this.suppliersCount.set(suppliers.length);
}catch(e){
this.notificationsService.error(
'Error',
'Error while getting suppliers.',
)
}
}
async getProductsUnderLimit(){
try{
const products = await firstValueFrom(this.productsService.getAllProductsUnderLimitEndpoint());
this.productsUnderLimitCount.set(products.length);
}catch(e){
this.notificationsService.error(
'Error',
'Error while getting products.',
)
}
}
async ngOnInit() {
await this.getDeliverers();
await this.getSuppliers();
await this.getProductsUnderLimit();
}
}

View File

@@ -1,5 +1,4 @@
.gitignore
.openapi-generator-ignore
README.md
api.base.service.ts
api.module.ts
@@ -24,11 +23,7 @@ model/connect-user-dto.ts
model/create-deliverer-dto.ts
model/create-delivery-note-dto.ts
model/create-price-dto.ts
model/create-product-quotation-dto.ts
model/create-purchase-order-dto.ts
model/create-purchase-order-product-dto.ts
model/create-purchase-product-dto.ts
model/create-quotation-dto.ts
model/create-quotation-product-dto.ts
model/create-setting-dto.ts
model/create-supplier-dto.ts

View File

@@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder';
import { Configuration } from './configuration';
export class BaseService {
protected basePath = 'http://localhost:5298';
protected basePath = 'https://localhost:44379';
public defaultHeaders = new HttpHeaders();
public configuration: Configuration;
public encoder: HttpParameterCodec;

View File

@@ -142,56 +142,6 @@ export class ProductsService extends BaseService {
);
}
/**
* @endpoint get /API/products/underLimit
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/products/underLimit`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetProductDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/products/{id}
* @param id

View File

@@ -16,8 +16,6 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { CreatePurchaseOrderDto } from '../model/create-purchase-order-dto';
// @ts-ignore
import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto';
// @ts-ignore
@@ -39,70 +37,6 @@ export class PurchaseordersService extends BaseService {
super(basePath, configuration);
}
/**
* @endpoint post /API/purchaseOrders
* @param createPurchaseOrderDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/purchaseOrders`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetPurchaseOrderDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createPurchaseOrderDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/purchaseOrders/{id}
* @param id

View File

@@ -16,8 +16,6 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { CreateQuotationDto } from '../model/create-quotation-dto';
// @ts-ignore
import { GetQuotationDto } from '../model/get-quotation-dto';
// @ts-ignore
@@ -41,70 +39,6 @@ export class QuotationsService extends BaseService {
super(basePath, configuration);
}
/**
* @endpoint post /API/quotations
* @param createQuotationDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetQuotationDto>;
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetQuotationDto>>;
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetQuotationDto>>;
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', 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([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/quotations`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetQuotationDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createQuotationDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/quotations/{id}
* @param id

View File

@@ -1,16 +0,0 @@
/**
* PyroFetes
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface CreateProductQuotationDto {
productId?: number;
quantity?: number;
}

View File

@@ -1,17 +0,0 @@
/**
* PyroFetes
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { CreatePurchaseOrderProductDto } from './create-purchase-order-product-dto';
export interface CreatePurchaseOrderDto {
purchaseConditions?: string | null;
products?: Array<CreatePurchaseOrderProductDto> | null;
}

View File

@@ -1,16 +0,0 @@
/**
* PyroFetes
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface CreatePurchaseOrderProductDto {
productId?: number;
quantity?: number;
}

View File

@@ -1,18 +0,0 @@
/**
* PyroFetes
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { CreateProductQuotationDto } from './create-product-quotation-dto';
export interface CreateQuotationDto {
message?: string | null;
conditionsSale?: string | null;
products?: Array<CreateProductQuotationDto> | null;
}

View File

@@ -19,7 +19,7 @@ export interface CreateQuotationProductDto {
productName?: string | null;
productDuration?: number;
productCaliber?: number;
productApprovalNumber?: string | null;
productApprovalNumber?: number;
productWeight?: number;
productNec?: number;
productImage?: string | null;

View File

@@ -13,6 +13,6 @@ import { GetPurchaseProductDto } from './get-purchase-product-dto';
export interface GetPurchaseOrderDto {
id?: number;
purchaseConditions?: string | null;
products?: Array<GetPurchaseProductDto> | null;
getPurchaseProductDto?: Array<GetPurchaseProductDto> | null;
}

View File

@@ -15,7 +15,7 @@ export interface GetPurchaseProductDto {
productName?: string | null;
productDuration?: number;
productCaliber?: number;
productApprovalNumber?: string | null;
productApprovalNumber?: number;
productWeight?: number;
productNec?: number;
productImage?: string | null;

View File

@@ -14,6 +14,6 @@ export interface GetQuotationDto {
id?: number;
message?: string | null;
conditionsSale?: string | null;
products?: Array<GetQuotationProductDto> | null;
getQuotationProductDto?: Array<GetQuotationProductDto> | null;
}

View File

@@ -19,7 +19,7 @@ export interface GetQuotationProductDto {
productName?: string | null;
productDuration?: number;
productCaliber?: number;
productApprovalNumber?: string | null;
productApprovalNumber?: number;
productWeight?: number;
productNec?: number;
productImage?: string | null;

View File

@@ -2,11 +2,7 @@ export * from './connect-user-dto';
export * from './create-deliverer-dto';
export * from './create-delivery-note-dto';
export * from './create-price-dto';
export * from './create-product-quotation-dto';
export * from './create-purchase-order-dto';
export * from './create-purchase-order-product-dto';
export * from './create-purchase-product-dto';
export * from './create-quotation-dto';
export * from './create-quotation-product-dto';
export * from './create-setting-dto';
export * from './create-supplier-dto';