Commit 7155a112 authored by philippepary's avatar philippepary
Browse files

Added Currency model

parent f1f7f086
......@@ -4,8 +4,10 @@ require(__DIR__ . "/../vendor/autoload.php");
$files = [
"../src/http/public/index.php",
"../src/lib/Model/Category.php",
"../src/lib/Model/Currency.php",
"../src/lib/Model/Product.php",
"../src/lib/Model/Tax.php",
"../src/lib/Model/User.php",
];
$dirs = [
"../src/http/routes/",
......
......@@ -2,8 +2,8 @@
// Pastèque API
//
// Copyright (C)
// 2012 Scil (http://scil.coop)
// 2017 Karamel, Association Pastèque (karamel@creativekara.fr, https://pasteque.org)
// 2012 Scil (http://scil.coop)
// 2017 Karamel, Association Pastèque (karamel@creativekara.fr, https://pasteque.org)
//
// This file is part of Pastèque.
//
......@@ -27,9 +27,20 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
/**
* Class Currency
* @package Pasteque
* @SWG\Definition(type="object")
* @Entity
* @Table(name="currencies")
* @rest\model Currency
* @rest\description Currency definition model
* @rest\property Int id ID of the currency
* @rest\property String reference Code of the currency, user-friendly ID
* @rest\property String label Full name of the currency
* @rest\property String symbol Symbol of the currency (€, $, ¥, £ …)
* @rest\property String decimalSeparator Symbol of the decimal separator (. or ,)
* @rest\property String thousandsSeparator Symbol of the thousands separator (' or , or nothing)
* @rest\property String format Format of the currency
* @rest\property Double rate Conversion rate toward the main currency (must be set to 1 if it is the main currency)
* @rest\property Boolean main Is this the main currency ?
* @rest\property Boolean visible Is this currency available in cash registers ?
*/
class Currency extends DoctrineModel
{
......@@ -44,7 +55,6 @@ class Currency extends DoctrineModel
/**
* Id of the Currency
* @var int
* @SWG\Property(format="int32")
* @Id @Column(type="integer")
* @GeneratedValue
*/
......@@ -55,7 +65,6 @@ class Currency extends DoctrineModel
* Code of the currency, user-friendly ID.
* It is automatically set from label if not explicitely set.
* @var string
* @SWG\Property()
* @Column(type="string", unique=true)
*/
protected $reference;
......@@ -65,7 +74,6 @@ class Currency extends DoctrineModel
/**
* Name of the currency
* @var string
* @SWG\Property()
* @Column(type="string")
*/
protected $label;
......@@ -80,7 +88,6 @@ class Currency extends DoctrineModel
/**
* Symbol of the currency
* @var string
* @SWG\Property()
* @Column(type="string")
*/
protected $symbol = '¤';
......@@ -90,7 +97,6 @@ class Currency extends DoctrineModel
/**
* Decimal separator of the currency
* @var string
* @SWG\Property()
* @Column(type="string")
*/
protected $decimalSeparator = '';
......@@ -100,7 +106,6 @@ class Currency extends DoctrineModel
/**
* Thousands separator of the currency
* @var string
* @SWG\Property()
* @Column(type="string")
*/
protected $thousandsSeparator = '';
......@@ -110,7 +115,6 @@ class Currency extends DoctrineModel
/**
* Format of the currency
* @var string
* @SWG\Property()
* @Column(type="string")
*/
protected $format = '#.##0.00¤';
......@@ -120,7 +124,6 @@ class Currency extends DoctrineModel
/**
* Rate of the currency, regarding the main currency
* @var float
* @SWG\Property(format="double")
* @Column(type="float")
*/
protected $rate = 1.0;
......@@ -130,7 +133,6 @@ class Currency extends DoctrineModel
/**
* Is the currency the reference one?
* @var bool
* @SWG\Property()
* @Column(type="boolean")
*/
protected $main = false;
......@@ -142,7 +144,6 @@ class Currency extends DoctrineModel
/**
* Is the currency currently useable (visible on cash registers) ?
* @var bool
* @SWG\Property()
* @Column(type="boolean")
*/
protected $visible = true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment