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
22 changed files with 587 additions and 43 deletions

View File

@@ -2,18 +2,40 @@
<input type="text" placeholder="Rechercher une livraison" class="search-input" (input)="search.set($any($event.target).value)"/> <input type="text" placeholder="Rechercher une livraison" class="search-input" (input)="search.set($any($event.target).value)"/>
<div class="livraisons-list"> <div class="livraisons-list">
@for (deliveryItem of filteredLivraisons(); track deliveryItem.id) { @for (deliveryItem of filteredDeliveries(); track deliveryItem.id) {
<div class="livraison-card"> <div class="livraison-card">
<div class="livraison-info"> <div class="livraison-info">
<h3>{{ deliveryItem.client }}</h3> <h3>{{ deliveryItem.delivererTransporter }}</h3>
<p class="mr-5">Date d'expédition: {{ deliveryItem.date }}</p> <p class="mr-5">Date d'expédition: {{ deliveryItem.expeditionDate }}</p>
<p>Produits : {{ deliveryItem.produits }}</p> <p>Produits : {{ deliveryItem.products }}</p>
</div> </div>
<button nz-button nzType="primary" [nzSize]="size" nzShape="round" (click)="validate(deliveryItem.id)"> <app-modal-nav name="Valider la livraison" nameIcon="check" (click)="validate(deliveryItem.id)">
<nz-icon nzType="check" /> <div style="max-height: 400px; overflow-y: auto;">
Valider <nz-table [nzData]="filteredDeliveries()"
</button> [nzFrontPagination]="false">
<thead>
<tr class="text-center">
<th>Réference</th>
<th>Nom</th>
<th>Quantité</th>
</tr>
</thead>
<tbody class="text-center">
@for (product of deliveryItem.products; track product.productId) {
<tr>
<td>{{product.productReference}}</td>
<td>{{product.productName}}</td>
<td>{{product.quantity}}</td>
</tr>
}
</tbody>
</nz-table>
</div>
</app-modal-nav>
</div> </div>
} }
</div> </div>

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

View File

@@ -1,8 +1,8 @@
<div class="flex gap-17 ml-20"> <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="#f59e0b" icon="inbox" [value]="productsUnderLimitCount()" 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="#3b82f6" icon="team" [value]="deliversCount()+suppliersCount()" 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="#10b981" icon="truck" [value]=deliversCount() 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="#ef4444" icon="shop" [value]="suppliersCount()" description="Fournisseurs partenaires."></app-info-card>
</div> </div>
<div class="mt-10 flex gap-30"> <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 {InfoCard} from "../../components/info-card/info-card";
import {DeliveryValidator} from "../../components/delivery-validator/delivery-validator"; import {DeliveryValidator} from "../../components/delivery-validator/delivery-validator";
import {InfoTable} from "../../components/info-table/info-table"; 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({ @Component({
selector: 'app-welcome', selector: 'app-welcome',
@@ -14,6 +17,55 @@ import {InfoTable} from "../../components/info-table/info-table";
styleUrl: './welcome.css' 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-deliverer-dto.ts
model/create-delivery-note-dto.ts model/create-delivery-note-dto.ts
model/create-price-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-purchase-product-dto.ts
model/create-quotation-dto.ts
model/create-quotation-product-dto.ts model/create-quotation-product-dto.ts
model/create-setting-dto.ts model/create-setting-dto.ts
model/create-supplier-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-user-password-dto.ts
model/patch-ware-house-product-quantity-dto.ts model/patch-ware-house-product-quantity-dto.ts
model/update-deliverer-dto.ts model/update-deliverer-dto.ts
model/update-delivery-note-dto.ts
model/update-product-dto.ts model/update-product-dto.ts
model/update-quotation-dto.ts
model/update-supplier-dto.ts model/update-supplier-dto.ts
model/update-user-dto.ts model/update-user-dto.ts
param.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'; import { GetDeliveryNoteDto } from '../model/get-delivery-note-dto';
// @ts-ignore // @ts-ignore
import { PatchDeliveryNoteRealDeliveryDateDto } from '../model/patch-delivery-note-real-delivery-date-dto'; import { PatchDeliveryNoteRealDeliveryDateDto } from '../model/patch-delivery-note-real-delivery-date-dto';
// @ts-ignore
import { UpdateDeliveryNoteDto } from '../model/update-delivery-note-dto';
// @ts-ignore // @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -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} * @endpoint get /API/products/{id}
* @param id * @param id

View File

@@ -16,6 +16,8 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpParameterCodec } from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore
import { CreatePurchaseOrderDto } from '../model/create-purchase-order-dto';
// @ts-ignore // @ts-ignore
import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto'; import { GetPurchaseOrderDto } from '../model/get-purchase-order-dto';
// @ts-ignore // @ts-ignore
@@ -37,6 +39,70 @@ export class PurchaseordersService extends BaseService {
super(basePath, configuration); 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} * @endpoint delete /API/purchaseOrders/{id}
* @param id * @param id

View File

@@ -16,10 +16,14 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpParameterCodec } from '../encoder'; import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
// @ts-ignore
import { CreateQuotationDto } from '../model/create-quotation-dto';
// @ts-ignore // @ts-ignore
import { GetQuotationDto } from '../model/get-quotation-dto'; import { GetQuotationDto } from '../model/get-quotation-dto';
// @ts-ignore // @ts-ignore
import { PatchQuotationConditionsSaleDto } from '../model/patch-quotation-conditions-sale-dto'; import { PatchQuotationConditionsSaleDto } from '../model/patch-quotation-conditions-sale-dto';
// @ts-ignore
import { UpdateQuotationDto } from '../model/update-quotation-dto';
// @ts-ignore // @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -37,6 +41,70 @@ export class QuotationsService extends BaseService {
super(basePath, configuration); 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} * @endpoint delete /API/quotations/{id}
* @param 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; productName?: string | null;
productDuration?: number; productDuration?: number;
productCaliber?: number; productCaliber?: number;
productApprovalNumber?: number; productApprovalNumber?: string | null;
productWeight?: number; productWeight?: number;
productNec?: number; productNec?: number;
productImage?: string | null; productImage?: string | null;

View File

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

View File

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

View File

@@ -14,6 +14,6 @@ export interface GetQuotationDto {
id?: number; id?: number;
message?: string | null; message?: string | null;
conditionsSale?: 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; productName?: string | null;
productDuration?: number; productDuration?: number;
productCaliber?: number; productCaliber?: number;
productApprovalNumber?: number; productApprovalNumber?: string | null;
productWeight?: number; productWeight?: number;
productNec?: number; productNec?: number;
productImage?: string | null; productImage?: string | null;

View File

@@ -2,7 +2,11 @@ export * from './connect-user-dto';
export * from './create-deliverer-dto'; export * from './create-deliverer-dto';
export * from './create-delivery-note-dto'; export * from './create-delivery-note-dto';
export * from './create-price-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-purchase-product-dto';
export * from './create-quotation-dto';
export * from './create-quotation-product-dto'; export * from './create-quotation-product-dto';
export * from './create-setting-dto'; export * from './create-setting-dto';
export * from './create-supplier-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-user-password-dto';
export * from './patch-ware-house-product-quantity-dto'; export * from './patch-ware-house-product-quantity-dto';
export * from './update-deliverer-dto'; export * from './update-deliverer-dto';
export * from './update-delivery-note-dto';
export * from './update-product-dto'; export * from './update-product-dto';
export * from './update-quotation-dto';
export * from './update-supplier-dto'; export * from './update-supplier-dto';
export * from './update-user-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;
}