Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-cristea committed Oct 16, 2024
1 parent 1953df0 commit 74d7f6b
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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<ContractInfo>,
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)
}
Original file line number Diff line number Diff line change
@@ -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
)
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 74d7f6b

Please sign in to comment.