Skip to content

Commit

Permalink
added a file missed in prevoius commit: order.erl
Browse files Browse the repository at this point in the history
  • Loading branch information
Mino committed May 18, 2010
1 parent 05b186b commit 4d4f21d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/order.erl
@@ -0,0 +1,21 @@
%%%-------------------------------------------------------------------
%%% File : order.erl
%%% Author : <Mino@X60S>
%%% Description :
%%%
%%% Created : 12 May 2010 by <Mino@X60S>
%%%-------------------------------------------------------------------
-module(order).

-export([add/1]).

-include("records.hrl").

%%====================================================================
%% API Functions
%%====================================================================
add(Cart) ->
Products = cart:get_products(Cart),
Items = [#orderItem{quantity=X, product=Y}||{X,Y} <- Products],
Order = #order{products=Items},
db:add_order(Order).

0 comments on commit 4d4f21d

Please sign in to comment.