package at.procon.eventhub.tachographfilesession.service;

final class DriverCardXmlSamples {

    private DriverCardXmlSamples() {
    }

    static String validDriverCardXml() {
        return """
                <DriverCard>
                  <Identification>
                    <cardIdentification>
                      <cardIssuingMemberState>12</cardIssuingMemberState>
                      <cardNumber>
                        <driverIdentification>123456789012</driverIdentification>
                        <cardReplacementIndex>0</cardReplacementIndex>
                        <cardRenewalIndex>0</cardRenewalIndex>
                      </cardNumber>
                      <cardIssuingAuthorityName>
                        <name>Authority</name>
                      </cardIssuingAuthorityName>
                      <cardIssueDate>2026-04-01T00:00:00Z</cardIssueDate>
                      <cardValidityBegin>2026-04-01T00:00:00Z</cardValidityBegin>
                      <cardExpiryDate>2031-04-01T00:00:00Z</cardExpiryDate>
                    </cardIdentification>
                    <driverCardHolderIdentification>
                      <cardHolderName>
                        <holderSurname><name>Muster</name></holderSurname>
                        <holderFirstNames><name>Max</name></holderFirstNames>
                      </cardHolderName>
                      <cardHolderBirthDate>
                        <year>1985</year>
                        <month>06</month>
                        <day>15</day>
                      </cardHolderBirthDate>
                      <cardHolderPreferredLanguage>de</cardHolderPreferredLanguage>
                    </driverCardHolderIdentification>
                    <signature></signature>
                  </Identification>
                  <DrivingLicenseInfo>
                    <cardDrivingLicenseInformation>
                      <drivingLicenceIssuingAuthority><name>Vienna</name></drivingLicenceIssuingAuthority>
                      <drivingLicenceIssuingNation>12</drivingLicenceIssuingNation>
                      <drivingLicenceNumber>B1234567</drivingLicenceNumber>
                    </cardDrivingLicenseInformation>
                    <signature></signature>
                  </DrivingLicenseInfo>
                  <VehiclesUsed>
                    <cardVehiclesUsed>
                      <vehiclePointerNewestRecord>1</vehiclePointerNewestRecord>
                      <cardVehicleRecords>
                        <vehicleOdometerBegin>1000</vehicleOdometerBegin>
                        <vehicleOdometerEnd>1100</vehicleOdometerEnd>
                        <vehicleFirstUse>2026-04-01T08:00:00Z</vehicleFirstUse>
                        <vehicleLastUse>2026-04-01T11:59:59Z</vehicleLastUse>
                        <vehicleRegistration>
                          <vehicleRegistrationNation>12</vehicleRegistrationNation>
                          <vehicleRegistrationNumber><vehicleRegNumber>W-12345A</vehicleRegNumber></vehicleRegistrationNumber>
                        </vehicleRegistration>
                        <vuDataBlockCounter>0001</vuDataBlockCounter>
                        <vehicleIdentificationNumber>VIN12345678901234</vehicleIdentificationNumber>
                      </cardVehicleRecords>
                      <cardVehicleRecords>
                        <vehicleOdometerBegin>1101</vehicleOdometerBegin>
                        <vehicleOdometerEnd>1200</vehicleOdometerEnd>
                        <vehicleFirstUse>2026-04-01T12:00:00Z</vehicleFirstUse>
                        <vehicleLastUse>2026-04-01T18:00:00Z</vehicleLastUse>
                        <vehicleRegistration>
                          <vehicleRegistrationNation>12</vehicleRegistrationNation>
                          <vehicleRegistrationNumber><vehicleRegNumber>W-54321B</vehicleRegNumber></vehicleRegistrationNumber>
                        </vehicleRegistration>
                        <vuDataBlockCounter>0002</vuDataBlockCounter>
                        <vehicleIdentificationNumber>VIN99999999999999</vehicleIdentificationNumber>
                      </cardVehicleRecords>
                    </cardVehiclesUsed>
                    <signature></signature>
                  </VehiclesUsed>
                  <DriverActivityData>
                    <cardDriverActivity>
                      <activityPointerOldestDayRecord>0</activityPointerOldestDayRecord>
                      <activityPointerNewestRecord>1</activityPointerNewestRecord>
                      <cardActivityDailyRecord>
                        <activityRecordDate>2026-04-01T00:00:00Z</activityRecordDate>
                        <activityDailyPresenceCounter>0001</activityDailyPresenceCounter>
                        <activityDayDistance>200</activityDayDistance>
                        <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>12:30:00Z</timeOfChange>
                        </activityChangeInfos>
                      </cardActivityDailyRecord>
                    </cardDriverActivity>
                    <signature></signature>
                  </DriverActivityData>
                </DriverCard>
                """;
    }

    static String validDriverCardXmlWithLocalActivityTimes() {
        return validDriverCardXml()
                .replace("<timeOfChange>08:00:00Z</timeOfChange>", "<timeOfChange>08:00:00</timeOfChange>")
                .replace("<timeOfChange>09:00:00Z</timeOfChange>", "<timeOfChange>09:00:00</timeOfChange>")
                .replace("<timeOfChange>12:30:00Z</timeOfChange>", "<timeOfChange>12:30:00</timeOfChange>");
    }

    static String driverCardXmlWithOpenVehicleUseRecord() {
        return validDriverCardXml()
                .replace("<vehicleLastUse>2026-04-01T18:00:00Z</vehicleLastUse>\n", "");
    }
}
