Skip to content

Commit

Permalink
obsolete currencies are included in api responses and highlighted in …
Browse files Browse the repository at this point in the history
…the website
  • Loading branch information
dgg committed Mar 15, 2014
1 parent 6eb7ea4 commit 913408c
Show file tree
Hide file tree
Showing 46 changed files with 59 additions and 542 deletions.
15 changes: 11 additions & 4 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Currency Resources
Resources related to ISO 4217 currencies.
--
Provides information about current supported currencies.
Provides information about supported currencies. Obsolete currencies are returned.
OPTIONS /currencies
> Accept: application/json
> Api_Key: your API key
Expand Down Expand Up @@ -79,7 +79,7 @@ OPTIONS /currencies
< 429
Retry-After: number of seconds to wait before making a new request
List current supported currencies.
List supported currencies. Obsolete currencies are returned.
GET /currencies
> Accept: application/json
> Api_Key: your API key
Expand All @@ -92,11 +92,18 @@ GET /currencies
"snapshots": [
...,
{
"isoCode": "USD",
"isoCode": "EUR",
"numericCode": 978,
"englishName": "Euro"
},
...
...,
{
"isoCode": "ZMK",
"numericCode": 894,
"englishName": "Zambian Kwacha",
"isObsolete" : true
},
...,
]
}
+++++
Expand Down
Binary file removed packages/EasyHttp.1.6.60.0/EasyHttp.1.6.60.0.nupkg
Binary file not shown.
Binary file removed packages/EasyHttp.1.6.60.0/lib/net40/EasyHttp.dll
Binary file not shown.
Binary file not shown.
Binary file added packages/EasyHttp.1.6.64.0/lib/net40/EasyHttp.dll
Binary file not shown.
Binary file removed packages/HtmlTags.2.0.0.181/HtmlTags.2.0.0.181.nupkg
Binary file not shown.
Binary file removed packages/HtmlTags.2.0.0.181/lib/4.0/HtmlTags.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed packages/Modernizr.2.7.1/Modernizr.2.7.1.nupkg
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Modernizr v2.7.1
* Modernizr v2.7.2
* www.modernizr.com
*
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
Expand All @@ -24,7 +24,7 @@

