Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shotengai
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
shotengai
Commits
daa37e9f
Commit
daa37e9f
authored
7 years ago
by
ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the syntax to fit ruby 2.3
parent
870dd2e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
order.rb
lib/shotengai/order.rb
+11
-8
product.rb
lib/shotengai/product.rb
+11
-3
No files found.
lib/shotengai/order.rb
View file @
daa37e9f
...
@@ -40,18 +40,21 @@ module Shotengai
...
@@ -40,18 +40,21 @@ module Shotengai
state
:unpaid
,
initial:
true
state
:unpaid
,
initial:
true
state
:paid
,
:delivering
,
:received
,
:canceled
,
:evaluated
state
:paid
,
:delivering
,
:received
,
:canceled
,
:evaluated
event
:pay
,
before:
[
:fill_snapshot
,
:set_pay_time
]
{
event
:pay
,
before:
[
:fill_snapshot
,
:set_pay_time
]
do
transitions
from: :unpaid
,
to: :paid
transitions
from: :unpaid
,
to: :paid
}
end
event
:cancel
{
event
:cancel
do
transitions
from: :unpaid
,
to: :canceled
transitions
from: :unpaid
,
to: :canceled
}
end
event
:send_out
,
after: :set_delivery_time
{
event
:send_out
,
after: :set_delivery_time
do
transitions
from: :paid
,
to: :delivering
transitions
from: :paid
,
to: :delivering
}
end
event
:get_it
,
after: :set_receipt_time
{
event
:get_it
,
after: :set_receipt_time
do
transitions
from: :delivering
,
to: :received
transitions
from: :delivering
,
to: :received
}
end
# event :evaluate {
# event :evaluate {
# transitions from: :received, to: :evaluated
# transitions from: :received, to: :evaluated
# }
# }
...
...
This diff is collapsed.
Click to expand it.
lib/shotengai/product.rb
View file @
daa37e9f
...
@@ -38,9 +38,17 @@ module Shotengai
...
@@ -38,9 +38,17 @@ module Shotengai
state
:no_on
,
initial:
true
state
:no_on
,
initial:
true
state
:on_sale
,
:deleted
state
:on_sale
,
:deleted
event
:put_on_shelf
{
transitions
from: :no_on
,
to: :on_sale
}
event
:put_on_shelf
do
event
:sold_out
{
transitions
from: :on_sale
,
to: :no_on
}
transitions
from: :no_on
,
to: :on_sale
event
:soft_delete
{
transitions
from:
[
:on_sale
,
:no_on
],
to: :deleted
}
end
event
:sold_out
do
transitions
from: :on_sale
,
to: :no_on
end
event
:soft_delete
do
transitions
from:
[
:on_sale
,
:no_on
],
to: :deleted
end
end
end
def
status_zh
def
status_zh
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment