diff --git a/logo-navbar.svg b/logo-navbar.svg new file mode 100644 index 0000000..d162b9d --- /dev/null +++ b/logo-navbar.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/logo-pyro-fetes.png b/logo-pyro-fetes.png new file mode 100644 index 0000000..cb0e305 Binary files /dev/null and b/logo-pyro-fetes.png differ diff --git a/openapi-generator.yaml b/openapi-generator.yaml new file mode 100644 index 0000000..43fcf8c --- /dev/null +++ b/openapi-generator.yaml @@ -0,0 +1,3 @@ +additionalProperties: + fileNaming: kebab-case + modelPropertyNaming: camelCase diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..f052220 --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.17.0" + } +} diff --git a/package.json b/package.json index 2e46947..340fe98 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "ng": "ng", "start": "ng serve", "build": "ng build", - "watch": "ng build --watch --configuration development" + "watch": "ng build --watch --configuration development", + "openapi": "rimraf src/app/services/api && openapi-generator-cli generate -i http://localhost:5298/swagger/v1/swagger.json -g typescript-angular -o src/app/services/api -c openapi-generator.yaml" }, "prettier": { "printWidth": 100, @@ -27,6 +28,7 @@ "@angular/forms": "^20.3.0", "@angular/platform-browser": "^20.3.0", "@angular/router": "^20.3.0", + "@openapitools/openapi-generator-cli": "^2.25.2", "@tailwindcss/postcss": "^4.1.17", "ng-zorro-antd": "^20.4.0", "postcss": "^8.5.6", @@ -40,6 +42,7 @@ "@angular/cli": "^20.3.10", "@angular/compiler-cli": "^20.3.0", "less": "^4.2.0", + "rimraf": "^6.1.3", "typescript": "~5.9.2" } } diff --git a/public/logo-navbar.svg b/public/logo-navbar.svg new file mode 100644 index 0000000..d162b9d --- /dev/null +++ b/public/logo-navbar.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/public/logo-pyro-fetes.png b/public/logo-pyro-fetes.png new file mode 100644 index 0000000..cb0e305 Binary files /dev/null and b/public/logo-pyro-fetes.png differ diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 010986a..da5b616 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -7,6 +7,7 @@ import { registerLocaleData } from '@angular/common'; import fr from '@angular/common/locales/fr'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideHttpClient } from '@angular/common/http'; +import {NzModalService} from 'ng-zorro-antd/modal'; registerLocaleData(fr); @@ -14,6 +15,7 @@ export const appConfig: ApplicationConfig = { providers: [ provideBrowserGlobalErrorListeners(), provideZoneChangeDetection({ eventCoalescing: true }), - provideRouter(routes), provideNzI18n(fr_FR), provideAnimationsAsync(), provideHttpClient() + provideRouter(routes), provideNzI18n(fr_FR), provideAnimationsAsync(), provideHttpClient(), + NzModalService ] }; diff --git a/src/app/app.css b/src/app/app.css index 73a1c7e..66078b0 100644 --- a/src/app/app.css +++ b/src/app/app.css @@ -3,11 +3,27 @@ } .app-layout { - height: 100vh; + height: 150vh; + width: 100%; +} + +.main-title { + color:#eabf63; } .top-nav { line-height: 64px; + background-color: #2c2c2c; +} + +.top-nav a { + display: block; + background-color: #4c4c4c; +} + +.nav-item { + color: #eabf63; + font-size: 18px; } .logo { @@ -15,22 +31,21 @@ height: 64px; padding-right: 24px; line-height: 64px; - background: #001529; + background: #1c1c1c; } .logo img { display: inline-block; - height: 32px; - width: 32px; - vertical-align: middle; + height: 70px; + width: 130px; } .logo h1 { display: inline-block; - margin: 0 0 0 15px; - color: #fff; + margin: 0 0 0 10px; + color: #eabf63; font-weight: 600; - font-size: 20px; + font-size: 22px; font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif; vertical-align: middle; } diff --git a/src/app/app.html b/src/app/app.html index 2c7dce2..43a740b 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -2,16 +2,17 @@ - +
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 9d068cd..1556a7d 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -7,8 +7,12 @@ export const routes: Routes = [ redirectTo: '/customers' }, { - path:'customers', - loadComponent: () => import('./pages/customers/customers').then(x => x.Customers) + path:'contact', + loadComponent: () => import('./pages/contact/contact').then(x => x.Contact) + }, + { + path:'customers', + loadComponent: () => import('./pages/customers/customers').then(x => x.Customers) }, { diff --git a/src/app/app.ts b/src/app/app.ts index 16a99a4..e04f8f4 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -2,10 +2,11 @@ import { Component } from '@angular/core'; import {RouterLink, RouterLinkActive, RouterOutlet} from '@angular/router'; import { NzLayoutModule } from 'ng-zorro-antd/layout'; import { NzMenuModule } from 'ng-zorro-antd/menu'; +import {NzIconDirective} from "ng-zorro-antd/icon"; @Component({ selector: 'app-root', - imports: [RouterOutlet, NzLayoutModule, NzMenuModule, RouterLinkActive, RouterLink], + imports: [RouterOutlet, NzLayoutModule, NzMenuModule, RouterLinkActive, RouterLink, NzIconDirective], templateUrl: './app.html', styleUrl: './app.css' }) diff --git a/src/app/pages/contact/contact-add-form/contact-add-form.css b/src/app/pages/contact/contact-add-form/contact-add-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/contact/contact-add-form/contact-add-form.html b/src/app/pages/contact/contact-add-form/contact-add-form.html new file mode 100644 index 0000000..9cf3fbf --- /dev/null +++ b/src/app/pages/contact/contact-add-form/contact-add-form.html @@ -0,0 +1,61 @@ +
+ + Nom + + + + + + + Prénom + + + + + + + Email + + + + + + + Téléphone + + + + + + + Adresse + + + + + + + Code postal + + + + + + + Ville + + + + + + + Rôle + + + + + + + + +
\ No newline at end of file diff --git a/src/app/pages/contact/contact-add-form/contact-add-form.ts b/src/app/pages/contact/contact-add-form/contact-add-form.ts new file mode 100644 index 0000000..604001f --- /dev/null +++ b/src/app/pages/contact/contact-add-form/contact-add-form.ts @@ -0,0 +1,89 @@ +import {Component, inject, signal} from '@angular/core'; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {ContactsService, CreateContactDto} from "../../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; +import {NzButtonComponent} from "ng-zorro-antd/button"; + +@Component({ + selector: 'app-contact-add-form', + imports: [ + NzFormLabelComponent, + NzFormItemComponent, + NzFormControlComponent, + NzInputDirective, + ReactiveFormsModule, + NzColDirective, + NzFormDirective, + NzFlexDirective, + NzButtonComponent + ], + templateUrl: './contact-add-form.html', + styleUrl: './contact-add-form.css', +}) +export class ContactAddForm { + private contactsService = inject(ContactsService); + private notificationService = inject(NzNotificationService); + + contactForm = new FormGroup({ + lastName: new FormControl(null, [Validators.required]), + firstName: new FormControl(null, [Validators.required]), + phoneNumber: new FormControl(null, [Validators.required]), + email: new FormControl(null, [Validators.required]), + address: new FormControl(null, [Validators.required]), + city: new FormControl(null, [Validators.required]), + role: new FormControl(null, [Validators.required]), + customerId: new FormControl(null), + }) + + contactPost = signal(this.contactForm.value); + contactsLoading = signal(false); + + async submitForm() { + if (this.contactForm.invalid) return; + + console.log(this.contactForm.getRawValue()) + this.contactPost.set(this.contactForm.getRawValue()) + + await this.createContact( + this.contactPost().lastName, + this.contactPost().firstName, + this.contactPost().phoneNumber, + this.contactPost().email, + this.contactPost().address, + this.contactPost().city, + this.contactPost().role, + this.contactPost().customerId + ) + this.contactForm.reset() + } + + async createContact(lastName: string, firstName: string, phoneNumber: string, email: string, address: string, city: string, role: string, customerId: number) { + this.contactsLoading.set(true); + + const contactValue: CreateContactDto = { + lastName: lastName, + firstName: firstName, + phoneNumber: phoneNumber, + email: email, + address: address, + city: city, + role: role, + customerId: customerId + } + + try { + const contact = await firstValueFrom(this.contactsService.createContactEndpoint(contactValue)); + this.contactPost.set(contact); + console.log(contact); + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.contactsLoading.set(false); + } +} diff --git a/src/app/pages/contact/contact-card/contact-card.css b/src/app/pages/contact/contact-card/contact-card.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/contact/contact-card/contact-card.html b/src/app/pages/contact/contact-card/contact-card.html new file mode 100644 index 0000000..331e35b --- /dev/null +++ b/src/app/pages/contact/contact-card/contact-card.html @@ -0,0 +1,70 @@ +@if (edit() == false) { + +

Contact n°{{ contact().id }}

+

Nom : {{ contact().lastName + " " + contact().firstName }}

+

Rôle : {{ contact().role }}

+

Numéro de téléphone : {{ contact().phoneNumber }}

+

Email : {{ contact().email }}

+

Adresse : {{ contact().address + ", " + contact().city }}

+ +
+ + + + + + +} @else { + +
+ + Nom + + + + + + Prénom + + + + + + Num. Tél. + + + + + + Email + + + + + + Adresse + + + + + + Ville + + + + + + Rôle + + + + +
+
+ + + + + + +} \ No newline at end of file diff --git a/src/app/pages/contact/contact-card/contact-card.ts b/src/app/pages/contact/contact-card/contact-card.ts new file mode 100644 index 0000000..c8ef92d --- /dev/null +++ b/src/app/pages/contact/contact-card/contact-card.ts @@ -0,0 +1,108 @@ +import {Component, inject, input, output, signal} from '@angular/core'; +import { + ContactsService, + CustomersService, GetContactDto, + GetCustomerDto, + UpdateContactDto, + UpdateCustomerDto +} from "../../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {firstValueFrom} from "rxjs"; +import {NzCardComponent} from "ng-zorro-antd/card"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzInputDirective} from "ng-zorro-antd/input"; + +@Component({ + selector: 'app-contact-card', + imports: [NzCardComponent, NzColDirective, NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent, NzIconDirective, NzInputDirective, NzRowDirective, ReactiveFormsModule], + templateUrl: './contact-card.html', + styleUrl: './contact-card.css', +}) +export class ContactCard { + private contactsService = inject(ContactsService); + private notificationService = inject(NzNotificationService) + + contactEdit = signal(null); + contactsLoading = signal(false); + + contactForm = new FormGroup({ + id: new FormControl(null, [Validators.required]), + lastname: new FormControl(null, [Validators.required]), + firstname: new FormControl(null, [Validators.required]), + phone: new FormControl(null, [Validators.required]), + email: new FormControl(null, [Validators.required]), + address: new FormControl(null, [Validators.required]), + city: new FormControl(null, [Validators.required]), + role: new FormControl(null, [Validators.required]) + }) + + async submitForm() { + this.contactsLoading.set(true); + + const contactValue = { + lastname: this.contactForm.value.lastname, + firstname: this.contactForm.value.firstname, + phone: this.contactForm.value.phone, + email: this.contactForm.value.email, + address: this.contactForm.value.address, + city: this.contactForm.value.city, + role: this.contactForm.value.role, + } + + try { + const contact = await firstValueFrom(this.contactsService.updateContactEndpoint(this.contact().id,contactValue)); + this.contactEdit.set(contact); + console.log(contact); + this.contactForm.reset(); + this.edit.set(false); + + this.triggerEdited.emit(); + + } catch (e) + { + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.contactsLoading.set(false); + + } + + + contact = input(null); + + edit = signal(false) + + triggerEdited = output(); + + protected Edit() { + this.edit.set(true) + } + + protected Back() { + this.edit.set(false) + this.contactForm.reset(); + } + + async Delete() { + this.contactsLoading.set(true); + + try { + const contact = await firstValueFrom(this.contactsService.deleteContactEndpoint(this.contact().id)); + this.contactEdit.set(contact); + + this.contactForm.reset(); + this.triggerEdited.emit(); + + } catch (e) + { + this.notificationService.error('Erreur de recherche', "Le contact n\'existe pas !"); + + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.contactsLoading.set(false); + } +} diff --git a/src/app/pages/contact/contact.css b/src/app/pages/contact/contact.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/contact/contact.html b/src/app/pages/contact/contact.html new file mode 100644 index 0000000..70b892c --- /dev/null +++ b/src/app/pages/contact/contact.html @@ -0,0 +1,11 @@ + + +
+
+ @for (contact of contacts(); track contact.id) + { + + + } +
+
diff --git a/src/app/pages/contact/contact.ts b/src/app/pages/contact/contact.ts new file mode 100644 index 0000000..796710b --- /dev/null +++ b/src/app/pages/contact/contact.ts @@ -0,0 +1,46 @@ +import {Component, inject, signal} from '@angular/core'; +import {ContactsService, GetContactDto} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {Router} from "@angular/router"; +import {firstValueFrom} from "rxjs"; +import {CustomersCardForm} from "../customers/create-customers-modal/customers-card-form"; +import {GetAllCustomersCard} from "../customers/customers-card/get-all-customers-card"; +import {NzRowDirective} from "ng-zorro-antd/grid"; +import {CreateContactModal} from "./create-contact-modal/create-contact-modal"; +import {ContactCard} from "./contact-card/contact-card"; + +@Component({ + selector: 'app-contact', + imports: [ + NzRowDirective, + CreateContactModal, + ContactCard + ], + templateUrl: './contact.html', + styleUrl: './contact.css', +}) +export class Contact { + private contactsService = inject(ContactsService); + private notificationService = inject(NzNotificationService) + + router = inject(Router); + + contacts = signal([]); + contactsLoading = signal(false); + + async ngOnInit() { + await this.fetchCustomers(); + } + + async fetchCustomers() { + this.contactsLoading.set(true); + try { + const contacts = await firstValueFrom(this.contactsService.getAllContactEndpoint()) + this.contacts.set(contacts) + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.contactsLoading.set(false); + } +} diff --git a/src/app/pages/contact/create-contact-modal/create-contact-modal.css b/src/app/pages/contact/create-contact-modal/create-contact-modal.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/contact/create-contact-modal/create-contact-modal.html b/src/app/pages/contact/create-contact-modal/create-contact-modal.html new file mode 100644 index 0000000..9561a47 --- /dev/null +++ b/src/app/pages/contact/create-contact-modal/create-contact-modal.html @@ -0,0 +1 @@ +

create-contact-modal works!

diff --git a/src/app/pages/contact/create-contact-modal/create-contact-modal.ts b/src/app/pages/contact/create-contact-modal/create-contact-modal.ts new file mode 100644 index 0000000..e88f0df --- /dev/null +++ b/src/app/pages/contact/create-contact-modal/create-contact-modal.ts @@ -0,0 +1,63 @@ +import {Component, output} from '@angular/core'; +import {ContactAddForm} from "../contact-add-form/contact-add-form"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzModalComponent} from "ng-zorro-antd/modal"; + +@Component({ + selector: 'app-create-contact-modal', + imports: [ + ContactAddForm, + NzButtonComponent, + NzModalComponent + ], + template: ` + + + Création de contacts + + + + + + + + + + + `, + styleUrl: './create-contact-modal.css', +}) +export class CreateContactModal { + constructor(private message: NzMessageService) {} + isVisible = false; + isConfirmLoading = false; + + showModal(): void { + this.isVisible = true; + } + + handleOk(): void { + this.isConfirmLoading = true; + this.message.success('Client créé !'); + setTimeout(() => { + this.isVisible = false; + this.isConfirmLoading = false; + }, 300); + this.triggerCreated.emit(); + } + + handleCancel(): void { + this.isVisible = false; + this.message.info('Création annulée'); + } + + triggerCreated = output() +} diff --git a/src/app/pages/customers/create-customers-modal/customers-card-form.css b/src/app/pages/customers/create-customers-modal/customers-card-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/customers/create-customers-modal/customers-card-form.html b/src/app/pages/customers/create-customers-modal/customers-card-form.html new file mode 100644 index 0000000..4b55f97 --- /dev/null +++ b/src/app/pages/customers/create-customers-modal/customers-card-form.html @@ -0,0 +1 @@ +

customers-card-form works!

diff --git a/src/app/pages/customers/create-customers-modal/customers-card-form.ts b/src/app/pages/customers/create-customers-modal/customers-card-form.ts new file mode 100644 index 0000000..a20b2fc --- /dev/null +++ b/src/app/pages/customers/create-customers-modal/customers-card-form.ts @@ -0,0 +1,59 @@ +import {Component, output} from '@angular/core'; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzButtonModule} from "ng-zorro-antd/button"; +import {NzModalModule} from "ng-zorro-antd/modal"; +import {CustomersAddForm} from "../customers-add-form/customers-add-form"; + +@Component({ + selector: 'app-create-customers-modal', + imports: [NzButtonModule, NzModalModule, CustomersAddForm], + template: ` + + + Création de clients + + + + + + + + + + + `, + styleUrl: './customers-card-form.css', +}) +export class CustomersCardForm { + constructor(private message: NzMessageService) {} + isVisible = false; + isConfirmLoading = false; + + showModal(): void { + this.isVisible = true; + } + + handleOk(): void { + this.isConfirmLoading = true; + this.message.success('Client créé !'); + setTimeout(() => { + this.isVisible = false; + this.isConfirmLoading = false; + }, 300); + this.triggerCreated.emit(); + } + + handleCancel(): void { + this.isVisible = false; + this.message.info('Création annulée'); + } + + triggerCreated = output() +} \ No newline at end of file diff --git a/src/app/pages/customers/customers-add-form/customers-add-form.css b/src/app/pages/customers/customers-add-form/customers-add-form.css new file mode 100644 index 0000000..eb7e51c --- /dev/null +++ b/src/app/pages/customers/customers-add-form/customers-add-form.css @@ -0,0 +1,19 @@ +nz-form-container { + background-color: #0000; +} + +nz-form-item { + background-color: #1c1c1c; + + +} + +nz-form-label { + font-style: italic; + color: #fff; +} + + +nz-modal-footer { + +} diff --git a/src/app/pages/customers/customers-add-form/customers-add-form.html b/src/app/pages/customers/customers-add-form/customers-add-form.html new file mode 100644 index 0000000..9d888b2 --- /dev/null +++ b/src/app/pages/customers/customers-add-form/customers-add-form.html @@ -0,0 +1,23 @@ +
+ + Note + + + + + + + Type + + + @for (customertype of customerTypes(); track customertype.id) { + + } + + + + + + + +
diff --git a/src/app/pages/customers/customers-add-form/customers-add-form.ts b/src/app/pages/customers/customers-add-form/customers-add-form.ts new file mode 100644 index 0000000..2f61b14 --- /dev/null +++ b/src/app/pages/customers/customers-add-form/customers-add-form.ts @@ -0,0 +1,86 @@ +import {Component, inject, signal} from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFormModule} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {CreateCustomerDto, CustomersService, CustomertypesService, GetCustomerTypeDto} from "../../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; + +@Component({ + selector: 'app-customers-add-form', + imports: [ReactiveFormsModule, NzFormModule, NzInputDirective, NzFlexDirective, NzButtonComponent, NzColDirective, NzFlexDirective, NzButtonComponent, NzSelectComponent, NzOptionComponent], + templateUrl: './customers-add-form.html', + styleUrl: './customers-add-form.css', +}) +export class CustomersAddForm { + + private customersService = inject(CustomersService); + private customertypesService = inject(CustomertypesService); + private notificationService = inject(NzNotificationService) + + + customerForm = new FormGroup({ + note: new FormControl(null, [Validators.required]), + customerTypeId: new FormControl(null, [Validators.required]), + }) + + customerPost = signal(this.customerForm.value); + customersLoading = signal(false); + + async submitForm() { + // Pour annuler si le formulaire est invalide + if (this.customerForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.customerForm.getRawValue()) + this.customerPost.set(this.customerForm.getRawValue()) + + await this.createCustomers(this.customerPost().note, this.customerPost().customerTypeId) + // Pour vider le formulaire + this.customerForm.reset() + } + + async createCustomers(note: string, customerTypeId: number) { + this.customersLoading.set(true); + + const customerValue = { + note: note, + customerTypeId: customerTypeId + } + + try { + const customer = await firstValueFrom(this.customersService.createCustomerEndpoint(customerValue)); + this.customerPost.set(customer); + console.log(customer); + } catch (e) + { + this.notificationService.error('Erreur de recherche', "L\'auteur n\'existe pas !"); + + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.customersLoading.set(false); + } + + customerTypes = signal([]) + + async ngOnInit() { + await this.fetchCustomerTypes() + } + + async fetchCustomerTypes() { + this.customersLoading.set(true); + try { + const customerType = await firstValueFrom(this.customertypesService.getAllCustomerTypeEndpoint()) + this.customerTypes.set(customerType) + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.customersLoading.set(false); + } +} diff --git a/src/app/pages/customers/customers-card/get-all-customers-card.css b/src/app/pages/customers/customers-card/get-all-customers-card.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/customers/customers-card/get-all-customers-card.html b/src/app/pages/customers/customers-card/get-all-customers-card.html new file mode 100644 index 0000000..944568d --- /dev/null +++ b/src/app/pages/customers/customers-card/get-all-customers-card.html @@ -0,0 +1,30 @@ +@if (edit() == false) { + +

Client n°{{ customer().id }}

+

Note : {{ customer().note }}

+

Type de client : {{ customer().customerType}}

+
+ + + + + + +} @else { + +
+ + Note + + + + +
+
+ + + + + + +} diff --git a/src/app/pages/customers/customers-card/get-all-customers-card.ts b/src/app/pages/customers/customers-card/get-all-customers-card.ts new file mode 100644 index 0000000..c06483f --- /dev/null +++ b/src/app/pages/customers/customers-card/get-all-customers-card.ts @@ -0,0 +1,89 @@ +import {Component, inject, input, output, signal} from '@angular/core'; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzFormModule} from "ng-zorro-antd/form"; +import {NzCardComponent} from "ng-zorro-antd/card"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {CustomersService, GetCustomerDto, UpdateCustomerDto} from "../../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; + +@Component({ + selector: 'app-customers-card', + imports: [ReactiveFormsModule, NzFormModule, NzCardComponent, NzIconDirective, NzInputDirective], + templateUrl: './get-all-customers-card.html', + styleUrl: './get-all-customers-card.css', +}) +export class GetAllCustomersCard { + private customersService = inject(CustomersService); + private notificationService = inject(NzNotificationService) + + customerEdit = signal(null); + customersLoading = signal(false); + + customerForm = new FormGroup({ + id: new FormControl(null, [Validators.required]), + note: new FormControl(null, [Validators.required]), + }) + + async submitForm() { + this.customersLoading.set(true); + + const customerValue = { + note: this.customerForm.value.note, + } + + try { + const customer = await firstValueFrom(this.customersService.updateCustomer(this.customer().id,customerValue)); + this.customerEdit.set(customer); + console.log(customer); + this.customerForm.reset(); + this.edit.set(false); + + this.triggerEdited.emit(); + + } catch (e) + { + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.customersLoading.set(false); + + } + + + customer = input(null); + + edit = signal(false) + + triggerEdited = output(); + + protected Edit() { + this.edit.set(true) + } + + protected Back() { + this.edit.set(false) + this.customerForm.reset(); + } + + async Delete() { + this.customersLoading.set(true); + + try { + const customer = await firstValueFrom(this.customersService.deleteCustomerEndpoint(this.customer().id)); + this.customerEdit.set(customer); + + this.customerForm.reset(); + this.triggerEdited.emit(); + + } catch (e) + { + this.notificationService.error('Erreur de recherche', "L\'auteur n\'existe pas !"); + + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.customersLoading.set(false); + } +} diff --git a/src/app/pages/customers/customers.html b/src/app/pages/customers/customers.html index 7ed2f32..7d7576a 100644 --- a/src/app/pages/customers/customers.html +++ b/src/app/pages/customers/customers.html @@ -1 +1,11 @@ -

customers works!

+ + +
+
+ @for (customer of customers(); track customer.id) + { + + + } +
+
\ No newline at end of file diff --git a/src/app/pages/customers/customers.ts b/src/app/pages/customers/customers.ts index 43d4a36..4f9235c 100644 --- a/src/app/pages/customers/customers.ts +++ b/src/app/pages/customers/customers.ts @@ -1,11 +1,44 @@ -import { Component } from '@angular/core'; +import {Component, inject, signal} from '@angular/core'; +import {CustomersCardForm} from "./create-customers-modal/customers-card-form"; +import {GetAllCustomersCard} from "./customers-card/get-all-customers-card"; +import {NzRowDirective} from "ng-zorro-antd/grid"; +import {CustomersService, GetCustomerDto} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {Router} from "@angular/router"; +import {firstValueFrom} from "rxjs"; @Component({ selector: 'app-customers', - imports: [], + imports: [ + CustomersCardForm, + GetAllCustomersCard, + NzRowDirective + ], templateUrl: './customers.html', styleUrl: './customers.css', }) export class Customers { + private customersService = inject(CustomersService); + private notificationService = inject(NzNotificationService) -} + router = inject(Router); + + customers = signal([]); + customersLoading = signal(false); + + async ngOnInit() { + await this.fetchCustomers(); + } + + async fetchCustomers() { + this.customersLoading.set(true); + try { + const customers = await firstValueFrom(this.customersService.getAllCustomerEndpoint()) + this.customers.set(customers) + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.customersLoading.set(false); + } +} \ No newline at end of file diff --git a/src/app/pages/opportunities/create-opportunity-modal/create-opportunity-modal.css b/src/app/pages/opportunities/create-opportunity-modal/create-opportunity-modal.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/opportunities/create-opportunity-modal/create-opportunity-modal.html b/src/app/pages/opportunities/create-opportunity-modal/create-opportunity-modal.html new file mode 100644 index 0000000..c704788 --- /dev/null +++ b/src/app/pages/opportunities/create-opportunity-modal/create-opportunity-modal.html @@ -0,0 +1 @@ +

create-opportunity-modal works!

diff --git a/src/app/pages/opportunities/create-opportunity-modal/create-opportunity-modal.ts b/src/app/pages/opportunities/create-opportunity-modal/create-opportunity-modal.ts new file mode 100644 index 0000000..d3599df --- /dev/null +++ b/src/app/pages/opportunities/create-opportunity-modal/create-opportunity-modal.ts @@ -0,0 +1,63 @@ +import {Component, output} from '@angular/core'; +import {OpportunityAddForm} from "../opportunity-add-form/opportunity-add-form"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzModalComponent} from "ng-zorro-antd/modal"; + +@Component({ + selector: 'app-create-opportunity-modal', + imports: [ + OpportunityAddForm, + NzButtonComponent, + NzModalComponent + ], + template: ` + + + Création d'opportunités + + + + + + + + + + + `, + styleUrl: './create-opportunity-modal.css', +}) +export class CreateOpportunityModal { + constructor(private message: NzMessageService) {} + isVisible = false; + isConfirmLoading = false; + + showModal(): void { + this.isVisible = true; + } + + handleOk(): void { + this.isConfirmLoading = true; + this.message.success('Opportunité créé !'); + setTimeout(() => { + this.isVisible = false; + this.isConfirmLoading = false; + }, 300); + this.triggerCreated.emit(); + } + + handleCancel(): void { + this.isVisible = false; + this.message.info('Création annulée'); + } + + triggerCreated = output() +} diff --git a/src/app/pages/opportunities/opportunities.html b/src/app/pages/opportunities/opportunities.html index 5b82714..2de5708 100644 --- a/src/app/pages/opportunities/opportunities.html +++ b/src/app/pages/opportunities/opportunities.html @@ -1 +1,57 @@ -

opportunities works!

+ + + + + +
+
+

📞 Appels

+

{{ totalCalls }}

+
+
+

✉️ Emails

+

{{ totalEmails }}

+
+
+

🤝 Réunions

+

{{ totalMeetings }}

+
+
+
+ + + +
+
+ + @for (communication of communications(); track communication.id) { + @if (communication.calling) { + + + } + } + +
+ +
+ + @for (communication of communications(); track communication.id) { + @if (communication.email) { + + + } + } + +
+ +
+ + @for (communication of communications(); track communication.id) { + @if (communication.meeting) { + + + } + } + +
+
\ No newline at end of file diff --git a/src/app/pages/opportunities/opportunities.ts b/src/app/pages/opportunities/opportunities.ts index e287f5b..2b373a5 100644 --- a/src/app/pages/opportunities/opportunities.ts +++ b/src/app/pages/opportunities/opportunities.ts @@ -1,11 +1,54 @@ -import { Component } from '@angular/core'; +import {Component, inject, signal} from '@angular/core'; +import {CreateOpportunityModal} from "./create-opportunity-modal/create-opportunity-modal"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {Router} from "@angular/router"; +import {firstValueFrom} from "rxjs"; +import {NzCardComponent} from "ng-zorro-antd/card"; +import {NzDividerComponent} from "ng-zorro-antd/divider"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {OpportunityCard} from "./opportunity-card/opportunity-card"; +import {CommunicationsService, GetCommunicationDto} from "../../services/api"; @Component({ selector: 'app-opportunities', - imports: [], + imports: [CreateOpportunityModal, NzCardComponent, NzDividerComponent, NzRowDirective, NzColDirective, OpportunityCard], templateUrl: './opportunities.html', styleUrl: './opportunities.css', }) export class Opportunities { + private communicationsService = inject(CommunicationsService); + private notificationService = inject(NzNotificationService) + router = inject(Router); + + communications = signal([]); + communicationsLoading = signal(false); + + async ngOnInit() { + await this.fetchCommunications(); + } + + get totalCalls() { + return this.communications().filter(c => c.calling).length; + } + + get totalEmails() { + return this.communications().filter(c => c.email).length; + } + + get totalMeetings() { + return this.communications().filter(c => c.meeting).length; + } + + async fetchCommunications() { + this.communicationsLoading.set(true); + try { + const communications = await firstValueFrom(this.communicationsService.getAllCommunicationsEndpoint()) + this.communications.set(communications) + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.communicationsLoading.set(false); + } } diff --git a/src/app/pages/opportunities/opportunity-add-form/opportunity-add-form.css b/src/app/pages/opportunities/opportunity-add-form/opportunity-add-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/opportunities/opportunity-add-form/opportunity-add-form.html b/src/app/pages/opportunities/opportunity-add-form/opportunity-add-form.html new file mode 100644 index 0000000..59f6bf6 --- /dev/null +++ b/src/app/pages/opportunities/opportunity-add-form/opportunity-add-form.html @@ -0,0 +1,37 @@ +
+ + Appel + + + + + + + Email + + + + + + + Réunion + + + + + + + Contact + + + @for (contact of contacts(); track contact.id) { + + } + + + + + + + +
\ No newline at end of file diff --git a/src/app/pages/opportunities/opportunity-add-form/opportunity-add-form.ts b/src/app/pages/opportunities/opportunity-add-form/opportunity-add-form.ts new file mode 100644 index 0000000..d1ec64b --- /dev/null +++ b/src/app/pages/opportunities/opportunity-add-form/opportunity-add-form.ts @@ -0,0 +1,105 @@ +import {Component, inject, signal} from '@angular/core'; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {CommunicationsService, ContactsService, CreateCommunicationDto, GetContactDto} from "../../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; + +@Component({ + selector: 'app-opportunity-add-form', + imports: [ + NzButtonComponent, + NzColDirective, + NzFlexDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzInputDirective, + NzRowDirective, + ReactiveFormsModule, + NzSelectComponent, + NzOptionComponent + ], + templateUrl: './opportunity-add-form.html', + styleUrl: './opportunity-add-form.css', +}) +export class OpportunityAddForm { + + private communicationsService = inject(CommunicationsService); + private notificationService = inject(NzNotificationService) + private contactsService = inject(ContactsService); + + + communicationForm = new FormGroup({ + calling: new FormControl(null), + email: new FormControl(null), + meeting: new FormControl(null), + contactId: new FormControl(null, [Validators.required]), + }, { validators: atLeastOneRequired }) + + communicationPost = signal(this.communicationForm.value); + communicationsLoading = signal(false); + + async submitForm() { + if (this.communicationForm.invalid) return; + + const raw = this.communicationForm.getRawValue(); + console.log('contactId:', raw.contactId, 'type:', typeof raw.contactId); + + console.log(this.communicationForm.getRawValue()) + this.communicationPost.set(this.communicationForm.getRawValue()) + + await this.createCommunication(this.communicationPost().calling, this.communicationPost().email, this.communicationPost().meeting, this.communicationPost().contactId) + this.communicationForm.reset() + } + + async createCommunication(calling: string, email: string, meeting: string, contactId: number) { + this.communicationsLoading.set(true); + + const communicationValue: CreateCommunicationDto = { + calling: calling, + email: email, + meeting: meeting, + contactId: Number(contactId) + } + + try { + const communication = await firstValueFrom(this.communicationsService.createCommunicationEndpoint(communicationValue)); + this.communicationPost.set(communication); + console.log(communication); + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.communicationsLoading.set(false); + } + + contacts = signal([]); + + async ngOnInit() { + await this.fetchContacts(); + } + + async fetchContacts() { + try { + const contacts = await firstValueFrom(this.contactsService.getAllContactEndpoint()); + this.contacts.set(contacts); + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + } + } + + + + function atLeastOneRequired(group: FormGroup) { + const { calling, email, meeting } = group.controls; + const valid = [calling, email, meeting].some(c => c.value); + return valid ? null : { atLeastOneRequired: true }; + } diff --git a/src/app/pages/opportunities/opportunity-card/opportunity-card.css b/src/app/pages/opportunities/opportunity-card/opportunity-card.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/opportunities/opportunity-card/opportunity-card.html b/src/app/pages/opportunities/opportunity-card/opportunity-card.html new file mode 100644 index 0000000..e25a26a --- /dev/null +++ b/src/app/pages/opportunities/opportunity-card/opportunity-card.html @@ -0,0 +1,58 @@ +@if (edit() == false) { + +

Contact n°{{ communication().contactId }}

+ @if (communication().calling) { +

📞 Appel : {{ communication().calling }}

+

Nom du Contact : {{ communication().contactLastName + " " + communication().contactFirstName}}

+

Numéro du Contact : {{ communication().contactPhoneNumber }}

+

Email du Contact : {{ communication().contactEmail }}

+ } + @if (communication().email) { +

✉️ Email : {{ communication().email }}

+

Nom du Contact : {{ communication().contactLastName + " " + communication().contactFirstName}}

+

Numéro du Contact : {{ communication().contactPhoneNumber }}

+

Email du Contact : {{ communication().contactEmail }}

+ } + @if (communication().meeting) { +

🤝 Réunion : {{ communication().meeting }}

+

Nom du Contact : {{ communication().contactLastName + " " + communication().contactFirstName}}

+

Numéro du Contact : {{ communication().contactPhoneNumber }}

+

Email du Contact : {{ communication().contactEmail }}

+ } +
+ + + + + + +} @else { + +
+ + Appel + + + + + + Email + + + + + + Réunion + + + + +
+
+ + + + + + +} diff --git a/src/app/pages/opportunities/opportunity-card/opportunity-card.ts b/src/app/pages/opportunities/opportunity-card/opportunity-card.ts new file mode 100644 index 0000000..447932c --- /dev/null +++ b/src/app/pages/opportunities/opportunity-card/opportunity-card.ts @@ -0,0 +1,100 @@ +import {Component, inject, input, output, signal} from '@angular/core'; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {FormControl, FormGroup, ReactiveFormsModule} from "@angular/forms"; +import {firstValueFrom} from "rxjs"; +import {NzCardComponent} from "ng-zorro-antd/card"; +import {NzFormControlComponent, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzColDirective} from "ng-zorro-antd/grid"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {CommunicationsService, GetCommunicationDto, UpdateCommunicationDto} from "../../../services/api"; + +@Component({ + selector: 'app-opportunity-card', + imports: [ + NzCardComponent, + ReactiveFormsModule, + NzFormLabelComponent, + NzFormControlComponent, + NzFormItemComponent, + NzIconDirective, + NzColDirective, + NzInputDirective + ], + templateUrl: './opportunity-card.html', + styleUrl: './opportunity-card.css', +}) +export class OpportunityCard { + private communicationsService = inject(CommunicationsService); + private notificationService = inject(NzNotificationService); + + communicationEdit = signal(null); + communicationsLoading = signal(false); + + communicationForm = new FormGroup({ + calling: new FormControl(null), + email: new FormControl(null), + meeting: new FormControl(null), + }, { validators: atLeastOneRequired }) + + async submitForm() { + this.communicationsLoading.set(true); + + const communicationValue: UpdateCommunicationDto = { + calling: this.communicationForm.value.calling, + email: this.communicationForm.value.email, + meeting: this.communicationForm.value.meeting, + } + + try { + const communication = await firstValueFrom(this.communicationsService.updateCommunicationEndpoint(this.communication().id, communicationValue)); + this.communicationEdit.set(communication as unknown as UpdateCommunicationDto); + console.log(communication); + this.communicationForm.reset(); + this.edit.set(false); + this.triggerEdited.emit(); + } catch (e) { + this.notificationService.error('Erreur', '(ou Erreur de communication avec l\'API)'); + } + + this.communicationsLoading.set(false); + } + + communication = input(null); + edit = signal(false); + triggerEdited = output(); + + protected Edit() { + this.edit.set(true); + this.communicationForm.patchValue({ + calling: this.communication().calling, + email: this.communication().email, + meeting: this.communication().meeting, + }); + } + + protected Back() { + this.edit.set(false); + this.communicationForm.reset(); + } + + async Delete() { + this.communicationsLoading.set(true); + + try { + await firstValueFrom(this.communicationsService.deleteCommunicationEndpoint(this.communication().id)); + this.communicationForm.reset(); + this.triggerEdited.emit(); + } catch (e) { + this.notificationService.error('Erreur', '(ou Erreur de communication avec l\'API)'); + } + + this.communicationsLoading.set(false); + } + } + + function atLeastOneRequired(group: FormGroup) { + const { calling, email, meeting } = group.controls; + const valid = [calling, email, meeting].some(c => c.value); + return valid ? null : { atLeastOneRequired: true }; +} diff --git a/src/app/pages/providers/create-providers-modal/create-providers-modal.css b/src/app/pages/providers/create-providers-modal/create-providers-modal.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/providers/create-providers-modal/create-providers-modal.html b/src/app/pages/providers/create-providers-modal/create-providers-modal.html new file mode 100644 index 0000000..1c34d8b --- /dev/null +++ b/src/app/pages/providers/create-providers-modal/create-providers-modal.html @@ -0,0 +1 @@ +

create-providers-modal works!

