4 Commits

Author SHA1 Message Date
Cristiano
750fc19d46 When closing modal it patch delivery 2025-12-18 16:48:08 +01:00
Cristiano
2796c46625 First view of validating delivery 2025-12-18 16:23:49 +01:00
Cristiano
01848b3920 Real value for products under limit 2025-12-11 17:49:32 +01:00
Cristiano
a7e099b9db Real value for deliverer and suppliers count 2025-12-11 16:26:12 +01:00
39 changed files with 630 additions and 209 deletions

View File

@@ -1,11 +1,11 @@
import {Component, effect, inject, input, OnInit, signal} from '@angular/core';
import {Component, inject, signal} from '@angular/core';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
import {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, GetDeliveryNoteDto} from "../../services/api";
import {DeliverersService, GetDelivererDto} from "../../services/api";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
@@ -21,14 +21,13 @@ import {firstValueFrom} from "rxjs";
ReactiveFormsModule,
NzDatePickerComponent,
NzSelectComponent,
NzOptionComponent,
NzOptionComponent
],
templateUrl: './deliverery-note-form.html',
styleUrl: './deliverery-note-form.css',
})
export class DelivereryNoteForm implements OnInit {
export class DelivereryNoteForm {
deliveryNoteForm: FormGroup = new FormGroup({
trackingNumber: new FormControl<string>("TRK-" + Date.now),
deliverer: new FormControl<string>(null,[Validators.required]),
expeditionDate: new FormControl(null,[Validators.required]),
estimatedDate: new FormControl(null),
@@ -55,20 +54,4 @@ export class DelivereryNoteForm implements OnInit {
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,
deliverer: this.deliveryNote().delivererId
});
}
});
}
}

View File

@@ -48,22 +48,24 @@
</td>
<td>
<div style="justify-content: center; display: flex">
<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"/>
</div>
<nz-divider nzType="vertical"></nz-divider>
<nz-icon nzType="edit" nzTheme="outline" class="cursor-pointer" (click)="openEditModal(deliveryNote)"></nz-icon>
<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-divider nzType="vertical"></nz-divider>
<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"/>
</div>
<nz-divider nzType="vertical"></nz-divider>
<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>
</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, viewChild} from '@angular/core';
import {Component, inject, OnInit, signal} from '@angular/core';
import {DatePipe} from "@angular/common";
import {ModalButton} from "../modal-button/modal-button";
import {ModalNav} from "../modal-nav/modal-nav";
@@ -32,7 +32,6 @@ 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();
@@ -108,6 +107,7 @@ 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,51 +115,4 @@ export class DelivereryNoteTable implements OnInit {
}
this.deliveryNotesLoading.set(false)
}
selectedDeliveryNote: GetDeliveryNoteDto | null = null;
openEditModal(deliveryNote: GetDeliveryNoteDto) {
this.selectedDeliveryNote = { ...deliveryNote };
this.modal().showModal();
}
async onModalOk(id: number, updateDelivereryNoteComponent: DelivereryNoteForm, modal: ModalNav) {
if (!this.selectedDeliveryNote) return;
await this.edit(id, updateDelivereryNoteComponent);
updateDelivereryNoteComponent.deliveryNoteForm.reset();
modal.isVisible = false;
await this.fetchDeliveryNotes();
}
onModalCancel(modal: ModalNav) {
modal.isVisible = false;
}
async edit(id: number, updateDelivereryNoteComponent: DelivereryNoteForm) {
if (updateDelivereryNoteComponent.deliveryNoteForm.invalid) {
this.notificationService.error(
'Erreur',
'Erreur d\'écriture dans le formulaire'
)
return;
}
try {
const deliveryNotes = updateDelivereryNoteComponent.deliveryNoteForm.getRawValue();
await firstValueFrom(this.deliveryNotesService.updateDeliveryNoteEndpoint(id, deliveryNotes))
this.notificationService.success(
'Success',
'Bon de livraison modifié'
)
} catch (e) {
console.error(e);
this.notificationService.error(
'Erreur',
'Erreur lors de la modification'
)
}
}
}

View File

@@ -2,18 +2,40 @@
<input type="text" placeholder="Rechercher une livraison" class="search-input" (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>Produits : {{ deliveryItem.products }}</p>
</div>
<button nz-button nzType="primary" [nzSize]="size" nzShape="round" (click)="validate(deliveryItem.id)">
<nz-icon nzType="check" />
Valider
</button>
<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>
</div>
}
</div>

View File

