'''*****************************************************************************
***  This file is part of Pecunia.                                           ***
***                                                                          ***
***  Copyright (C) 2017, 2018, 2019, 2020, 2021, 2023                        ***
***  John Schneiderman <Licencing _AT_ Schneiderman _DOT_ me>                ***
***                                                                          ***
***  This program is free software: you can redistribute it and/or modify it ***
***  under the terms of the GNU Lesser General Public License as published   ***
***  by the Free Software Foundation, either version 3 of the License, or    ***
***  (at your option) any later version.                                     ***
***                                                                          ***
***  This program is distributed in the hope that it will be useful, but     ***
***  WITHOUT ANY WARRANTY; without even the implied warranty of              ***
***  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                    ***
***  See the GNU Lesser General Public License for more details.             ***
***                                                                          ***
***  You should have received a copy of the GNU Lesser General Public License***
***  along with this program. If not, see <http://www.gnu.org/licenses/>.    ***
*****************************************************************************'''


class Currency(object):
	"""
	Represents all the information regarding a currency in the ISO-4217 format.
	"""

	def __init__(self, country: str, name: str, code: str, number: int, minor: int,
			  symbol: str):
		"""
		Full initialisation constructor.

		:param country: The name of the country that uses the currency.
		:param name: The name of the currency itself.
		:param code: The code for the currency in the ISO 4217 format.
		:param number: The number for the currency given by ISO 4217.
		:param minor: The number of minor units in the currency.
		"""
		self.__country = country
		self.__name = name
		self.__code = code
		self.__number = number
		self.__minor = minor
		self.__symbol = symbol

	@property
	def country(self) -> str:
		"""
		The name of the country that uses this currency.
		"""
		return self.__country

	@property
	def name(self) -> str:
		"""
		The name of the currency itself.
		"""
		return self.__name

	@property
	def code(self) -> str:
		"""
		The ISO 4217 code for the currency.
		"""
		return self.__code

	@property
	def number(self) -> int:
		"""
		The ISO 4217 number for the currency.
		"""
		return self.__number

	@property
	def minor(self) -> int:
		"""
		The number of minor digits in the currency.
		"""
		return self.__minor

	@property
	def symbol(self) -> str:
		"""
		The symbol of the currency.
		"""
		return self.__symbol

	def __str__(self):
		return "Country ({}), Name ({}), Code ({}), Number ({}), Minor ({})".format(
			self.__country,
			self.__name,
			self.__code,
			self.__number,
			self.__minor
		)