diff --git a/src/app/pages/providers/create-providers-modal/create-providers-modal.ts b/src/app/pages/providers/create-providers-modal/create-providers-modal.ts new file mode 100644 index 0000000..551cc7e --- /dev/null +++ b/src/app/pages/providers/create-providers-modal/create-providers-modal.ts @@ -0,0 +1,59 @@ +import {Component, output} from '@angular/core'; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzModalComponent} from "ng-zorro-antd/modal"; +import {ProvidersAddForm} from "../providers-add-form/providers-add-form"; + +@Component({ + selector: 'app-create-providers-modal', + imports: [NzButtonComponent, NzModalComponent, ProvidersAddForm], + template: ` + + + Création de prestataires + + + + + + + + + + + `, + styleUrl: './create-providers-modal.css', +}) +export class CreateProvidersModal { + constructor(private message: NzMessageService) {} + isVisible = false; + isConfirmLoading = false; + + showModal(): void { + this.isVisible = true; + } + + handleOk(): void { + this.isConfirmLoading = true; + this.message.success('Prestataire créé !'); + setTimeout(() => { + this.isVisible = false; + this.isConfirmLoading = false; + }, 300); + this.triggerCreated.emit(); + } + + handleCancel(): void { + this.isVisible = false; + this.message.info('Création annulée'); + } + + triggerCreated = output() +} diff --git a/src/app/pages/providers/providers-add-form/providers-add-form.css b/src/app/pages/providers/providers-add-form/providers-add-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/providers/providers-add-form/providers-add-form.html b/src/app/pages/providers/providers-add-form/providers-add-form.html new file mode 100644 index 0000000..69dfa7a --- /dev/null +++ b/src/app/pages/providers/providers-add-form/providers-add-form.html @@ -0,0 +1,23 @@ +
+ + Prix + + + + + + + Type + + + @for (providertype of providerTypes(); track providertype.id) { + + } + + + + + + + +
diff --git a/src/app/pages/providers/providers-add-form/providers-add-form.ts b/src/app/pages/providers/providers-add-form/providers-add-form.ts new file mode 100644 index 0000000..cbb7720 --- /dev/null +++ b/src/app/pages/providers/providers-add-form/providers-add-form.ts @@ -0,0 +1,85 @@ +import {Component, inject, signal} from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; +import {CreateProviderDto, GetProviderTypeDto, ProvidertypesService, ServiceprovidersService} from "../../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; + +@Component({ + selector: 'app-providers-add-form', + imports: [FormsModule, NzButtonComponent, NzColDirective, NzFlexDirective, NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent, NzInputDirective, NzOptionComponent, NzRowDirective, NzSelectComponent, ReactiveFormsModule], + templateUrl: './providers-add-form.html', + styleUrl: './providers-add-form.css', +}) +export class ProvidersAddForm { + private providersService = inject(ServiceprovidersService); + private serviceprovidertypesService = inject(ProvidertypesService); + private notificationService = inject(NzNotificationService) + + + providerForm = new FormGroup({ + Price: new FormControl(null, [Validators.required]), + providerTypeId: new FormControl(null, [Validators.required]), + }) + + providerPost = signal(this.providerForm.value); + providersLoading = signal(false); + + async submitForm() { + // Pour annuler si le formulaire est invalide + if (this.providerForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.providerForm.getRawValue()) + this.providerPost.set(this.providerForm.getRawValue()) + + await this.createProviders(this.providerPost().price, this.providerPost().providerTypeId) + // Pour vider le formulaire + this.providerForm.reset() + } + + async createProviders(price: number, customerTypeId: number) { + this.providersLoading.set(true); + + const providerValue = { + price: price, + customerTypeId: customerTypeId + } + + try { + const provider = await firstValueFrom(this.providersService.createProviderEndpoint(providerValue)); + this.providerPost.set(provider); + console.log(provider); + } catch (e) + { + this.notificationService.error('Erreur de recherche', "L\'auteur n\'existe pas !"); + + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.providersLoading.set(false); + } + + providerTypes = signal([]) + + async ngOnInit() { + await this.fetchCustomerTypes() + } + + async fetchCustomerTypes() { + this.providersLoading.set(true); + try { + const providerType = await firstValueFrom(this.serviceprovidertypesService.getAllProviderTypesEndpoint()) + this.providerTypes.set(providerType) + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.providersLoading.set(false); + } +} diff --git a/src/app/pages/providers/providers-card/providers-card.css b/src/app/pages/providers/providers-card/providers-card.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/providers/providers-card/providers-card.html b/src/app/pages/providers/providers-card/providers-card.html new file mode 100644 index 0000000..e5b0da9 --- /dev/null +++ b/src/app/pages/providers/providers-card/providers-card.html @@ -0,0 +1,30 @@ +@if (edit() == false) { + +

Prestataire n°{{ provider().id }}

+

Prix : {{ provider().price }}

+

Type de Prestataire : {{ provider().providerType }}

+
+ + + + + + +} @else { + +
+ + Prix + + + + +
+
+ + + + + + +} diff --git a/src/app/pages/providers/providers-card/providers-card.ts b/src/app/pages/providers/providers-card/providers-card.ts new file mode 100644 index 0000000..8e52f43 --- /dev/null +++ b/src/app/pages/providers/providers-card/providers-card.ts @@ -0,0 +1,90 @@ +import {Component, inject, input, output, signal} from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzCardComponent} from "ng-zorro-antd/card"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {GetProviderDto, ServiceprovidersService, UpdateProviderDto} from "../../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; + +@Component({ + selector: 'app-providers-card', + imports: [FormsModule, NzCardComponent, NzColDirective, NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent, NzIconDirective, NzInputDirective, NzRowDirective, ReactiveFormsModule], + templateUrl: './providers-card.html', + styleUrl: './providers-card.css', +}) +export class ProvidersCard { + private providersService = inject(ServiceprovidersService); + private notificationService = inject(NzNotificationService) + + providerEdit = signal(null); + providersLoading = signal(false); + + providerForm = new FormGroup({ + id: new FormControl(null, [Validators.required]), + price: new FormControl(null, [Validators.required]), + }) + + async submitForm() { + this.providersLoading.set(true); + + const providerValue = { + price: this.providerForm.value.price, + } + + try { + const provider = await firstValueFrom(this.providersService.updateProviderEndpoint(this.provider().id,providerValue)); + this.providerEdit.set(provider); + console.log(provider); + this.providerForm.reset(); + this.edit.set(false); + + this.triggerEdited.emit(); + + } catch (e) + { + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.providersLoading.set(false); + + } + + + provider = input(null); + + edit = signal(false) + + triggerEdited = output(); + + protected Edit() { + this.edit.set(true) + } + + protected Back() { + this.edit.set(false) + this.providerForm.reset(); + } + + async Delete() { + this.providersLoading.set(true); + + try { + const provider = await firstValueFrom(this.providersService.deleteProviderEndpoint(this.provider().id)); + this.providerEdit.set(provider); + + this.providerForm.reset(); + this.triggerEdited.emit(); + + } catch (e) + { + this.notificationService.error('Erreur de recherche', "L\'auteur n\'existe pas !"); + + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.providersLoading.set(false); + } +} diff --git a/src/app/pages/providers/providers.html b/src/app/pages/providers/providers.html index 5d1a3a1..6e1fd60 100644 --- a/src/app/pages/providers/providers.html +++ b/src/app/pages/providers/providers.html @@ -1 +1,11 @@ -

providers works!