window.Modernizr = (function( window, document, undefined ) {

var version = '2.7.1',
var version = '2.7.2',

Modernizr = {},

Expand Down Expand Up @@ -605,7 +605,7 @@ window.Modernizr = (function( window, document, undefined ) {

// Note, Android < 4 will pass this test, but can only animate
// a single property at a time
// daneden.me/2011/12/putting-up-with-androids-bullshit/
// goo.gl/v3V4Gp
tests['cssanimations'] = function() {
return testPropsAll('animationName');
};
Expand Down Expand Up @@ -1403,4 +1403,4 @@ window.Modernizr = (function( window, document, undefined ) {

return Modernizr;

})(this, this.document);
})(this, this.document);
Binary file added packages/Modernizr.2.7.2/Modernizr.2.7.2.nupkg
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
504 changes: 0 additions & 504 deletions packages/NSubstitute.1.7.1.0/lib/NET40/NSubstitute.XML

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.7.2 (March 2014)
* [FIX] Basic support for types that return dynamic. Thanks to Alexandr Nikitin. (#75)
* [NEW] Auto-subbing for observables. Thanks to Paul Betts.

1.7.1 (January 2014)
* [FIX] Ambiguous arg exception with out/ref parameters. Thanks to Alexandr Nikitin. (#129)

Expand Down
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
6 changes: 3 additions & 3 deletions src/ApiModel/NMoneys.Web.ApiModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="NMoneys">
<HintPath>..\..\packages\NMoneys.3.4.0.0\lib\Net20-client\NMoneys.dll</HintPath>
<Reference Include="NMoneys, Version=3.4.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\NMoneys.3.4.1.0\lib\Net20-client\NMoneys.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
Expand All @@ -48,7 +49,6 @@
<Compile Include="v1\Messages\ICurrencyResponse.cs" />
<Compile Include="v1\Messages\IFormatResponse.cs" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ApiModel/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NMoneys" version="3.4.0.0" targetFramework="net35" />
<package id="NMoneys" version="3.4.1.0" targetFramework="net35" />
</packages>
1 change: 1 addition & 0 deletions src/ApiModel/v1/Datatypes/CurrencySnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ public class CurrencySnapshot
public CurrencyIsoCode IsoCode { get; set; }
public short NumericCode { get; set; }
public string EnglishName { get; set; }
public bool? IsObsolete { get; set; }
}
}
12 changes: 6 additions & 6 deletions src/Tests/NMoneys.Web.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="EasyHttp, Version=1.6.60.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="EasyHttp, Version=1.6.64.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\EasyHttp.1.6.60.0\lib\net40\EasyHttp.dll</HintPath>
<HintPath>..\..\packages\EasyHttp.1.6.64.0\lib\net40\EasyHttp.dll</HintPath>
</Reference>
<Reference Include="ExpectedObjects">
<HintPath>..\..\packages\ExpectedObjects.1.0.0.2\lib\ExpectedObjects.dll</HintPath>
Expand All @@ -52,13 +52,13 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\mongocsharpdriver.1.8.3\lib\net35\MongoDB.Driver.dll</HintPath>
</Reference>
<Reference Include="NMoneys, Version=3.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="NMoneys, Version=3.4.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\NMoneys.3.4.0.0\lib\Net20-client\NMoneys.dll</HintPath>
<HintPath>..\..\packages\NMoneys.3.4.1.0\lib\Net20-client\NMoneys.dll</HintPath>
</Reference>
<Reference Include="NSubstitute, Version=1.7.1.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<Reference Include="NSubstitute, Version=1.7.2.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\NSubstitute.1.7.1.0\lib\NET40\NSubstitute.dll</HintPath>
<HintPath>..\..\packages\NSubstitute.1.7.2.0\lib\NET40\NSubstitute.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
6 changes: 3 additions & 3 deletions src/Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EasyHttp" version="1.6.60.0" targetFramework="net40" />
<package id="EasyHttp" version="1.6.64.0" targetFramework="net40" />
<package id="ExpectedObjects" version="1.0.0.2" targetFramework="net40" />
<package id="JsonFx" version="2.0.1209.2802" targetFramework="net40" />
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net40" />
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net40" />
<package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="mongocsharpdriver" version="1.8.3" targetFramework="net40" />
<package id="NMoneys" version="3.4.0.0" targetFramework="net40" />
<package id="NSubstitute" version="1.7.1.0" targetFramework="net40" />
<package id="NMoneys" version="3.4.1.0" targetFramework="net40" />
<package id="NSubstitute" version="1.7.2.0" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" />
<package id="ServiceStack" version="3.9.71" targetFramework="net40" />
<package id="ServiceStack.Common" version="3.9.71" targetFramework="net40" />
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Api/v1/Messages/Currencies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace NMoneys.Web.Api.v1.Messages
{
[Route("/v1/currencies", "GET", Summary = "List current supported currencies.", Notes = "Obsolete currencies are not returned.")]
[Route("/v1/currencies", "GET", Summary = "List supported currencies.", Notes = "Obsolete currencies are also returned.")]
[Api("List current supported currencies.")]
public class Currencies : IReturn<CurrencyResponse>
{ }
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Api/v1/Messages/Discovery/DiscoverCurrencies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace NMoneys.Web.Api.v1.Messages.Discovery
{
[Route("/v1/currencies", "OPTIONS", Summary = "Provides information about current supported currencies.")]
[Route("/v1/currencies", "OPTIONS", Summary = "Provides information about supported currencies.", Notes = "Obsolete currencies are also returned.")]
[Api("Provides information about current supported currencies.")]
public class DiscoverCurrencies : IReturn<DiscoveryResponse>
{ }
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Api/v1/Resources/Currencies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ public object Get(Messages.Currencies request)
{
CurrencySnapshot[] snapshots = Currency.FindAll()
.OrderBy(c => c.AlphabeticCode, StringComparer.OrdinalIgnoreCase)
.Where(c => !c.IsObsolete)
.Select(c =>
{
var snapshot = new CurrencySnapshot
{
IsoCode = c.IsoCode,
NumericCode = c.NumericCode,
EnglishName = c.EnglishName,
IsObsolete = c.IsObsolete ? true : default(bool?)
};
return snapshot;
})
Expand Down
8 changes: 8 additions & 0 deletions src/Web/Content/Site.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ iframe{ border-width: 0;}
.snapshot {
text-align: left;
}
.snapshot.obsolete a:not(:hover) {
color: #7f8c8d;
}

.snapshot .alphabetic-code {
margin-right: 5px;
Expand Down Expand Up @@ -177,3 +180,8 @@ iframe{ border-width: 0;}
.quantities td:nth-child(even), th:nth-child(even) { color: #e74c3c; }
.quantities td:nth-child(odd), th:nth-child(odd) { color:#1abc9c; }
.quantities th { text-align: center; background: #ecf0f1}

.modal-header > .obsolete {
color: #7f8c8d;
font-weight: bolder;
}
10 changes: 5 additions & 5 deletions src/Web/NMoneys.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="HtmlTags, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="HtmlTags, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\HtmlTags.2.0.0.181\lib\4.0\HtmlTags.dll</HintPath>
<HintPath>..\..\packages\HtmlTags.2.1.0.183\lib\4.0\HtmlTags.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Web.Mvc">
Expand All @@ -67,9 +67,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Newtonsoft.Json.6.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NMoneys, Version=3.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="NMoneys, Version=3.4.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\NMoneys.3.4.0.0\lib\Net20-client\NMoneys.dll</HintPath>
<HintPath>..\..\packages\NMoneys.3.4.1.0\lib\Net20-client\NMoneys.dll</HintPath>
</Reference>
<Reference Include="NMoneys.Exchange">
<HintPath>..\..\packages\NMoneys.Exchange.2.1.1.0\lib\Net20-client\NMoneys.Exchange.dll</HintPath>
Expand Down Expand Up @@ -271,7 +271,7 @@
<Content Include="Scripts\jquery-2.1.0.min.js" />
<Content Include="Scripts\jquery.highlight.js" />
<Content Include="Scripts\jquery.quicksearch.js" />
<Content Include="Scripts\modernizr-2.7.1.js" />
<Content Include="Scripts\modernizr-2.7.2.js" />
<Content Include="Scripts\parsley.min.js" />
<Content Include="Scripts\prettify.js" />
<Content Include="Scripts\_references.js" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Modernizr v2.7.1
* Modernizr v2.7.2
* www.modernizr.com
*
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
Expand All @@ -24,7 +24,7 @@

window.Modernizr = (function( window, document, undefined ) {

var version = '2.7.1',
var version = '2.7.2',

Modernizr = {},

Expand Down Expand Up @@ -605,7 +605,7 @@ window.Modernizr = (function( window, document, undefined ) {

// Note, Android < 4 will pass this test, but can only animate
// a single property at a time
// daneden.me/2011/12/putting-up-with-androids-bullshit/
// goo.gl/v3V4Gp
tests['cssanimations'] = function() {
return testPropsAll('animationName');
};
Expand Down Expand Up @@ -1403,4 +1403,4 @@ window.Modernizr = (function( window, document, undefined ) {

return Modernizr;

})(this, this.document);
})(this, this.document);
2 changes: 1 addition & 1 deletion src/Web/Views/Currencies/DisplayTemplates/Snapshot.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@model NMoneys.Web.Models.Snapshot

<article class="span2 tile snapshot" id="@Model.AlphabeticCode">
<article class="span2 tile snapshot @(Model.Obsolete ? "obsolete" : string.Empty)" id="@Model.AlphabeticCode">
<div class="tabulated">
<div class="cell alphabetic-code">
<h3><a href="#@(Model.AlphabeticCode)_modal" role="button" data-toggle="modal" data-remote="@Url.Action("Detail", new { code = Model.AlphabeticCode })">@Model.AlphabeticCode</a></h3>
Expand Down
1 change: 1 addition & 0 deletions src/Web/Views/Currencies/DisplayTemplates/_detail.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<div class="modal hide fade" id="@(Model.AlphabeticCode)_modal" role="dialog" aria-hidden="true">
<header class="modal-header">
@if (Model.Obsolete) { <span class="obsolete">Obsolete</span> }
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
&nbsp;
</header>
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<add key="ClientValidationEnabled" value="false" />
<add key="UnobtrusiveJavaScriptEnabled" value="false" />

<add key="throttling" value="{NumberOfRequests:3,Period:PT10S}" />
<add key="throttling" value="{NumberOfRequests:10,Period:PT30S}" />
<add key="email_api_key" value="pxOoeu3PhLtq9GECbCa_Tw" />
<add key="analytics_tracking_id" value="" />
<add key="https_port" value="44300" />
Expand Down
6 changes: 3 additions & 3 deletions src/Web/packages.config
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.5.0.2" targetFramework="net40" />
<package id="HtmlTags" version="2.0.0.181" targetFramework="net40" />
<package id="HtmlTags" version="2.1.0.183" targetFramework="net40" />
<package id="jQuery" version="2.1.0" targetFramework="net40" />
<package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net40" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.1" targetFramework="net40" />
<package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net40" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net40" />
<package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="Modernizr" version="2.7.1" targetFramework="net40" />
<package id="Modernizr" version="2.7.2" targetFramework="net40" />
<package id="mongocsharpdriver" version="1.8.3" targetFramework="net40" />
<package id="Mvc4Futures" version="4.0.20710.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.1" targetFramework="net40" />
<package id="NMoneys" version="3.4.0.0" targetFramework="net40" />
<package id="NMoneys" version="3.4.1.0" targetFramework="net40" />
<package id="NMoneys.Exchange" version="2.1.1.0" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" />
<package id="ServiceStack" version="3.9.71" targetFramework="net40" />
Expand Down

0 comments on commit 913408c

Please sign in to comment.