diff --git a/test/data/ims_otrs_customers_extra.json b/test/data/ims_otrs_customers_extra.json new file mode 100644 index 0000000000000000000000000000000000000000..b8b5c94c52f83c1e315ed693958a94bc405a7b3e --- /dev/null +++ b/test/data/ims_otrs_customers_extra.json @@ -0,0 +1,1001 @@ +[ + { + "Id": 57284, + "ParentCustomerId": null, + "Name": "DUMMY 1", + "FullName": "DUMMY 1", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": null, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 0, + "PwInformDown": 0, + "PwInformAtRisk": 0, + "PwInformImPact": 0, + "PwInformNoImPact": 0, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": null, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2016-05-18T10:20:38", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57603, + "ParentCustomerId": null, + "Name": "DUMMY 2", + "FullName": "DUMMY 2", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [ + { + "Id": 706, + "MainTypeId": 5, + "CustomerId": 57603, + "RelateTypeId": 2, + "ContactId": 1081, + "Contact": { + "Id": 1081, + "IsGroup": 1, + "Name": "DUMMY 2 NOC", + "InFix": "", + "LastName": "-", + "Gender": "", + "Phone": "", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "BANOC@DUMMY2.COM", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-04T10:55:58", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T13:03:03", + "Errors": null, + "HasErrors": false + }, + { + "Id": 1771, + "MainTypeId": 5, + "CustomerId": 57603, + "RelateTypeId": 2, + "ContactId": 1082, + "Contact": { + "Id": 1082, + "IsGroup": 1, + "Name": "DUMMY 2 PEERING", + "InFix": "", + "LastName": "-", + "Gender": "", + "Phone": "", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "BBPEERING@DUMMY2.COM", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-04T10:56:07", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T18:05:14", + "Errors": null, + "HasErrors": false + } + ], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 1, + "Name": "COMMERCIAL PEER", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-01-31T13:35:07", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57604, + "ParentCustomerId": null, + "Name": "DUMMY 3", + "FullName": "DUMMY 3", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 1, + "Name": "COMMERCIAL PEER", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-01-31T13:35:07", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57605, + "ParentCustomerId": null, + "Name": "DUMMY 4", + "FullName": "DUMMY 4", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 1, + "Name": "COMMERCIAL PEER", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-02-24T12:08:46", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57606, + "ParentCustomerId": null, + "Name": "DUMMY 5", + "FullName": "DUMMY 5", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [ + { + "Id": 839, + "MainTypeId": 5, + "CustomerId": 57606, + "RelateTypeId": 2, + "ContactId": 1521, + "Contact": { + "Id": 1521, + "IsGroup": 1, + "Name": "DUMMY 5", + "InFix": "", + "LastName": "-", + "Gender": "", + "Phone": "E 1234 5678", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "ENOC@DUMMY5.NET", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-03T19:26:57", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T13:03:17", + "Errors": null, + "HasErrors": false + } + ], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 1, + "Name": "COMMERCIAL PEER", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-01-31T13:35:07", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57607, + "ParentCustomerId": null, + "Name": "DUMMY 6", + "FullName": "DUMMY 6", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [ + { + "Id": 844, + "MainTypeId": 5, + "CustomerId": 57607, + "RelateTypeId": 2, + "ContactId": 1528, + "Contact": { + "Id": 1528, + "IsGroup": 1, + "Name": "DUMMY 6", + "InFix": "", + "LastName": "-", + "Gender": "", + "Phone": "", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "FNOC@DUMMY6.COM", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-03T19:26:58", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T13:03:17", + "Errors": null, + "HasErrors": false + } + ], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 1, + "Name": "COMMERCIAL PEER", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-01-31T13:35:07", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57608, + "ParentCustomerId": null, + "Name": "DUMMY 7", + "FullName": "DUMMY 7", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [ + { + "Id": 872, + "MainTypeId": 5, + "CustomerId": 57608, + "RelateTypeId": 2, + "ContactId": 1598, + "Contact": { + "Id": 1598, + "IsGroup": 0, + "Name": "DUMMY 7", + "InFix": "", + "LastName": "NOC", + "Gender": "", + "Phone": "G 1234 5678", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "GNOC@DUMMY7.COM", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-03T19:27:00", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T13:03:20", + "Errors": null, + "HasErrors": false + } + ], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 1, + "Name": "COMMERCIAL PEER", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-01-31T13:35:07", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57609, + "ParentCustomerId": null, + "Name": "DUMMY 8", + "FullName": "DUMMY 8", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [ + { + "Id": 944, + "MainTypeId": 5, + "CustomerId": 57609, + "RelateTypeId": 2, + "ContactId": 1997, + "Contact": { + "Id": 1997, + "IsGroup": 1, + "Name": "H D_FIRST", + "InFix": "H D_INFIX", + "LastName": "H D_LAST", + "Gender": "H GENDER", + "Phone": "H 1234 5678", + "Mobile": "H 2345 6789", + "Fax": "H FAX NUMBER", + "Webpage": "H WEB", + "Mail": "HNOC@DUMMY8.COM", + "PlannedworkMail": "H PLANNED WORK MAIL", + "TroubleticketMail": "H TROUBLE TICKET MAIL", + "JobTitle": "H JOB TITLE", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "H LANG", + "PreFix": "H PREFIX", + "SmsQuery": "H SMS", + "ExtraInfo": "H EXTRA", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-03T19:27:14", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T13:03:28", + "Errors": null, + "HasErrors": false + } + ], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 3, + "Name": "EU NREN", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-01-31T13:35:07", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57610, + "ParentCustomerId": null, + "Name": "DUMMY 9", + "FullName": "DUMMY 9", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [ + { + "Id": 1274, + "MainTypeId": 5, + "CustomerId": 57610, + "RelateTypeId": 2, + "ContactId": 2069, + "Contact": { + "Id": 2069, + "IsGroup": 1, + "Name": "DUMMY 9", + "InFix": "", + "LastName": "-", + "Gender": "", + "Phone": "", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "IAF_NAME.L_NAME@DUMMY9.COM", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-03T19:27:17", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T13:04:02", + "Errors": null, + "HasErrors": false + }, + { + "Id": 1275, + "MainTypeId": 5, + "CustomerId": 57610, + "RelateTypeId": 2, + "ContactId": 2070, + "Contact": { + "Id": 2070, + "IsGroup": 1, + "Name": "DUMMY 9 NOC", + "InFix": "", + "LastName": "-", + "Gender": "", + "Phone": "", + "Mobile": "I 2345 6789", + "Fax": "", + "Webpage": "", + "Mail": "IBNOC@DUMMY9.COM", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-03T19:27:17", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T13:04:02", + "Errors": null, + "HasErrors": false + } + ], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 1, + "Name": "COMMERCIAL PEER", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-01-31T13:35:07", + "Errors": null, + "HasErrors": false + }, + { + "Id": 57611, + "ParentCustomerId": null, + "Name": "DUMMY 10", + "FullName": "DUMMY 10", + "Number": null, + "Address": "", + "PhoneNumber": "", + "FaxNumber": "", + "AccountManager": "", + "AccountEmail": "", + "Code": "", + "SlaId": null, + "ServiceCenter": 0, + "ServiceCenterName": "", + "Website": "", + "CustomerTypeId": 1, + "PwCodeBlue": 0, + "PwInformProtectionSwitch": 1, + "PwInformDown": 1, + "PwInformAtRisk": 1, + "PwInformImPact": 1, + "PwInformNoImPact": 1, + "PwExtraInfo": "", + "PwLanguage": "", + "CountryId": null, + "Sla": null, + "Sites": null, + "Nodes": null, + "Racks": null, + "Orders": null, + "PwInformedList": null, + "Circuits": null, + "OloCircuits": null, + "ChannelReservations": null, + "PortReservations": null, + "IpRanges": null, + "NumberManagementList": null, + "CustomerRelatedContacts": [ + { + "Id": 1154, + "MainTypeId": 5, + "CustomerId": 57611, + "RelateTypeId": 2, + "ContactId": 2408, + "Contact": { + "Id": 2408, + "IsGroup": 1, + "Name": "DUMMY 10", + "InFix": "", + "LastName": "-", + "Gender": "", + "Phone": "", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "JNOC@DUMMY10.TV", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": [], + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": null, + "QueueContacts": null, + "RowVersion": "2020-03-03T19:27:29", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T13:03:50", + "Errors": null, + "HasErrors": false + } + ], + "CustomerRelatedContracts": null, + "InNumbers": null, + "ManagementSystems": null, + "CustomerType": { + "Id": 1, + "Name": "COMMERCIAL PEER", + "Customers": [], + "RowVersion": "2020-01-31T13:26:02", + "Errors": null, + "HasErrors": false + }, + "ContractCustomerRelations": null, + "ParentCustomer": null, + "SubCustomers": null, + "EsimProfiles": null, + "Esims": null, + "Country": null, + "PwEmailSetups": null, + "TelephoneNumbers": null, + "TelephoneNumberRanges": null, + "RowVersion": "2020-01-31T13:35:07", + "Errors": null, + "HasErrors": false + } +] \ No newline at end of file diff --git a/test/data/ims_otrs_vendor_contact_extra.json b/test/data/ims_otrs_vendor_contact_extra.json new file mode 100644 index 0000000000000000000000000000000000000000..9d052833a6b198e76a1335768a65413b1367f68e --- /dev/null +++ b/test/data/ims_otrs_vendor_contact_extra.json @@ -0,0 +1,227 @@ +[ + { + "Id": 1288, + "MainTypeId": 1, + "VendorId": 2584, + "RelateTypeId": 2, + "ContactId": 1085, + "Vendor": { + "Id": 2584, + "Name": "DUMMY 10", + "TypeId": 1, + "SlaOnSiteId": null, + "SlaMainTimeToRepairId": null, + "SlaLink": "", + "SlaDescription": "", + "Description": "", + "SpareOwner": "", + "StockLocation": "", + "StockContact": "", + "InternetAddress": "", + "MasterAccount": "", + "EscalationDescription": "", + "Color": "", + "IssuerCodeEsim": null, + "MnoCode": "", + "EumId": "", + "EquipmentDefinitions": null, + "ManagementSystems": null, + "CardCodes": null, + "CardDefinitions": null, + "CableTypes": null, + "VendorRelatedContacts": [], + "VendorMaterialTypes": null, + "Contract": null, + "SlaOnSite": null, + "SlaMainTimeToRepair": null, + "Type": null, + "RowVersion": "2020-01-31T17:18:22", + "Errors": null, + "HasErrors": false + }, + "Contact": { + "Id": 1085, + "IsGroup": 0, + "Name": "K D_FIRST", + "InFix": "K D_INFIX", + "LastName": "K D_LAST", + "Gender": "K GENDER", + "Phone": "K PHONE", + "Mobile": "K MOBILE", + "Fax": "K FAX", + "Webpage": "K WEB", + "Mail": "K@DUMMY10.FR", + "PlannedworkMail": "K PLANNED MAIL", + "TroubleticketMail": "K TT MAIL", + "JobTitle": "K JOB", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "K LANG", + "PreFix": "K PREFIX", + "SmsQuery": "K SMS", + "ExtraInfo": "K EXTRA", + "CustomerRelatedContacts": null, + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": [], + "QueueContacts": null, + "RowVersion": "2020-03-03T19:26:42", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T16:33:09", + "Errors": null, + "HasErrors": false + }, + { + "Id": 1289, + "MainTypeId": 1, + "VendorId": 2584, + "RelateTypeId": 2, + "ContactId": 1092, + "Vendor": { + "Id": 2584, + "Name": "DUMMY 11", + "TypeId": 1, + "SlaOnSiteId": null, + "SlaMainTimeToRepairId": null, + "SlaLink": "", + "SlaDescription": "", + "Description": "", + "SpareOwner": "", + "StockLocation": "", + "StockContact": "", + "InternetAddress": "", + "MasterAccount": "", + "EscalationDescription": "", + "Color": "", + "IssuerCodeEsim": null, + "MnoCode": "", + "EumId": "", + "EquipmentDefinitions": null, + "ManagementSystems": null, + "CardCodes": null, + "CardDefinitions": null, + "CableTypes": null, + "VendorRelatedContacts": [], + "VendorMaterialTypes": null, + "Contract": null, + "SlaOnSite": null, + "SlaMainTimeToRepair": null, + "Type": null, + "RowVersion": "2020-01-31T17:18:22", + "Errors": null, + "HasErrors": false + }, + "Contact": { + "Id": 1092, + "IsGroup": 1, + "Name": "L DUMMY FIRST", + "InFix": "", + "LastName": "-", + "Gender": "", + "Phone": "", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "L_DUMMY@DUMM11.COM", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": null, + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": [], + "QueueContacts": null, + "RowVersion": "2020-03-03T19:26:43", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T16:33:09", + "Errors": null, + "HasErrors": false + }, + { + "Id": 1290, + "MainTypeId": 1, + "VendorId": 2584, + "RelateTypeId": 2, + "ContactId": 1093, + "Vendor": { + "Id": 2584, + "Name": "DUMMY 12", + "TypeId": 1, + "SlaOnSiteId": null, + "SlaMainTimeToRepairId": null, + "SlaLink": "", + "SlaDescription": "", + "Description": "", + "SpareOwner": "", + "StockLocation": "", + "StockContact": "", + "InternetAddress": "", + "MasterAccount": "", + "EscalationDescription": "", + "Color": "", + "IssuerCodeEsim": null, + "MnoCode": "", + "EumId": "", + "EquipmentDefinitions": null, + "ManagementSystems": null, + "CardCodes": null, + "CardDefinitions": null, + "CableTypes": null, + "VendorRelatedContacts": [], + "VendorMaterialTypes": null, + "Contract": null, + "SlaOnSite": null, + "SlaMainTimeToRepair": null, + "Type": null, + "RowVersion": "2020-01-31T17:18:22", + "Errors": null, + "HasErrors": false + }, + "Contact": { + "Id": 1093, + "IsGroup": 1, + "Name": "M FIRST", + "InFix": "", + "LastName": "M LAST", + "Gender": "", + "Phone": "M PHONE", + "Mobile": "", + "Fax": "", + "Webpage": "", + "Mail": "M@DUMMY12.DE", + "PlannedworkMail": "", + "TroubleticketMail": "", + "JobTitle": "", + "Priority": null, + "PlannedWorkMailType": null, + "Language": "", + "PreFix": "", + "SmsQuery": "", + "ExtraInfo": "", + "CustomerRelatedContacts": null, + "ContactRelatedContacts": null, + "MainContactRelatedContacts": null, + "SiteRelatedContacts": null, + "VendorRelatedContacts": [], + "QueueContacts": null, + "RowVersion": "2020-03-03T19:26:43", + "Errors": null, + "HasErrors": false + }, + "RowVersion": "2020-03-04T16:33:09", + "Errors": null, + "HasErrors": false + } +] \ No newline at end of file diff --git a/test/test_ims_data.py b/test/test_ims_data.py index 4a951ec054df8df4397189dc4c2de7f826e75cc8..5457110e7a4a4e12316eada9f6c7c7fdb73bb2a2 100644 --- a/test/test_ims_data.py +++ b/test/test_ims_data.py @@ -2,8 +2,9 @@ import json import inventory_provider from inventory_provider.db.ims import InventoryStatus -from inventory_provider.db.ims_data import lookup_pop_info, lookup_lg_routers, \ - otrs_get_customer_company_rows +from inventory_provider.db.ims_data import lookup_pop_info, \ + lookup_lg_routers, otrs_get_customer_company_rows, \ + otrs_get_customer_users_rows def test_lookup_lg_routers(mocker): @@ -111,3 +112,62 @@ def test_otrs_get_customer_company_rows(mocker): names.append(row[1]) assert ids == ['DUMMY1', 'DUMMY2', 'DUMMY3', 'DUMMY4', 'DUMMY5'] assert names == ['DUMMY 1', 'DUMMY 2', 'DUMMY 3', 'DUMMY 4', 'DUMMY 5'] + + +def test_otrs_get_customer_users(mocker): + ims = mocker.patch('inventory_provider.db.ims.IMS') + resp_data = {} + with open('test/data/ims_otrs_customers_extra.json') as data: + resp_data['Customer'] = json.load(data) + with open('test/data/ims_otrs_vendor_contact_extra.json') as data: + resp_data['VendorRelatedContact'] = json.load(data) + + def se(*args, **kargs): + return resp_data.get(args[0], []) + + mocked_get_all_entities = ims.return_value.get_all_entities + mocked_get_all_entities.side_effect = se + + mocked_get_all_entities = ims.return_value.get_all_entities + ds = inventory_provider.db.ims.IMS( + 'dummy_base', 'dummy_username', 'dummy_password') + + customer_users = list(otrs_get_customer_users_rows(ds)) + mocked_get_all_entities.assert_any_call('Customer', [32768, 262144]) + mocked_get_all_entities.assert_any_call('VendorRelatedContact', [8, 16]) + + assert customer_users[0] == [ + 'email', + 'username', + 'customer_id', + 'customer_id_2', + 'title', + 'firstname', + 'lastname', + 'phone', + 'fax', + 'mobile', + 'street', + 'zip', + 'city', + 'country', + 'comments' + ] + + assert len(customer_users) == 13 + assert customer_users[1] == [ + 'BANOC@DUMMY2.COM', 'BANOC@DUMMY2.COM', 'DUMMY2', '', '', + 'DUMMY 2 NOC', '-', '', '', '', + '', '', '', '', 'Organisation imported as a user' + ] + assert customer_users[6] == [ + 'HNOC@DUMMY8.COM', 'HNOC@DUMMY8.COM', 'DUMMY8', 'OTRS-GEANT-NREN', '', + 'H D_FIRST', 'H D_INFIX H D_LAST', '', '', '', + '', '', '', '', 'Organisation imported as a user' + ] + assert customer_users[10] == [ + 'K@DUMMY10.FR', 'K@DUMMY10.FR', 'DUMMY10', '', '', + 'K D_FIRST', 'K D_INFIX K D_LAST', '', '', '', + '', '', '', '', '' + ] + assert customer_users[12][6] == 'M LAST'