+ + +
+
+ @for (provider of providers(); track provider.id) + { + + + } +
+
\ No newline at end of file diff --git a/src/app/pages/providers/providers.ts b/src/app/pages/providers/providers.ts index de4acdb..b1b0557 100644 --- a/src/app/pages/providers/providers.ts +++ b/src/app/pages/providers/providers.ts @@ -1,11 +1,40 @@ -import { Component } from '@angular/core'; +import {Component, inject, signal} from '@angular/core'; +import {NzRowDirective} from "ng-zorro-antd/grid"; +import {GetProviderDto, ServiceprovidersService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {Router} from "@angular/router"; +import {firstValueFrom} from "rxjs"; +import {ProvidersCard} from "./providers-card/providers-card"; +import {CreateProvidersModal} from "./create-providers-modal/create-providers-modal"; @Component({ selector: 'app-providers', - imports: [], + imports: [NzRowDirective, ProvidersCard, CreateProvidersModal], templateUrl: './providers.html', styleUrl: './providers.css', }) export class Providers { + private providersService = inject(ServiceprovidersService); + private notificationService = inject(NzNotificationService) + router = inject(Router); + + providers = signal([]); + providersLoading = signal(false); + + async ngOnInit() { + await this.fetchProviders(); + } + + async fetchProviders() { + this.providersLoading.set(true); + try { + const providers = await firstValueFrom(this.providersService.getAllProvidersEndpoint()) + this.providers.set(providers) + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.providersLoading.set(false); + } } diff --git a/src/app/pages/staff/create-staff-modal/create-staff-modal.css b/src/app/pages/staff/create-staff-modal/create-staff-modal.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/staff/create-staff-modal/create-staff-modal.html b/src/app/pages/staff/create-staff-modal/create-staff-modal.html new file mode 100644 index 0000000..50f5d70 --- /dev/null +++ b/src/app/pages/staff/create-staff-modal/create-staff-modal.html @@ -0,0 +1 @@ +

create-staff-modal works!

diff --git a/src/app/pages/staff/create-staff-modal/create-staff-modal.ts b/src/app/pages/staff/create-staff-modal/create-staff-modal.ts new file mode 100644 index 0000000..835acb8 --- /dev/null +++ b/src/app/pages/staff/create-staff-modal/create-staff-modal.ts @@ -0,0 +1,63 @@ +import {Component, output} from '@angular/core'; +import StaffAddForm from "../staff-add-form/staff-add-form"; +import {NzMessageService} from "ng-zorro-antd/message"; +import {NzModalComponent} from "ng-zorro-antd/modal"; +import {NzButtonComponent} from "ng-zorro-antd/button"; + +@Component({ + selector: 'app-create-staff-modal', + imports: [ + StaffAddForm, + NzModalComponent, + NzButtonComponent + ], + template: ` + + + Création de staff + + + + + + + + + + + `, + styleUrl: './create-staff-modal.css', +}) +export class CreateStaffModal { + constructor(private message: NzMessageService) {} + isVisible = false; + isConfirmLoading = false; + + showModal(): void { + this.isVisible = true; + } + + handleOk(): void { + this.isConfirmLoading = true; + this.message.success('Staff créé !'); + setTimeout(() => { + this.isVisible = false; + this.isConfirmLoading = false; + }, 300); + this.triggerCreated.emit(); + } + + handleCancel(): void { + this.isVisible = false; + this.message.info('Création annulée'); + } + + triggerCreated = output() +} diff --git a/src/app/pages/staff/staff-add-form/staff-add-form.css b/src/app/pages/staff/staff-add-form/staff-add-form.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/staff/staff-add-form/staff-add-form.html b/src/app/pages/staff/staff-add-form/staff-add-form.html new file mode 100644 index 0000000..678fcbb --- /dev/null +++ b/src/app/pages/staff/staff-add-form/staff-add-form.html @@ -0,0 +1,47 @@ +
+ + Nom + + + + + + + Prénom + + + + + + + Profession + + + + + + + Email + + + + + + + Numéro F4T2 + + + + + + + Exp. F4T2 + + + + + + + + +
diff --git a/src/app/pages/staff/staff-add-form/staff-add-form.ts b/src/app/pages/staff/staff-add-form/staff-add-form.ts new file mode 100644 index 0000000..56df90b --- /dev/null +++ b/src/app/pages/staff/staff-add-form/staff-add-form.ts @@ -0,0 +1,94 @@ +import {Component, inject, signal} from '@angular/core'; +import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzButtonComponent} from "ng-zorro-antd/button"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFlexDirective} from "ng-zorro-antd/flex"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; +import {CreateStaffDto, GetProviderTypeDto, ProvidertypesService, StaffsService} from "../../../services/api"; + +@Component({ + selector: 'app-staff-add-form', + imports: [FormsModule, NzButtonComponent, NzColDirective, NzFlexDirective, NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent, NzInputDirective, NzRowDirective, ReactiveFormsModule], + templateUrl: './staff-add-form.html', + styleUrl: './staff-add-form.css', +}) +class StaffAddForm { + private staffsService = inject(StaffsService); + private serviceprovidertypesService = inject(ProvidertypesService); + private notificationService = inject(NzNotificationService) + + + staffForm = new FormGroup({ + lastName: new FormControl(null, [Validators.required]), + firstName: new FormControl(null, [Validators.required]), + profession: new FormControl(null, [Validators.required]), + email: new FormControl(null, [Validators.required]), + f4T2NumberApproval: new FormControl(null, [Validators.required]), + f4T2ExpirationDate: new FormControl(null, [Validators.required]) + }) + + staffPost = signal(this.staffForm.value as any); + staffsLoading = signal(false); + + async submitForm() { + // Pour annuler si le formulaire est invalide + if (this.staffForm.invalid) return; + + // Pour obtenir la valeur du formulaire + console.log(this.staffForm.getRawValue()) + this.staffPost.set(this.staffForm.getRawValue() as any) + + await this.createStaff(this.staffPost().lastName, this.staffPost().firstName, this.staffPost().profession, this.staffPost().email, this.staffPost().f4T2NumberApproval, this.staffPost().f4T2ExpirationDate) + // Pour vider le formulaire + this.staffForm.reset() + } + + async createStaff(lastname: string, firstname: string, profession: string, email: string, f4t2number: string, f4t2expiration: Date | string) + { + this.staffsLoading.set(true); + + const staffValue: CreateStaffDto = { + lastName: lastname, + firstName: firstname, + profession: profession, + email: email, + f4T2NumberApproval: f4t2number, + f4T2ExpirationDate: f4t2expiration instanceof Date ? f4t2expiration : new Date(f4t2expiration) + } + + try { + const staff = await firstValueFrom(this.staffsService.createStaffEndpoint(staffValue)); + this.staffPost.set(staff as unknown as CreateStaffDto); + console.log(staff); + } catch (e) + { + + this.notificationService.error('Erreur', ' (ou Erreur de communication avec l\'API)'); + } + + this.staffsLoading.set(false); + } + + providerTypes = signal([]) + + async ngOnInit() { + await this.fetchCustomerTypes() + } + + async fetchCustomerTypes() { + this.staffsLoading.set(true); + try { + const providerType = await firstValueFrom(this.serviceprovidertypesService.getAllProviderTypesEndpoint()) + this.providerTypes.set(providerType) + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.staffsLoading.set(false); + } +} + +export default StaffAddForm diff --git a/src/app/pages/staff/staff-card/staff-card.css b/src/app/pages/staff/staff-card/staff-card.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/pages/staff/staff-card/staff-card.html b/src/app/pages/staff/staff-card/staff-card.html new file mode 100644 index 0000000..09e0487 --- /dev/null +++ b/src/app/pages/staff/staff-card/staff-card.html @@ -0,0 +1,40 @@ +@if (edit() == false) { + +

Staff n°{{ staff().id }}

+

Nom : {{ staff().lastName }} {{ staff().firstName }}

+

Profession : {{ staff().profession }}

+

Email : {{ staff().email }}

+

N° F4T2 : {{ staff().f4T2NumberApproval }}

+

Expiration F4T2 : {{ staff().f4T2ExpirationDate }}

+

Niveau d'experience : {{ staff().experienceLevel}}

+
+ + + + + + +} @else { + +
+ + N° F4T2 + + + + + + Exp. F4T2 + + + + +
+
+ + + + + + +} \ No newline at end of file diff --git a/src/app/pages/staff/staff-card/staff-card.ts b/src/app/pages/staff/staff-card/staff-card.ts new file mode 100644 index 0000000..ef46418 --- /dev/null +++ b/src/app/pages/staff/staff-card/staff-card.ts @@ -0,0 +1,89 @@ +import {Component, inject, input, output, signal} from '@angular/core'; +import {NzCardComponent} from "ng-zorro-antd/card"; +import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; +import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form"; +import {NzIconDirective} from "ng-zorro-antd/icon"; +import {NzInputDirective} from "ng-zorro-antd/input"; +import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {firstValueFrom} from "rxjs"; +import {GetStaffDto, StaffsService, UpdateStaffDto} from "../../../services/api"; + +@Component({ + selector: 'app-staff-card', + imports: [ + NzCardComponent, + NzColDirective, + NzFormControlComponent, + NzFormDirective, + NzFormItemComponent, + NzFormLabelComponent, + NzIconDirective, + NzInputDirective, + NzRowDirective, + ReactiveFormsModule + ], + templateUrl: './staff-card.html', + styleUrl: './staff-card.css', +}) +export class StaffCard { + private staffsService = inject(StaffsService); + private notificationService = inject(NzNotificationService) + + staffEdit = signal(null); + staffsLoading = signal(false); + + staffForm = new FormGroup({ + f4T2NumberApproval: new FormControl(null, [Validators.required]), + f4T2ExpirationDate: new FormControl(null, [Validators.required]), + }) + + async submitForm() { + this.staffsLoading.set(true); + + const staffValue: UpdateStaffDto = { + f4T2NumberApproval: this.staffForm.value.f4T2NumberApproval, + f4T2ExpirationDate: this.staffForm.value.f4T2ExpirationDate, + } + + try { + const staff = await firstValueFrom(this.staffsService.updateStaffEndpoint(this.staff().id, staffValue)); + this.staffEdit.set(staff as unknown as UpdateStaffDto); + console.log(staff); + this.staffForm.reset(); + this.edit.set(false); + this.triggerEdited.emit(); + } catch (e) { + this.notificationService.error('Erreur', '(ou Erreur de communication avec l\'API)'); + } + + this.staffsLoading.set(false); + } + + staff = input(null); + edit = signal(false) + triggerEdited = output(); + + protected Edit() { + this.edit.set(true) + } + + protected Back() { + this.edit.set(false) + this.staffForm.reset(); + } + + async Delete() { + this.staffsLoading.set(true); + + try { + await firstValueFrom(this.staffsService.deleteStaffEndpoint(this.staff().id)); + this.staffForm.reset(); + this.triggerEdited.emit(); + } catch (e) { + this.notificationService.error('Erreur', '(ou Erreur de communication avec l\'API)'); + } + + this.staffsLoading.set(false); + } +} diff --git a/src/app/pages/staff/staff.html b/src/app/pages/staff/staff.html index f9500ec..3cf8b5b 100644 --- a/src/app/pages/staff/staff.html +++ b/src/app/pages/staff/staff.html @@ -1 +1,11 @@ -

staff works!

+ + +
+
+ @for (staff of staffs(); track staff.id) + { + + + } +
+
\ No newline at end of file diff --git a/src/app/pages/staff/staff.ts b/src/app/pages/staff/staff.ts index 7464c3a..3ef9ab5 100644 --- a/src/app/pages/staff/staff.ts +++ b/src/app/pages/staff/staff.ts @@ -1,11 +1,40 @@ -import { Component } from '@angular/core'; +import {Component, inject, signal} from '@angular/core'; +import {NzRowDirective} from "ng-zorro-antd/grid"; +import {GetStaffDto, StaffsService} from "../../services/api"; +import {NzNotificationService} from "ng-zorro-antd/notification"; +import {Router} from "@angular/router"; +import {firstValueFrom} from "rxjs"; +import {CreateStaffModal} from "./create-staff-modal/create-staff-modal"; +import {StaffCard} from "./staff-card/staff-card"; @Component({ selector: 'app-staff', - imports: [], + imports: [NzRowDirective, CreateStaffModal, StaffCard,], templateUrl: './staff.html', styleUrl: './staff.css', }) export class Staff { + private staffsService = inject(StaffsService); + private notificationService = inject(NzNotificationService) + router = inject(Router); + + staffs = signal([]); + staffsLoading = signal(false); + + async ngOnInit() { + await this.fetchStaff(); + } + + async fetchStaff() { + this.staffsLoading.set(true); + try { + const staff = await firstValueFrom(this.staffsService.getAllStaffsEndpoint()) + this.staffs.set(staff) + } catch (e) { + this.notificationService.error('Erreur', 'Erreur de communication avec l\'API'); + } + + this.staffsLoading.set(false); + } } diff --git a/src/app/services/api/.gitignore b/src/app/services/api/.gitignore new file mode 100644 index 0000000..149b576 --- /dev/null +++ b/src/app/services/api/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/src/app/services/api/.openapi-generator-ignore b/src/app/services/api/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/src/app/services/api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/src/app/services/api/.openapi-generator/FILES b/src/app/services/api/.openapi-generator/FILES new file mode 100644 index 0000000..381935a --- /dev/null +++ b/src/app/services/api/.openapi-generator/FILES @@ -0,0 +1,54 @@ +.gitignore +.openapi-generator-ignore +README.md +api.base.service.ts +api.module.ts +api/api.ts +api/availabilities.service.ts +api/communications.service.ts +api/contacts.service.ts +api/customers.service.ts +api/customertypes.service.ts +api/experiencelevels.service.ts +api/historyofapprovals.service.ts +api/providertypes.service.ts +api/serviceproviders.service.ts +api/staffs.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/create-availability-dto.ts +model/create-communication-dto.ts +model/create-contact-dto.ts +model/create-customer-dto.ts +model/create-customer-type-dto.ts +model/create-experience-level-dto.ts +model/create-history-of-approval-dto.ts +model/create-provider-dto.ts +model/create-provider-type-dto.ts +model/create-staff-dto.ts +model/get-availability-dto.ts +model/get-communication-dto.ts +model/get-contact-dto.ts +model/get-customer-dto.ts +model/get-customer-type-dto.ts +model/get-experience-level-dto.ts +model/get-history-of-approval-dto.ts +model/get-provider-dto.ts +model/get-provider-type-dto.ts +model/get-staff-dto.ts +model/models.ts +model/update-availability-dto.ts +model/update-communication-dto.ts +model/update-contact-dto.ts +model/update-customer-dto.ts +model/update-customer-type-dto.ts +model/update-experience-level-dto.ts +model/update-history-of-approval-dto.ts +model/update-provider-dto.ts +model/update-provider-type-dto.ts +model/update-staff-dto.ts +param.ts +provide-api.ts +variables.ts diff --git a/src/app/services/api/.openapi-generator/VERSION b/src/app/services/api/.openapi-generator/VERSION new file mode 100644 index 0000000..6328c54 --- /dev/null +++ b/src/app/services/api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.17.0 diff --git a/src/app/services/api/README.md b/src/app/services/api/README.md new file mode 100644 index 0000000..c2ba935 --- /dev/null +++ b/src/app/services/api/README.md @@ -0,0 +1,185 @@ +# @ + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 1.0.0 + +## Building + +To install the required dependencies and to build the typescript sources run: + +```console +npm install +npm run build +``` + +## Publishing + +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) + +## Consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +```console +npm install @ --save +``` + +_without publishing (not recommended):_ + +```console +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: + +```console +npm link +``` + +In your project: + +```console +npm link +``` + +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +Please refer to this issue for a solution / workaround. +Published packages are not effected by this issue. + +### General usage + +In your Angular project: + +```typescript + +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi() + ], +}; +``` + +**NOTE** +If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: +```typescript +import { ApiModule } from ''; +``` + +If different from the generated base path, during app bootstrap, you can provide the base path to your service. + +```typescript +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi('http://localhost:9999') + ], +}; +``` + +```typescript +// with a custom configuration +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi({ + withCredentials: true, + username: 'user', + password: 'password' + }) + ], +}; +``` + +```typescript +// with factory building a custom configuration +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi, Configuration } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration({ + basePath: 'http://localhost:9999', + withCredentials: true, + username: authService.getUsername(), + password: authService.getPassword(), + }), + deps: [AuthService], + multi: false + } + ], +}; +``` + +### Using multiple OpenAPI files / APIs + +In order to use multiple APIs generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: + +```typescript +import { provideApi as provideUserApi } from 'my-user-api-path'; +import { provideApi as provideAdminApi } from 'my-admin-api-path'; +import { HttpClientModule } from '@angular/common/http'; +import { environment } from '../environments/environment'; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideUserApi(environment.basePath), + provideAdminApi(environment.basePath), + ], +}; +``` + +### Customizing path parameter encoding + +Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' +and Dates for format 'date-time' are encoded correctly. + +Other styles (e.g. "matrix") are not that easy to encode +and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). + +To implement your own parameter encoding (or call another library), +pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object +(see [General Usage](#general-usage) above). + +Example value for use in your Configuration-Provider: + +```typescript +new Configuration({ + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) +``` + +[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations +[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values +[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/src/app/services/api/api.base.service.ts b/src/app/services/api/api.base.service.ts new file mode 100644 index 0000000..1e0f210 --- /dev/null +++ b/src/app/services/api/api.base.service.ts @@ -0,0 +1,83 @@ +/** + * 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 { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { CustomHttpParameterCodec } from './encoder'; +import { Configuration } from './configuration'; + +export class BaseService { + protected basePath = 'http://localhost:5298'; + public defaultHeaders = new HttpHeaders(); + public configuration: Configuration; + public encoder: HttpParameterCodec; + + constructor(basePath?: string|string[], configuration?: Configuration) { + this.configuration = configuration || new Configuration(); + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } + + protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); + } + return this.addToHttpParamsRecursive(httpParams, value, key); + } + + protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { + if (value === null || value === undefined) { + return httpParams; + } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach(k => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error("key may not be null if value is not object or array"); + } +} diff --git a/src/app/services/api/api.module.ts b/src/app/services/api/api.module.ts new file mode 100644 index 0000000..58d341f --- /dev/null +++ b/src/app/services/api/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/src/app/services/api/api/api.ts b/src/app/services/api/api/api.ts new file mode 100644 index 0000000..bba0b75 --- /dev/null +++ b/src/app/services/api/api/api.ts @@ -0,0 +1,21 @@ +export * from './availabilities.service'; +import { AvailabilitiesService } from './availabilities.service'; +export * from './communications.service'; +import { CommunicationsService } from './communications.service'; +export * from './contacts.service'; +import { ContactsService } from './contacts.service'; +export * from './customers.service'; +import { CustomersService } from './customers.service'; +export * from './customertypes.service'; +import { CustomertypesService } from './customertypes.service'; +export * from './experiencelevels.service'; +import { ExperiencelevelsService } from './experiencelevels.service'; +export * from './historyofapprovals.service'; +import { HistoryofapprovalsService } from './historyofapprovals.service'; +export * from './providertypes.service'; +import { ProvidertypesService } from './providertypes.service'; +export * from './serviceproviders.service'; +import { ServiceprovidersService } from './serviceproviders.service'; +export * from './staffs.service'; +import { StaffsService } from './staffs.service'; +export const APIS = [AvailabilitiesService, CommunicationsService, ContactsService, CustomersService, CustomertypesService, ExperiencelevelsService, HistoryofapprovalsService, ProvidertypesService, ServiceprovidersService, StaffsService]; diff --git a/src/app/services/api/api/availabilities.service.ts b/src/app/services/api/api/availabilities.service.ts new file mode 100644 index 0000000..bb38167 --- /dev/null +++ b/src/app/services/api/api/availabilities.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateAvailabilityDto } from '../model/create-availability-dto'; +// @ts-ignore +import { GetAvailabilityDto } from '../model/get-availability-dto'; +// @ts-ignore +import { UpdateAvailabilityDto } from '../model/update-availability-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class AvailabilitiesService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/availabilities + * @param createAvailabilityDto + * @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 createAvailabilityEndpoint(createAvailabilityDto: CreateAvailabilityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createAvailabilityEndpoint(createAvailabilityDto: CreateAvailabilityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createAvailabilityEndpoint(createAvailabilityDto: CreateAvailabilityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createAvailabilityEndpoint(createAvailabilityDto: CreateAvailabilityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createAvailabilityDto === null || createAvailabilityDto === undefined) { + throw new Error('Required parameter createAvailabilityDto was null or undefined when calling createAvailabilityEndpoint.'); + } + + 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/availabilities`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createAvailabilityDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/availabilities/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteAvailabilityEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteAvailabilityEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteAvailabilityEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteAvailabilityEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteAvailabilityEndpoint.'); + } + + 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/availabilities/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/availabilities + * @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 getAllAvailabilityxuest(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllAvailabilityxuest(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllAvailabilityxuest(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllAvailabilityxuest(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/availabilities`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/availabilities/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAvailabilityEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAvailabilityEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAvailabilityEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAvailabilityEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getAvailabilityEndpoint.'); + } + + 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/availabilities/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/availabilities/{id} + * @param id + * @param updateAvailabilityDto + * @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 updateAvailabilityEndpoint(id: number, updateAvailabilityDto: UpdateAvailabilityDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateAvailabilityEndpoint(id: number, updateAvailabilityDto: UpdateAvailabilityDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateAvailabilityEndpoint(id: number, updateAvailabilityDto: UpdateAvailabilityDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateAvailabilityEndpoint(id: number, updateAvailabilityDto: UpdateAvailabilityDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateAvailabilityEndpoint.'); + } + if (updateAvailabilityDto === null || updateAvailabilityDto === undefined) { + throw new Error('Required parameter updateAvailabilityDto was null or undefined when calling updateAvailabilityEndpoint.'); + } + + 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/availabilities/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateAvailabilityDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/communications.service.ts b/src/app/services/api/api/communications.service.ts new file mode 100644 index 0000000..6ccf985 --- /dev/null +++ b/src/app/services/api/api/communications.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateCommunicationDto } from '../model/create-communication-dto'; +// @ts-ignore +import { GetCommunicationDto } from '../model/get-communication-dto'; +// @ts-ignore +import { UpdateCommunicationDto } from '../model/update-communication-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class CommunicationsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/communications + * @param createCommunicationDto + * @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 createCommunicationEndpoint(createCommunicationDto: CreateCommunicationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createCommunicationEndpoint(createCommunicationDto: CreateCommunicationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createCommunicationEndpoint(createCommunicationDto: CreateCommunicationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createCommunicationEndpoint(createCommunicationDto: CreateCommunicationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createCommunicationDto === null || createCommunicationDto === undefined) { + throw new Error('Required parameter createCommunicationDto was null or undefined when calling createCommunicationEndpoint.'); + } + + 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/communications`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createCommunicationDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/communications/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteCommunicationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteCommunicationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteCommunicationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteCommunicationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteCommunicationEndpoint.'); + } + + 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/communications/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/communications + * @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 getAllCommunicationsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllCommunicationsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllCommunicationsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllCommunicationsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/communications`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/communications/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCommunicationEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getCommunicationEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCommunicationEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCommunicationEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getCommunicationEndpoint.'); + } + + 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/communications/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/communications/{id} + * @param id + * @param updateCommunicationDto + * @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 updateCommunicationEndpoint(id: number, updateCommunicationDto: UpdateCommunicationDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateCommunicationEndpoint(id: number, updateCommunicationDto: UpdateCommunicationDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateCommunicationEndpoint(id: number, updateCommunicationDto: UpdateCommunicationDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateCommunicationEndpoint(id: number, updateCommunicationDto: UpdateCommunicationDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateCommunicationEndpoint.'); + } + if (updateCommunicationDto === null || updateCommunicationDto === undefined) { + throw new Error('Required parameter updateCommunicationDto was null or undefined when calling updateCommunicationEndpoint.'); + } + + 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/communications/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateCommunicationDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/contacts.service.ts b/src/app/services/api/api/contacts.service.ts new file mode 100644 index 0000000..d8a5e13 --- /dev/null +++ b/src/app/services/api/api/contacts.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateContactDto } from '../model/create-contact-dto'; +// @ts-ignore +import { GetContactDto } from '../model/get-contact-dto'; +// @ts-ignore +import { UpdateContactDto } from '../model/update-contact-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ContactsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/contacts + * @param createContactDto + * @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 createContactEndpoint(createContactDto: CreateContactDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createContactEndpoint(createContactDto: CreateContactDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createContactEndpoint(createContactDto: CreateContactDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createContactEndpoint(createContactDto: CreateContactDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createContactDto === null || createContactDto === undefined) { + throw new Error('Required parameter createContactDto was null or undefined when calling createContactEndpoint.'); + } + + 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/contacts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createContactDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/contacts/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteContactEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteContactEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteContactEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteContactEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteContactEndpoint.'); + } + + 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/contacts/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/contacts + * @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 getAllContactEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllContactEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllContactEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllContactEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/contacts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/contacts/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getContactEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getContactEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getContactEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getContactEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getContactEndpoint.'); + } + + 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/contacts/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/contacts/{id} + * @param id + * @param updateContactDto + * @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 updateContactEndpoint(id: number, updateContactDto: UpdateContactDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateContactEndpoint(id: number, updateContactDto: UpdateContactDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateContactEndpoint(id: number, updateContactDto: UpdateContactDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateContactEndpoint(id: number, updateContactDto: UpdateContactDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateContactEndpoint.'); + } + if (updateContactDto === null || updateContactDto === undefined) { + throw new Error('Required parameter updateContactDto was null or undefined when calling updateContactEndpoint.'); + } + + 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/contacts/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateContactDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/customers.service.ts b/src/app/services/api/api/customers.service.ts new file mode 100644 index 0000000..5d8adf2 --- /dev/null +++ b/src/app/services/api/api/customers.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateCustomerDto } from '../model/create-customer-dto'; +// @ts-ignore +import { GetCustomerDto } from '../model/get-customer-dto'; +// @ts-ignore +import { UpdateCustomerDto } from '../model/update-customer-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class CustomersService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/customers + * @param createCustomerDto + * @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 createCustomerEndpoint(createCustomerDto: CreateCustomerDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createCustomerEndpoint(createCustomerDto: CreateCustomerDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createCustomerEndpoint(createCustomerDto: CreateCustomerDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createCustomerEndpoint(createCustomerDto: CreateCustomerDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createCustomerDto === null || createCustomerDto === undefined) { + throw new Error('Required parameter createCustomerDto was null or undefined when calling createCustomerEndpoint.'); + } + + 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/customers`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createCustomerDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/customers/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteCustomerEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteCustomerEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteCustomerEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteCustomerEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteCustomerEndpoint.'); + } + + 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/customers/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/customers + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllCustomerEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllCustomerEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllCustomerEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllCustomerEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/customers`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/customers/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCustomerEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getCustomerEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCustomerEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCustomerEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getCustomerEndpoint.'); + } + + 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/customers/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/customers/{id} + * @param id + * @param updateCustomerDto + * @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 updateCustomer(id: number, updateCustomerDto: UpdateCustomerDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateCustomer(id: number, updateCustomerDto: UpdateCustomerDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateCustomer(id: number, updateCustomerDto: UpdateCustomerDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateCustomer(id: number, updateCustomerDto: UpdateCustomerDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateCustomer.'); + } + if (updateCustomerDto === null || updateCustomerDto === undefined) { + throw new Error('Required parameter updateCustomerDto was null or undefined when calling updateCustomer.'); + } + + 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/customers/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateCustomerDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/customertypes.service.ts b/src/app/services/api/api/customertypes.service.ts new file mode 100644 index 0000000..9c8f9ec --- /dev/null +++ b/src/app/services/api/api/customertypes.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateCustomerTypeDto } from '../model/create-customer-type-dto'; +// @ts-ignore +import { GetCustomerTypeDto } from '../model/get-customer-type-dto'; +// @ts-ignore +import { UpdateCustomerTypeDto } from '../model/update-customer-type-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class CustomertypesService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/customertypes + * @param createCustomerTypeDto + * @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 createCustomerTypeEndpoint(createCustomerTypeDto: CreateCustomerTypeDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createCustomerTypeEndpoint(createCustomerTypeDto: CreateCustomerTypeDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createCustomerTypeEndpoint(createCustomerTypeDto: CreateCustomerTypeDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createCustomerTypeEndpoint(createCustomerTypeDto: CreateCustomerTypeDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createCustomerTypeDto === null || createCustomerTypeDto === undefined) { + throw new Error('Required parameter createCustomerTypeDto was null or undefined when calling createCustomerTypeEndpoint.'); + } + + 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/customertypes`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createCustomerTypeDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/customertypes/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteCustomerTypeEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteCustomerTypeEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteCustomerTypeEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteCustomerTypeEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteCustomerTypeEndpoint.'); + } + + 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/customertypes/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/customertypes + * @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 getAllCustomerTypeEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllCustomerTypeEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllCustomerTypeEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllCustomerTypeEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/customertypes`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/customertypes/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCustomerTypeEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getCustomerTypeEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCustomerTypeEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCustomerTypeEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getCustomerTypeEndpoint.'); + } + + 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/customertypes/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/customertypes/{id} + * @param id + * @param updateCustomerTypeDto + * @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 updateCustomerType(id: number, updateCustomerTypeDto: UpdateCustomerTypeDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateCustomerType(id: number, updateCustomerTypeDto: UpdateCustomerTypeDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateCustomerType(id: number, updateCustomerTypeDto: UpdateCustomerTypeDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateCustomerType(id: number, updateCustomerTypeDto: UpdateCustomerTypeDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateCustomerType.'); + } + if (updateCustomerTypeDto === null || updateCustomerTypeDto === undefined) { + throw new Error('Required parameter updateCustomerTypeDto was null or undefined when calling updateCustomerType.'); + } + + 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/customertypes/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateCustomerTypeDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/experiencelevels.service.ts b/src/app/services/api/api/experiencelevels.service.ts new file mode 100644 index 0000000..e6719c4 --- /dev/null +++ b/src/app/services/api/api/experiencelevels.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateExperienceLevelDto } from '../model/create-experience-level-dto'; +// @ts-ignore +import { GetExperienceLevelDto } from '../model/get-experience-level-dto'; +// @ts-ignore +import { UpdateExperienceLevelDto } from '../model/update-experience-level-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ExperiencelevelsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/experiencelevels + * @param createExperienceLevelDto + * @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 createExperienceLevelEndpoint(createExperienceLevelDto: CreateExperienceLevelDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createExperienceLevelEndpoint(createExperienceLevelDto: CreateExperienceLevelDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createExperienceLevelEndpoint(createExperienceLevelDto: CreateExperienceLevelDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createExperienceLevelEndpoint(createExperienceLevelDto: CreateExperienceLevelDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createExperienceLevelDto === null || createExperienceLevelDto === undefined) { + throw new Error('Required parameter createExperienceLevelDto was null or undefined when calling createExperienceLevelEndpoint.'); + } + + 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/experiencelevels`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createExperienceLevelDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/experiencelevels/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteExerienceLevelEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteExerienceLevelEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteExerienceLevelEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteExerienceLevelEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteExerienceLevelEndpoint.'); + } + + 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/experiencelevels/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/experiencelevels + * @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 getAllExperienceLevelsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllExperienceLevelsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllExperienceLevelsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllExperienceLevelsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/experiencelevels`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/experiencelevels/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getExperienceLevelEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getExperienceLevelEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getExperienceLevelEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getExperienceLevelEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getExperienceLevelEndpoint.'); + } + + 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/experiencelevels/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/experiencelevels/{id} + * @param id + * @param updateExperienceLevelDto + * @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 updateExperienceLevelEndpoint(id: number, updateExperienceLevelDto: UpdateExperienceLevelDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateExperienceLevelEndpoint(id: number, updateExperienceLevelDto: UpdateExperienceLevelDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateExperienceLevelEndpoint(id: number, updateExperienceLevelDto: UpdateExperienceLevelDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateExperienceLevelEndpoint(id: number, updateExperienceLevelDto: UpdateExperienceLevelDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateExperienceLevelEndpoint.'); + } + if (updateExperienceLevelDto === null || updateExperienceLevelDto === undefined) { + throw new Error('Required parameter updateExperienceLevelDto was null or undefined when calling updateExperienceLevelEndpoint.'); + } + + 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/experiencelevels/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateExperienceLevelDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/historyofapprovals.service.ts b/src/app/services/api/api/historyofapprovals.service.ts new file mode 100644 index 0000000..aff0f8e --- /dev/null +++ b/src/app/services/api/api/historyofapprovals.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateHistoryOfApprovalDto } from '../model/create-history-of-approval-dto'; +// @ts-ignore +import { GetHistoryOfApprovalDto } from '../model/get-history-of-approval-dto'; +// @ts-ignore +import { UpdateHistoryOfApprovalDto } from '../model/update-history-of-approval-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class HistoryofapprovalsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/historyofapprovals + * @param createHistoryOfApprovalDto + * @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 createHistoryOfApprovalEndpoint(createHistoryOfApprovalDto: CreateHistoryOfApprovalDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createHistoryOfApprovalEndpoint(createHistoryOfApprovalDto: CreateHistoryOfApprovalDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createHistoryOfApprovalEndpoint(createHistoryOfApprovalDto: CreateHistoryOfApprovalDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createHistoryOfApprovalEndpoint(createHistoryOfApprovalDto: CreateHistoryOfApprovalDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createHistoryOfApprovalDto === null || createHistoryOfApprovalDto === undefined) { + throw new Error('Required parameter createHistoryOfApprovalDto was null or undefined when calling createHistoryOfApprovalEndpoint.'); + } + + 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/historyofapprovals`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createHistoryOfApprovalDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/historyofapprovals/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteHistoryOfApprovalEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteHistoryOfApprovalEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteHistoryOfApprovalEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteHistoryOfApprovalEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteHistoryOfApprovalEndpoint.'); + } + + 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/historyofapprovals/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/historyofapprovals + * @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 getAllHistoryOfApprovalEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllHistoryOfApprovalEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllHistoryOfApprovalEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllHistoryOfApprovalEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/historyofapprovals`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/historyofapprovals/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getHistoryOfApprovalEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getHistoryOfApprovalEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getHistoryOfApprovalEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getHistoryOfApprovalEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getHistoryOfApprovalEndpoint.'); + } + + 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/historyofapprovals/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/historyofapprovals/{id} + * @param id + * @param updateHistoryOfApprovalDto + * @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 updateHistoryOfApprovalEndpoint(id: number, updateHistoryOfApprovalDto: UpdateHistoryOfApprovalDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateHistoryOfApprovalEndpoint(id: number, updateHistoryOfApprovalDto: UpdateHistoryOfApprovalDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateHistoryOfApprovalEndpoint(id: number, updateHistoryOfApprovalDto: UpdateHistoryOfApprovalDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateHistoryOfApprovalEndpoint(id: number, updateHistoryOfApprovalDto: UpdateHistoryOfApprovalDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateHistoryOfApprovalEndpoint.'); + } + if (updateHistoryOfApprovalDto === null || updateHistoryOfApprovalDto === undefined) { + throw new Error('Required parameter updateHistoryOfApprovalDto was null or undefined when calling updateHistoryOfApprovalEndpoint.'); + } + + 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/historyofapprovals/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateHistoryOfApprovalDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/providertypes.service.ts b/src/app/services/api/api/providertypes.service.ts new file mode 100644 index 0000000..81fdd00 --- /dev/null +++ b/src/app/services/api/api/providertypes.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateProviderTypeDto } from '../model/create-provider-type-dto'; +// @ts-ignore +import { GetProviderTypeDto } from '../model/get-provider-type-dto'; +// @ts-ignore +import { UpdateProviderTypeDto } from '../model/update-provider-type-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ProvidertypesService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/providertypes + * @param createProviderTypeDto + * @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 createProviderTypeEndpoint(createProviderTypeDto: CreateProviderTypeDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createProviderTypeEndpoint(createProviderTypeDto: CreateProviderTypeDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createProviderTypeEndpoint(createProviderTypeDto: CreateProviderTypeDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createProviderTypeEndpoint(createProviderTypeDto: CreateProviderTypeDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createProviderTypeDto === null || createProviderTypeDto === undefined) { + throw new Error('Required parameter createProviderTypeDto was null or undefined when calling createProviderTypeEndpoint.'); + } + + 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/providertypes`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createProviderTypeDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/providertypes/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteProviderTypeEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteProviderTypeEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteProviderTypeEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteProviderTypeEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteProviderTypeEndpoint.'); + } + + 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/providertypes/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/providertypes + * @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 getAllProviderTypesEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllProviderTypesEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllProviderTypesEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllProviderTypesEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/providertypes`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/providertypes/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getProviderTypeEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getProviderTypeEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getProviderTypeEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getProviderTypeEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getProviderTypeEndpoint.'); + } + + 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/providertypes/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/providertypes/{id} + * @param id + * @param updateProviderTypeDto + * @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 updateProviderTypeEndpoint(id: number, updateProviderTypeDto: UpdateProviderTypeDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateProviderTypeEndpoint(id: number, updateProviderTypeDto: UpdateProviderTypeDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateProviderTypeEndpoint(id: number, updateProviderTypeDto: UpdateProviderTypeDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateProviderTypeEndpoint(id: number, updateProviderTypeDto: UpdateProviderTypeDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateProviderTypeEndpoint.'); + } + if (updateProviderTypeDto === null || updateProviderTypeDto === undefined) { + throw new Error('Required parameter updateProviderTypeDto was null or undefined when calling updateProviderTypeEndpoint.'); + } + + 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/providertypes/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateProviderTypeDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/serviceproviders.service.ts b/src/app/services/api/api/serviceproviders.service.ts new file mode 100644 index 0000000..377f44f --- /dev/null +++ b/src/app/services/api/api/serviceproviders.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateProviderDto } from '../model/create-provider-dto'; +// @ts-ignore +import { GetProviderDto } from '../model/get-provider-dto'; +// @ts-ignore +import { UpdateProviderDto } from '../model/update-provider-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ServiceprovidersService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/serviceproviders + * @param createProviderDto + * @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 createProviderEndpoint(createProviderDto: CreateProviderDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createProviderEndpoint(createProviderDto: CreateProviderDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createProviderEndpoint(createProviderDto: CreateProviderDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createProviderEndpoint(createProviderDto: CreateProviderDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createProviderDto === null || createProviderDto === undefined) { + throw new Error('Required parameter createProviderDto was null or undefined when calling createProviderEndpoint.'); + } + + 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/serviceproviders`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createProviderDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/serviceproviders/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteProviderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteProviderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteProviderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteProviderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteProviderEndpoint.'); + } + + 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/serviceproviders/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/serviceproviders + * @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 getAllProvidersEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllProvidersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllProvidersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllProvidersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/serviceproviders`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/serviceproviders/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getProviderEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getProviderEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getProviderEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getProviderEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getProviderEndpoint.'); + } + + 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/serviceproviders/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/serviceproviders/{id} + * @param id + * @param updateProviderDto + * @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 updateProviderEndpoint(id: number, updateProviderDto: UpdateProviderDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateProviderEndpoint(id: number, updateProviderDto: UpdateProviderDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateProviderEndpoint(id: number, updateProviderDto: UpdateProviderDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateProviderEndpoint(id: number, updateProviderDto: UpdateProviderDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateProviderEndpoint.'); + } + if (updateProviderDto === null || updateProviderDto === undefined) { + throw new Error('Required parameter updateProviderDto was null or undefined when calling updateProviderEndpoint.'); + } + + 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/serviceproviders/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateProviderDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/api/staffs.service.ts b/src/app/services/api/api/staffs.service.ts new file mode 100644 index 0000000..8196b0a --- /dev/null +++ b/src/app/services/api/api/staffs.service.ts @@ -0,0 +1,332 @@ +/** + * PyroFetes + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CreateStaffDto } from '../model/create-staff-dto'; +// @ts-ignore +import { GetStaffDto } from '../model/get-staff-dto'; +// @ts-ignore +import { UpdateStaffDto } from '../model/update-staff-dto'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class StaffsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * @endpoint post /API/staffs + * @param createStaffDto + * @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 createStaffEndpoint(createStaffDto: CreateStaffDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createStaffEndpoint(createStaffDto: CreateStaffDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createStaffEndpoint(createStaffDto: CreateStaffDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createStaffEndpoint(createStaffDto: CreateStaffDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createStaffDto === null || createStaffDto === undefined) { + throw new Error('Required parameter createStaffDto was null or undefined when calling createStaffEndpoint.'); + } + + 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/staffs`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createStaffDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint delete /API/staffs/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteStaffEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteStaffEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteStaffEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteStaffEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling deleteStaffEndpoint.'); + } + + 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/staffs/${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('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/staffs + * @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 getAllStaffsEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllStaffsEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllStaffsEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAllStaffsEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + 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/staffs`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint get /API/staffs/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getStaffEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getStaffEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getStaffEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getStaffEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getStaffEndpoint.'); + } + + 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/staffs/${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('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * @endpoint put /API/staffs/{id} + * @param id + * @param updateStaffDto + * @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 updateStaffEndpoint(id: number, updateStaffDto: UpdateStaffDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateStaffEndpoint(id: number, updateStaffDto: UpdateStaffDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateStaffEndpoint(id: number, updateStaffDto: UpdateStaffDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateStaffEndpoint(id: number, updateStaffDto: UpdateStaffDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling updateStaffEndpoint.'); + } + if (updateStaffDto === null || updateStaffDto === undefined) { + throw new Error('Required parameter updateStaffDto was null or undefined when calling updateStaffEndpoint.'); + } + + 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/staffs/${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('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateStaffDto, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/src/app/services/api/configuration.ts b/src/app/services/api/configuration.ts new file mode 100644 index 0000000..5ffdfbb --- /dev/null +++ b/src/app/services/api/configuration.ts @@ -0,0 +1,193 @@ +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; +} + +export class Configuration { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; + } + if (username !== undefined) { + this.username = username; + } + if (password !== undefined) { + this.password = password; + } + if (accessToken !== undefined) { + this.accessToken = accessToken; + } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; + + // init default JWTBearerAuth credential + if (!this.credentials['JWTBearerAuth']) { + this.credentials['JWTBearerAuth'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value + ? headers.set(headerName, (prefix ?? '') + value) + : headers; + } + + public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams { + const value = this.lookupCredential(credentialKey); + return value + ? query.set(paramName, value) + : query; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/src/app/services/api/encoder.ts b/src/app/services/api/encoder.ts new file mode 100644 index 0000000..138c4d5 --- /dev/null +++ b/src/app/services/api/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * Workaround for https://github.com/angular/angular/issues/18261 + */ +export class CustomHttpParameterCodec implements HttpParameterCodec { + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } +} diff --git a/src/app/services/api/git_push.sh b/src/app/services/api/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/src/app/services/api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/src/app/services/api/index.ts b/src/app/services/api/index.ts new file mode 100644 index 0000000..02cb7d4 --- /dev/null +++ b/src/app/services/api/index.ts @@ -0,0 +1,7 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './provide-api'; +export * from './param'; diff --git a/src/app/services/api/model/create-availability-dto.ts b/src/app/services/api/model/create-availability-dto.ts new file mode 100644 index 0000000..0132309 --- /dev/null +++ b/src/app/services/api/model/create-availability-dto.ts @@ -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. + */ + + +export interface CreateAvailabilityDto { + availabilityDate?: string; + deliveryDate?: string; + expirationDate?: string; + renewalDate?: string; +} + diff --git a/src/app/services/api/model/create-communication-dto.ts b/src/app/services/api/model/create-communication-dto.ts new file mode 100644 index 0000000..27da861 --- /dev/null +++ b/src/app/services/api/model/create-communication-dto.ts @@ -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. + */ + + +export interface CreateCommunicationDto { + calling?: string | null; + email?: string | null; + meeting?: string | null; + contactId?: number; +} + diff --git a/src/app/services/api/model/create-contact-dto.ts b/src/app/services/api/model/create-contact-dto.ts new file mode 100644 index 0000000..92a3845 --- /dev/null +++ b/src/app/services/api/model/create-contact-dto.ts @@ -0,0 +1,22 @@ +/** + * 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 CreateContactDto { + lastName?: string | null; + firstName?: string | null; + phoneNumber?: string | null; + email?: string | null; + address?: string | null; + city?: string | null; + role?: string | null; + customerId?: number | null; +} + diff --git a/src/app/services/api/model/create-customer-dto.ts b/src/app/services/api/model/create-customer-dto.ts new file mode 100644 index 0000000..8335101 --- /dev/null +++ b/src/app/services/api/model/create-customer-dto.ts @@ -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 CreateCustomerDto { + note?: string | null; + customerTypeId?: number; +} + diff --git a/src/app/services/api/model/create-customer-type-dto.ts b/src/app/services/api/model/create-customer-type-dto.ts new file mode 100644 index 0000000..da3d756 --- /dev/null +++ b/src/app/services/api/model/create-customer-type-dto.ts @@ -0,0 +1,15 @@ +/** + * 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 CreateCustomerTypeDto { + label?: string | null; +} + diff --git a/src/app/services/api/model/create-experience-level-dto.ts b/src/app/services/api/model/create-experience-level-dto.ts new file mode 100644 index 0000000..20c17ba --- /dev/null +++ b/src/app/services/api/model/create-experience-level-dto.ts @@ -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 CreateExperienceLevelDto { + label?: string | null; + staffId?: number | null; +} + diff --git a/src/app/services/api/model/create-history-of-approval-dto.ts b/src/app/services/api/model/create-history-of-approval-dto.ts new file mode 100644 index 0000000..25086df --- /dev/null +++ b/src/app/services/api/model/create-history-of-approval-dto.ts @@ -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. + */ + + +export interface CreateHistoryOfApprovalDto { + deliveryDate?: string; + expirationDate?: string; + staffId?: number; +} + diff --git a/src/app/services/api/model/create-provider-dto.ts b/src/app/services/api/model/create-provider-dto.ts new file mode 100644 index 0000000..a939b6a --- /dev/null +++ b/src/app/services/api/model/create-provider-dto.ts @@ -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 CreateProviderDto { + price?: number; + providerTypeId?: number; +} + diff --git a/src/app/services/api/model/create-provider-type-dto.ts b/src/app/services/api/model/create-provider-type-dto.ts new file mode 100644 index 0000000..35cc613 --- /dev/null +++ b/src/app/services/api/model/create-provider-type-dto.ts @@ -0,0 +1,15 @@ +/** + * 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 CreateProviderTypeDto { + label?: string | null; +} + diff --git a/src/app/services/api/model/create-staff-dto.ts b/src/app/services/api/model/create-staff-dto.ts new file mode 100644 index 0000000..614f4b7 --- /dev/null +++ b/src/app/services/api/model/create-staff-dto.ts @@ -0,0 +1,20 @@ +/** + * 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 CreateStaffDto { + firstName?: string | null; + lastName?: string | null; + profession?: string | null; + email?: string | null; + f4T2NumberApproval?: string | null; + f4T2ExpirationDate?: Date | null; +} + diff --git a/src/app/services/api/model/get-availability-dto.ts b/src/app/services/api/model/get-availability-dto.ts new file mode 100644 index 0000000..ae862c0 --- /dev/null +++ b/src/app/services/api/model/get-availability-dto.ts @@ -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 GetAvailabilityDto { + id?: number; + availabilityDate?: string; + deliveryDate?: string; + expirationDate?: string; + renewalDate?: string; +} + diff --git a/src/app/services/api/model/get-communication-dto.ts b/src/app/services/api/model/get-communication-dto.ts new file mode 100644 index 0000000..bdfd4cc --- /dev/null +++ b/src/app/services/api/model/get-communication-dto.ts @@ -0,0 +1,23 @@ +/** + * 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 GetCommunicationDto { + id?: number; + calling?: string | null; + email?: string | null; + meeting?: string | null; + contactId?: number; + contactFirstName?: string | null; + contactLastName?: string | null; + contactEmail?: string | null; + contactPhoneNumber?: string | null; +} + diff --git a/src/app/services/api/model/get-contact-dto.ts b/src/app/services/api/model/get-contact-dto.ts new file mode 100644 index 0000000..bbbedd0 --- /dev/null +++ b/src/app/services/api/model/get-contact-dto.ts @@ -0,0 +1,23 @@ +/** + * 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 GetContactDto { + id?: number; + lastName?: string | null; + firstName?: string | null; + phoneNumber?: string | null; + email?: string | null; + address?: string | null; + city?: string | null; + role?: string | null; + customerId?: number | null; +} + diff --git a/src/app/services/api/model/get-customer-dto.ts b/src/app/services/api/model/get-customer-dto.ts new file mode 100644 index 0000000..f4c6a47 --- /dev/null +++ b/src/app/services/api/model/get-customer-dto.ts @@ -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. + */ + + +export interface GetCustomerDto { + id?: number; + note?: string | null; + customerTypeId?: number; + customerType?: string | null; +} + diff --git a/src/app/services/api/model/get-customer-type-dto.ts b/src/app/services/api/model/get-customer-type-dto.ts new file mode 100644 index 0000000..aa7b052 --- /dev/null +++ b/src/app/services/api/model/get-customer-type-dto.ts @@ -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 GetCustomerTypeDto { + id?: number; + label?: string | null; +} + diff --git a/src/app/services/api/model/get-experience-level-dto.ts b/src/app/services/api/model/get-experience-level-dto.ts new file mode 100644 index 0000000..c6fddc7 --- /dev/null +++ b/src/app/services/api/model/get-experience-level-dto.ts @@ -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. + */ + + +export interface GetExperienceLevelDto { + id?: number; + label?: string | null; + staffId?: number | null; +} + diff --git a/src/app/services/api/model/get-history-of-approval-dto.ts b/src/app/services/api/model/get-history-of-approval-dto.ts new file mode 100644 index 0000000..5102b19 --- /dev/null +++ b/src/app/services/api/model/get-history-of-approval-dto.ts @@ -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. + */ + + +export interface GetHistoryOfApprovalDto { + id?: number; + deliveryDate?: string; + expirationDate?: string; + staffId?: number; +} + diff --git a/src/app/services/api/model/get-provider-dto.ts b/src/app/services/api/model/get-provider-dto.ts new file mode 100644 index 0000000..33ed302 --- /dev/null +++ b/src/app/services/api/model/get-provider-dto.ts @@ -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. + */ + + +export interface GetProviderDto { + id?: number; + price?: number; + providerTypeId?: number; + providerType?: string | null; +} + diff --git a/src/app/services/api/model/get-provider-type-dto.ts b/src/app/services/api/model/get-provider-type-dto.ts new file mode 100644 index 0000000..9c5d7e8 --- /dev/null +++ b/src/app/services/api/model/get-provider-type-dto.ts @@ -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 GetProviderTypeDto { + id?: number; + label?: string | null; +} + diff --git a/src/app/services/api/model/get-staff-dto.ts b/src/app/services/api/model/get-staff-dto.ts new file mode 100644 index 0000000..b5a9c8b --- /dev/null +++ b/src/app/services/api/model/get-staff-dto.ts @@ -0,0 +1,22 @@ +/** + * 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 GetStaffDto { + id?: number; + firstName?: string | null; + lastName?: string | null; + profession?: string | null; + email?: string | null; + f4T2NumberApproval?: string | null; + f4T2ExpirationDate?: Date | null; + experienceLevel?: string | null; +} + diff --git a/src/app/services/api/model/models.ts b/src/app/services/api/model/models.ts new file mode 100644 index 0000000..4bc8e96 --- /dev/null +++ b/src/app/services/api/model/models.ts @@ -0,0 +1,30 @@ +export * from './create-availability-dto'; +export * from './create-communication-dto'; +export * from './create-contact-dto'; +export * from './create-customer-dto'; +export * from './create-customer-type-dto'; +export * from './create-experience-level-dto'; +export * from './create-history-of-approval-dto'; +export * from './create-provider-dto'; +export * from './create-provider-type-dto'; +export * from './create-staff-dto'; +export * from './get-availability-dto'; +export * from './get-communication-dto'; +export * from './get-contact-dto'; +export * from './get-customer-dto'; +export * from './get-customer-type-dto'; +export * from './get-experience-level-dto'; +export * from './get-history-of-approval-dto'; +export * from './get-provider-dto'; +export * from './get-provider-type-dto'; +export * from './get-staff-dto'; +export * from './update-availability-dto'; +export * from './update-communication-dto'; +export * from './update-contact-dto'; +export * from './update-customer-dto'; +export * from './update-customer-type-dto'; +export * from './update-experience-level-dto'; +export * from './update-history-of-approval-dto'; +export * from './update-provider-dto'; +export * from './update-provider-type-dto'; +export * from './update-staff-dto'; diff --git a/src/app/services/api/model/update-availability-dto.ts b/src/app/services/api/model/update-availability-dto.ts new file mode 100644 index 0000000..6580cc6 --- /dev/null +++ b/src/app/services/api/model/update-availability-dto.ts @@ -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. + */ + + +export interface UpdateAvailabilityDto { + availabilityDate?: string; + deliveryDate?: string; + expirationDate?: string; + renewalDate?: string; +} + diff --git a/src/app/services/api/model/update-communication-dto.ts b/src/app/services/api/model/update-communication-dto.ts new file mode 100644 index 0000000..2a7c063 --- /dev/null +++ b/src/app/services/api/model/update-communication-dto.ts @@ -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. + */ + + +export interface UpdateCommunicationDto { + calling?: string | null; + email?: string | null; + meeting?: string | null; +} + diff --git a/src/app/services/api/model/update-contact-dto.ts b/src/app/services/api/model/update-contact-dto.ts new file mode 100644 index 0000000..4f3e7ba --- /dev/null +++ b/src/app/services/api/model/update-contact-dto.ts @@ -0,0 +1,22 @@ +/** + * 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 UpdateContactDto { + lastName?: string | null; + firstName?: string | null; + phoneNumber?: string | null; + email?: string | null; + address?: string | null; + city?: string | null; + role?: string | null; + customerTypeId?: number | null; +} + diff --git a/src/app/services/api/model/update-customer-dto.ts b/src/app/services/api/model/update-customer-dto.ts new file mode 100644 index 0000000..7024615 --- /dev/null +++ b/src/app/services/api/model/update-customer-dto.ts @@ -0,0 +1,15 @@ +/** + * 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 UpdateCustomerDto { + note?: string | null; +} + diff --git a/src/app/services/api/model/update-customer-type-dto.ts b/src/app/services/api/model/update-customer-type-dto.ts new file mode 100644 index 0000000..09a1edf --- /dev/null +++ b/src/app/services/api/model/update-customer-type-dto.ts @@ -0,0 +1,15 @@ +/** + * 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 UpdateCustomerTypeDto { + label?: string | null; +} + diff --git a/src/app/services/api/model/update-experience-level-dto.ts b/src/app/services/api/model/update-experience-level-dto.ts new file mode 100644 index 0000000..3f032fe --- /dev/null +++ b/src/app/services/api/model/update-experience-level-dto.ts @@ -0,0 +1,15 @@ +/** + * 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 UpdateExperienceLevelDto { + label?: string | null; +} + diff --git a/src/app/services/api/model/update-history-of-approval-dto.ts b/src/app/services/api/model/update-history-of-approval-dto.ts new file mode 100644 index 0000000..57fcb73 --- /dev/null +++ b/src/app/services/api/model/update-history-of-approval-dto.ts @@ -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 UpdateHistoryOfApprovalDto { + deliveryDate?: string; + expirationDate?: string; +} + diff --git a/src/app/services/api/model/update-provider-dto.ts b/src/app/services/api/model/update-provider-dto.ts new file mode 100644 index 0000000..5b1ec3a --- /dev/null +++ b/src/app/services/api/model/update-provider-dto.ts @@ -0,0 +1,15 @@ +/** + * 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 UpdateProviderDto { + price?: number; +} + diff --git a/src/app/services/api/model/update-provider-type-dto.ts b/src/app/services/api/model/update-provider-type-dto.ts new file mode 100644 index 0000000..3b3192a --- /dev/null +++ b/src/app/services/api/model/update-provider-type-dto.ts @@ -0,0 +1,15 @@ +/** + * 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 UpdateProviderTypeDto { + label?: string | null; +} + diff --git a/src/app/services/api/model/update-staff-dto.ts b/src/app/services/api/model/update-staff-dto.ts new file mode 100644 index 0000000..39f7cb3 --- /dev/null +++ b/src/app/services/api/model/update-staff-dto.ts @@ -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 UpdateStaffDto { + f4T2NumberApproval?: string | null; + f4T2ExpirationDate?: Date | null; +} + diff --git a/src/app/services/api/param.ts b/src/app/services/api/param.ts new file mode 100644 index 0000000..78a2d20 --- /dev/null +++ b/src/app/services/api/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; + +/** + * Standard types as defined in OpenAPI Specification: Data Types + */ +export type StandardDataType = + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +export type DataType = StandardDataType | string; + +/** + * Standard formats as defined in OpenAPI Specification: Data Types + */ +export type StandardDataFormat = + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + style: ParamStyle, + explode: boolean; + dataType: DataType; + dataFormat: DataFormat | undefined; +} diff --git a/src/app/services/api/provide-api.ts b/src/app/services/api/provide-api.ts new file mode 100644 index 0000000..19c762a --- /dev/null +++ b/src/app/services/api/provide-api.ts @@ -0,0 +1,15 @@ +import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; +import { Configuration, ConfigurationParameters } from './configuration'; +import { BASE_PATH } from './variables'; + +// Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). +export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === "string" + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} \ No newline at end of file diff --git a/src/app/services/api/variables.ts b/src/app/services/api/variables.ts new file mode 100644 index 0000000..6fe5854 --- /dev/null +++ b/src/app/services/api/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/src/index.html b/src/index.html index 319da74..34b7420 100644 --- a/src/index.html +++ b/src/index.html @@ -5,7 +5,7 @@ Pyrofètes Frontend - + diff --git a/src/theme.less b/src/theme.less index ecf2541..9c64788 100644 --- a/src/theme.less +++ b/src/theme.less @@ -6,4 +6,69 @@ // Override less variables to here // View all variables: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/components/style/themes/default.less -// @primary-color: #1890ff; +@primary-color: #1c1c1c; + +@modal-content-bg: #1c1c1c; +@moodal-content-header-bg: #1c1c1c; +@modal-header-bg: #1c1c1c; +@modal-header-border-color-split : #1c1c1c; +@modal-footer-border-color-split : #1c1c1c; +@modal-content-border-color-split : #1c1c1c; +@modal-close-color: #ea7e63; +@modal-heading-color: #AF9252; +@label-color: #AF9252; + + +.ant-modal-content { + border-radius: 16px; + overflow: hidden; +} + + +.ant-modal-header { + border-top-left-radius: 16px; + border-top-right-radius: 16px; +} + +.ant-modal-footer { + border-bottom-left-radius: 16px; + border-bottom-right-radius: 16px; +} + +/* Bouton Cancel/Annuler - Rouge */ +.ant-modal-footer .ant-btn-default { + background-color: #1c1c1c; + color: #ea7e63; + border-color: #ea7e63; +} + +.ant-modal-footer .ant-btn-default:hover, +.ant-modal-footer .ant-btn-default:focus { + background-color: #ea7e63; + color: #1c1c1c; + border-color: #ea7e63; +} + +/* Bouton Submit/Valider - Vert */ +.ant-modal-footer .ant-btn-primary { + background-color: #1c1c1c; + color: #5cd073; + border-color: #5cd073; +} + +.ant-modal-footer .ant-btn-primary:hover, +.ant-modal-footer .ant-btn-primary:focus { + background-color: #5cd073; + color: #1c1c1c; + border-color: #5cd073; +} + +/* Désactiver l'ombre par défaut si vous le souhaitez */ +.ant-modal-footer .ant-btn { + box-shadow: none; +} + +.ant-modal-footer .ant-btn:hover, +.ant-modal-footer .ant-btn:focus { + box-shadow: none; +} \ No newline at end of file