Compare commits

..

4 Commits

266 changed files with 1387 additions and 92 deletions

View File

@ -0,0 +1,53 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { CittaRes } from '../../models/citta-res';
export interface LuoghiControllerFindManyCitta$Params {
/**
* Sigla Provincia
*/
siglaProvincia: string;
/**
* Filter by active status (0 = inactive, 1 = active)
*/
flagAttivo?: number;
}
export function luoghiControllerFindManyCitta(
http: HttpClient,
rootUrl: string,
params: LuoghiControllerFindManyCitta$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<CittaRes>>> {
const rb = new RequestBuilder(
rootUrl,
luoghiControllerFindManyCitta.PATH,
'get',
);
if (params) {
rb.query('siglaProvincia', params.siglaProvincia, {});
rb.query('flagAttivo', params.flagAttivo, {});
}
return http
.request(
rb.build({ responseType: 'json', accept: 'application/json', context }),
)
.pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<CittaRes>>;
}),
);
}
luoghiControllerFindManyCitta.PATH = '/public/luoghi/citta';

View File

@ -0,0 +1,53 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { ProvinciaRes } from '../../models/provincia-res';
export interface LuoghiControllerFindManyProvince$Params {
/**
* Codice Regione
*/
codiceRegione: string;
/**
* Filter by active status (0 = inactive, 1 = active)
*/
flagAttivo?: number;
}
export function luoghiControllerFindManyProvince(
http: HttpClient,
rootUrl: string,
params: LuoghiControllerFindManyProvince$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<ProvinciaRes>>> {
const rb = new RequestBuilder(
rootUrl,
luoghiControllerFindManyProvince.PATH,
'get',
);
if (params) {
rb.query('codiceRegione', params.codiceRegione, {});
rb.query('flagAttivo', params.flagAttivo, {});
}
return http
.request(
rb.build({ responseType: 'json', accept: 'application/json', context }),
)
.pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<ProvinciaRes>>;
}),
);
}
luoghiControllerFindManyProvince.PATH = '/public/luoghi/province';

View File

@ -0,0 +1,53 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { RegioneRes } from '../../models/regione-res';
export interface LuoghiControllerFindManyRegioni$Params {
/**
* Codice Stato
*/
codiceStato: string;
/**
* Filter by active status (0 = inactive, 1 = active)
*/
flagAttivo?: number;
}
export function luoghiControllerFindManyRegioni(
http: HttpClient,
rootUrl: string,
params: LuoghiControllerFindManyRegioni$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<RegioneRes>>> {
const rb = new RequestBuilder(
rootUrl,
luoghiControllerFindManyRegioni.PATH,
'get',
);
if (params) {
rb.query('codiceStato', params.codiceStato, {});
rb.query('flagAttivo', params.flagAttivo, {});
}
return http
.request(
rb.build({ responseType: 'json', accept: 'application/json', context }),
)
.pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<RegioneRes>>;
}),
);
}
luoghiControllerFindManyRegioni.PATH = '/public/luoghi/regioni';

View File

@ -0,0 +1,47 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { StatoRes } from '../../models/stato-res';
export interface LuoghiControllerFindManyStati$Params {
/**
* Filter by active status (0 = inactive, 1 = active)
*/
flagAttivo?: number;
}
export function luoghiControllerFindManyStati(
http: HttpClient,
rootUrl: string,
params?: LuoghiControllerFindManyStati$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<StatoRes>>> {
const rb = new RequestBuilder(
rootUrl,
luoghiControllerFindManyStati.PATH,
'get',
);
if (params) {
rb.query('flagAttivo', params.flagAttivo, {});
}
return http
.request(
rb.build({ responseType: 'json', accept: 'application/json', context }),
)
.pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<StatoRes>>;
}),
);
}
luoghiControllerFindManyStati.PATH = '/public/luoghi/stati';

View File

@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { CittaRes } from '../../models/citta-res';
export interface StrutturePubblicheControllerFindManyCittaInStrutture$Params {
/**
* Sigla Provincia
*/
siglaProvincia: string;
/**
* Filter by active status (0 = inactive, 1 = active)
*/
flagAttivo?: number;
}
export function strutturePubblicheControllerFindManyCittaInStrutture(
http: HttpClient,
rootUrl: string,
params: StrutturePubblicheControllerFindManyCittaInStrutture$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<CittaRes>>> {
const rb = new RequestBuilder(
rootUrl,
strutturePubblicheControllerFindManyCittaInStrutture.PATH,
'get',
);
if (params) {
rb.query('siglaProvincia', params.siglaProvincia, {});
rb.query('flagAttivo', params.flagAttivo, {});
}
return http
.request(
rb.build({ responseType: 'json', accept: 'application/json', context }),
)
.pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<CittaRes>>;
}),
);
}
strutturePubblicheControllerFindManyCittaInStrutture.PATH =
'/public/strutture/luoghi/citta';

View File

@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { ProvinciaRes } from '../../models/provincia-res';
export interface StrutturePubblicheControllerFindManyProvinceInStrutture$Params {
/**
* Codice Regione
*/
codiceRegione: string;
/**
* Filter by active status (0 = inactive, 1 = active)
*/
flagAttivo?: number;
}
export function strutturePubblicheControllerFindManyProvinceInStrutture(
http: HttpClient,
rootUrl: string,
params: StrutturePubblicheControllerFindManyProvinceInStrutture$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<ProvinciaRes>>> {
const rb = new RequestBuilder(
rootUrl,
strutturePubblicheControllerFindManyProvinceInStrutture.PATH,
'get',
);
if (params) {
rb.query('codiceRegione', params.codiceRegione, {});
rb.query('flagAttivo', params.flagAttivo, {});
}
return http
.request(
rb.build({ responseType: 'json', accept: 'application/json', context }),
)
.pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<ProvinciaRes>>;
}),
);
}
strutturePubblicheControllerFindManyProvinceInStrutture.PATH =
'/public/strutture/luoghi/province';

View File

@ -0,0 +1,54 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { RegioneRes } from '../../models/regione-res';
export interface StrutturePubblicheControllerFindManyRegioniInStrutture$Params {
/**
* Codice Stato
*/
codiceStato: string;
/**
* Filter by active status (0 = inactive, 1 = active)
*/
flagAttivo?: number;
}
export function strutturePubblicheControllerFindManyRegioniInStrutture(
http: HttpClient,
rootUrl: string,
params: StrutturePubblicheControllerFindManyRegioniInStrutture$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<RegioneRes>>> {
const rb = new RequestBuilder(
rootUrl,
strutturePubblicheControllerFindManyRegioniInStrutture.PATH,
'get',
);
if (params) {
rb.query('codiceStato', params.codiceStato, {});
rb.query('flagAttivo', params.flagAttivo, {});
}
return http
.request(
rb.build({ responseType: 'json', accept: 'application/json', context }),
)
.pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<RegioneRes>>;
}),
);
}
strutturePubblicheControllerFindManyRegioniInStrutture.PATH =
'/public/strutture/luoghi/regioni';

View File

