Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f186d2c3
authored
Feb 06, 2015
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add logging for user creating bill with more places than in RESERVE_UNPAID_SLOT_…
…PERCENT event property
1 parent
60ba90b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BillBean.java
code/moya-utils/src/main/java/fi/codecrew/moya/utilities/moyamessage/MoyaEventType.java
code/moya-beans/ejbModule/fi/codecrew/moya/beans/BillBean.java
View file @
f186d2c
...
@@ -58,6 +58,7 @@ import fi.codecrew.moya.model.Discount;
...
@@ -58,6 +58,7 @@ import fi.codecrew.moya.model.Discount;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.FoodWave
;
import
fi.codecrew.moya.model.FoodWave
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.LanEventPropertyKey
;
import
fi.codecrew.moya.model.PlaceSlot
;
import
fi.codecrew.moya.model.PlaceSlot
;
import
fi.codecrew.moya.model.Product
;
import
fi.codecrew.moya.model.Product
;
import
fi.codecrew.moya.model.ProductFlag
;
import
fi.codecrew.moya.model.ProductFlag
;
...
@@ -305,6 +306,12 @@ public class BillBean implements BillBeanLocal {
...
@@ -305,6 +306,12 @@ public class BillBean implements BillBeanLocal {
}
}
int
count
=
bl
.
getQuantity
().
intValue
();
int
count
=
bl
.
getQuantity
().
intValue
();
Date
now
=
new
Date
();
Date
now
=
new
Date
();
long
reserveLimit
=
eventbean
.
getPropertyLong
(
LanEventPropertyKey
.
RESERVE_UNPAID_SLOT_PERCENT
);
if
(
count
*
100
/
prod
.
getPlaces
().
size
()
>
reserveLimit
)
{
long
limitCount
=
prod
.
getPlaces
().
size
()
*
reserveLimit
/
100
;
logbean
.
sendMessage
(
MoyaEventType
.
BILL_INFO
,
bill
.
getUser
(),
"User created bill "
,
bill
.
getId
(),
" for product '"
,
prod
.
getName
(),
"' for '"
,
count
,
"' products, which is bigger than reservation limit. '"
,
limitCount
,
"', ("
,
reserveLimit
,
"%)"
);
}
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
PlaceSlot
ps
=
new
PlaceSlot
();
PlaceSlot
ps
=
new
PlaceSlot
();
ps
.
setBill
(
bill
);
ps
.
setBill
(
bill
);
...
...
code/moya-utils/src/main/java/fi/codecrew/moya/utilities/moyamessage/MoyaEventType.java
View file @
f186d2c
...
@@ -15,6 +15,7 @@ public enum MoyaEventType {
...
@@ -15,6 +15,7 @@ public enum MoyaEventType {
USER_PERMISSION_VIOLATION
(
MoyaEventSource
.
USER
),
USER_PERMISSION_VIOLATION
(
MoyaEventSource
.
USER
),
LOGIN_SUCCESSFULL
(
MoyaEventSource
.
USER
),
LOGIN_SUCCESSFULL
(
MoyaEventSource
.
USER
),
PLACE_ACTION
(
MoyaEventSource
.
PLACEMAP
),
PLACE_ACTION
(
MoyaEventSource
.
PLACEMAP
),
BILL_INFO
(
MoyaEventSource
.
SHOP
),
;
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment