package at.procon.eventhub.tachographfilesession.service;

final class VehicleUnitXmlSamples {

    private VehicleUnitXmlSamples() {
    }

    static String vehicleUnitXml() {
        return """
                <VehicleUnit>
                  <Overview>
                    <vehicleIdentificationNumber>VINVU123456789012</vehicleIdentificationNumber>
                    <vehicleRegistrationIdentification>
                      <vehicleRegistrationNation>12</vehicleRegistrationNation>
                      <vehicleRegistrationNumber><vehicleRegNumber>W-1000V</vehicleRegNumber></vehicleRegistrationNumber>
                    </vehicleRegistrationIdentification>
                    <vuDownloadablePeriod>
                      <minDownloadableTime>2026-04-01T00:00:00Z</minDownloadableTime>
                      <maxDownloadableTime>2026-04-02T10:00:00Z</maxDownloadableTime>
                    </vuDownloadablePeriod>
                  </Overview>
                  <Activities>
                    <vuCardIWData>
                      <vuCardIWRecords>
                        <cardHolderName>
                          <holderSurname><name>Muster</name></holderSurname>
                          <holderFirstNames><name>Max</name></holderFirstNames>
                        </cardHolderName>
                        <fullCardNumber>
                          <cardType>DRIVER_CARD</cardType>
                          <cardIssuingMemberState>12</cardIssuingMemberState>
                          <cardNumber>
                            <driverIdentification>123456789012</driverIdentification>
                            <cardReplacementIndex>0</cardReplacementIndex>
                            <cardRenewalIndex>0</cardRenewalIndex>
                          </cardNumber>
                          <generation>2</generation>
                        </fullCardNumber>
                        <cardExpiryDate>2031-04-01T00:00:00Z</cardExpiryDate>
                        <cardInsertionTime>2026-04-01T08:00:00Z</cardInsertionTime>
                        <vehicleOdometerValueAtInsertion>1000</vehicleOdometerValueAtInsertion>
                        <cardSlotNumber>DRIVER</cardSlotNumber>
                        <cardWithdrawalTime>2026-04-01T11:00:00Z</cardWithdrawalTime>
                        <vehicleOdometerValueAtWithdrawal>1100</vehicleOdometerValueAtWithdrawal>
                        <manualInputFlag>NO_ENTRY</manualInputFlag>
                      </vuCardIWRecords>
                      <vuCardIWRecords>
                        <cardHolderName>
                          <holderSurname><name>Test</name></holderSurname>
                          <holderFirstNames><name>Tina</name></holderFirstNames>
                        </cardHolderName>
                        <fullCardNumber>
                          <cardType>DRIVER_CARD</cardType>
                          <cardIssuingMemberState>12</cardIssuingMemberState>
                          <cardNumber>
                            <driverIdentification>999999999999</driverIdentification>
                            <cardReplacementIndex>1</cardReplacementIndex>
                            <cardRenewalIndex>1</cardRenewalIndex>
                          </cardNumber>
                          <generation>2</generation>
                        </fullCardNumber>
                        <cardInsertionTime>2026-04-02T07:30:00Z</cardInsertionTime>
                        <vehicleOdometerValueAtInsertion>1200</vehicleOdometerValueAtInsertion>
                        <cardSlotNumber>DRIVER</cardSlotNumber>
                        <manualInputFlag>MANUAL_ENTRIES</manualInputFlag>
                      </vuCardIWRecords>
                    </vuCardIWData>
                    <vuActivityDailyData>
                      <noOfActivityChanges>3</noOfActivityChanges>
                      <activityChangeInfos>
                        <slot>DRIVER</slot>
                        <drivingStatus>SINGLE</drivingStatus>
                        <cardStatus>INSERTED</cardStatus>
                        <activity>WORK</activity>
                        <timeOfChange>08:00:00Z</timeOfChange>
                      </activityChangeInfos>
                      <activityChangeInfos>
                        <slot>DRIVER</slot>
                        <drivingStatus>SINGLE</drivingStatus>
                        <cardStatus>INSERTED</cardStatus>
                        <activity>DRIVING</activity>
                        <timeOfChange>09:00:00Z</timeOfChange>
                      </activityChangeInfos>
                      <activityChangeInfos>
                        <slot>DRIVER</slot>
                        <drivingStatus>SINGLE</drivingStatus>
                        <cardStatus>INSERTED</cardStatus>
                        <activity>BREAK/REST</activity>
                        <timeOfChange>11:00:00Z</timeOfChange>
                      </activityChangeInfos>
                    </vuActivityDailyData>
                  </Activities>
                  <Activities>
                    <vuActivityDailyData>
                      <noOfActivityChanges>2</noOfActivityChanges>
                      <activityChangeInfos>
                        <slot>DRIVER</slot>
                        <drivingStatus>SINGLE</drivingStatus>
                        <cardStatus>INSERTED</cardStatus>
                        <activity>WORK</activity>
                        <timeOfChange>07:30:00Z</timeOfChange>
                      </activityChangeInfos>
                      <activityChangeInfos>
                        <slot>DRIVER</slot>
                        <drivingStatus>SINGLE</drivingStatus>
                        <cardStatus>INSERTED</cardStatus>
                        <activity>DRIVING</activity>
                        <timeOfChange>08:00:00Z</timeOfChange>
                      </activityChangeInfos>
                    </vuActivityDailyData>
                    <vuPlaceDailyWorkPeriodData>
                      <vuPlaceDailyWorkPeriodRecords>
                        <fullCardNumber>
                          <cardType>DRIVER_CARD</cardType>
                          <cardIssuingMemberState>12</cardIssuingMemberState>
                          <cardNumber>
                            <driverIdentification>123456789012</driverIdentification>
                            <cardReplacementIndex>0</cardReplacementIndex>
                            <cardRenewalIndex>0</cardRenewalIndex>
                          </cardNumber>
                          <generation>2</generation>
                        </fullCardNumber>
                        <placeRecord>
                          <entryTime>2026-04-01T08:00:00Z</entryTime>
                          <entryTypeDailyWorkPeriod>0</entryTypeDailyWorkPeriod>
                          <dailyWorkPeriodCountry>12</dailyWorkPeriodCountry>
                          <dailyWorkPeriodRegion>9</dailyWorkPeriodRegion>
                          <vehicleOdometerValue>1000</vehicleOdometerValue>
                          <entryGnssPlaceRecord>
                            <timeStamp>2026-04-01T08:00:00Z</timeStamp>
                            <gnssAccuracy>5</gnssAccuracy>
                            <geoCoordinates>
                              <latitude>48.2082</latitude>
                              <longitude>16.3738</longitude>
                            </geoCoordinates>
                            <authenticationStatus>AUTHENTICATED</authenticationStatus>
                          </entryGnssPlaceRecord>
                        </placeRecord>
                      </vuPlaceDailyWorkPeriodRecords>
                    </vuPlaceDailyWorkPeriodData>
                    <vuGnssADData>
                      <vuGnssADRecord>
                        <timeStamp>2026-04-02T08:00:00Z</timeStamp>
                        <cardNumberDriverSlot>
                          <cardType>DRIVER_CARD</cardType>
                          <cardIssuingMemberState>12</cardIssuingMemberState>
                          <cardNumber>
                            <driverIdentification>999999999999</driverIdentification>
                            <cardReplacementIndex>1</cardReplacementIndex>
                            <cardRenewalIndex>1</cardRenewalIndex>
                          </cardNumber>
                          <generation>2</generation>
                        </cardNumberDriverSlot>
                        <gnssPlaceRecord>
                          <timeStamp>2026-04-02T08:00:00Z</timeStamp>
                          <gnssAccuracy>4</gnssAccuracy>
                          <geoCoordinates>
                            <latitude>48012</latitude>
                            <longitude>16373</longitude>
                          </geoCoordinates>
                          <authenticationStatus>NOT_AUTHENTICATED</authenticationStatus>
                        </gnssPlaceRecord>
                        <vehicleOdometerValue>1210</vehicleOdometerValue>
                      </vuGnssADRecord>
                    </vuGnssADData>
                    <vuSpecificConditionData>
                      <specificConditionRecords>
                        <entryTime>2026-04-02T09:00:00Z</entryTime>
                        <specificConditionType>1</specificConditionType>
                      </specificConditionRecords>
                    </vuSpecificConditionData>
                    <vuBorderCrossingData>
                      <vuBorderCrossingRecord>
                        <cardNumberDriverSlot>
                          <cardType>DRIVER_CARD</cardType>
                          <cardIssuingMemberState>12</cardIssuingMemberState>
                          <cardNumber>
                            <driverIdentification>999999999999</driverIdentification>
                            <cardReplacementIndex>1</cardReplacementIndex>
                            <cardRenewalIndex>1</cardRenewalIndex>
                          </cardNumber>
                          <generation>2</generation>
                        </cardNumberDriverSlot>
                        <countryLeft>12</countryLeft>
                        <countryEntered>56</countryEntered>
                        <gnssPlaceAuthRecord>
                          <timeStamp>2026-04-02T08:30:00Z</timeStamp>
                          <geoCoordinates>
                            <latitude>48020</latitude>
                            <longitude>16380</longitude>
                          </geoCoordinates>
                          <authenticationStatus>AUTHENTICATED</authenticationStatus>
                        </gnssPlaceAuthRecord>
                        <vehicleOdometerValue>1220</vehicleOdometerValue>
                      </vuBorderCrossingRecord>
                    </vuBorderCrossingData>
                    <vuLoadUnloadData>
                      <vuLoadUnloadRecord>
                        <timeStamp>2026-04-02T08:45:00Z</timeStamp>
                        <operationType>1</operationType>
                        <cardNumberDriverSlot>
                          <cardType>DRIVER_CARD</cardType>
                          <cardIssuingMemberState>12</cardIssuingMemberState>
                          <cardNumber>
                            <driverIdentification>999999999999</driverIdentification>
                            <cardReplacementIndex>1</cardReplacementIndex>
                            <cardRenewalIndex>1</cardRenewalIndex>
                          </cardNumber>
                          <generation>2</generation>
                        </cardNumberDriverSlot>
                        <gnssPlaceAuthRecord>
                          <timeStamp>2026-04-02T08:45:00Z</timeStamp>
                          <geoCoordinates>
                            <latitude>48025</latitude>
                            <longitude>16385</longitude>
                          </geoCoordinates>
                          <authenticationStatus>AUTHENTICATED</authenticationStatus>
                        </gnssPlaceAuthRecord>
                        <vehicleOdometerValue>1225</vehicleOdometerValue>
                      </vuLoadUnloadRecord>
                    </vuLoadUnloadData>
                  </Activities>
                  <EventsFaults>
                    <vuOverSpeedingEventData>
                      <vuOverSpeedingEventRecords>
                        <eventType>1</eventType>
                        <eventRecordPurpose>1</eventRecordPurpose>
                        <eventBeginTime>2026-04-02T08:10:00Z</eventBeginTime>
                        <eventEndTime>2026-04-02T08:12:00Z</eventEndTime>
                        <maxSpeedValue>96</maxSpeedValue>
                        <averageSpeedValue>91</averageSpeedValue>
                        <cardNumberDriverSlotBegin>
                          <cardType>DRIVER_CARD</cardType>
                          <cardIssuingMemberState>12</cardIssuingMemberState>
                          <cardNumber>
                            <driverIdentification>999999999999</driverIdentification>
                            <cardReplacementIndex>1</cardReplacementIndex>
                            <cardRenewalIndex>1</cardRenewalIndex>
                          </cardNumber>
                          <generation>2</generation>
                        </cardNumberDriverSlotBegin>
                        <similarEventsNumber>1</similarEventsNumber>
                      </vuOverSpeedingEventRecords>
                    </vuOverSpeedingEventData>
                  </EventsFaults>
                </VehicleUnit>
                """;
    }

    static String vehicleUnitXmlWithLocalActivityTimes() {
        return vehicleUnitXml()
                .replace("<timeOfChange>08:00:00Z</timeOfChange>", "<timeOfChange>08:00:00</timeOfChange>")
                .replace("<timeOfChange>09:00:00Z</timeOfChange>", "<timeOfChange>09:00:00</timeOfChange>")
                .replace("<timeOfChange>11:00:00Z</timeOfChange>", "<timeOfChange>11:00:00</timeOfChange>")
                .replace("<timeOfChange>07:30:00Z</timeOfChange>", "<timeOfChange>07:30:00</timeOfChange>");
    }
}
