plastic-api
v1.0.0
Published
A Node.js RESTFUL API
Downloads
2
Readme
Plastic API
Servizi REST di comunicazione con il DB - Progetto ING per Plastic Consult
Per UNIFORMITA' i salvataggi saranno tutti effettuati con una MERGE-ALL verrà esposta solo quella
Descrizione
API REST per CRUD su DB.
API Reference
ADDRESS
GET ALL ADDRESS
Find all address defined into DB
GET /address/MERGE Addresses
MERGE address: the difference with save or update depends on id address. Merge query is based on @company_id, @address_type, @header_label, save or update is based on id if it is present or not
POST /address/merge-all[
{
"company_id": "30A6CCEC-1894-4D01-806D-694C5FA53347",
"address_type": "D",
"header_label": "FLO spa (Sede Centrale)",
"street": "Frazione Ghiara Sabbioni, 33/A ",
"zipcode": "43018",
"city": "CATANIA",
"region": "SICILIA",
"country": "ITALIA",
"location_type": "IT",
"phone_number": "+390521823111",
"phone_number2nd": "390521822844",
"is_default": "0",
"active": null,
"note": null,
"updated_by": "c2t",
"insert_date": null,
"update_date": null,
"area": "CT"
}
]FIND Address BY ID
Find One address by its id
GET /address/:id| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id| uniqueidentifer | Address ID |
[
{
"id": "7E69BBC5-5B82-4E6E-B491-14B66CBB127C",
"company_id": "30A6CCEC-1894-4D01-806D-694C5FA53347",
"address_type": "H",
"header_label": "FLO spa (Sede Centrale)",
"street": "Frazione Ghiara Sabbioni, 33/A ",
"zipcode": "43012",
"city": "FONTANELLATO",
"region": "Emilia-Romagna",
"country": "ITALIA",
"location_type": "IT",
"phone_number": "+390521823111",
"phone_number2nd": "390521822844",
"is_default": true,
"active": null,
"note": null,
"updated_by": "CC",
"insert_date": "2023-11-30T10:25:42.253Z",
"update_date": "2023-11-30T10:25:42.253Z",
"area": "PR"
}]FIND Address BY company_id, address_type
Find One address by its id
GET /address/findby| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| company_id| uniqueidentifer | Optional. Comapny ID |
| address_type| char | Optional. Address type D (stands for Delivery) or H (stands for Head)|
| city| String | Optional. City address|
| area| String | Optional. Area address|
| region| String | Optional. Region address|
| active| Defined or not | Optional. Default only active otherwise not null (datetime) is not active |
PUT Addresses
Save ONE or MORE address
PUT /address/save-all[
{
"company_id": "30A6CCEC-1894-4D01-806D-694C5FA53347",
"address_type": "D",
"header_label": "FLO spa (Sede Centrale)",
"street": "Piazza Cavour 14",
"zipcode": "43012",
"city": "CATANIA",
"region": "SICILIA",
"country": "ITALIA",
"location_type": "IT",
"phone_number": "+390521823111",
"phone_number2nd": "390521822844",
"is_default": "0",
"active": null,
"note": null,
"updated_by": "c2t",
"insert_date": null,
"update_date": null,
"area": "CT"
}
]ADDRESS TYPE
GET ALL ADDRESS TYPE
Find all address_type defined into DB, for example: "Sedel Legale" or "Sede Industriale".
GET /address_type/[
{
"id": "485B325B-EF64-48A2-A678-9ABD774F2DFE",
"abbreviation": "H",
"description": "Sede Legale"
}
]GET ADDRESS_TYPE BY ID
GET /address_type/:id [
{
"id": "DCEAE9B5-EB47-4251-8AAF-70EBF27A5D97",
"abbreviation": "H",
"description": "Head Office"
}
]GET ADDRESS_TYPE FIND BY: abbreviation (H, OP, IND), description
GET /address_type/findby| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| abbreviation| String(3) | Optional. H, O, OP, IND |
| description| String | Optional. Head Office, Office, Operational Site, Industrial Site|
[
{
"id": "DCEAE9B5-EB47-4251-8AAF-70EBF27A5D97",
"abbreviation": "H",
"description": "Head Office"
}
]ANSWER TYPE
GET ALL ANSWER TYPE
Find all answer_type defined into DB
GET /answer_type/ [
{
"id": "6D610748-D752-4FE6-AF27-8021F7F315C5",
"type": "Valore alfanumerico"
},
{
"id": "D0DF5F88-B449-4ECB-9C54-8512D464603F",
"type": "Da 1 a 5"
}
]AREA TYPE
Es. MArketing, Acquisti, Direzione, Produzione etc.
GET Area Type FIND ALL
Get area_type, diverse aree di lavoro dei contatti
GET /area_type/[
{
"id": "4EB3EC4B-F3FD-45CB-8FF3-60778F6986E6",
"name": "Acquisti",
"description": null,
"visualization_order": null
},
{
"id": "BBEB62C7-7D58-44E6-81C0-52CAAD8DD567",
"name": "Altro",
"description": null,
"visualization_order": null
},
{
"id": "2DB00F21-03C0-4526-8772-A390632D9493",
"name": "Amministrazione Finanza Controllo",
"description": null,
"visualization_order": null
}
]CODE
GET Code
Find all code for Congiuntura project
GET /code/[
{
"abbreviation": "A.1.1.",
"description": null
},
{
"abbreviation": "A.1.2.",
"description": null
},
{
"abbreviation": "A.1.6.",
"description": null
}
]COMPANY
POST Company MERGE ALL
SAVE or UPDATE array Companies using MERGE query on SQLServer based on @checksum (vat and business_name, should be changed with cf): date (insert and update are calculated automatically if are null). Would be inserted contact_company as well
POST /company/merge-allINPUT:
[
{
"id":"",
"updated_by":"c2t",
"business_name":"ECOFILM S.R.L.",
"vat":"011955270168",
"cf":null,
"email":"[email protected]",
"description":"PRODUZIONE FILM PER L''IMBALLAGGIO",
"legal_form":"s.r.l.",
"pec":null,
"unique_code":null,
"status":"Attiva",
"web_site":"https://ecofilmsrl.it/",
"note":null,
"insert_date":null,
"update_date":"2023-12-20",
"last_call_date":null,
"addresses":[
{
"id": "9686354C-D090-475C-9EBA-15393AC83784",
"company_id": "9AFA89C0-6C7F-4F94-8B19-B81BB6A87555",
"address_type": "H",
"header_label": "Ecofilm",
"street": "Via Primo Maggio 10/12",
"zipcode": "24040",
"city": "Osio Sopra",
"region": "LOMBARDIA",
"country": "ITALIA",
"location_type": "IT",
"phone_number": "+39035501281",
"phone_number2nd": null,
"is_default": "0",
"active": null,
"note": null,
"updated_by": "c2t",
"insert_date": null,
"update_date": null,
"area": "BG"
}
],
"contact_company": [
{
"contact_id": "174A2AED-8B5A-4415-B64F-2B72C1E6C98B",
"company_id": "583193C2-B237-4EE3-8AAF-8C6E778BA53B",
"address_id": "1E5514E7-8DEA-45C5-826F-61457D67F4A7",
"assigned_to": null,
"is_main": null,
"job_function": null,
"area_type": {
"id": null,
"name": null,
"description": null,
"visualization_order": null
},
"rating": null,
"insert_date": "2024-03-05T16:09:16.000Z",
"update_date": "2024-03-05T17:29:01.000Z",
"contact": {
"id": "174A2AED-8B5A-4415-B64F-2B72C1E6C98B",
"name": "Corrado",
"lastname": "Dentis",
"title": "Dott.",
"email": "[email protected]",
"phone": null,
"phone_int": null,
"mobile": null,
"status": "Attivo",
"insert_date": "2024-03-05T16:09:15.000Z",
"update_date": "2024-03-05T17:29:00.000Z",
"updated_by": "c2t"
}
}
],
}
]GET Companies
Find all companies with ONLY basic INFO
GET /company/OUTPUT:
[
{
"id": "040E5B72-581F-4875-A227-375AB603039B",
"updated_by": "c2t",
"business_name": "GUALAPACK S.p.A. (ex Safta)",
"vat": "01252890064",
"cf": "01252890064",
"email": null,
"description": null,
"legal_form": "Società a responsabilità limitata (S.r.l.)",
"pec": null,
"unique_code": null,
"status": "Attiva",
"web_site": "www.gualapackgroup.com/it",
"code": "A.1.2.",
"assigned_to": null,
"note": null,
"insert_date": "2024-01-24T11:04:30.000Z",
"update_date": "2024-01-24T11:04:30.000Z",
"last_call_date": null,
"checksum": null
}
]Find One company by its id only BASIC info
GET /company/:id| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id| uniqueidentifer | Company ID |
[
{
"id": "040E5B72-581F-4875-A227-375AB603039B",
"updated_by": "c2t",
"business_name": "GUALAPACK S.p.A. (ex Safta)",
"vat": "01252890064",
"cf": "01252890064",
"email": null,
"description": null,
"legal_form": "Società a responsabilità limitata (S.r.l.)",
"pec": null,
"unique_code": null,
"status": "Attiva",
"web_site": "www.gualapackgroup.com/it",
"code": "A.1.2.",
"assigned_to": null,
"note": null,
"insert_date": "2024-01-24T11:04:30.000Z",
"update_date": "2024-01-24T11:04:30.000Z",
"last_call_date": null,
"checksum": null
}
]Get Companies by params
Find companies by optional request params filter
GET /company/findby?| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| business_name| String | Optional. Company Business name |
| vat| String | Optional. Company VAT |
| cf| String | Optional. Company Fiscal Code |
| email| String | Optional. Company email |
| info_contact| String | Optional. Contact email OR Contact lastname |
| area| String(2) | Optional. Address area |
| region| String | Optional. Address region |
| project_name| Array String | Optional. Project Name: es. Congiuntura Use '[]' for more project_name es. project_name[]=Riciclo&project_name[]='Congiuntura'|
| customer_name| Array String | Optional. Customer Name: es. ASSORIMAP. Use '[]' for more customer_name es. customer_name[]=ASSORIMAP&customer_name[]='IPPR'|
| status| Array String | Optional. Company status : es. 'Attiva', 'Liquidata', 'Cessata'. Use '[]' for more status es. status[]=attiva&status[]=liquidata&status[]=cessata |
| sales_start used with sales_end| Float | Optional. Used together for 'Fatturato'|
| staff_start used with staff_end| Float | Optional. Used for 'Addetti'|
RETURN VALUE:
[
{
"id": "040E5B72-581F-4875-A227-375AB603039B",
"updated_by": "c2t",
"business_name": "GUALAPACK S.p.A. (ex Safta)",
"vat": "01252890064",
"cf": "01252890064",
"email": null,
"description": null,
"legal_form": "Società a responsabilità limitata (S.r.l.)",
"pec": null,
"unique_code": null,
"status": "Attiva",
"web_site": "www.gualapackgroup.com/it",
"code": "A.1.2.",
"assigned_to": null,
"note": null,
"insert_date": "2024-01-24T11:04:30.000Z",
"update_date": "2024-01-24T11:04:30.000Z",
"last_call_date": null,
"checksum": null,
"addresses": [
{
"id": "421301C7-45DB-4153-B67F-1C3D6B8A3C5C",
"company_id": "040E5B72-581F-4875-A227-375AB603039B",
"address_type": "H",
"header_label": "GUALAPACK S.p.A. (ex Safta) Head_Office",
"street": "Via Arda, 11",
"zipcode": "29122",
"city": "Piacenza",
"region": "EMILIA ROMAGNA",
"country": "Italia",
"location_type": "IT",
"phone_number": "0523 5981",
"phone_number2nd": null,
"is_default": null,
"active": "2024-01-24T11:04:30.000Z",
"note": null,
"updated_by": "c2t",
"insert_date": "2024-01-24T11:04:30.000Z",
"update_date": "2024-01-24T11:04:30.000Z",
"area": "PC"
}
] ,
"contact_company": [
{
"contact_id": "174A2AED-8B5A-4415-B64F-2B72C1E6C98B",
"company_id": "583193C2-B237-4EE3-8AAF-8C6E778BA53B",
"address_id": "1E5514E7-8DEA-45C5-826F-61457D67F4A7",
"assigned_to": null,
"is_main": null,
"job_function": null,
"rating": null,
"insert_date": "2024-03-05T16:09:16.000Z",
"update_date": "2024-03-05T17:29:01.000Z",
"contact": {
"id": "174A2AED-8B5A-4415-B64F-2B72C1E6C98B",
"name": "Corrado",
"lastname": "Dentis",
"title": "Dott.",
"email": "[email protected]",
"phone": null,
"phone_int": null,
"mobile": null,
"status": "Attivo",
"insert_date": "2024-03-05T16:09:15.000Z",
"update_date": "2024-03-05T17:29:00.000Z",
"updated_by": "c2t"
}
}
],
"tags": [],
"project_customer": [
{
"project": {
"id": null,
"updated_by": null,
"name": "Congiuntura",
"description": "Cogiuntura Desc",
"note": null,
"insert_date": null,
"update_date": null,
"begin_date": null,
"end_date": null,
"project_timing_survey": []
},
"customer": {
"id": null,
"updated_by": null,
"name": "ASSORIMAP",
"description": null,
"note": null,
"insert_date": null,
"update_date": null,
"projects": []
},
"company_id": null,
"update_date": null,
"insert_date": null
}
],
"economics": [
{
"id": "E2091F6D-648A-4DE0-BDFC-6E3463331960",
"company_id": "040E5B72-581F-4875-A227-375AB603039B",
"year": 2023,
"amount": 1500000,
"amount_type": "Fatturato",
"insert_date": "2024-02-05T00:00:00.000Z",
"update_date": "2024-02-05T00:00:00.000Z",
"updated_by": "c2t"
},
{
"id": "4D46C1A4-98B9-4DDA-8B9F-E66355ED4AFC",
"company_id": "040E5B72-581F-4875-A227-375AB603039B",
"year": 2022,
"amount": 2,
"amount_type": "Addetti",
"insert_date": "2024-02-05T16:30:18.000Z",
"update_date": "2024-02-05T16:30:18.914Z",
"updated_by": "c2t"
}
]
}
]Get Companies by params
Return department
GET /company/findDepartmentBy?| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| cf| String | Optional. Company Fiscal Code|
RETURN VALUE:
[
{
"co_id": "8AE4DFBF-679D-4E57-A867-04244DC878A7",
"company_department": "PACKAGING"
},
{
"co_id": "BAFE5EA1-C0A8-43AE-A68C-0696B8449808",
"company_department": "Test divisione AGRI 1"
},
]
COMPANY STATUS
GET Company status
Find all company status
GET /company_status/[
{
"abbreviation": "Attiva",
"description": null
},
{
"abbreviation": "Cessata",
"description": null
},
{
"abbreviation": "In Liquidazione",
"description": null
}
]COMPANY TAG
GET Company status
Find by params with TAG object: tags array contains TAG
GET /company_tag/findbyINPUT params:
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| company_id| Uniqueidentifier | Optional. Company ID |
| tag_id| Uniqueidentifier | Optional. TAG ID |
| key_tag| Integer | Optional. Should be 1 or 0 : 1 if tag is a key tag for company maximum three (TODO: add check on service) |
[
{
"company_id": "B248839E-151A-47C0-9087-6F35FA547AF9",
"key_tag": true,
"insert_date": "2023-12-18T12:52:23.700Z",
"update_date": "2024-02-05T18:43:10.000Z",
"updated_by": "c2t",
"tags": [
{
"id": "932515C1-5DEE-4403-838E-376C079B92E7",
"name": "LDPE",
"insert_date": "2023-09-25T17:31:35.313Z",
"update_date": "2023-09-25T17:31:35.313Z",
"dimension": {
"id": "1E89726C-C577-4CFD-9C0D-2DF39082440E",
"name": "Polimero",
"insert_date": "2023-09-25T11:21:23.643Z",
"update_date": "2023-09-25T11:21:23.643Z",
"updated_by": null,
"visualization_order": null,
"parent_id": null,
"children": []
},
"property_value": []
}
]
}
]POST MERGE ALL
Merge company tag - ADD new tag company if is not present otherwise update key_tag
GET /company_tag/merge-allINPUT OBJECT for merge:
[
{
"company_id": "B248839E-151A-47C0-9087-6F35FA547AF9",
"tag_id": "932515C1-5DEE-4403-838E-376C079B92E7",
"key_tag": "1",
"insert_date": null,
"update_date": null,
"updated_by": "c2t"
}
]COMPANY LINK
POST Company Link MERGE ALL
SAVE or UPDATE array Company links using MERGE query on SQLServer based on @id
POST /company_link/merge-allINPUT:
[
{
"id":"8CACA3A8-F20D-46A8-9D7F-32533A8EF040",
"company_id": "C34230F1-E90A-4160-82F2-B2EC86DA1590",
"parent_id": "ABBA2693-52BF-482F-BA39-DD47EACFF1FA",
"link_type": {
"id": "B1A5A999-9539-4E1A-A98C-F6CE7942F60B",
"code": "CON",
"name": "Consociata",
"description": null
},
"group_name": "test group NAME",
"note": "note test",
"share": 25,
"insert_date": "2024-03-25T17:26:13",
"update_date": "2024-03-25T17:26:13",
"updated_by": "EO"
}
]
POST Company Link UPDATE BY PARENT_ID
UPDATE Company Link by parent_id
POST /company_link/update-by-parentidINPUT:
[
{
"id":"8CACA3A8-F20D-46A8-9D7F-32533A8EF040",
"company_id": "C34230F1-E90A-4160-82F2-B2EC86DA1590",
"parent_id": "ABBA2693-52BF-482F-BA39-DD47EACFF1FA",
"link_type": {
"id": "B1A5A999-9539-4E1A-A98C-F6CE7942F60B",
"code": "CON",
"name": "Consociata",
"description": null
},
"group_name": "test group NAME",
"note": "note test",
"share": 25,
"insert_date": "2024-03-25T17:26:13",
"update_date": "2024-03-25T17:26:13",
"updated_by": "EO"
}
]
GET Company Link FIND BY
Get company link (consociata/controllata/capogruppo) by parameters
GET /company_link/findby?INPUT params:
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| company_id| Uniqueidentifier | Optional. Company ID |
| parent_id| Uniqueidentifier | Optional. Parent ID form company table |
| group_name| String(100) | Optional. Group name |
| code| String(3) | Optional. Code for capogruppo, consociata, controllata: CTR, GRP, CON |
| name| String(100) | Optional. Fullname for link capogruppo, consociata, controllata |
[
{
"id": "8CACA3A8-F20D-46A8-9D7F-32533A8EF040",
"company_id": "C34230F1-E90A-4160-82F2-B2EC86DA1590",
"parent_id": "ABBA2693-52BF-482F-BA39-DD47EACFF1FA",
"link_type": {
"id": "B1A5A999-9539-4E1A-A98C-F6CE7942F60B",
"code": "CON",
"name": "Consociata",
"description": null
},
"group_name": "test group NAME",
"note": "note test",
"share": 25,
"insert_date": "2024-03-25T17:26:13.657Z",
"update_date": "2024-03-25T18:40:29.000Z",
"updated_by": "EO"
}
]GET Company Link - RETURN LIST NOT GRP
Get company link (consociata/controllata)
GET /company_link/findnotcode?INPUT params:
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| code| String(3) | Optional. LINK CODE: CRT (controllata), CON (consociata), GRP (gruppo) |
CONTACT
Get Contacts
Find all contacts
GET /contact/[
{
"id": "BAABA7A9-054D-43EF-904D-1277511A1FA7",
"name": "Laura",
"lastname": "Giacopino",
"title": "Ing.",
"email": "[email protected]",
"phone": null,
"mobile": null,
"status": "Attivo",
"insert_date": "2024-01-08T17:53:21.000Z",
"update_date": "2024-01-10T14:20:24.099Z",
"updated_by": "c2t",
"contact_company": {
"contact_id": null,
"company_id": null,
"address_id": null,
"area_type": {
"id": null,
"name": null,
"description": null,
"visualization_order": null
},
"assigned_to" :"CC",
"is_main": null,
"job_function": "Test MERGE using company",
"rating": 2,
"insert_date": null,
"update_date": null
}
},
{
"id": "F86E4425-36AD-4E7A-B0D1-1C8ADC00F62A",
"name": "Augusto ",
"lastname": "Balloni",
"title": "Ing.",
"email": "[email protected]",
"phone": null,
"mobile": null,
"status": "Attivo",
"insert_date": "2024-01-08T17:53:18.000Z",
"update_date": "2024-01-10T14:20:21.054Z",
"updated_by": "c2t",
"contact_company": {
"contact_id": null,
"company_id": null,
"address_id": null,
"assigned_to" :"CC",
"is_main": null,
"area_type": {
"id": null,
"name": null,
"description": null,
"visualization_order": null
},
"job_function": "Test MERGE using company",
"rating": 2,
"insert_date": null,
"update_date": null
}
}
]Find One contact by its id
GET /contact/:idGet Contacts by params
Find contacts by optional request params filter
GET /contact/findby?| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| name| String | Optional. Contact firstame |
| lastname| String | Optional. Contact lastname |
| email| String | Optional. Contact email (unique IDX) |
| status| String | Optional. Contact status : es. 'Attivo', 'In pensione', 'Licenziato' (TBD definire gli stati per i contatti). Use '[]' for more status es.status[]=attiva&status[]=licenziatoa&status[]=inpensione |
POST Contact MERGE ALL
Merge contact
POST /contact/merge-all[
{
"name": "Loredana",
"lastname": "Facciolà",
"title": "Dott.ssa",
"email": "[email protected]",
"phone": "1234",
"mobile": null,
"status": "attivo",
"insert_date": null,
"update_date": null,
"updated_by": "c2t"
},
{
"name": "Giuseppe",
"lastname": "Milazzo",
"title": "Dott.ssa",
"email": "[email protected]",
"phone": "1234",
"mobile": null,
"status": "attivo",
"insert_date": null,
"update_date": null,
"updated_by": "c2t"
}
]CONTACT_COMPANY
GET CONTACT_COMPANY BY ID
FIND BY ID contact_company
GET /contact_company/:contact_id/:company_idPATH PARAMS:
| :-------- | :------- | :-------------------------------- |
| company_id| Uniqueidentifier | Optional. Company ID |
| contact_id| Uniqueidentifier | Optional. Contact ID |
[
{
"contact_id": "D86FA775-4C69-4C14-A72B-6885F3292DD6",
"company_id": "B3264821-EA29-41FB-89CE-167B94452C5C",
"address_id": null,
"assigned_to": "c2t",
"is_main": null,
"job_function": "test",
"area_type": {
"id": null,
"name": null,
"description": null,
"visualization_order": null
},
"rating": 5,
"insert_date": "2024-03-11T00:00:00.000Z",
"update_date": "2024-03-11T00:00:00.000Z",
"contact": {
"id": "D86FA775-4C69-4C14-A72B-6885F3292DD6",
"name": "Loredana",
"lastname": "Facciolà",
"title": "Dott.ssa",
"email": "[email protected]",
"phone": "123",
"phone_int": "123",
"mobile": "123",
"status": "Attivo",
"insert_date": "2024-03-11T00:00:00.000Z",
"update_date": "2024-03-11T00:00:00.000Z",
"updated_by": "c2t"
}
}
]GET CONTACT_COMPANY BY parameters
FIND BY parameters
GET /contact_company/findby?PATH PARAMS:
| :-------- | :------- | :-------------------------------- |
| company_id| Uniqueidentifier | Optional. Company ID |
| contact_id| Uniqueidentifier | Optional. Contact ID |
| address_id| Uniqueidentifier | Optional. Address ID |
| is_main| Bit | Optional. is contact main? 0/1 |
| job_function[]| Array | Optional. String Arrya of contacts job_functions |
POST CONTACT_COMPANY MERGE-ALL
POST /contact_company/merge-all[
{
"contact_id": "49EA9587-948C-442D-A149-56B939FB5AEF",
"company_id": "69F8C4BC-6D8E-4EC2-B6BB-808BA9132375",
"address_id":"C02BA3D7-86CE-413C-990B-0F2A3A5E29FB",
"area_type": {
"id": null,
"name": null,
"description": null,
"visualization_order": null
},
"job_function": "Test per virgolette",
"is_main":1,
"rating":5,
"insert_date": null,
"update_date": null,
"contact" :
{
"id": "49EA9587-948C-442D-A149-56B939FB5AEF",
"name": "Giancarlo ",
"lastname": "Boffi",
"title": "Sig.",
"email": "[email protected]",
"phone": "12345",
"phone_int": null,
"mobile": null,
"status": "Attivo",
"insert_date": "2024-01-23T20:44:17.000Z",
"update_date": "2024-02-07T10:32:29.000Z",
"updated_by": "c2t"
}
}
]DELETE CONTACT_COMPANY REMOVE
Delete return JSON with company_id and contact_id if contact has no more COMPANIES DELETE CONTACT too
DELETE /contact_company/remove?
PARAMS:
| :-------- | :------- | :-------------------------------- |
| company_id| Uniqueidentifier | Optional. Company ID |
| contact_id| Uniqueidentifier | Optional. Contact ID |
CUSTOMER
Get Customers
Find all customers
GET /customer/Get Customers with Projects
Find all Customers with their projects committed
GET /project/findAllWithProjects| Return value | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id| String | Customer Id |
| updated_by| String | Customer updated_by |
| name| String | Customer name |
| description| String | Brief description Customer |
| note| String | Customer note |
| insert_date| Date | Customer insert date |
| update_date| Date | Customer update date |
| projects| List | List of projects: [{ "id", "updated_by", "name", "description", "note", "insert_date", "update_date"}] |
DIMENSION
Get ALL Dimensions and first level children
Find all dimensions with its children (first level only)
GET /dimension/[
{
"id": "1E89726C-C577-4CFD-9C0D-2DF39082440E",
"name": "Polimero",
"insert_date": "2023-09-25T11:21:23.643Z",
"update_date": "2023-09-25T11:21:23.643Z",
"updated_by": null,
"visualization_order": 1,
"parent_id": null,
"children": []
},
{
"id": "B1B878FF-8A43-4692-888D-97D1A099F3DF",
"name": "Lavorazione",
"insert_date": "2023-09-25T16:35:41.803Z",
"update_date": "2023-09-25T16:35:41.803Z",
"updated_by": null,
"visualization_order": 2,
"parent_id": "30CDA509-7094-4687-9A0E-93D406F57C2E",
"children": [
{
"id": "442FA7CF-4128-42C8-A076-74B1CC3C7FC8",
"name": "Tecnologia",
"insert_date": null,
"update_date": null,
"updated_by": null,
"visualization_order": 3,
"parent_id": "B1B878FF-8A43-4692-888D-97D1A099F3DF",
"children": [],
"update_by": null
},
{
"id": "0DAD5331-01C3-48EE-BCD4-AAA64DEB0DB9",
"name": "Manufatti",
"insert_date": null,
"update_date": null,
"updated_by": null,
"visualization_order": 6,
"parent_id": "B1B878FF-8A43-4692-888D-97D1A099F3DF",
"children": [],
"update_by": null
},
{
"id": "2F87775A-FB69-45A9-AE47-CC4BBBFAD7A5",
"name": "Altre attività",
"insert_date": null,
"update_date": null,
"updated_by": null,
"visualization_order": 8,
"parent_id": "B1B878FF-8A43-4692-888D-97D1A099F3DF",
"children": [],
"update_by": null
}
]
}
]Get Dimension by ID
Find Dimension by ID with its children (first level only)
GET /dimension/:id[
{
"id": "B1B878FF-8A43-4692-888D-97D1A099F3DF",
"name": "Lavorazione",
"insert_date": "2023-09-25T16:35:41.803Z",
"update_date": "2023-09-25T16:35:41.803Z",
"updated_by": null,
"visualization_order": 2,
"parent_id": "30CDA509-7094-4687-9A0E-93D406F57C2E",
"children": [
{
"id": "442FA7CF-4128-42C8-A076-74B1CC3C7FC8",
"name": "Tecnologia",
"insert_date": null,
"update_date": null,
"updated_by": null,
"visualization_order": 3,
"parent_id": "B1B878FF-8A43-4692-888D-97D1A099F3DF",
"children": [],
"update_by": null
}
]
}
]Get Dimension FIND BY
Find DIMENSION by name, parentd_id
GET /dimension/findby| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| name| String | Optional. Dimension name ex. 'Lavorazione' or Polimero (U_IDX) You can't insert twice same name|
| parent_id| Uniqueidentifier | Optional. Parent id |
[
{
"id": "442FA7CF-4128-42C8-A076-74B1CC3C7FC8",
"name": "Tecnologia",
"insert_date": "2023-09-25T11:23:32.000Z",
"update_date": "2023-09-25T11:23:32.000Z",
"updated_by": null,
"visualization_order": 3,
"parent_id": "B1B878FF-8A43-4692-888D-97D1A099F3DF",
"children": []
}
]POST Dimension MERGE ALL
MERGE all dimensions: if id is null will be inserted otherwise update all information
GET /dimension/merge-all[
{
"id": null,
"name": "Lavorazione test per INSERT 2",
"parent_id": "30CDA509-7094-4687-9A0E-93D406F57C2E",
"insert_date": null,
"update_date": null,
"updated_by": null,
"visualization_order": 100
}
]ECONOMICS
Get ALL Economics
Find all economics
GET /economics/[
{
"id": "0D292617-57E7-4099-AFE3-F0545FFB0560",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": 2021,
"amount": 2,
"amount_type": {
"id": "6A48E42F-6EE2-4A92-9731-4D4ECD1233F2",
"name": "Addetti",
"description": "Numero di dipendenti all'interno dell'azienda"
},
"insert_date": "2024-02-05T16:34:23.000Z",
"update_date": "2024-02-05T16:34:23.116Z",
"updated_by": "c2t"
},
{
"id": "4D46C1A4-98B9-4DDA-8B9F-E66355ED4AFC",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": 2022,
"amount": 2,
"amount_type": {
"id": "6A48E42F-6EE2-4A92-9731-4D4ECD1233F2",
"name": "Addetti",
"description": "Numero di dipendenti all'interno dell'azienda"
},
"insert_date": "2024-02-05T16:30:18.000Z",
"update_date": "2024-02-05T16:30:18.914Z",
"updated_by": "c2t"
},
{
"id": "E2091F6D-648A-4DE0-BDFC-6E3463331960",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": 2023,
"amount": 1500000,
"amount_type": {
"id": "E0C9F950-1853-4F55-B3FF-16315C463B8A",
"name": "Fatturato",
"description": "Totale vendita per anno"
},
"insert_date": "2024-02-05T00:00:00.000Z",
"update_date": "2024-02-05T00:00:00.000Z",
"updated_by": "c2t"
}
]Get Economics by ID
Find Economics by ID
GET /economics/:id{
"id": "DFC2F550-9013-4BDD-88AD-FF20986D4711",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": 2023,
"amount": 250,
"amount_type": {
"id": "6A48E42F-6EE2-4A92-9731-4D4ECD1233F2",
"name": "Addetti",
"description": "Numero di dipendenti all'interno dell'azienda"
},
"insert_date": "2024-02-05T00:00:00.000Z",
"update_date": "2024-02-05T16:29:58.747Z",
"updated_by": "c2t"
}Get Economics FIND BY
Find ECONOMICS by company_id, year[], amount_start, amount_end (BETWEEN) GROUP BY per YEAR
GET /economics/findby| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| company_id| Uniqueidentifier | Optional. Company ID|
| year| String | Optional. Economics years : ex. '2023'. Use '[]' for years year[]=2022&year[]=2023 |
| amount_start| Float | Optional Should be used with amount_end for BETWEEN|
| amount_end| Float | Optional Should be used with amount_start for BETWEEN|
| amount_type_name| String | Optional Based on Language 'Addetti' or 'Staff', 'Fatturato' or 'Sales'|
{
"2021": [
{
"id": "0D292617-57E7-4099-AFE3-F0545FFB0560",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": 2021,
"amount": 2,
"amount_type": {
"id": "6A48E42F-6EE2-4A92-9731-4D4ECD1233F2",
"name": "Addetti",
"description": "Numero di dipendenti all'interno dell'azienda"
},
"insert_date": "2024-02-05T16:34:23.000Z",
"update_date": "2024-02-05T16:34:23.116Z",
"updated_by": "c2t"
}
],
"2022": [
{
"id": "4D46C1A4-98B9-4DDA-8B9F-E66355ED4AFC",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": 2022,
"amount": 2,
"amount_type": {
"id": "6A48E42F-6EE2-4A92-9731-4D4ECD1233F2",
"name": "Addetti",
"description": "Numero di dipendenti all'interno dell'azienda"
},
"insert_date": "2024-02-05T16:30:18.000Z",
"update_date": "2024-02-05T16:30:18.914Z",
"updated_by": "c2t"
}
]
}Get Economics FIND BY STAFF AND SALES
Find ECONOMICS by company_id, sales_start - sales_end (BETWEEN), staff_start - staff_end (BETWEEN) GROUP BY per YEAR
GET /economics/findby-staff-and-sales| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| company_id| Uniqueidentifier | Optional. Company ID|
| sales_start used with sales_end | Float | Optional Should be used with sales_end for BETWEEN|
| staff_start used with staff_end | Float | Optional Should be used with staff_end for BETWEEN|
| staff_name | String | Optional Depends on Language 'Addetti' or 'Staff'|
| sales_name | String | Optional Depends on Language 'Fatturato' or 'Sales'|
{
"2021": [
{
"id": "0D292617-57E7-4099-AFE3-F0545FFB0560",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": 2021,
"amount": 2,
"amount_type": {
"id": "6A48E42F-6EE2-4A92-9731-4D4ECD1233F2",
"name": "Addetti",
"description": "Numero di dipendenti all'interno dell'azienda"
},
"insert_date": "2024-02-05T16:34:23.000Z",
"update_date": "2024-02-05T16:34:23.116Z",
"updated_by": "c2t"
}
],
"2022": [
{
"id": "4D46C1A4-98B9-4DDA-8B9F-E66355ED4AFC",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": 2022,
"amount": 2,
"amount_type": {
"id": "6A48E42F-6EE2-4A92-9731-4D4ECD1233F2",
"name": "Addetti",
"description": "Numero di dipendenti all'interno dell'azienda"
},
"insert_date": "2024-02-05T16:30:18.000Z",
"update_date": "2024-02-05T16:30:18.914Z",
"updated_by": "c2t"
}
]
}POST Economics MERGE ALL
MERGE all economics: only amount should be updated, if you need changed remove and merge again
GET /economics/merge-all[
{
"id": "DFC2F550-9013-4BDD-88AD-FF20986D4711",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"year": "2021",
"amount": 2,
"amount_type": "Addetti",
"insert_date": null,
"update_date": null,
"updated_by": "c2t"
}
]INTERVIEW
Get Interviews
Find all interviews
GET /interview/Get Interviews by OperatorId
Find all interviews assigned to operator by id code of Operator
GET /interview/operator/:operatorId| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| operatorId| String(2) | Required. Operator ID: indentifier operator code such as EO or CC |
Get Interview by Interview Id
Find One interview by its id
GET /interview/:id| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id| uniqueidentifer | Optional. Interview ID |
Get Interview by params
Find interviews by optional request params filter
GET /interview/findby?| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| operatorId| String(2) | Optional. Operator ID: indentifier operator code such as EO or CC |
| customer_name| String | Optional. Customer Name: es. IPPR, ASSORIMAP |
| business_name| String | Optional. Company interviewed: es. FLO S.p.A. + ISAP PACKAGING |
| code| String | Optional. Code: es. Congiuntura Code as F.1.1 |
| project_name| String | Optional. Project Name: es. Congiuntura |
| begin_date| String | Optional. Begin Date using only with endDate (for between query) : es. '2023-11-17' |
| end_date| String | Optional. End Date using only with beginDate (for between query) : es. '2023-11-17' |
| status| String | Optional. Interview status : es. 'completata'. Use '[]' for more status es.status[]=completato&status[]=rifiutato&status[]=ready |
| Return value | Type | Description |
| :-------- | :------- | :-------------------------------- |
| begin_date| String | Interview begin date |
| end_date| String | Interview end date |
| update_date| String | Last update date |
| project_name| String | Project Name: es. Congiuntura |
| year| String | Year of project |
| customer_name| String | Customer Name: es. IPPR, ASSORIMAP |
| status| String | Optional. Interview status : es. 'completata'. Use '[]' for more status es.status[]=completato&status[]=rifiutato&status[]=ready |
| business_name| String | Optional. Company interviewed: es. FLO S.p.A. + ISAP PACKAGING |
| code| String | Optional. Code for Project Survey : es. F.1.1 per Congiuntura |
| contacts_number| String | Optional. Number of contacts for interview |
Get Interview Count Status
Find interviews by optional request params filter
GET /interview/countStatus/:operatorId| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| operatorId| String(2) | Operator ID: indentifier operator code such as EO or CC |
| Return value | Type | Description |
| :-------- | :------- | :-------------------------------- |
| completed | Integer | Number of completed interviews or zero per operator |
| todo | Integer | Number of to do interviews or zero per operator |
| total | Integer | Number of interviews or zero per operator (all status) |
INTERVIEW STATUS
Get Interviews Status
Find all interviews status
GET /insterviewstatus/LEGAL FORM
GET Legal Forms
Find all legal form
GET /legal_form/[
{
"id": "D6EB0EA3-95F9-4D16-B2C1-F24663857398",
"name": "Società per azioni (S.p.A.)",
"description": null,
"visualization_order": 1
},
{
"id": "2F08684C-5AA4-471A-98BD-4F75B5E07105",
"name": "Ditta Individuale",
"description": null,
"visualization_order": 2
},
{
"id": "8BADDD91-71B1-435E-9E90-4F894440899B",
"name": "Società in nome collettivo (S.n.c.)",
"description": null,
"visualization_order": 3
}
]LINK TYPE
Capogruppo, Controllata, Consociata
GET Link Type FIND ALL
Get company link_type (consociata/controllata/capogruppo)
GET /link_type/[
{
"id": "7C604B71-9FD2-4B14-B768-F46473666D4F",
"code": "GRP",
"name": "Capogruppo",
"description": null
},
{
"id": "B1A5A999-9539-4E1A-A98C-F6CE7942F60B",
"code": "CON",
"name": "Consociata",
"description": null
},
{
"id": "10539B56-4CB6-410C-936E-3108B0D9CD5D",
"code": "CTR",
"name": "Controllata",
"description": null
}
]GET Legal Forms by params
Find all legal form by params
GET /legal_form/findby?| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| name| String | Optional. Name: legal form name (es. S.p.A or S.r.l.) |
GET ALL Machines
Find all machine
GET /machine/ [
{
"id": "C97B47F9-57CD-417E-81EF-C5822CE11728",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"name": "M1.1",
"description": "Macchina M1 per estrusione TEST per merge",
"insert_date": "2024-02-05T00:00:00.000Z",
"update_date": "2024-02-05T17:21:01.310Z",
"updated_by": "c2t"
},
{
"id": "0F72CE5E-1825-4C89-8849-533F6779A2C7",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"name": "M1.12",
"description": "Macchina M1 per estrusione TEST per merge",
"insert_date": "2024-02-05T17:28:57.000Z",
"update_date": "2024-02-05T17:28:57.916Z",
"updated_by": "c2t"
}
]GET Machine by ID
Find all machine by Machine ID
GET /machine/:id INPUT params:
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id| Uniqueidentifier | Machine ID |
[
{
"id": "C97B47F9-57CD-417E-81EF-C5822CE11728",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"name": "M1.1",
"description": "Macchina M1 per estrusione TEST per merge",
"insert_date": "2024-02-05T00:00:00.000Z",
"update_date": "2024-02-05T17:21:01.310Z",
"updated_by": "c2t"
}
]GET Machines by PARAMS
Find all machine by name, company_id, description
GET /machine/findby INPUT params:
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| name| String | Optional. Machine Name or its part |
| description| String | Optional. Machine Description or its part: ex. Estrusione |
| company_id| Uniqueidentifier | Optional. Company ID |
[
{
"id": "C97B47F9-57CD-417E-81EF-C5822CE11728",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"name": "M1.1",
"description": "Macchina M1 per estrusione TEST per merge",
"insert_date": "2024-02-05T00:00:00.000Z",
"update_date": "2024-02-05T17:21:01.310Z",
"updated_by": "c2t"
}
]POST Machines MERGE ALL
POST /machine/merge-all INPUT array to send - BODY:
[
{
"name": "M1.12",
"description": "Macchina M1 per estrusione TEST per merge",
"company_id": "58A184EB-61C7-4E79-B075-034F774BBB95",
"insert_date": null,
"update_date": null,
"updated_by": "c2t"
}
]OPERATOR
GET ALL Operators
Find all operator
GET /operator/[
{
"code": "MDO",
"name": "Massimo",
"lastname": "Dotti"
},
{
"code": "PA",
"name": "Paolo",
"lastname": "Arcelli"
}
]PROJECT
Get Projects
Find all projects
GET /project/Get Projects with Customers
Find all projects with Customers
GET /project/findAllWithCustomers| Return value | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id| String | Project Id |
| updated_by| String | Project updated_by |
| name| String | Project name |
| description| String | Brief description Project |
| note| String | Project note |
| insert_date| Date | Project insert date |
| update_date| Date | Project update date |
| Customers| List | List of customers: actually is in comment should be added |
PROJECT CUSTOMER COMPANY
GET FIND BY
GET /project_customer_company/findby| Return value | Type | Description |
| :-------- | :------- | :-------------------------------- |
| company_id| UniqueIdentifier (String) | Optional. Company ID |
[
{
"project": {
"id": "D221FE11-AC86-4CCF-B401-4E484F0A20EB",
"updated_by": "EO",
"name": "Congiuntura",
"description": "Cogiuntura Desc",
"note": null,
"insert_date": "2023-11-09T18:02:31.437Z",
"update_date": "2023-11-09T18:02:31.437Z",
"begin_date": "2023-11-09T18:02:31.437Z",
"end_date": "2023-11-09T18:02:31.437Z",
"project_timing_survey": []
},
"customer": {
"id": "F9406400-8402-4660-9794-B4C505B6C9F1",
"updated_by": "c2t",
"name": "ASSORIMAP",
"description": null,
"note": null,
"insert_date": null,
"update_date": null,
"projects": []
},
"company_id": "B3264821-EA29-41FB-89CE-167B94452C5C",
"update_date": "2024-04-09T00:00:00.000Z",
"insert_date": "2024-04-09T00:00:00.000Z",
"assigned_to": "c2t"
}
]GET FIND BY ID
GET /project_customer_company/:project_id/:customer_id/:company_id| Return value | Type | Description |
| :-------- | :------- | :-------------------------------- |
| project_id| UniqueIdentifier (String) | Optional. Project ID |
| customer_id| UniqueIdentifier (String) | Optional. Customer ID |
| company_id| UniqueIdentifier (String) | Optional. Company ID |
[
{
"project": {
"id": "D221FE11-AC86-4CCF-B401-4E484F0A20EB",
"updated_by": "EO",
"name": "Congiuntura",
"description": "Cogiuntura Desc",
"note": null,
"insert_date": "2023-11-09T18:02:31.437Z",
"update_date": "2023-11-09T18:02:31.437Z",
"begin_date": "2023-11-09T18:02:31.437Z",
"end_date": "2023-11-09T18:02:31.437Z",
"project_timing_survey": []
},
"customer": {
"id": "F9406400-8402-4660-9794-B4C505B6C9F1",
"updated_by": "c2t",
"name": "ASSORIMAP",
"description": null,
"note": null,
"insert_date": null,
"update_date": null,
"projects": []
},
"company_id": "B3264821-EA29-41FB-89CE-167B94452C5C",
"update_date": "2024-04-09T00:00:00.000Z",
"insert_date": "2024-04-09T00:00:00.000Z",
"assigned_to": "c2t"
}
]POST MERGE ALL
Pay attention using keys values
GET /project_customer_company/merge-all[
{
"project": {
"id": "C76EA3D4-4F88-4A4F-8851-93C8C9B8B8EE",
"updated_by": "EO",
"name": "Congiuntura",
"description": "Cogiuntura Desc",
"note": null,
"insert_date": "2023-11-09T18:02:31.437Z",
"update_date": "2023-11-09T18:02:31.437Z",
"begin_date": "2023-11-09T18:02:31.437Z",
"end_date": "2023-11-09T18:02:31.437Z",
"project_timing_survey": []
},
"customer": {
"id": "79026A30-3096-4A65-96A6-3DA0CC97C41B",
"updated_by": "c2t",
"name": "ASSORIMAP",
"description": null,
"note": null,
"insert_date": null,
"update_date": null,
"projects": []
},
"company_id": "6F724C95-1AFC-41FF-A783-000EF0E4265F",
"update_date": "2024-04-09T00:00:00.000Z",
"insert_date": "2024-04-09T00:00:00.000Z",
"assigned_to": "c2t"
}
]QUESTION
Put Question
Put one o more questions into DB
PUT /project/save-all {
"updated_by":"c2t",
"answertype":"6D610748-D752-4FE6-AF27-8021F7F315C5",
"question":"Question text TEST api",
"insert_date":"2023-12-28",
"update_date":"2023-12-20",
"section":"3FD0FF06-40B1-4D34-A8F9-B410E6D2724D"
}| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id | newID() | Question identifier default on DB, NOT put in insert |
| answertype | String | Answertype ID - UniqueIndentifier |
| question | String(200) | Question text |
| insert_date | Date | Question insert date automatically calculated if not defined |
| update_date | Date | Question update date automatically calculated if not defined |
| section | String | Answertype ID - UniqueIndentifier |
GET ALL Questions
Get all questions: find all
GET /question/RETURN OBJECT Question group by ID with section and answertype object
{
"756687E9-62F9-4138-ACA0-85A590973744": {
"id": "756687E9-62F9-4138-ACA0-85A590973744",
"question": "Produzione di granulo / scaglie / macinati",
"insert_date": null,
"update_date": null,
"updated_by": null,
"section": null,
"answertype": null,
"measure": [
{
"id": "0EE7CCDE-E5DB-4B84-A0EA-2CABBE6907AA",
"name": "ton"
},
{
"id": "7CD18159-605F-4002-A953-5653E2310682",
"name": "%"
}
],
"section_id": {
"id": "3FD0FF06-40B1-4D34-A8F9-B410E6D2724D",
"name": "ALTRE NOTIZIE",
"insert_date": "2023-10-30T17:04:02.560Z",
"update_date": "2023-10-30T17:04:02.560Z",
"updated_by": "c2t"
},
"answertype_id": {
"id": "6D610748-D752-4FE6-AF27-8021F7F315C5",
"type": "Valore alfanumerico"
},
"tag": [
{
"id": "4986F87F-0CB6-459A-8B84-068A06EDAE66",
"name": "Capsule caffè",
"insert_date": "2023-11-22T12:11:31.217Z",
"update_date": "2023-11-22T12:11:31.217Z",
"dimension": {
"id": "0DAD5331-01C3-48EE-BCD4-AAA64DEB0DB9",
"name": "Manufatti",
"insert_date": "2023-09-25T11:21:42.420Z",
"update_date": "2023-09-25T11:21:42.420Z",
"updated_by": null,
"parent_id": null
},
"property_value": []
},
{
"id": "4BD22645-8582-4664-B4D6-12E5C4A729C3",
"name": "Vaschette per gastronomia",
"insert_date": "2023-11-22T12:11:31.217Z",
"update_date": "2023-11-22T12:11:31.217Z",
"dimension": {
"id": "0DAD5331-01C3-48EE-BCD4-AAA64DEB0DB9",
"name": "Manufatti",
"insert_date": "2023-09-25T11:21:42.420Z",
"update_date": "2023-09-25T11:21:42.420Z",
"updated_by": null,
"parent_id": null
},
"property_value": []
}
]
}
}GET Question by ID
Get question by ID (PK): find by id
GET /question/:idRETURN OBJECT Question group by ID with section and answertype object as FIND ALL Object
GET Question by section_id, answertype_id, question (like)
Get question by section_id, answertype_id, question (like)
GET /question/findby?section_id=''&answertype_id=''&question=''| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| section_id| String | Section ID: uniqueindentifier for section |
| answertype_id| String | AnswerType ID: uniqueindentifier for answer type |
| question| String | Question like text |
RETURN OBJECT Question group by ID with section and answertype object as FIND ALL Object
TAG
Get Tag
Find all tag
GET /tag/Get Tag by dimensionId
Find all tag by dimensionId
GET /tag/dimension/:dimensionId| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| dimensionId| String | Dimension ID: is UniqueIndentifier dimension (stand for Manufatti, Polimero, Lavorazione etc. ) |
[
{
"id": "66C52D38-308D-420E-B5B0-EE00B32B5208",
"name": "Biopolimeri",
"insert_date": "2023-11-09T15:15:15.393Z",
"update_date": "2023-11-09T15:15:15.393Z",
"dimension": {
"id": "1E89726C-C577-4CFD-9C0D-2DF39082440E",
"name": "Polimero",
"insert_date": "2023-09-25T11:21:23.643Z",
"update_date": "2023-09-25T11:21:23.643Z",
"updated_by": null,
"parent_id": null
},
"property_value": []
}
]| Return value | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id | String | Tag identifier |
| dimension | Object | Dimension Id (stand for Manufatti, Polimero, Lavorazione etc. ) |
| parent_id | String | Tag parent in the same table Tag UniqueIndentifier |
| name | String | Tag name: es. 'Capsule caffè', 'PP', 'Film per etichette', 'Compundazione' etc |
| insert_date | Date | Tag insert date |
| update_date | Date | Tag update date |
TAG DEPENDENCY
Get Tag Dependency FIND BY
Find Tag Dependency By
GET /tag_dependency/findby| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| id| UniqueIdentifier | Optional ID (PK) |
| tag_parent_id| UniqueIdentifier | Optional TAG Parent ID |
| dimension_name| String | Optional Dimension name: es. Polimero, Manufatti, etc|
| tag_name| String | Optional Tag name: es. EVA, Capsule caffè, Bolla|
| tag_id| UniqueIdentifier | Optional Tag ID|
{
"id": "3F74D9D3-FF7A-4028-BC7B-86A785D689F5",
"tag_parent_id": "3233F0B0-F5FF-4589-A013-2493648EDD1F",
"tag_id": "4BE8FD52-5040-45FC-AC84-9010DD25E242",
"insert_date": "2023-12-15T18:05:11.573Z",
"update_date": "2023-12-15T18:05:11.573Z",
"updated_by": "c2t",
"tags": [
{
"id": "4BE8FD52-5040-45FC-AC84-9010DD25E242",
"name": "Altro film",
"insert_date": "2023-12-15T16:56:03.167Z",
"update_date": "2023-12-15T16:56:03.167Z",
"dimension": {
"id": "0DAD5331-01C3-48EE-BCD4-AAA64DEB0DB9",
"name": "Manufatti",
"insert_date": "2023-09-25T11:21:42.420Z",
"update_date": "2023-09-25T11:21:42.420Z",
"updated_by": null,
"visualization_order": null,
"parent_id": "442FA7CF-4128-42C8-A076-74B1CC3C7FC8",
"children": []
},
"property_value": []
},
{
"id": "206DABFD-E21A-4561-999A-73389F53838A",
"name": "Non shopper",
"insert_date": "2023-12-15T16:55:41.970Z",
"update_date": "2023-12-15T16:55:41.970Z",
"dimension": {
"id": "0DAD5331-01C3-48EE-BCD4-AAA64DEB0DB9",
"name": "Manufatti",
"insert_date": "2023-09-25T11:21:42.420Z",
"update_date": "2023-09-25T11:21:42.420Z",
"updated_by": null,
"visualization_order": null,
"parent_id": "442FA7CF-4128-42C8-A076-74B1CC3C7FC8",
"children": []
},
"property_value": []
},
{
"id": "19C0158D-F491-4394-BB6A-1BAEB6F62CE5",
"name": "Sacchetti asporto merce",
"insert_date": "2023-12-15T16:55:16.443Z",
"update_date": "2023-12-15T16:55:16.443Z",
"dimension": {
"id": "0DAD5331-01C3-48EE-BCD4-AAA64DEB0DB9",
"name": "Manufatti",
"insert_date": "2023-09-25T11:21:42.420Z",
"update_date": "2023-09-25T11:21:42.420Z",
"updated_by": null,
"visualization_order": null,
"parent_id": "442FA7CF-4128-42C8-A076-74B1CC3C7FC8",
"children": []
},
"property_value": []
}
]
}Tech Stack
Server: NodeJS, Express
Installation
Clone Project
Clone fabbricaDigitale4.0 with git clone.
git clone https://gitlab.com/it.c2t/plastic/plastic-api.git
cd plastic-apiInstall Dependencies
Install project dependencies:
cd plastic-api
npm installContribuire
Se vuoi contribuire a questo progetto, segui questi passaggi:
- Fork questo repository
git clone https://gitlab.com/it.c2t/plastic/plastic-api.git - Crea il tuo branch
git checkout -b my-feature - Committa le tue modifiche
git commit -am 'FEAT: / BUG FIX: ' - Push alla tua branch
git push origin my-feature - Crea una Pull Request.
git pull
Authors: IT-C2T