@@ -1,44 +1,78 @@
import {Component, computed, signal} from '@angular/core';
import {Component, computed, inject, OnInit, signal} from '@angular/core';
import {NzButtonComponent, NzButtonSize} from "ng-zorro-antd/button";
import {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
NzIconDirective,
ModalButton,
ModalNav,
NzTableComponent
],
templateUrl: './delivery-validator.html',
styleUrl: './delivery-validator.css',
})
export class DeliveryValidator {
export class DeliveryValidator implements OnInit {
private deliveriesService = inject(DeliverynotesService);
private notificationsService = inject(NzNotificationService);
size: NzButtonSize = 'large';
search = signal('');
livraisons = signal([
{ id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 },
{ id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 },
{ id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 },
{ id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 },
{ id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 },
{ id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 },
{ id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 },
{ id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 },
{ id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 },
{ id: 1, client: 'Carrefour', date: '2025-02-03', produits: 12 },
{ id: 2, client: 'Intermarché', date: '2025-02-04', produits: 8 },
{ id: 3, client: 'Auchan', date: '2025-02-05', produits: 23 }
]);
deliveries = signal<GetDeliveryNoteDto[]>(null);
filteredLivraisons = computed(() => {
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
}
const query = this.search().toLowerCase();
return this.livraisons().filter(l =>
l.client.toLowerCase().includes(query) ||
l.date.includes(query)
return this.deliveries().filter(l =>
l.delivererTransporter.toLowerCase().includes(query) ||
l.estimateDeliveryDate.includes(query)
);
});
validate(id: number) {
return
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',
)
}
}
}

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>()
}

View File

@@ -1,9 +1,9 @@
<form nz-form nzLayout="horizontal" [formGroup]="searchForm">
<form nz-form nzLayout="horizontal" [formGroup]="searchForm" (ngSubmit)="submitForm()">
<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()"/>
<nz-icon nzType="search" nzTheme="outline" class="mr-2 text-xl"></nz-icon>
<input class="input" placeholder="Rechercher" formControlName="searchValue"/>
</div>
</nz-form-control>
</nz-form-item>

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
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";
@@ -45,22 +45,6 @@ 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]="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>

View File

@@ -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";
@@ -42,23 +42,6 @@ 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

@@ -1,4 +1,4 @@
<nz-table [nzData]="filteredUsers()"
<nz-table [nzData]="users()"
[nzLoading]="usersLoading()"
[nzFrontPagination]="false"
class="mr-7">
@@ -11,7 +11,7 @@
</tr>
</thead>
<tbody class="text-center">
@for (user of filteredUsers(); track user.id) {
@for (user of users(); track user.id) {
<tr>
<td>{{user.name}}</td>
<td>{{user.email}}</td>

View File

@@ -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 {NzIconDirective} from "ng-zorro-antd/icon";
import {NzTableComponent} from "ng-zorro-antd/table";
@@ -32,22 +32,6 @@ export class UserTable implements OnInit {
await this.fetchUsers();
}
private searchQuery = signal<string>('');
filteredUsers = computed(() => {
const q = this.searchQuery().toLowerCase().trim();
if (!q) return this.users();
return this.users().filter(s => {
const name = (s.name ?? '').toLowerCase();
return name.includes(q);
});
});
applySearch(query: string) {
this.searchQuery.set(query);
}
async fetchUsers() {
this.usersLoading.set(true)
@@ -121,7 +105,4 @@ 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,8 +10,7 @@
}
<div class="ml-95 w-150">
<app-search (searchEvent)="onProductSearch($event)"></app-search>
<app-search class="w-full"></app-search>
</div>
</div>

View File

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

View File

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

View File

@@ -9,8 +9,7 @@
</app-modal-button>
<div class="ml-95 w-150">
<app-search (searchEvent)="onUserSearch($event)"></app-search>
<app-search></app-search>
</div>
</div>

View File

@@ -32,9 +32,6 @@ export class User {
await this.usersTable().fetchUsers()
}
onUserSearch(query: string) {
this.usersTable().applySearch(query);
}
onModalCancel() {
this.modal().isVisible = false;
}

View File

@@ -1,8 +1,8 @@
<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>
<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 class="mt-10 flex gap-30">

View File

@@ -1,7 +1,10 @@
import { Component } from '@angular/core';
import {Component, inject, OnInit, signal} from '@angular/core';
import {InfoCard} from "../../components/info-card/info-card";
import {DeliveryValidator} from "../../components/delivery-validator/delivery-validator";
import {InfoTable} from "../../components/info-table/info-table";
import {DeliverersService, ProductsService, SuppliersService} from "../../services/api";
import {firstValueFrom} from "rxjs";
import {NzNotificationService} from "ng-zorro-antd/notification";
@Component({
selector: 'app-welcome',
@@ -14,6 +17,55 @@ import {InfoTable} from "../../components/info-table/info-table";
styleUrl: './welcome.css'
})
export class Welcome {
export class Welcome implements OnInit {
private productsService = inject(ProductsService);
private deliverersService = inject(DeliverersService);
private suppliersService = inject(SuppliersService);
private notificationsService = inject(NzNotificationService);
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

@@ -24,7 +24,11 @@ model/connect-user-dto.ts
model/create-deliverer-dto.ts
model/create-delivery-note-dto.ts
model/create-price-dto.ts
model/create-product-quotation-dto.ts
model/create-purchase-order-dto.ts
model/create-purchase-order-product-dto.ts
model/create-purchase-product-dto.ts
model/create-quotation-dto.ts
model/create-quotation-product-dto.ts
model/create-setting-dto.ts
model/create-supplier-dto.ts
@@ -58,7 +62,9 @@ model/patch-supplier-delivery-delay-dto.ts
model/patch-user-password-dto.ts
model/patch-ware-house-product-quantity-dto.ts
model/update-deliverer-dto.ts
model/update-delivery-note-dto.ts
model/update-product-dto.ts
model/update-quotation-dto.ts
model/update-supplier-dto.ts
model/update-user-dto.ts
param.ts

View File

@@ -22,6 +22,8 @@ import { CreateDeliveryNoteDto } from '../model/create-delivery-note-dto';
import { GetDeliveryNoteDto } from '../model/get-delivery-note-dto';
// @ts-ignore
import { PatchDeliveryNoteRealDeliveryDateDto } from '../model/patch-delivery-note-real-delivery-date-dto';
// @ts-ignore
import { UpdateDeliveryNoteDto } from '../model/update-delivery-note-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -371,4 +373,72 @@ export class DeliverynotesService extends BaseService {
);
}
/**
* @endpoint put /API/deliveryNotes/{id}
* @param id
* @param updateDeliveryNoteDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetDeliveryNoteDto>;
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetDeliveryNoteDto>>;
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetDeliveryNoteDto>>;
public updateDeliveryNoteEndpoint(id: number, updateDeliveryNoteDto: UpdateDeliveryNoteDto, 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 updateDeliveryNoteEndpoint.');
}
if (updateDeliveryNoteDto === null || updateDeliveryNoteDto === undefined) {
throw new Error('Required parameter updateDeliveryNoteDto was null or undefined when calling updateDeliveryNoteEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/deliveryNotes/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetDeliveryNoteDto>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: updateDeliveryNoteDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}

View File

@@ -142,6 +142,56 @@ export class ProductsService extends BaseService {
);
}
/**
* @endpoint get /API/products/underLimit
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllProductsUnderLimitEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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,6 +16,8 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { CreatePurchaseOrderDto } from '../model/create-purchase-order-dto';
// @ts-ignore
import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto';
// @ts-ignore
@@ -37,6 +39,70 @@ export class PurchaseordersService extends BaseService {
super(basePath, configuration);
}
/**
* @endpoint post /API/purchaseOrders
* @param createPurchaseOrderDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createPurchaseOrder(createPurchaseOrderDto: CreatePurchaseOrderDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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,10 +16,14 @@ 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
import { PatchQuotationConditionsSaleDto } from '../model/patch-quotation-conditions-sale-dto';
// @ts-ignore
import { UpdateQuotationDto } from '../model/update-quotation-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -37,6 +41,70 @@ export class QuotationsService extends BaseService {
super(basePath, configuration);
}
/**
* @endpoint post /API/quotations
* @param createQuotationDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createQuotationEndpoint(createQuotationDto: CreateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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
@@ -305,4 +373,72 @@ export class QuotationsService extends BaseService {
);
}
/**
* @endpoint put /API/quotations/{id}
* @param id
* @param updateQuotationDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetQuotationDto>;
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetQuotationDto>>;
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetQuotationDto>>;
public updateQuotationEndpoint(id: number, updateQuotationDto: UpdateQuotationDto, 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 updateQuotationEndpoint.');
}
if (updateQuotationDto === null || updateQuotationDto === undefined) {
throw new Error('Required parameter updateQuotationDto was null or undefined when calling updateQuotationEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/quotations/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetQuotationDto>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: updateQuotationDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,7 +2,11 @@ export * from './connect-user-dto';
export * from './create-deliverer-dto';
export * from './create-delivery-note-dto';
export * from './create-price-dto';
export * from './create-product-quotation-dto';
export * from './create-purchase-order-dto';
export * from './create-purchase-order-product-dto';
export * from './create-purchase-product-dto';
export * from './create-quotation-dto';
export * from './create-quotation-product-dto';
export * from './create-setting-dto';
export * from './create-supplier-dto';
@@ -35,6 +39,8 @@ export * from './patch-supplier-delivery-delay-dto';
export * from './patch-user-password-dto';
export * from './patch-ware-house-product-quantity-dto';
export * from './update-deliverer-dto';
export * from './update-delivery-note-dto';
export * from './update-product-dto';
export * from './update-quotation-dto';
export * from './update-supplier-dto';
export * from './update-user-dto';

View File

@@ -0,0 +1,19 @@
/**
* PyroFetes
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface UpdateDeliveryNoteDto {
trackingNumber?: string | null;
estimateDeliveryDate?: string;
expeditionDate?: string;
realDeliveryDate?: string | null;
delivererId?: number;
}

View File

@@ -0,0 +1,16 @@
/**
* PyroFetes
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface UpdateQuotationDto {
message?: string | null;
conditionsSale?: string | null;
}