auction_fun_core 0.8.5 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/auction_fun_core.gemspec +1 -0
- data/db/migrate/20240229143000_create_auctions.rb +1 -0
- data/db/seeds.rb +87 -36
- data/i18n/en-US/contracts/contracts.en-US.yml +9 -0
- data/i18n/en-US/mail/application.en-US.yml +59 -0
- data/i18n/en-US/mail/auction_context/post_auction/participant.en-US.yml +13 -0
- data/i18n/en-US/mail/auction_context/post_auction/winner.en-US.yml +13 -0
- data/i18n/pt-BR/contracts/contracts.pt-BR.yml +9 -0
- data/i18n/pt-BR/mail/application.pt-BR.yml +59 -0
- data/i18n/pt-BR/mail/auction_context/post_auction/participant.pt-BR.yml +13 -0
- data/i18n/pt-BR/mail/auction_context/post_auction/winner.pt-BR.yml +13 -0
- data/i18n/pt-BR/mail/user_context/registration.pt-BR.yml +0 -4
- data/lib/auction_fun_core/contracts/auction_context/post_auction/participant_contract.rb +42 -0
- data/lib/auction_fun_core/contracts/auction_context/post_auction/winner_contract.rb +41 -0
- data/lib/auction_fun_core/contracts/auction_context/processor/finish/closed_contract.rb +47 -0
- data/lib/auction_fun_core/contracts/auction_context/processor/finish/penny_contract.rb +48 -0
- data/lib/auction_fun_core/contracts/auction_context/processor/finish/standard_contract.rb +48 -0
- data/lib/auction_fun_core/entities/auction.rb +6 -0
- data/lib/auction_fun_core/operations/auction_context/create_operation.rb +12 -2
- data/lib/auction_fun_core/operations/auction_context/post_auction/participant_operation.rb +52 -0
- data/lib/auction_fun_core/operations/auction_context/post_auction/winner_operation.rb +51 -0
- data/lib/auction_fun_core/operations/auction_context/processor/finish/closed_operation.rb +100 -0
- data/lib/auction_fun_core/operations/auction_context/processor/finish/penny_operation.rb +100 -0
- data/lib/auction_fun_core/operations/auction_context/processor/finish/standard_operation.rb +102 -0
- data/lib/auction_fun_core/operations/auction_context/processor/start_operation.rb +23 -11
- data/lib/auction_fun_core/operations/bid_context/create_bid_penny_operation.rb +57 -7
- data/lib/auction_fun_core/operations/staff_context/registration_operation.rb +10 -0
- data/lib/auction_fun_core/relations/auctions.rb +167 -26
- data/lib/auction_fun_core/relations/staffs.rb +1 -1
- data/lib/auction_fun_core/services/mail/auction_context/post_auction/participant_mailer.rb +31 -0
- data/lib/auction_fun_core/services/mail/auction_context/post_auction/winner_mailer.rb +31 -0
- data/lib/auction_fun_core/services/mail/templates/auction_context/post_auction/participant.html.erb +173 -0
- data/lib/auction_fun_core/services/mail/templates/auction_context/post_auction/winner.html.erb +174 -0
- data/lib/auction_fun_core/services/mail/templates/user_context/registration.html.erb +2 -2
- data/lib/auction_fun_core/version.rb +1 -1
- data/lib/auction_fun_core/workers/application_job.rb +2 -0
- data/lib/auction_fun_core/workers/operations/auction_context/post_auction/participant_operation_job.rb +33 -0
- data/lib/auction_fun_core/workers/operations/auction_context/post_auction/winner_operation_job.rb +33 -0
- data/lib/auction_fun_core/workers/operations/auction_context/processor/finish/closed_operation_job.rb +34 -0
- data/lib/auction_fun_core/workers/operations/auction_context/processor/finish/penny_operation_job.rb +37 -0
- data/lib/auction_fun_core/workers/operations/auction_context/processor/finish/standard_operation_job.rb +34 -0
- data/lib/auction_fun_core/workers/services/mail/auction_context/post_auction/participant_mailer_job.rb +51 -0
- data/lib/auction_fun_core/workers/services/mail/auction_context/post_auction/winner_mailer_job.rb +51 -0
- data/system/providers/background_job.rb +19 -0
- metadata +43 -5
- data/lib/auction_fun_core/contracts/auction_context/processor/finish_contract.rb +0 -27
- data/lib/auction_fun_core/operations/auction_context/processor/finish_operation.rb +0 -61
- data/lib/auction_fun_core/workers/operations/auction_context/processor/finish_operation_job.rb +0 -32
@@ -7,13 +7,13 @@ module AuctionFunCore
|
|
7
7
|
class Auctions < ROM::Relation[:sql]
|
8
8
|
use :pagination, per_page: 10
|
9
9
|
|
10
|
-
KINDS = Types::Coercible::String.
|
11
|
-
STATUSES = Types::Coercible::String.
|
12
|
-
.enum("scheduled", "running", "paused", "canceled", "finished")
|
10
|
+
KINDS = Types::Coercible::String.enum("standard", "penny", "closed")
|
11
|
+
STATUSES = Types::Coercible::String.enum("scheduled", "running", "paused", "canceled", "finished")
|
13
12
|
|
14
13
|
schema(:auctions, infer: true) do
|
15
14
|
attribute :id, Types::Integer
|
16
15
|
attribute :staff_id, Types::ForeignKey(:staffs)
|
16
|
+
attribute :winner_id, Types::ForeignKey(:users)
|
17
17
|
attribute :title, Types::String
|
18
18
|
attribute :description, Types::String
|
19
19
|
attribute :kind, KINDS
|
@@ -32,6 +32,7 @@ module AuctionFunCore
|
|
32
32
|
|
33
33
|
associations do
|
34
34
|
belongs_to :staff, as: :staff, relation: :staffs
|
35
|
+
belongs_to :winner, as: :winner, relation: :users, foreign_key: :winner_id
|
35
36
|
has_many :bids, as: :bids, relation: :bids
|
36
37
|
end
|
37
38
|
end
|
@@ -40,22 +41,13 @@ module AuctionFunCore
|
|
40
41
|
auto_struct(true)
|
41
42
|
|
42
43
|
def all(page = 1, per_page = 10, options = {bidders_count: 3})
|
43
|
-
|
44
|
-
|
45
|
-
read(all_auctions_with_bid_info(per_page, offset, options))
|
46
|
-
end
|
47
|
-
|
48
|
-
def info(auction_id, options = {bidders_count: 3})
|
49
|
-
raise "Invalid argument" unless auction_id.is_a?(Integer)
|
44
|
+
raise "Invalid argument" unless page.is_a?(Integer) && per_page.is_a?(Integer)
|
50
45
|
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
private
|
46
|
+
offset = ((page - 1) * per_page)
|
55
47
|
|
56
|
-
|
57
|
-
|
58
|
-
(SELECT COUNT(*) FROM (SELECT * FROM bids WHERE bids.auction_id =
|
48
|
+
read("
|
49
|
+
SELECT a.id, a.title, a.description, a.kind, a.status, a.started_at, a.finished_at, a.stopwatch, a.initial_bid_cents,
|
50
|
+
(SELECT COUNT(*) FROM (SELECT * FROM bids WHERE bids.auction_id = a.id) dt) AS total_bids,
|
59
51
|
CASE
|
60
52
|
WHEN a.kind = 'standard' THEN
|
61
53
|
json_build_object(
|
@@ -78,15 +70,18 @@ module AuctionFunCore
|
|
78
70
|
json_build_object('minimal', (a.initial_bid_cents + (a.initial_bid_cents * 0.10))::int)
|
79
71
|
END as bids
|
80
72
|
FROM auctions as a
|
81
|
-
LEFT JOIN LATERAL (SELECT * FROM bids WHERE auction_id = a.id ORDER BY value_cents DESC LIMIT #{options[:bidders_count]}) as bi ON a.id = bi.auction_id
|
73
|
+
LEFT JOIN LATERAL (SELECT * FROM bids WHERE auction_id = a.id ORDER BY value_cents DESC LIMIT #{options[:bidders_count]}) as bi ON a.id = bi.auction_id
|
82
74
|
LEFT JOIN users ON bi.user_id = users.id AND bi.auction_id = a.id
|
83
|
-
|
84
|
-
|
75
|
+
GROUP BY a.id
|
76
|
+
LIMIT #{per_page} OFFSET #{offset}")
|
85
77
|
end
|
86
78
|
|
87
|
-
def
|
88
|
-
"
|
89
|
-
|
79
|
+
def info(auction_id, options = {bidders_count: 3})
|
80
|
+
raise "Invalid argument" unless auction_id.is_a?(Integer)
|
81
|
+
|
82
|
+
read("
|
83
|
+
SELECT a.id, a.title, a.description, a.kind, a.status, a.started_at, a.finished_at, a.stopwatch, a.initial_bid_cents,
|
84
|
+
(SELECT COUNT(*) FROM (SELECT * FROM bids WHERE bids.auction_id = #{auction_id}) dt) AS total_bids,
|
90
85
|
CASE
|
91
86
|
WHEN a.kind = 'standard' THEN
|
92
87
|
json_build_object(
|
@@ -109,10 +104,156 @@ module AuctionFunCore
|
|
109
104
|
json_build_object('minimal', (a.initial_bid_cents + (a.initial_bid_cents * 0.10))::int)
|
110
105
|
END as bids
|
111
106
|
FROM auctions as a
|
112
|
-
LEFT JOIN LATERAL (SELECT * FROM bids WHERE auction_id = a.id ORDER BY value_cents DESC LIMIT #{options[:bidders_count]}) as bi ON a.id = bi.auction_id
|
107
|
+
LEFT JOIN LATERAL (SELECT * FROM bids WHERE auction_id = a.id ORDER BY value_cents DESC LIMIT #{options[:bidders_count]}) as bi ON a.id = bi.auction_id AND a.id = #{auction_id}
|
113
108
|
LEFT JOIN users ON bi.user_id = users.id AND bi.auction_id = a.id
|
114
|
-
|
115
|
-
|
109
|
+
WHERE a.id = #{auction_id}
|
110
|
+
GROUP BY a.id")
|
111
|
+
end
|
112
|
+
|
113
|
+
# Retrieves the standard auction winner and other participating bidders for a specified auction.
|
114
|
+
#
|
115
|
+
# This method queries the database to fetch the winner based on the highest bid and collects an array
|
116
|
+
# of other participants who placed bids in the auction, all except for the winner. The method returns
|
117
|
+
# structured data that includes the auction ID, winner's ID, total number of bids,
|
118
|
+
# and a list of participant IDs.
|
119
|
+
#
|
120
|
+
# @return [Hash] a hash containing details about the auction, including winner and participants:
|
121
|
+
# - :id [Integer] the ID of the auction
|
122
|
+
# - :winner_id [Integer] the ID of the winning bidder
|
123
|
+
# - :total_bids [Integer] the total number of bids placed in the auction
|
124
|
+
# - :participants [Array<Integer>] an array of user IDs of the other participants, excluding the winner
|
125
|
+
def load_standard_auction_winners_and_participants(auction_id)
|
126
|
+
raise "Invalid argument" unless auction_id.is_a?(Integer)
|
127
|
+
|
128
|
+
read("SELECT a.id, a.kind, a.status, w.user_id AS winner_id, COALESCE(COUNT(b.id), 0) AS total_bids,
|
129
|
+
COALESCE(
|
130
|
+
ARRAY_REMOVE(ARRAY_AGG(DISTINCT b.user_id ORDER BY b.user_id), w.user_id), ARRAY[]::INT[]
|
131
|
+
) AS participant_ids
|
132
|
+
FROM auctions a
|
133
|
+
LEFT JOIN bids b ON a.id = b.auction_id
|
134
|
+
LEFT JOIN (
|
135
|
+
SELECT auction_id, user_id, MAX(value_cents) AS value_cents
|
136
|
+
FROM bids
|
137
|
+
WHERE auction_id = #{auction_id}
|
138
|
+
GROUP BY auction_id, user_id
|
139
|
+
ORDER BY value_cents DESC
|
140
|
+
LIMIT 1
|
141
|
+
) AS w ON a.id = w.auction_id
|
142
|
+
WHERE a.id = #{auction_id}
|
143
|
+
GROUP BY a.id, w.user_id")
|
144
|
+
end
|
145
|
+
|
146
|
+
# Retrieves the penny auction winner and other participating bidders for a specified auction.
|
147
|
+
#
|
148
|
+
# This method queries the database to fetch the winner based on the latest bid and collects an array
|
149
|
+
# of other participants who placed bids in the auction, all except for the winner. The method returns
|
150
|
+
# structured data that includes the auction ID, winner's ID, total number of bids,
|
151
|
+
# and a list of participant IDs.
|
152
|
+
#
|
153
|
+
# @return [Hash] a hash containing details about the auction, including winner and participants:
|
154
|
+
# - :id [Integer] the ID of the auction
|
155
|
+
# - :winner_id [Integer] the ID of the winning bidder
|
156
|
+
# - :total_bids [Integer] the total number of bids placed in the auction
|
157
|
+
# - :participants [Array<Integer>] an array of user IDs of the other participants, excluding the winner
|
158
|
+
def load_penny_auction_winners_and_participants(auction_id)
|
159
|
+
raise "Invalid argument" unless auction_id.is_a?(Integer)
|
160
|
+
|
161
|
+
read("SELECT a.id, a.kind, a.status, w.user_id AS winner_id, COALESCE(COUNT(b.id), 0) AS total_bids,
|
162
|
+
COALESCE(
|
163
|
+
ARRAY_REMOVE(ARRAY_AGG(DISTINCT b.user_id ORDER BY b.user_id), w.user_id), ARRAY[]::INT[]
|
164
|
+
) AS participant_ids
|
165
|
+
FROM auctions a
|
166
|
+
LEFT JOIN bids b ON a.id = b.auction_id
|
167
|
+
LEFT JOIN (
|
168
|
+
SELECT auction_id, user_id
|
169
|
+
FROM bids
|
170
|
+
WHERE auction_id = #{auction_id}
|
171
|
+
ORDER BY bids.created_at DESC
|
172
|
+
LIMIT 1
|
173
|
+
) AS w ON a.id = w.auction_id
|
174
|
+
WHERE a.id = #{auction_id}
|
175
|
+
GROUP BY a.id, w.user_id")
|
176
|
+
end
|
177
|
+
|
178
|
+
# Retrieves the closed auction winner and other participating bidders for a specified auction.
|
179
|
+
#
|
180
|
+
# This method queries the database to fetch the winner based on the highest bid and collects an array
|
181
|
+
# of other participants who placed bids in the auction, all except for the winner. The method returns
|
182
|
+
# structured data that includes the auction ID, winner's ID, total number of bids,
|
183
|
+
# and a list of participant IDs.
|
184
|
+
#
|
185
|
+
# @return [Hash] a hash containing details about the auction, including winner and participants:
|
186
|
+
# - :id [Integer] the ID of the auction
|
187
|
+
# - :winner_id [Integer] the ID of the winning bidder
|
188
|
+
# - :total_bids [Integer] the total number of bids placed in the auction
|
189
|
+
# - :participants [Array<Integer>] an array of user IDs of the other participants, excluding the winner
|
190
|
+
def load_closed_auction_winners_and_participants(auction_id)
|
191
|
+
raise "Invalid argument" unless auction_id.is_a?(Integer)
|
192
|
+
|
193
|
+
read("SELECT a.id, a.kind, a.status, w.user_id AS winner_id, COALESCE(COUNT(b.id), 0) AS total_bids,
|
194
|
+
COALESCE(
|
195
|
+
ARRAY_REMOVE(ARRAY_AGG(DISTINCT b.user_id ORDER BY b.user_id), w.user_id), ARRAY[]::INT[]
|
196
|
+
) AS participant_ids
|
197
|
+
FROM auctions a
|
198
|
+
LEFT JOIN bids b ON a.id = b.auction_id
|
199
|
+
LEFT JOIN (
|
200
|
+
SELECT auction_id, user_id, MAX(value_cents) AS value_cents
|
201
|
+
FROM bids
|
202
|
+
WHERE auction_id = #{auction_id}
|
203
|
+
GROUP BY auction_id, user_id
|
204
|
+
ORDER BY value_cents DESC
|
205
|
+
LIMIT 1
|
206
|
+
) AS w ON a.id = w.auction_id
|
207
|
+
WHERE a.id = #{auction_id}
|
208
|
+
GROUP BY a.id, w.user_id")
|
209
|
+
end
|
210
|
+
|
211
|
+
def load_winner_statistics(auction_id, winner_id)
|
212
|
+
raise "Invalid argument" unless auction_id.is_a?(Integer) && winner_id.is_a?(Integer)
|
213
|
+
|
214
|
+
read("SELECT a.id, COUNT(b.id) AS auction_total_bids, MAX(b.value_cents) AS winner_bid,
|
215
|
+
date(a.finished_at) as auction_date,
|
216
|
+
(SELECT COUNT(*) FROM bids b2
|
217
|
+
WHERE b2.auction_id = #{auction_id}
|
218
|
+
AND b2.user_id = #{winner_id}
|
219
|
+
) AS winner_total_bids
|
220
|
+
FROM auctions a
|
221
|
+
LEFT JOIN bids b ON a.id = b.auction_id AND a.id = #{auction_id}
|
222
|
+
LEFT JOIN users u ON u.id = b.user_id AND u.id = #{winner_id}
|
223
|
+
LEFT JOIN (
|
224
|
+
SELECT auction_id, user_id, MAX(value_cents) AS value_cents
|
225
|
+
FROM bids
|
226
|
+
WHERE auction_id = #{auction_id}
|
227
|
+
GROUP BY auction_id, user_id
|
228
|
+
ORDER BY value_cents DESC
|
229
|
+
LIMIT 1
|
230
|
+
) AS w ON a.id = w.auction_id
|
231
|
+
WHERE a.id = #{auction_id}
|
232
|
+
GROUP BY a.id")
|
233
|
+
end
|
234
|
+
|
235
|
+
def load_participant_statistics(auction_id, participant_id)
|
236
|
+
raise "Invalid argument" unless auction_id.is_a?(Integer) && participant_id.is_a?(Integer)
|
237
|
+
|
238
|
+
read("SELECT a.id, COUNT(b.id) AS auction_total_bids, MAX(b.value_cents) AS winner_bid,
|
239
|
+
date(a.finished_at) as auction_date,
|
240
|
+
(SELECT COUNT(*) FROM bids b2
|
241
|
+
WHERE b2.auction_id = #{auction_id}
|
242
|
+
AND b2.user_id = #{participant_id}
|
243
|
+
) AS winner_total_bids
|
244
|
+
FROM auctions a
|
245
|
+
LEFT JOIN bids b ON a.id = b.auction_id AND a.id = #{auction_id}
|
246
|
+
LEFT JOIN users u ON u.id = b.user_id AND u.id = #{participant_id}
|
247
|
+
LEFT JOIN (
|
248
|
+
SELECT auction_id, user_id, MAX(value_cents) AS value_cents
|
249
|
+
FROM bids
|
250
|
+
WHERE auction_id = #{auction_id}
|
251
|
+
GROUP BY auction_id, user_id
|
252
|
+
ORDER BY value_cents DESC
|
253
|
+
LIMIT 1
|
254
|
+
) AS w ON a.id = w.auction_id
|
255
|
+
WHERE a.id = #{auction_id}
|
256
|
+
GROUP BY a.id")
|
116
257
|
end
|
117
258
|
end
|
118
259
|
end
|
@@ -7,7 +7,7 @@ module AuctionFunCore
|
|
7
7
|
class Staffs < ROM::Relation[:sql]
|
8
8
|
use :pagination, per_page: 10
|
9
9
|
|
10
|
-
STAFF_KINDS = Types::Coercible::String.
|
10
|
+
STAFF_KINDS = Types::Coercible::String.enum("root", "common")
|
11
11
|
|
12
12
|
schema(:staffs, infer: true) do
|
13
13
|
attribute :id, Types::Integer
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AuctionFunCore
|
4
|
+
module Services
|
5
|
+
module Mail
|
6
|
+
module AuctionContext
|
7
|
+
module PostAuction
|
8
|
+
class ParticipantMailer
|
9
|
+
include IdleMailer::Mailer
|
10
|
+
include IdleMailer::TemplateManager
|
11
|
+
|
12
|
+
# @param auction [ROM::Struct::Auction] The auction object
|
13
|
+
# @param participant [ROM::Struct::User] The user object
|
14
|
+
# @param statistics [OpenStruct] Statistics object
|
15
|
+
def initialize(auction, participant, statistics)
|
16
|
+
@auction = auction
|
17
|
+
@participant = participant
|
18
|
+
@statistics = statistics
|
19
|
+
mail.to = participant.email
|
20
|
+
mail.subject = I18n.t("mail.auction_context.post_auction.participant_mailer.subject", title: @auction.title)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.template_name
|
24
|
+
IdleMailer.config.templates.join("auction_context/post_auction/participant")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AuctionFunCore
|
4
|
+
module Services
|
5
|
+
module Mail
|
6
|
+
module AuctionContext
|
7
|
+
module PostAuction
|
8
|
+
class WinnerMailer
|
9
|
+
include IdleMailer::Mailer
|
10
|
+
include IdleMailer::TemplateManager
|
11
|
+
|
12
|
+
# @param auction [ROM::Struct::Auction] The auction object
|
13
|
+
# @param winner [ROM::Struct::User] The user object
|
14
|
+
# @param statistics [OpenStruct] Statistics object
|
15
|
+
def initialize(auction, winner, statistics)
|
16
|
+
@auction = auction
|
17
|
+
@winner = winner
|
18
|
+
@statistics = statistics
|
19
|
+
mail.to = winner.email
|
20
|
+
mail.subject = I18n.t("mail.auction_context.post_auction.winner_mailer.subject", title: @auction.title)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.template_name
|
24
|
+
IdleMailer.config.templates.join("auction_context/post_auction/winner")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/auction_fun_core/services/mail/templates/auction_context/post_auction/participant.html.erb
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="width:600px;" width="600">
|
2
|
+
<tr>
|
3
|
+
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
4
|
+
<div style="margin:0px auto;max-width:600px;">
|
5
|
+
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
6
|
+
<tbody>
|
7
|
+
<tr>
|
8
|
+
<td style="direction:ltr;font-size:0px;padding:20px 0;padding-bottom:0px;text-align:center;">
|
9
|
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
10
|
+
<tr>
|
11
|
+
<td style="vertical-align:top;width:600px;">
|
12
|
+
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
13
|
+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
14
|
+
<tbody>
|
15
|
+
<tr>
|
16
|
+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
17
|
+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;">
|
18
|
+
<tbody>
|
19
|
+
<tr>
|
20
|
+
<td style="width:50px;">
|
21
|
+
<img alt="image description" height="auto" src="https://codedmails.com/images/logo-circle.png" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:14px;" width="50" />
|
22
|
+
</td>
|
23
|
+
</tr>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
</td>
|
27
|
+
</tr>
|
28
|
+
<tr>
|
29
|
+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
30
|
+
<div style="font-family:Helvetica, Arial, sans-serif;font-size:18px;font-weight:400;line-height:24px;text-align:left;color:#434245;">
|
31
|
+
<h1 style="margin: 0; font-size: 24px; line-height: normal; font-weight: bold;">
|
32
|
+
<%= I18n.t("mail.general.hello", name: @participant.name) %>,
|
33
|
+
</h1>
|
34
|
+
</div>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
</div>
|
40
|
+
</td>
|
41
|
+
</tr>
|
42
|
+
</table>
|
43
|
+
</td>
|
44
|
+
</tr>
|
45
|
+
</tbody>
|
46
|
+
</table>
|
47
|
+
</div>
|
48
|
+
</td>
|
49
|
+
</tr>
|
50
|
+
</table>
|
51
|
+
<table align="center" border="0" cellpadding="0" cellspacing="0" style="width:600px;" width="600">
|
52
|
+
<tr>
|
53
|
+
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
54
|
+
<div style="margin:0px auto;max-width:600px;">
|
55
|
+
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;">
|
56
|
+
<tbody>
|
57
|
+
<tr>
|
58
|
+
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
|
59
|
+
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
60
|
+
<tr>
|
61
|
+
<td style="vertical-align:top;width:600px;">
|
62
|
+
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
63
|
+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
|
64
|
+
<tbody>
|
65
|
+
<tr>
|
66
|
+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
67
|
+
<div style="font-family:Helvetica, Arial, sans-serif;font-size:18px;font-weight:400;line-height:24px;text-align:left;color:#434245;">
|
68
|
+
<%= raw I18n.t("mail.auction_context.post_auction.participant_mailer.body.description", title: @auction.title) %>
|
69
|
+
</div>
|
70
|
+
</td>
|
71
|
+
</tr>
|
72
|
+
<tr>
|
73
|
+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
74
|
+
<div style="font-family:Helvetica, Arial, sans-serif;font-size:18px;font-weight:400;line-height:24px;text-align:left;color:#434245;">
|
75
|
+
<ul>
|
76
|
+
<li><%= I18n.t("mail.auction_context.post_auction.participant_mailer.body.stats.auction_total_bids", auction_total_bids: @statistics.auction_total_bids) %></li>
|
77
|
+
<li><%= I18n.t("mail.auction_context.post_auction.participant_mailer.body.stats.winner_bid", winner_bid: @statistics.winner_bid) %></li>
|
78
|
+
<li><%= I18n.t("mail.auction_context.post_auction.participant_mailer.body.stats.auction_date") %>: <%= I18n.l(@statistics.auction_date, format: :default) %></li>
|
79
|
+
</ul>
|
80
|
+
</td>
|
81
|
+
</tr>
|
82
|
+
<tr>
|
83
|
+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
84
|
+
<div style="font-family:Helvetica, Arial, sans-serif;font-size:18px;font-weight:bold;line-height:24px;text-align:left;color:#434245;">
|
85
|
+
<%= I18n.t("application.general.team") %>
|
86
|
+
</div>
|
87
|
+
</td>
|
88
|
+
</tr>
|
89
|
+
<tr>
|
90
|
+
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
|
91
|
+
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation">
|
92
|
+
<tr>
|
93
|
+
<td>
|
94
|
+
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;">
|
95
|
+
<tbody>
|
96
|
+
<tr>
|
97
|
+
<td style="padding:4px;">
|
98
|
+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-radius:3px;width:18px;">
|
99
|
+
<tbody>
|
100
|
+
<tr>
|
101
|
+
<td style="font-size:0;height:18px;vertical-align:middle;width:18px;">
|
102
|
+
<a href="https://twitter.com/auctionfun" target="_blank" style="color: #2e58ff; text-decoration: none;">
|
103
|
+
<img alt="twitter-logo" height="18" src="https://codedmails.com/images/social/black/twitter-logo-transparent-black.png" style="border-radius:3px;display:block;" width="18" />
|
104
|
+
</a>
|
105
|
+
</td>
|
106
|
+
</tr>
|
107
|
+
</tbody>
|
108
|
+
</table>
|
109
|
+
</td>
|
110
|
+
</tr>
|
111
|
+
</tbody>
|
112
|
+
</table>
|
113
|
+
</td>
|
114
|
+
<td>
|
115
|
+
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;">
|
116
|
+
<tbody>
|
117
|
+
<tr>
|
118
|
+
<td style="padding:4px;">
|
119
|
+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-radius:3px;width:18px;">
|
120
|
+
<tbody>
|
121
|
+
<tr>
|
122
|
+
<td style="font-size:0;height:18px;vertical-align:middle;width:18px;">
|
123
|
+
<a href="https://facebook.com/auctionfun" target="_blank" style="color: #2e58ff; text-decoration: none;">
|
124
|
+
<img alt="facebook-logo" height="18" src="https://codedmails.com/images/social/black/facebook-logo-transparent-black.png" style="border-radius:3px;display:block;" width="18" />
|
125
|
+
</a>
|
126
|
+
</td>
|
127
|
+
</tr>
|
128
|
+
</tbody>
|
129
|
+
</table>
|
130
|
+
</td>
|
131
|
+
</tr>
|
132
|
+
</tbody>
|
133
|
+
</table>
|
134
|
+
</td>
|
135
|
+
<td>
|
136
|
+
<table align="left" border="0" cellpadding="0" cellspacing="0" role="presentation" style="float:none;display:inline-table;">
|
137
|
+
<tbody>
|
138
|
+
<tr>
|
139
|
+
<td style="padding:4px;">
|
140
|
+
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-radius:3px;width:18px;">
|
141
|
+
<tbody>
|
142
|
+
<tr>
|
143
|
+
<td style="font-size:0;height:18px;vertical-align:middle;width:18px;">
|
144
|
+
<a href="https://instagram.com/auctionfun" target="_blank" style="color: #2e58ff; text-decoration: none;">
|
145
|
+
<img alt="instagram-logo" height="18" src="https://codedmails.com/images/social/black/instagram-logo-transparent-black.png" style="border-radius:3px;display:block;" width="18" />
|
146
|
+
</a>
|
147
|
+
</td>
|
148
|
+
</tr>
|
149
|
+
</tbody>
|
150
|
+
</table>
|
151
|
+
</td>
|
152
|
+
</tr>
|
153
|
+
</tbody>
|
154
|
+
</table>
|
155
|
+
</td>
|
156
|
+
</tr>
|
157
|
+
</table>
|
158
|
+
</td>
|
159
|
+
</tr>
|
160
|
+
</tbody>
|
161
|
+
</table>
|
162
|
+
</div>
|
163
|
+
</td>
|
164
|
+
</tr>
|
165
|
+
</table>
|
166
|
+
</td>
|
167
|
+
</tr>
|
168
|
+
</tbody>
|
169
|
+
</table>
|
170
|
+
</div>
|
171
|
+
</td>
|
172
|
+
</tr>
|
173
|
+
</table>
|