diff --git a/src/main/kotlin/org/calypsonet/keyple/demo/common/constant/RemoteServiceId.kt b/src/main/kotlin/org/calypsonet/keyple/demo/common/constant/RemoteServiceId.kt index 49e6660..49af0e1 100644 --- a/src/main/kotlin/org/calypsonet/keyple/demo/common/constant/RemoteServiceId.kt +++ b/src/main/kotlin/org/calypsonet/keyple/demo/common/constant/RemoteServiceId.kt @@ -12,9 +12,18 @@ package org.calypsonet.keyple.demo.common.constant enum class RemoteServiceId { + + // Suitable for C# Keyple-less clients SELECT_APP_AND_READ_CONTRACTS, SELECT_APP_AND_INCREASE_CONTRACT_COUNTER, + + // Suitable for Android Keyple clients READ_CARD_AND_ANALYZE_CONTRACTS, READ_CARD_AND_WRITE_CONTRACT, - PERSONALIZE_CARD + PERSONALIZE_CARD, + + // Suitable for Kotlin Multiplaform Keyple-less client + SELECT_APP_AND_ANALYZE_CONTRACTS, + SELECT_APP_AND_LOAD_CONTRACT, + SELECT_APP_AND_PERSONALIZE_CARD } diff --git a/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndAnalyzeContractsInputDto.kt b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndAnalyzeContractsInputDto.kt new file mode 100644 index 0000000..77f032f --- /dev/null +++ b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndAnalyzeContractsInputDto.kt @@ -0,0 +1,14 @@ +/* ************************************************************************************** + * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ + * + * See the NOTICE file(s) distributed with this work for additional information + * regarding copyright ownership. + * + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + ************************************************************************************** */ +package org.calypsonet.keyple.demo.common.dto + +data class SelectAppAndAnalyzeContractsInputDto(var pluginType: String) diff --git a/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndAnalyzeContractsOutputDto.kt b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndAnalyzeContractsOutputDto.kt new file mode 100644 index 0000000..b6b8bec --- /dev/null +++ b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndAnalyzeContractsOutputDto.kt @@ -0,0 +1,32 @@ +/* ************************************************************************************** + * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ + * + * See the NOTICE file(s) distributed with this work for additional information + * regarding copyright ownership. + * + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + ************************************************************************************** */ +package org.calypsonet.keyple.demo.common.dto + +/** + * - validContracts: List of contracts present in the card. Each contract is tied to a counter by + * its index. + * - statusCode: 0 (if successful), 1 (server is not ready), 2 (card rejected). + * - message: Status message. + */ +data class SelectAppAndAnalyzeContractsOutputDto( + var applicationSerialNumber: String, + var validContracts: List, + var statusCode: Int, + var message: String +) { + /** + * - title: Contract name. + * - description: Contract details. + * - isValid: Indicates if the contract is currently usable. + */ + data class ContractInfo(var title: String, var description: String, var isValid: Boolean) +} diff --git a/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndLoadContractInputDto.kt b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndLoadContractInputDto.kt new file mode 100644 index 0000000..6e5a37f --- /dev/null +++ b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndLoadContractInputDto.kt @@ -0,0 +1,21 @@ +/* ************************************************************************************** + * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ + * + * See the NOTICE file(s) distributed with this work for additional information + * regarding copyright ownership. + * + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + ************************************************************************************** */ +package org.calypsonet.keyple.demo.common.dto + +import org.calypsonet.keyple.demo.common.model.type.PriorityCode + +data class SelectAppAndLoadContractInputDto( + var applicationSerialNumber: String, + var contractTariff: PriorityCode, + var ticketToLoad: Int, + var pluginType: String +) diff --git a/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndLoadContractOutputDto.kt b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndLoadContractOutputDto.kt new file mode 100644 index 0000000..0d54615 --- /dev/null +++ b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndLoadContractOutputDto.kt @@ -0,0 +1,19 @@ +/* ************************************************************************************** + * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ + * + * See the NOTICE file(s) distributed with this work for additional information + * regarding copyright ownership. + * + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + ************************************************************************************** */ +package org.calypsonet.keyple.demo.common.dto + +/** + * - statusCode: 0 (successful), 1 (server is not ready), 2 (card rejected), 3 (please present the + * same card). + * - message: error message + */ +data class SelectAppAndLoadContractOutputDto(var statusCode: Int, var message: String) diff --git a/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndPersonalizeCardInputDto.kt b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndPersonalizeCardInputDto.kt new file mode 100644 index 0000000..cb1c435 --- /dev/null +++ b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndPersonalizeCardInputDto.kt @@ -0,0 +1,14 @@ +/* ************************************************************************************** + * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ + * + * See the NOTICE file(s) distributed with this work for additional information + * regarding copyright ownership. + * + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + ************************************************************************************** */ +package org.calypsonet.keyple.demo.common.dto + +class SelectAppAndPersonalizeCardInputDto(var pluginType: String) diff --git a/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndPersonalizeCardOutputDto.kt b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndPersonalizeCardOutputDto.kt new file mode 100644 index 0000000..7b0b3c2 --- /dev/null +++ b/src/main/kotlin/org/calypsonet/keyple/demo/common/dto/SelectAppAndPersonalizeCardOutputDto.kt @@ -0,0 +1,18 @@ +/* ************************************************************************************** + * Copyright (c) 2024 Calypso Networks Association https://calypsonet.org/ + * + * See the NOTICE file(s) distributed with this work for additional information + * regarding copyright ownership. + * + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + ************************************************************************************** */ +package org.calypsonet.keyple.demo.common.dto + +/** + * - statusCode: 0 (if successful), 1 (if error). + * - message: error message + */ +data class SelectAppAndPersonalizeCardOutputDto(var statusCode: Int, var message: String) diff --git a/src/test/kotlin/org/calypsonet/keyple/demo/common/parser/ContractStructureParserTest.kt b/src/test/kotlin/org/calypsonet/keyple/demo/common/parser/ContractInfoStructureParserTest.kt similarity index 98% rename from src/test/kotlin/org/calypsonet/keyple/demo/common/parser/ContractStructureParserTest.kt rename to src/test/kotlin/org/calypsonet/keyple/demo/common/parser/ContractInfoStructureParserTest.kt index 6e7300a..ad5468c 100644 --- a/src/test/kotlin/org/calypsonet/keyple/demo/common/parser/ContractStructureParserTest.kt +++ b/src/test/kotlin/org/calypsonet/keyple/demo/common/parser/ContractInfoStructureParserTest.kt @@ -20,7 +20,7 @@ import org.calypsonet.keyple.demo.common.model.type.PriorityCode import org.calypsonet.keyple.demo.common.model.type.VersionNumber import org.junit.jupiter.api.Test -class ContractStructureParserTest { +class ContractInfoStructureParserTest { private val contractStructureParser = ContractStructureParser()