@ -0,0 +1,48 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
import { HttpClient, HttpContext, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { StrictHttpResponse } from '../../strict-http-response';
import { RequestBuilder } from '../../request-builder';
import { StatoRes } from '../../models/stato-res';
export interface StrutturePubblicheControllerFindManyStatiInStrutture$Params {
/**
* Filter by active status (0 = inactive, 1 = active)
*/
flagAttivo?: number;
}
export function strutturePubblicheControllerFindManyStatiInStrutture(
http: HttpClient,
rootUrl: string,
params?: StrutturePubblicheControllerFindManyStatiInStrutture$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<StatoRes>>> {
const rb = new RequestBuilder(
rootUrl,
strutturePubblicheControllerFindManyStatiInStrutture.PATH,
'get',
);
if (params) {
rb.query('flagAttivo', params.flagAttivo, {});
}
return http
.request(
rb.build({ responseType: 'json', accept: 'application/json', context }),
)
.pipe(
filter((r: any): r is HttpResponse<any> => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<Array<StatoRes>>;
}),
);
}
strutturePubblicheControllerFindManyStatiInStrutture.PATH =
'/public/strutture/luoghi/stati';

View File

@ -22,14 +22,24 @@ export interface StrutturePubblicheControllerFindManyStrutture$Params {
indirizzo?: string | null;
/**
* Luogo calcola distanza da
* Codice Stato
*/
luogo: string;
codiceStato: string;
/**
* Tipo luogo calcola distanza da
* Regione
*/
'luogo.tipo': string;
regione?: string;
/**
* Sigla Provincia
*/
siglaProvincia?: string;
/**
* Comune
*/
comune?: string;
/**
* Tipo della struttura
@ -51,8 +61,10 @@ export function strutturePubblicheControllerFindManyStrutture(
if (params) {
rb.query('nome', params.nome, {});
rb.query('indirizzo', params.indirizzo, {});
rb.query('luogo', params.luogo, {});
rb.query('luogo.tipo', params['luogo.tipo'], {});
rb.query('codiceStato', params.codiceStato, {});
rb.query('regione', params.regione, {});
rb.query('siglaProvincia', params.siglaProvincia, {});
rb.query('comune', params.comune, {});
rb.query('tipoStruttura', params.tipoStruttura, {});
}

View File

@ -6,6 +6,7 @@ export type { AccountDto } from './models/account-dto';
export type { AccountResDto } from './models/account-res-dto';
export type { BufferJson } from './models/buffer-json';
export type { CategoriaPrestazioneResDto } from './models/categoria-prestazione-res-dto';
export type { CittaRes } from './models/citta-res';
export type { CodiceLuogo } from './models/codice-luogo';
export type { CodiceLuogoExcerptResDto } from './models/codice-luogo-excerpt-res-dto';
export type { ConvenzioniStrutture } from './models/convenzioni-strutture';
@ -56,8 +57,11 @@ export type { NomenclatoreLivello2ResDto } from './models/nomenclatore-livello-2
export type { NomenclatoreLivello3ResDto } from './models/nomenclatore-livello-3-res-dto';
export type { NomenclatoreLivello4ResDto } from './models/nomenclatore-livello-4-res-dto';
export type { NomenclatoreRes } from './models/nomenclatore-res';
export type { ProvinciaRes } from './models/provincia-res';
export type { RecoveryDto } from './models/recovery-dto';
export type { RegioneRes } from './models/regione-res';
export type { SortMetaDto } from './models/sort-meta-dto';
export type { StatoRes } from './models/stato-res';
export type { Stipulatore } from './models/stipulatore';
export type { Struttura } from './models/struttura';
export type { StrutturaExcerptRes } from './models/struttura-excerpt-res';

View File

@ -0,0 +1,15 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface CittaRes {
/**
* Total number of structures in the system
*/
codice: string;
/**
* Total number of structures in the system
*/
comune: string;
}

View File

@ -6,12 +6,12 @@ export interface LuogoRes {
/**
* Total number of structures in the system
*/
codice: string | null;
codice: string;
/**
* Total number of structures in the system
*/
codiceRegione: string | null;
codiceRegione: string;
/**
* Total number of structures in the system
@ -21,7 +21,7 @@ export interface LuogoRes {
/**
* Total number of structures in the system
*/
comune: string | null;
comune: string;
/**
* Total number of structures in the system
@ -36,17 +36,17 @@ export interface LuogoRes {
/**
* Total number of structures in the system
*/
provincia: string | null;
provincia: string;
/**
* Total number of structures in the system
*/
regione: string | null;
regione: string;
/**
* Total number of structures in the system
*/
siglaProvincia: string | null;
siglaProvincia: string;
/**
* Total number of structures in the system

View File

@ -0,0 +1,15 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface ProvinciaRes {
/**
* Total number of structures in the system
*/
provincia: string;
/**
* Total number of structures in the system
*/
siglaProvincia: string;
}

View File

@ -0,0 +1,15 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface RegioneRes {
/**
* Total number of structures in the system
*/
codiceRegione: string;
/**
* Total number of structures in the system
*/
regione: string;
}

View File

@ -0,0 +1,15 @@
/* tslint:disable */
/* eslint-disable */
/* Code generated by ng-openapi-gen DO NOT EDIT. */
export interface StatoRes {
/**
* Total number of structures in the system
*/
codiceStato: string;
/**
* Total number of structures in the system
*/
stato: string;
}

View File

@ -11,11 +11,23 @@ import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { StrictHttpResponse } from '../strict-http-response';
import { CittaRes } from '../models/citta-res';
import { luoghiControllerFindLuogoByAutocomplete } from '../fn/luoghi/luoghi-controller-find-luogo-by-autocomplete';
import { LuoghiControllerFindLuogoByAutocomplete$Params } from '../fn/luoghi/luoghi-controller-find-luogo-by-autocomplete';
import { luoghiControllerFindLuogoEsteso } from '../fn/luoghi/luoghi-controller-find-luogo-esteso';
import { LuoghiControllerFindLuogoEsteso$Params } from '../fn/luoghi/luoghi-controller-find-luogo-esteso';
import { luoghiControllerFindManyCitta } from '../fn/luoghi/luoghi-controller-find-many-citta';
import { LuoghiControllerFindManyCitta$Params } from '../fn/luoghi/luoghi-controller-find-many-citta';
import { luoghiControllerFindManyProvince } from '../fn/luoghi/luoghi-controller-find-many-province';
import { LuoghiControllerFindManyProvince$Params } from '../fn/luoghi/luoghi-controller-find-many-province';
import { luoghiControllerFindManyRegioni } from '../fn/luoghi/luoghi-controller-find-many-regioni';
import { LuoghiControllerFindManyRegioni$Params } from '../fn/luoghi/luoghi-controller-find-many-regioni';
import { luoghiControllerFindManyStati } from '../fn/luoghi/luoghi-controller-find-many-stati';
import { LuoghiControllerFindManyStati$Params } from '../fn/luoghi/luoghi-controller-find-many-stati';
import { LuogoRes } from '../models/luogo-res';
import { ProvinciaRes } from '../models/provincia-res';
import { RegioneRes } from '../models/regione-res';
import { StatoRes } from '../models/stato-res';
@Injectable({ providedIn: 'root' })
export class LuoghiApiClient extends BaseService {
@ -115,4 +127,187 @@ export class LuoghiApiClient extends BaseService {
map((r: StrictHttpResponse<Array<LuogoRes>>): Array<LuogoRes> => r.body),
);
}
/** Path part for operation `luoghiControllerFindManyStati()` */
static readonly LuoghiControllerFindManyStatiPath = '/public/luoghi/stati';
/**
* Get stati.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `luoghiControllerFindManyStati()` instead.
*
* This method doesn't expect any request body.
*/
luoghiControllerFindManyStati$Response(
params?: LuoghiControllerFindManyStati$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<StatoRes>>> {
return luoghiControllerFindManyStati(
this.http,
this.rootUrl,
params,
context,
);
}
/**
* Get stati.
*
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `luoghiControllerFindManyStati$Response()` instead.
*
* This method doesn't expect any request body.
*/
luoghiControllerFindManyStati(
params?: LuoghiControllerFindManyStati$Params,
context?: HttpContext,
): Observable<Array<StatoRes>> {
return this.luoghiControllerFindManyStati$Response(params, context).pipe(
map((r: StrictHttpResponse<Array<StatoRes>>): Array<StatoRes> => r.body),
);
}
/** Path part for operation `luoghiControllerFindManyRegioni()` */
static readonly LuoghiControllerFindManyRegioniPath =
'/public/luoghi/regioni';
/**
* Get regioni.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `luoghiControllerFindManyRegioni()` instead.
*
* This method doesn't expect any request body.
*/
luoghiControllerFindManyRegioni$Response(
params: LuoghiControllerFindManyRegioni$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<RegioneRes>>> {
return luoghiControllerFindManyRegioni(
this.http,
this.rootUrl,
params,
context,
);
}
/**
* Get regioni.
*
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `luoghiControllerFindManyRegioni$Response()` instead.
*
* This method doesn't expect any request body.
*/
luoghiControllerFindManyRegioni(
params: LuoghiControllerFindManyRegioni$Params,
context?: HttpContext,
): Observable<Array<RegioneRes>> {
return this.luoghiControllerFindManyRegioni$Response(params, context).pipe(
map(
(r: StrictHttpResponse<Array<RegioneRes>>): Array<RegioneRes> => r.body,
),
);
}
/** Path part for operation `luoghiControllerFindManyProvince()` */
static readonly LuoghiControllerFindManyProvincePath =
'/public/luoghi/province';
/**
* Get province.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `luoghiControllerFindManyProvince()` instead.
*
* This method doesn't expect any request body.
*/
luoghiControllerFindManyProvince$Response(
params: LuoghiControllerFindManyProvince$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<ProvinciaRes>>> {
return luoghiControllerFindManyProvince(
this.http,
this.rootUrl,
params,
context,
);
}
/**
* Get province.
*
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `luoghiControllerFindManyProvince$Response()` instead.
*
* This method doesn't expect any request body.
*/
luoghiControllerFindManyProvince(
params: LuoghiControllerFindManyProvince$Params,
context?: HttpContext,
): Observable<Array<ProvinciaRes>> {
return this.luoghiControllerFindManyProvince$Response(params, context).pipe(
map(
(r: StrictHttpResponse<Array<ProvinciaRes>>): Array<ProvinciaRes> =>
r.body,
),
);
}
/** Path part for operation `luoghiControllerFindManyCitta()` */
static readonly LuoghiControllerFindManyCittaPath = '/public/luoghi/citta';
/**
* Get città.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `luoghiControllerFindManyCitta()` instead.
*
* This method doesn't expect any request body.
*/
luoghiControllerFindManyCitta$Response(
params: LuoghiControllerFindManyCitta$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<CittaRes>>> {
return luoghiControllerFindManyCitta(
this.http,
this.rootUrl,
params,
context,
);
}
/**
* Get città.
*
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `luoghiControllerFindManyCitta$Response()` instead.
*
* This method doesn't expect any request body.
*/
luoghiControllerFindManyCitta(
params: LuoghiControllerFindManyCitta$Params,
context?: HttpContext,
): Observable<Array<CittaRes>> {
return this.luoghiControllerFindManyCitta$Response(params, context).pipe(
map((r: StrictHttpResponse<Array<CittaRes>>): Array<CittaRes> => r.body),
);
}
}

View File

@ -11,6 +11,18 @@ import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { StrictHttpResponse } from '../strict-http-response';
import { CittaRes } from '../models/citta-res';
import { ProvinciaRes } from '../models/provincia-res';
import { RegioneRes } from '../models/regione-res';
import { StatoRes } from '../models/stato-res';
import { strutturePubblicheControllerFindManyCittaInStrutture } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-citta-in-strutture';
import { StrutturePubblicheControllerFindManyCittaInStrutture$Params } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-citta-in-strutture';
import { strutturePubblicheControllerFindManyProvinceInStrutture } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-province-in-strutture';
import { StrutturePubblicheControllerFindManyProvinceInStrutture$Params } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-province-in-strutture';
import { strutturePubblicheControllerFindManyRegioniInStrutture } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-regioni-in-strutture';
import { StrutturePubblicheControllerFindManyRegioniInStrutture$Params } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-regioni-in-strutture';
import { strutturePubblicheControllerFindManyStatiInStrutture } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-stati-in-strutture';
import { StrutturePubblicheControllerFindManyStatiInStrutture$Params } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-stati-in-strutture';
import { strutturePubblicheControllerFindManyStrutture } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-strutture';
import { StrutturePubblicheControllerFindManyStrutture$Params } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-strutture';
import { strutturePubblicheControllerFindManyTipiStrutture } from '../fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-tipi-strutture';
@ -126,4 +138,201 @@ export class StrutturePubblicheApiClient extends BaseService {
),
);
}
/** Path part for operation `strutturePubblicheControllerFindManyStatiInStrutture()` */
static readonly StrutturePubblicheControllerFindManyStatiInStrutturePath =
'/public/strutture/luoghi/stati';
/**
* Get stati strutture.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `strutturePubblicheControllerFindManyStatiInStrutture()` instead.
*
* This method doesn't expect any request body.
*/
strutturePubblicheControllerFindManyStatiInStrutture$Response(
params?: StrutturePubblicheControllerFindManyStatiInStrutture$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<StatoRes>>> {
return strutturePubblicheControllerFindManyStatiInStrutture(
this.http,
this.rootUrl,
params,
context,
);
}
/**
* Get stati strutture.
*
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `strutturePubblicheControllerFindManyStatiInStrutture$Response()` instead.
*
* This method doesn't expect any request body.
*/
strutturePubblicheControllerFindManyStatiInStrutture(
params?: StrutturePubblicheControllerFindManyStatiInStrutture$Params,
context?: HttpContext,
): Observable<Array<StatoRes>> {
return this.strutturePubblicheControllerFindManyStatiInStrutture$Response(
params,
context,
).pipe(
map((r: StrictHttpResponse<Array<StatoRes>>): Array<StatoRes> => r.body),
);
}
/** Path part for operation `strutturePubblicheControllerFindManyRegioniInStrutture()` */
static readonly StrutturePubblicheControllerFindManyRegioniInStrutturePath =
'/public/strutture/luoghi/regioni';
/**
* Get regioni strutture.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `strutturePubblicheControllerFindManyRegioniInStrutture()` instead.
*
* This method doesn't expect any request body.
*/
strutturePubblicheControllerFindManyRegioniInStrutture$Response(
params: StrutturePubblicheControllerFindManyRegioniInStrutture$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<RegioneRes>>> {
return strutturePubblicheControllerFindManyRegioniInStrutture(
this.http,
this.rootUrl,
params,
context,
);
}
/**
* Get regioni strutture.
*
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `strutturePubblicheControllerFindManyRegioniInStrutture$Response()` instead.
*
* This method doesn't expect any request body.
*/
strutturePubblicheControllerFindManyRegioniInStrutture(
params: StrutturePubblicheControllerFindManyRegioniInStrutture$Params,
context?: HttpContext,
): Observable<Array<RegioneRes>> {
return this.strutturePubblicheControllerFindManyRegioniInStrutture$Response(
params,
context,
).pipe(
map(
(r: StrictHttpResponse<Array<RegioneRes>>): Array<RegioneRes> => r.body,
),
);
}
/** Path part for operation `strutturePubblicheControllerFindManyProvinceInStrutture()` */
static readonly StrutturePubblicheControllerFindManyProvinceInStrutturePath =
'/public/strutture/luoghi/province';
/**
* Get province strutture.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `strutturePubblicheControllerFindManyProvinceInStrutture()` instead.
*
* This method doesn't expect any request body.
*/
strutturePubblicheControllerFindManyProvinceInStrutture$Response(
params: StrutturePubblicheControllerFindManyProvinceInStrutture$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<ProvinciaRes>>> {
return strutturePubblicheControllerFindManyProvinceInStrutture(
this.http,
this.rootUrl,
params,
context,
);
}
/**
* Get province strutture.
*
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `strutturePubblicheControllerFindManyProvinceInStrutture$Response()` instead.
*
* This method doesn't expect any request body.
*/
strutturePubblicheControllerFindManyProvinceInStrutture(
params: StrutturePubblicheControllerFindManyProvinceInStrutture$Params,
context?: HttpContext,
): Observable<Array<ProvinciaRes>> {
return this.strutturePubblicheControllerFindManyProvinceInStrutture$Response(
params,
context,
).pipe(
map(
(r: StrictHttpResponse<Array<ProvinciaRes>>): Array<ProvinciaRes> =>
r.body,
),
);
}
/** Path part for operation `strutturePubblicheControllerFindManyCittaInStrutture()` */
static readonly StrutturePubblicheControllerFindManyCittaInStrutturePath =
'/public/strutture/luoghi/citta';
/**
* Get città strutture.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `strutturePubblicheControllerFindManyCittaInStrutture()` instead.
*
* This method doesn't expect any request body.
*/
strutturePubblicheControllerFindManyCittaInStrutture$Response(
params: StrutturePubblicheControllerFindManyCittaInStrutture$Params,
context?: HttpContext,
): Observable<StrictHttpResponse<Array<CittaRes>>> {
return strutturePubblicheControllerFindManyCittaInStrutture(
this.http,
this.rootUrl,
params,
context,
);
}
/**
* Get città strutture.
*
*
*
* This method provides access only to the response body.
* To access the full response (for headers, for example), `strutturePubblicheControllerFindManyCittaInStrutture$Response()` instead.
*
* This method doesn't expect any request body.
*/
strutturePubblicheControllerFindManyCittaInStrutture(
params: StrutturePubblicheControllerFindManyCittaInStrutture$Params,
context?: HttpContext,
): Observable<Array<CittaRes>> {
return this.strutturePubblicheControllerFindManyCittaInStrutture$Response(
params,
context,
).pipe(
map((r: StrictHttpResponse<Array<CittaRes>>): Array<CittaRes> => r.body),
);
}
}

View File

@ -355,7 +355,6 @@ export class ManageStruttureDialogComponent {
});
if (this.struttureForm.invalid) return;
const _struttureForm = this.struttureForm.getRawValue();
console.log(_struttureForm.stipulatori);
const baseParams = {
nome: _struttureForm.nome!,

View File

@ -20,46 +20,97 @@
<p-divider class="w-full my-0!"></p-divider>
<form [formGroup]="cercaStruttureForm"
(ngSubmit)="getStrutture()">
<div class="flex flex-wrap gap-8 md:gap-12 items-start">
<div class="flex flex-wrap gap-8 md:gap-6 items-start">
<div
class="flex-1 bg-surface-0 dark:bg-surface-950 flex flex-col justify-start items-start gap-8 md:gap-12 w-full">
class="flex-3 bg-surface-0 dark:bg-surface-950 flex flex-col justify-start items-start gap-8 md:gap-12 w-full">
<div class="self-stretch flex flex-col justify-start items-start gap-6">
<div class="self-stretch flex flex-col justify-start items-start gap-6">
<div
class="self-stretch justify-start text-surface-900 dark:text-surface-0 text-lg md:text-xl font-semibold leading-tight">
Strutture Convenzionate</div>
Strutture Convenzionate
</div>
<div class="self-stretch flex flex-col justify-start items-start gap-4">
<div class="self-stretch flex flex-col justify-start items-start gap-2">
<div id="tipoStruttura"
class="self-stretch justify-start text-surface-900 dark:text-surface-0 text-base font-normal leading-tight">
Tipologia struttura</div>
<p-dropdown [options]="vm.tipologieStrutture"
class="flex-auto lg:flex-1 lg:mt-0 w-full mr-0 lg:mr-1 text-surface-900 dark:text-surface-0"
name="tiplogiaStruttura"
appendTo="body"
formControlName="tipologiaStruttura"
placeholder="Seleziona il tipo struttura"
showClear="true"
optionLabel="descrizione"
optionValue="codice"
ariaLabelledBy="tipoStruttura"
[filter]="true"></p-dropdown>
Tipologia struttura
</div>
<p-select [options]="vm.tipologieStrutture"
class="flex-auto lg:flex-1 lg:mt-0 w-full mr-0 lg:mr-1 text-surface-900 dark:text-surface-0"
name="tiplogiaStruttura"
appendTo="body"
formControlName="tipologiaStruttura"
placeholder="Seleziona il tipo struttura"
showClear="true"
optionLabel="descrizione"
optionValue="codice"
ariaLabelledBy="tipoStruttura"
emptyFilterMessage="Nessuna tipologia struttura trovata"
emptyMessage="Nessuna tipologia struttura trovata"
[loading]="vm.tipologieStruttureAreLoading"
[filter]="true"></p-select>
</div>
</div>
<div class="self-stretch flex flex-col md:flex-row justify-start items-start gap-4">
<div class="flex-1 flex flex-col justify-start items-start gap-2 w-full">
<div id="luogoAutocomplete"
<div class="flex-1 flex flex-col justify-start items-start gap-2 w-full hidden">
<div id="stato"
class="self-stretch justify-start text-surface-900 dark:text-surface-0 text-base font-normal leading-tight">
Luogo<small class="text-red-600">*
Stato<small class="text-red-600">*
@if (
cercaStruttureForm.controls.luogo.errors?.['required'] &&
cercaStruttureForm.controls.stato.errors?.['required'] &&
vm.cercaStruttureFormSubmitted
) {
Luogo obbligatorio
Stato obbligatorio
}
</small></div>
<p-autoComplete #acSt
</small>
</div>
<p-select [options]="vm.stati"
class="flex-auto lg:flex-1 lg:mt-0 w-full mr-0 lg:mr-1 text-surface-900 dark:text-surface-0"
[ngClass]="{
'ng-invalid ng-dirty':
cercaStruttureForm.controls.stato.errors?.['required'] &&
vm.cercaStruttureFormSubmitted,
}"
name="stato"
appendTo="body"
formControlName="stato"
placeholder="Seleziona lo stato"
showClear="true"
optionLabel="stato"
ariaLabelledBy="stato"
emptyFilterMessage="Nessuno Stato trovato"
emptyMessage="Nessuno Stato trovato"
[loading]="vm.statiAreLoading"
[filter]="true">
<ng-template #selectedItem
let-selectedOption>
<div class="flex items-center gap-2"
*ngIf="selectedOption">
<img src="./assets/images/flags/{{
selectedOption.codiceStato | lowercase
}}.png"
style="width: 18px; vertical-align: middle"
onerror="this.style.display='none'" />
<div>{{ selectedOption.stato }}</div>
</div>
</ng-template>
<ng-template let-stato
#item>
<div class="flex items-center gap-2">
<img src="./assets/images/flags/{{
stato.codiceStato | lowercase
}}.png"
style="width: 18px; vertical-align: middle"
onerror="this.style.display='none'" />
<div>{{ stato.stato }}</div>
</div>
</ng-template>
<ng-template #dropdownicon>
<i class="pi pi-map"></i>
</ng-template>
</p-select>
<!-- <p-autoComplete #acSt
formControlName="luogo"
[suggestions]="vm.filteredLuoghiEsteso"
(completeMethod)="fetchLuogo($event, 1)"
@ -147,41 +198,132 @@
}
</div>
</ng-template>
</p-autoComplete>
</p-autoComplete> -->
</div>
<div class="flex-1 flex flex-col justify-start items-start gap-2 w-full">
<div id="indirizzo"
<div *ngIf="
cercaStruttureForm.controls.stato.value &&
cercaStruttureForm.controls.stato.value.codiceStato === 'ITA'
"
class="flex-1 flex flex-col justify-start items-start gap-2 w-full">
<div id="regione"
class="self-stretch justify-start text-surface-900 dark:text-surface-0 text-base font-normal leading-tight">
Indirizzo</div>
<input type="text"
class="flex-auto lg:flex-1 lg:mt-0 w-full mr-0 lg:mr-1 text-surface-900 dark:text-surface-0 "
formControlName="indirizzo"
pInputText
aria-labelledby="indirizzo"
placeholder="Inserisci l'indirizzo" />
Regione<small class="text-red-600">*
@if (
cercaStruttureForm.controls.regione.errors?.[
'required'
] && vm.cercaStruttureFormSubmitted
) {
Regione obbligatorio
}
</small>
</div>
<p-select [options]="vm.regioni"
class="flex-auto lg:flex-1 lg:mt-0 w-full mr-0 lg:mr-1 text-surface-900 dark:text-surface-0"
[ngClass]="{
'ng-dirty ng-invalid':
cercaStruttureForm.controls.regione.errors?.[
'required'
] && vm.cercaStruttureFormSubmitted,
}"
name="regione"
appendTo="body"
formControlName="regione"
placeholder="Seleziona la regione"
showClear="true"
optionLabel="regione"
ariaLabelledBy="regione"
emptyFilterMessage="Nessuna Regione trovata"
emptyMessage="Nessuna Regione trovata"
[loading]="vm.regioniAreLoading"
[filter]="true" />
</div>
<div *ngIf="cercaStruttureForm.controls.regione.value"
class="flex-1 flex flex-col justify-start items-start gap-2 w-full">
<div id="provincia"
class="self-stretch justify-start text-surface-900 dark:text-surface-0 text-base font-normal leading-tight">
Provincia
</div>
<p-select [options]="vm.province"
class="flex-auto lg:flex-1 lg:mt-0 w-full mr-0 lg:mr-1 text-surface-900 dark:text-surface-0"
name="provincia"
appendTo="body"
formControlName="provincia"
placeholder="Seleziona la provincia"
showClear="true"
optionLabel="provincia"
ariaLabelledBy="provincia"
emptyFilterMessage="Nessuna Provincia trovata"
emptyMessage="Nessuna Provincia trovata"
[loading]="vm.provinceAreLoading"
[filter]="true">
</p-select>
</div>
<div *ngIf="cercaStruttureForm.controls.provincia.value"
class="flex-1 flex flex-col justify-start items-start gap-2 w-full">
<div id="citta"
class="self-stretch justify-start text-surface-900 dark:text-surface-0 text-base font-normal leading-tight">
Città
</div>
<p-select [options]="vm.citta"
class="flex-auto lg:flex-1 lg:mt-0 w-full mr-0 lg:mr-1 text-surface-900 dark:text-surface-0"
name="citta"
appendTo="body"
formControlName="citta"
placeholder="Seleziona la città"
showClear="true"
optionLabel="comune"
ariaLabelledBy="citta"
emptyFilterMessage="Nessuna Città trovata"
emptyMessage="Nessuna Città trovata"
[loading]="vm.cittaAreLoading"
[filter]="true">
</p-select>
</div>
</div>
</div>
<div class="self-stretch flex flex-col md:flex-row justify-end items-center gap-4">
<div class="self-stretch flex flex-col justify-start items-start gap-6">
<div class="flex-1 flex flex-col justify-start items-start gap-2 w-full">
<div id="indirizzo"
class="self-stretch justify-start text-surface-900 dark:text-surface-0 text-base font-normal leading-tight">
Indirizzo
</div>
<input type="text"
class="flex-auto lg:flex-1 lg:mt-0 w-full mr-0 lg:mr-1 text-surface-900 dark:text-surface-0"
formControlName="indirizzo"
pInputText
aria-labelledby="indirizzo"
placeholder="Inserisci l'indirizzo" />
</div>
</div>
<!-- <div class="self-stretch flex flex-col md:flex-row justify-end items-center gap-4">
<div class="flex-1 flex flex-col justify-start items-start gap-2 w-full">
<div class="flex align-items-center">
@if (cercaStruttureForm.controls.luogo.value?.tipo === 'comune') {
@if (
cercaStruttureForm.controls.luogo.value?.tipo === 'comune'
) {
<fa-icon class="self-center fs-16 mr-3 text-color-secondary"
[icon]="faCity"></fa-icon>
<div class="flex flex-col">
<span>{{ cercaStruttureForm.controls.luogo.value?.comune
}}{{
cercaStruttureForm.controls.luogo.value?.codiceStato === 'ITA'
? ' (' + cercaStruttureForm.controls.luogo.value?.siglaProvincia + ')'
cercaStruttureForm.controls.luogo.value?.codiceStato ===
'ITA'
? ' (' +
cercaStruttureForm.controls.luogo.value
?.siglaProvincia +
')'
: ''
}}</span>
<small class="font-light text-xs text-color-secondary">
<i>{{
cercaStruttureForm.controls.luogo.value?.codiceStato === 'ITA'
cercaStruttureForm.controls.luogo.value?.codiceStato ===
'ITA'
? 'Comune: '
: ('Stato estero: ' | titlecase)
}}</i>{{
cercaStruttureForm.controls.luogo.value?.codiceStato === 'ITA'
cercaStruttureForm.controls.luogo.value?.codiceStato ===
'ITA'
? 'Italia → ' +
cercaStruttureForm.controls.luogo.value?.regione +
' → ' +
@ -191,47 +333,66 @@
: ''
}}</small>
</div>
} @else if (cercaStruttureForm.controls.luogo.value?.tipo === 'stato') {
} @else if (
cercaStruttureForm.controls.luogo.value?.tipo === 'stato'
) {
<fa-icon class="self-center fs-16 mr-3 text-color-secondary"
[icon]="faGlobeEurope"></fa-icon>
<div class="flex flex-col">
<span>{{ cercaStruttureForm.controls.luogo.value?.stato }}</span>
<span>{{
cercaStruttureForm.controls.luogo.value?.stato
}}</span>
<small class="font-light text-xs text-color-secondary">
{{
cercaStruttureForm.controls.luogo.value?.codiceStato === 'ITA'
cercaStruttureForm.controls.luogo.value?.codiceStato ===
'ITA'
? ('Stato' | titlecase)
: ('Stato estero' | titlecase)
}}</small>
</div>
} @else if (cercaStruttureForm.controls.luogo.value?.tipo === 'regione') {
} @else if (
cercaStruttureForm.controls.luogo.value?.tipo === 'regione'
) {
<fa-icon class="fs-16 mr-3 text-color-secondary"
[icon]="faMapLocationDot"></fa-icon>
<div class="flex flex-col">
<span>{{ cercaStruttureForm.controls.luogo.value?.regione }}</span>
<span>{{
cercaStruttureForm.controls.luogo.value?.regione
}}</span>
<small class="font-light text-xs text-color-secondary">
<i>Regione:</i>
{{'Italia → ' + cercaStruttureForm.controls.luogo.value?.regione }}</small>
{{
'Italia → ' +
cercaStruttureForm.controls.luogo.value?.regione
}}</small>
</div>
} @else if (cercaStruttureForm.controls.luogo.value?.tipo === 'provincia') {
} @else if (
cercaStruttureForm.controls.luogo.value?.tipo === 'provincia'
) {
<fa-icon class="self-center fs-16 mr-3 text-color-secondary"
[icon]="faMapLocationDot"></fa-icon>
<div class="flex flex-col">
<span>{{ cercaStruttureForm.controls.luogo.value?.provincia }}</span>
<span>{{
cercaStruttureForm.controls.luogo.value?.provincia
}}</span>
<small class="font-light text-xs text-color-secondary">
<i>Provincia:</i>
{{
'Italia → ' + cercaStruttureForm.controls.luogo.value?.regione + ' → ' + cercaStruttureForm.controls.luogo.value?.provincia
'Italia → ' +
cercaStruttureForm.controls.luogo.value?.regione +
' → ' +
cercaStruttureForm.controls.luogo.value?.provincia
}}</small>
</div>
} @else {
<div class="flex flex-col">
<span>&nbsp;</span>
<small class="font-light text-xs text-color-secondary">&nbsp;</small>
</div>
<div class="flex flex-col">
<span>&nbsp;</span>
<small class="font-light text-xs text-color-secondary">&nbsp;</small>
</div>
}
</div>
</div>
</div>
</div> -->
<div class="self-stretch flex flex-col md:flex-row justify-end items-center gap-4">
<button pButton
@ -246,14 +407,16 @@
[disabled]="vm.isSearching"
[loading]="vm.isSearching"
icon="pi pi-search"
[label]="vm.isSearching ? 'Ricerca in corso...' : 'Cerca strutture'"
[label]="
vm.isSearching ? 'Ricerca in corso...' : 'Cerca strutture'
"
severity="primary"
class="w-full md:w-auto"></button>
</div>
</div>
</div>
<div
class="flex-auto lg:flex-1 bg-surface-50 dark:bg-surface-900 rounded-2xl border-2 border-dashed border-surface-200 dark:border-surface-700 h-[343px] w-full lg:1/2">
class="flex-auto lg:flex-2 bg-surface-50 dark:bg-surface-900 rounded-2xl border-2 border-dashed border-surface-200 dark:border-surface-700 h-[343px] w-full lg:1/2">
<google-map #gmap
height="100%"
width="100%"
@ -284,7 +447,10 @@
responsiveLayout="stack"
scrollHeight="400px"
[rowsPerPageOptions]="[10, 50, 100]"
[globalFilterFields]="['struttura.nome', 'struttura.struttureTipiStrutture']">
[globalFilterFields]="[
'struttura.nome',
'struttura.struttureTipiStrutture',
]">
<ng-template #caption>
<div class="flex">
<p-iconfield iconPosition="left"
@ -326,7 +492,9 @@
[ngSwitch]="col.field">
<td *ngSwitchCase="'struttura.struttureTipiStrutture'">
<div>
<ng-container *ngFor="let item of row.struttura.struttureTipiStrutture.split(',')">
<ng-container *ngFor="
let item of row.struttura.struttureTipiStrutture.split(',')
">
<span class="font-light">{{ item.trim() }}</span><br />
</ng-container>
</div>
@ -336,7 +504,9 @@
<p-rating *ngIf="row.struttura.stelline.length"
[(ngModel)]="row.struttura.stelline.length"
[readonly]="true" />
<p><b>{{ row.struttura.nome }}</b></p>
<p>
<b>{{ row.struttura.nome }}</b>
</p>
</div>
<div *ngIf="row.struttura.sitoWeb"
class="mt-4 ont-light">
@ -346,12 +516,23 @@
</td>
<td *ngSwitchCase="'indirizzo'">
<span class="font-light">
<p> {{ row.struttura.indirizzo }}{{ row.struttura.numeroCivico ? ', ' + row.struttura.numeroCivico : '' }}
<p>
{{ row.struttura.indirizzo
}}{{
row.struttura.numeroCivico
? ', ' + row.struttura.numeroCivico
: ''
}}
</p>
<p>
{{ row.struttura.cap }}
{{ row.struttura.codiceLuogo ? row.struttura.codiceLuogo.comune + ' (' +
row.struttura.codiceLuogo.siglaProvincia + ')' : ''
{{
row.struttura.codiceLuogo
? row.struttura.codiceLuogo.comune +
' (' +
row.struttura.codiceLuogo.siglaProvincia +
')'
: ''
}}
</p>
<div class="text-sm"

View File

@ -14,7 +14,15 @@ import {
MapMarker,
} from '@angular/google-maps';
import { StrutturePubblicheControllerFindManyStrutture$Params } from '@api/fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-strutture';
import { LuogoRes, StrutturePubblicheResDto, TipoStruttura } from '@api/models';
import {
CittaRes,
LuogoRes,
ProvinciaRes,
RegioneRes,
StatoRes,
StrutturePubblicheResDto,
TipoStruttura,
} from '@api/models';
import { LuoghiService } from '@core/services';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import {
@ -34,6 +42,7 @@ import { InputIconModule } from 'primeng/inputicon';
import { InputTextModule } from 'primeng/inputtext';
import { MultiSelectModule } from 'primeng/multiselect';
import { RatingModule } from 'primeng/rating';
import { SelectModule } from 'primeng/select';
import { Table, TableModule } from 'primeng/table';
import { ToastModule } from 'primeng/toast';
import { ToggleButtonModule } from 'primeng/togglebutton';
@ -41,6 +50,8 @@ import {
catchError,
EMPTY,
endWith,
filter,
finalize,
map,
Observable,
of,
@ -54,9 +65,14 @@ import { StrutturePubblicheService } from './strutture-pubbliche.service';
const cercaStruttureFormGroupFunc = () => {
return new FormGroup({
tipologiaStruttura: new FormControl<string | null>(null),
luogo: new FormControl<LuogoRes | null>(null, {
stato: new FormControl<StatoRes | null>(null, {
validators: [Validators.required],
}),
regione: new FormControl<RegioneRes | null>(null, {
validators: [Validators.required],
}),
provincia: new FormControl<ProvinciaRes | null>(null),
citta: new FormControl<CittaRes | null>(null),
indirizzo: new FormControl<string | null>(null),
});
};
@ -66,11 +82,19 @@ export type cercaStruttureFormValue = cercaStruttureForm['value'];
export interface CercaStruttureComponentState {
strutture: StrutturePubblicheResDto[];
tipologieStrutture: TipoStruttura[];
stati: Array<StatoRes>;
regioni: Array<RegioneRes>;
province: Array<ProvinciaRes>;
citta: Array<CittaRes>;
filteredLuoghiEsteso: Array<LuogoRes & { dataKey: string }>;
cercaStruttureFormSubmitted: boolean;
tipologieStruttureAreLoading: boolean;
struttureAreLoading: boolean;
statiAreLoading: boolean;
regioniAreLoading: boolean;
provinceAreLoading: boolean;
cittaAreLoading: boolean;
luoghiAreLoading: boolean;
isSearching: boolean;
}
@ -96,6 +120,7 @@ type State = CercaStruttureComponentState;
IconFieldModule,
InputIconModule,
RatingModule,
SelectModule,
],
providers: [RxState, LuoghiService],
templateUrl: './strutture-pubbliche.component.html',
@ -155,12 +180,20 @@ export class StrutturePubblicheComponent {
this.model$ = this.state.select();
this.state.set({
strutture: undefined,
stati: [],
regioni: [],
province: [],
citta: [],
tipologieStrutture: [],
filteredLuoghiEsteso: [],
cercaStruttureFormSubmitted: false,
tipologieStruttureAreLoading: false,
struttureAreLoading: false,
statiAreLoading: false,
regioniAreLoading: false,
provinceAreLoading: false,
cittaAreLoading: false,
luoghiAreLoading: false,
isSearching: false,
});
@ -168,10 +201,19 @@ export class StrutturePubblicheComponent {
const fetchTipologieStrutture$ = of(EMPTY).pipe(
switchMap(() =>
this.strutturePubblicheService.getTipologieStrutture().pipe(
catchError((err) => {
this.messageService.add({
severity: 'error',
life: 5000,
summary: 'Attenzione!',
detail:
'Impossibile recuperare i tipi struttura in questo momento, riprova più tardi',
});
return of([] as TipoStruttura[]);
}),
map((res) => ({
tipologieStrutture: res,
})),
catchError(() => of({ tipologieStrutture: [] })),
startWith({ tipologieStruttureAreLoading: true }),
endWith({ tipologieStruttureAreLoading: false }),
),
@ -179,6 +221,103 @@ export class StrutturePubblicheComponent {
);
this.state.connect(fetchTipologieStrutture$);
const fetchStati$ = this.strutturePubblicheService.getStati().pipe(
tap(() => this.state.set({ statiAreLoading: true })),
map((stati) => ({ stati })),
tap((stati) => {
if (stati)
this.cercaStruttureForm.get('stato')?.setValue(stati.stati[0]);
}),
catchError(() => {
this.messageService.add({
severity: 'error',
life: 5000,
summary: 'Attenzione!',
detail:
'Impossibile recuperare gli stati in questo momento, riprova più tardi',
});
return of({ stati: [] as StatoRes[] });
}),
finalize(() => this.state.set({ statiAreLoading: false })),
);
this.state.connect(fetchStati$);
const fetchRegioni$ =
this.cercaStruttureForm.controls.stato.valueChanges.pipe(
tap(() => this.state.set({ regioniAreLoading: true })),
tap((stato) => {
const isITA = stato?.codiceStato === 'ITA';
if (!isITA) {
// Reset completo
this.resetLocation('stato');
// Disable cascata
this.cercaStruttureForm.get('regione')?.disable();
this.cercaStruttureForm.get('provincia')?.disable();
this.cercaStruttureForm.get('citta')?.disable();
// Rimuovo il required da regione (non serve più)
this.cercaStruttureForm.get('regione')?.clearValidators();
this.cercaStruttureForm.get('regione')?.updateValueAndValidity();
return;
}
// Se ITA → abilita tutto e rimetti validatori
this.cercaStruttureForm.get('regione')?.enable();
this.cercaStruttureForm.get('provincia')?.enable();
this.cercaStruttureForm.get('citta')?.enable();
this.cercaStruttureForm
.get('regione')
?.setValidators([Validators.required]);
this.cercaStruttureForm.get('regione')?.updateValueAndValidity();
}),
filter((stato) => !!stato),
switchMap((stato) =>
this.strutturePubblicheService.getRegioni(stato.codiceStato).pipe(
map((regioni) => ({ regioni })),
catchError(() => of({ regioni: [] as RegioneRes[] })),
finalize(() => this.state.set({ regioniAreLoading: false })),
),
),
);
this.state.connect(fetchRegioni$);
const fetchProvince$ =
this.cercaStruttureForm.controls.regione.valueChanges.pipe(
tap(() => this.state.set({ provinceAreLoading: true })),
tap(() => this.resetLocation('regione')),
filter((regione) => !!regione),
switchMap((regione) =>
this.strutturePubblicheService
.getProvince(regione.codiceRegione)
.pipe(
map((province) => ({ province })),
catchError(() => of({ province: [] as ProvinciaRes[] })),
finalize(() => this.state.set({ provinceAreLoading: false })),
),
),
);
this.state.connect(fetchProvince$);
const fetchCitta$ =
this.cercaStruttureForm.controls.provincia.valueChanges.pipe(
tap(() => this.state.set({ cittaAreLoading: true })),
tap(() => this.resetLocation('provincia')),
filter((provincia) => !!provincia),
switchMap((provincia) =>
this.strutturePubblicheService
.getCitta(provincia.siglaProvincia)
.pipe(
map((citta) => ({ citta })),
catchError(() => of({ citta: [] as CittaRes[] })),
finalize(() => this.state.set({ cittaAreLoading: false })),
),
),
);
this.state.connect(fetchCitta$);
this.options = {
center: { lat: 45.4627123, lng: 9.1075213 },
zoom: 8,
@ -222,6 +361,23 @@ export class StrutturePubblicheComponent {
this.state.connect(fetchCities$);
}
private resetLocation(level: 'stato' | 'regione' | 'provincia') {
if (level === 'stato') {
this.cercaStruttureForm.get('regione')?.reset();
this.cercaStruttureForm.get('provincia')?.reset();
this.cercaStruttureForm.get('citta')?.reset();
}
if (level === 'regione') {
this.cercaStruttureForm.get('provincia')?.reset();
this.cercaStruttureForm.get('citta')?.reset();
}
if (level === 'provincia') {
this.cercaStruttureForm.get('citta')?.reset();
}
}
getStrutture() {
this.state.set({
cercaStruttureFormSubmitted: true,
@ -232,12 +388,14 @@ export class StrutturePubblicheComponent {
const _form = this.cercaStruttureForm.value;
this.cercaStruttureForm.disable();
this.cercaStruttureForm.disable({ emitEvent: false });
const params: StrutturePubblicheControllerFindManyStrutture$Params = {
indirizzo: _form.indirizzo,
tipoStruttura: _form.tipologiaStruttura,
luogo: _form.luogo!.luogo!,
'luogo.tipo': _form.luogo!.tipo!,
codiceStato: _form.stato!.codiceStato,
regione: _form.regione?.regione,
siglaProvincia: _form.provincia?.siglaProvincia,
comune: _form.citta?.comune,
};
this.calcolaIndirizzoDa = _form.indirizzo;
@ -255,7 +413,7 @@ export class StrutturePubblicheComponent {
return of([] as StrutturePubblicheResDto[]);
}),
tap((res) => {
this.cercaStruttureForm.enable();
this.cercaStruttureForm.enable({ emitEvent: false });
if (!res) return;
this.gMapMarkers(res, false);
}),
@ -408,8 +566,6 @@ export class StrutturePubblicheComponent {
}
applyFilterGlobal($event: Event, stringVal: string) {
console.log(this.struttureTable);
this.struttureTable.filterGlobal(
($event.target as HTMLInputElement).value,
stringVal,
@ -432,7 +588,7 @@ export class StrutturePubblicheComponent {
? ', ' + struttura.struttura.numeroCivico
: ''
}`;
address += `${struttura.struttura.cap} ${struttura.struttura.codiceLuogo.comune}(${struttura.struttura.codiceLuogo.siglaProvincia})`;
address += ` ${struttura.struttura.cap} ${struttura.struttura.codiceLuogo.comune}(${struttura.struttura.codiceLuogo.siglaProvincia})`;
// address += `${struttura.struttura.codiceLuogo.provincia ? '(' + struttura.struttura.codiceLuogo.siglaProvincia + ')' : ''}`;
const destination = encodeURIComponent(
@ -448,9 +604,9 @@ export class StrutturePubblicheComponent {
if (this.calcolaIndirizzoDa) {
url = `${url}&origin=${this.calcolaIndirizzoDa}`;
}
const luogo = this.cercaStruttureForm.controls.luogo.value;
const luogo = this.cercaStruttureForm.controls.citta.value;
if (luogo) {
url = `${url}, ${luogo.luogo}`;
url = `${url}, ${luogo.comune}`;
}
url = `${url}&travelmode=${travelMode}`;
@ -459,11 +615,11 @@ export class StrutturePubblicheComponent {
return url;
}
checkLuogo() {
//Hack: rimosso dall'autocomplete forceSelection perchè non funzionava come previsto, selezionando ad esempio "Milano" (comune), selezionava "Milano" (comune).
const luogo = this.cercaStruttureForm.controls['luogo'].value;
if (typeof luogo === 'string') {
this.cercaStruttureForm.controls['luogo'].setValue(null);
}
}
// checkLuogo() {
// //Hack: rimosso dall'autocomplete forceSelection perchè non funzionava come previsto, selezionando ad esempio "Milano" (comune), selezionava "Milano" (comune).
// const luogo = this.cercaStruttureForm.controls['luogo'].value;
// if (typeof luogo === 'string') {
// this.cercaStruttureForm.controls['luogo'].setValue(null);
// }
// }
}

View File

@ -3,6 +3,10 @@ import { Injectable } from '@angular/core';
import { StrutturePubblicheControllerFindManyStrutture$Params } from '@api/fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-strutture';
import { LuoghiApiClient, StrutturePubblicheApiClient } from '@api/services';
import { catchError, map, throwError } from 'rxjs';
import { StrutturePubblicheControllerFindManyCittaInStrutture$Params } from '../../../../api/fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-citta-in-strutture';
import { StrutturePubblicheControllerFindManyProvinceInStrutture$Params } from '../../../../api/fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-province-in-strutture';
import { StrutturePubblicheControllerFindManyRegioniInStrutture$Params } from '../../../../api/fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-regioni-in-strutture';
import { StrutturePubblicheControllerFindManyStatiInStrutture$Params } from '../../../../api/fn/strutture-pubbliche/strutture-pubbliche-controller-find-many-stati-in-strutture';
@Injectable({
providedIn: 'root',
@ -38,6 +42,65 @@ export class StrutturePubblicheService {
);
}
getStati(flagAttivo: number = 1) {
const params: StrutturePubblicheControllerFindManyStatiInStrutture$Params =
{
flagAttivo,
};
return this.strutturePubblicheApiClient
.strutturePubblicheControllerFindManyStatiInStrutture(params)
.pipe(
catchError((err: HttpErrorResponse) => {
return throwError(() => err);
}),
);
}
getRegioni(codiceStato: string, flagAttivo: number = 1) {
const params: StrutturePubblicheControllerFindManyRegioniInStrutture$Params =
{
codiceStato,
flagAttivo,
};
return this.strutturePubblicheApiClient
.strutturePubblicheControllerFindManyRegioniInStrutture(params)
.pipe(
catchError((err: HttpErrorResponse) => {
return throwError(() => err);
}),
);
}
getProvince(codiceRegione: string, flagAttivo: number = 1) {
const params: StrutturePubblicheControllerFindManyProvinceInStrutture$Params =
{
codiceRegione,
flagAttivo,
};
return this.strutturePubblicheApiClient
.strutturePubblicheControllerFindManyProvinceInStrutture(params)
.pipe(
catchError((err: HttpErrorResponse) => {
return throwError(() => err);
}),
);
}
getCitta(siglaProvincia: string, flagAttivo: number = 1) {
const params: StrutturePubblicheControllerFindManyCittaInStrutture$Params =
{
siglaProvincia,
flagAttivo,
};
return this.strutturePubblicheApiClient
.strutturePubblicheControllerFindManyCittaInStrutture(params)
.pipe(
catchError((err: HttpErrorResponse) => {
return throwError(() => err);
}),
);
}
getTipologieStrutture() {
return this.strutturePubblicheApiClient
.strutturePubblicheControllerFindManyTipiStrutture()

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

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