Closed dvx76 closed 2 days ago
Fixes #227
Tested with the previous raw response from one of the updated fixtures
>>> anonymize_maintenance(test) {'maintenanceReport': {'capturedAt': '2024-11-09T10:23:54Z', 'inspectionDueInDays': 489, 'inspectionDueInKm': 15500, 'mileageInKm': 77043, 'oilServiceDueInDays': 489, 'oilServiceDueInKm': 15500}, 'preferredServicePartner': {'name': 'Example Service Partner', 'brand': 'C', 'partnerNumber': '1111', 'id': 'DEU11111', 'contact': {'phone': '+49 1234 567890', 'url': 'https://example.com', 'email': 'user@example.com'}, 'address': {'city': 'Example City', 'street': 'Example Avenue', 'houseNumber': '15', 'zipCode': '54321', 'countryCode': 'DEU'}, 'location': {'latitude': 53.470636, 'longitude': 9.689872}, 'openingHours': [{'periodStart': 'MONDAY', 'periodEnd': 'FRIDAY', 'openingTimes': [{'from': '08:00:00', 'to': '17:00:00'}]}, {'periodStart': 'SATURDAY', 'periodEnd': 'SATURDAY', 'openingTimes': [{'from': '09:00:00', 'to': '13:00:00'}]}, {'periodStart': 'SUNDAY', 'periodEnd': 'SUNDAY', 'openingTimes': []}]}, 'predictiveMaintenance': {'setting': {'serviceActivated': True, 'email': 'user@example.com', 'phone': '+49 1234 567890'}}, 'customerService': {'activeBookings': [], 'bookingHistory': [{'creationDate': '2024-01-12T10:25:49Z', 'confirmationDate': '2024-01-12T10:30:23.431Z', 'closedDate': '2024-03-13T07:37:00Z', 'appointmentDate': '2024-03-13T07:37:00Z', 'contactedDate': '2024-01-15T08:22:35Z', 'updateDate': '2024-03-30T02:11:11.255Z', 'servicePartner': {'name': 'Example Service Partner', 'brand': 'C', 'partnerNumber': '1111', 'id': 'DEU11111', 'contact': {'phone': '+49 1234 567890', 'url': 'https://example.com', 'email': 'user@example.com'}, 'address': {'city': 'Example City', 'street': 'Example Avenue', 'houseNumber': '15', 'zipCode': '54321', 'countryCode': 'DEU'}, 'location': {'latitude': 53.470636, 'longitude': 9.689872}, 'openingHours': []}, 'bookingId': '4b437397-9f76-4bc9-8972-bb4af0fc9d31-1705055157793', 'mileageInKm': 58777, 'resolution': 'APPOINTMENT', 'type': 'AUTO', 'extras': [], 'addOns': {}, 'warnings': [{'iconName': '', 'messageId': 'A644', 'notificationId': 42564, 'text': '42564'}]}, {'creationDate': '2023-08-17T11:32:50Z', 'acceptedDate': '2023-08-17T12:32:07Z', 'confirmationDate': '2023-08-17T11:35:01.656Z', 'closedDate': '2023-08-18T05:58:02Z', 'updateDate': '2023-08-18T06:00:05.449Z', 'servicePartner': {'name': 'Example Service Partner', 'brand': 'C', 'partnerNumber': '1111', 'id': 'DEU11111', 'contact': {'phone': '+49 1234 567890', 'url': 'https://example.com', 'email': 'user@example.com'}, 'address': {'city': 'Example City', 'street': 'Example Avenue', 'houseNumber': '15', 'zipCode': '54321', 'countryCode': 'DEU'}, 'location': {'latitude': 53.470636, 'longitude': 9.689872}, 'openingHours': []}, 'bookingId': '426ff0a7-8f11-44f9-a235-ebe259c4b52c-1692271996343', 'mileageInKm': 49670, 'resolution': 'REJECTED', 'type': 'AUTO', 'extras': [], 'addOns': {}, 'warnings': [{'iconName': '', 'messageId': 'A224', 'notificationId': 41508, 'text': 'Please add maximum n.a. of oil. You can continue driving.'}]}]}}
@sanderob can you test if generating a fixture for your car with these changes correctly anonymizes everything?
Fixes #227
Tested with the previous raw response from one of the updated fixtures