c80_shared 0.1.84 → 0.1.89

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c350acb1acfe2bb7060d94d485389cffa9094f896e592d3737b1b0548c021d3
4
- data.tar.gz: 65251cd254240e4c433a3da1a63dd5a9ba04e05e582d4627512cf677e77bd04a
3
+ metadata.gz: 302b70eb9a075299310a7cdf997ff1a25400c48e9650edb240bb4c915fc1add0
4
+ data.tar.gz: 35e696ea03564f3bab6a1d5b366937206c7937e2165a3245caff52c34fb79078
5
5
  SHA512:
6
- metadata.gz: 33c326147eb7fc1675dbd7a1a9ace65c363f94b5fca91b758c2fdd33c55c2cc18310a896b076ff25b20524cb4e6bdaa63391484ed9b1e609ca3e88401597ffdb
7
- data.tar.gz: 7dc082db68c5560341b0364f78973fe9250cd91f2873cc19bc3c8d9204561a61b169f79ffc71dadace2fba1d9f36f3867fb2e731f21ae5fa12a240d28c12a7a2
6
+ metadata.gz: 945626034ec455457efaa3e8bc7c460526d39d6c241dd3cced31f9f42076c9b93ead3826eb26f1b6498a27de63e94890c07a63fa023f8e7c475fe71995382563
7
+ data.tar.gz: 0a793903aa2eac4c0d00f52aad2b07dfa50b40ccd7101e6ac3c51bd02598110497aeec962678eb0612c030911d79757abad11099f3ef3aaadedf9cce9f2e268f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- c80_shared (0.1.84)
4
+ c80_shared (0.1.89)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,2 @@
1
+ build:
2
+ /bin/bash -c "/usr/share/rvm/bin/rvm ruby-2.3.7 do /usr/share/rvm/rubies/ruby-2.3.7/bin/ruby /usr/share/rvm/rubies/ruby-2.3.7/bin/gem build c80_shared.gemspec"
@@ -0,0 +1,12 @@
1
+ #https://makandracards.com/makandra/52455-rails-including-html-in-your-i18n-locales
2
+ #
3
+ module Dicts
4
+ module Lease
5
+ class OfferCancelation < ::Dict
6
+ FLEXIBLE = new 1, :flexible
7
+ STANDARD = new 2, :standard
8
+ STRICT = new 3, :strict
9
+ SUPER_STRICT = new 4, :super_strict
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ # при изменении данного списка необходимо соответственно изменить методы отрисовки кнопок в декораторе ::Lease::Bids::Client::Actions
2
+ module Dicts
3
+ class Operator < ::Dict
4
+ STRIPE = new 1, :stripe
5
+ PAYPAL = new 2, :paypal
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Dicts
2
+ class RequestInfoState < ::Dict
3
+ CREATED = new 1, :created
4
+ SUBMITTING = new 2, :submitting
5
+ SUCCESS = new 3, :success
6
+ end
7
+ end
@@ -0,0 +1,25 @@
1
+ module Accounts
2
+ class CentralAgentSerializer < AbstractSerializer
3
+ class << self
4
+ def available_attributes
5
+ %i[
6
+ email
7
+ phone
8
+ name
9
+ ]
10
+ end
11
+
12
+ def email(central_agent)
13
+ { email: central_agent.account.user.email }
14
+ end
15
+
16
+ def phone(central_agent)
17
+ { phone: central_agent.account.user.phone }
18
+ end
19
+
20
+ def name(central_agent)
21
+ { name: central_agent.account.user.name }
22
+ end
23
+ end
24
+ end
25
+ end
@@ -15,6 +15,9 @@ module Lease
15
15
  boat_id
16
16
  boat
17
17
  price
18
+ price_percent
19
+ cancellation_type
20
+ human_payment_prices
18
21
  currency
19
22
  state
20
23
  from
@@ -47,6 +50,7 @@ module Lease
47
50
  def boat(bid)
48
51
  boat = bid.boat
49
52
  boat_serialized = BoatSerializer.serialize boat, attributes: %i[
53
+ id
50
54
  name
51
55
  boat_length
52
56
  guests_total
@@ -72,6 +76,36 @@ module Lease
72
76
  { price: bid.price }
73
77
  end
74
78
 
79
+ def price_percent(bid)
80
+ { price_percent: bid.price_percent }
81
+ end
82
+
83
+ def cancellation_type(bid)
84
+ return { cancellation_type: nil } if bid.cancellation_type.nil?
85
+
86
+ ct = ::Dicts::Lease::OfferCancelation.find bid.cancellation_type
87
+
88
+ { cancellation_type: {
89
+ id: ct.id,
90
+ title: I18n.t('lease.offer_cancelation.%s.title' % ct.index),
91
+ short: I18n.t('lease.offer_cancelation.%s.short' % ct.index),
92
+ full_html: I18n.t('lease.offer_cancelation.%s.full_html' % ct.index)
93
+ }
94
+ }
95
+ end
96
+
97
+ def human_payment_prices(bid)
98
+ if bid.price.present? && bid.price_percent.present?
99
+ first_price = bid.price * bid.price_percent / 100
100
+ {
101
+ human_payment_prices: {
102
+ first_payment: num_to_cur(first_price, bid.currency, @opts[:locale]),
103
+ second_payment: num_to_cur((bid.price - first_price), bid.currency, @opts[:locale])
104
+ }
105
+ }
106
+ end
107
+ end
108
+
75
109
  def currency(bid)
76
110
  { currency: bid.currency }
77
111
  end
@@ -0,0 +1,64 @@
1
+ module Lease
2
+ class RequestInfoSerializer < ::AbstractSerializer
3
+ class << self
4
+ def serialize(model, attributes:, opts: {})
5
+ super
6
+ end
7
+
8
+ def available_attributes
9
+ %i[
10
+ id
11
+ uuid
12
+ operator
13
+ amount
14
+ currency
15
+ external_transaction_id
16
+ state
17
+ created_at
18
+ updated_at
19
+ ]
20
+ end
21
+
22
+ def id(request_info)
23
+ { id: request_info.id }
24
+ end
25
+
26
+ def uuid(request_info)
27
+ { uuid: request_info.uuid }
28
+ end
29
+
30
+ def operator(request_info)
31
+ {
32
+ operator: {
33
+ id: request_info.operator.id,
34
+ index: request_info.operator.type_index
35
+ }
36
+ }
37
+ end
38
+
39
+ def amount(request_info)
40
+ { amount: request_info.amount }
41
+ end
42
+
43
+ def currency(request_info)
44
+ { currency: request_info.currency }
45
+ end
46
+
47
+ def external_transaction_id(request_info)
48
+ { external_transaction_id: request_info.external_transaction_id }
49
+ end
50
+
51
+ def state(request_info)
52
+ { state: request_info.state }
53
+ end
54
+
55
+ def created_at(request_info)
56
+ { created_at: request_info.created_at }
57
+ end
58
+
59
+ def updated_at(request_info)
60
+ { updated_at: request_info.updated_at }
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,34 @@
1
+ en:
2
+ lease:
3
+ offer_cancelation:
4
+ :flexible:
5
+ title: Flexible
6
+ short: free cancellation up to 24 hours of trip start date
7
+ full_html: '<ul><li>Cancellations within 24 hours of trip start date are non-refundable;</li>
8
+ <li>Refund 100% of the rental price if cancelled more than 24 hours prior to commencement of the rental;</li>
9
+ <li>No refund at all of the rental price if cancelled within 24 hours of commencement of the rental.</li>
10
+ </ul>'
11
+ :standard:
12
+ title: Standard
13
+ short: no refund during cancellation less than 1 week prior to charter
14
+ full_html: '<ul>
15
+ <li>Refund 100% of the rental price if cancelled more than 7 days prior to commencement of the rental;</li>
16
+ <li>50% refund for cancellations within 2-6 days of trip star date;</li>
17
+ <li>Cancellations within 2 days of trip start date are non-refundable</li>
18
+ </ul>'
19
+
20
+ :strict:
21
+ title: Strict
22
+ short: free cancellation up to 30 days of the trip start date
23
+ full_html: '<ul>
24
+ <li>50% refund for cancellations within 14-30 days of trip start date;</li>
25
+ <li>Cancellations within 14 days of trip start date are non-refundable;</li>
26
+ </ul>'
27
+ :super_strict:
28
+ title: Super Strict
29
+ short: '&nbsp;'
30
+ full_html: '<ul>
31
+ <li>In case of cancellation between 3 to 2 months before embarkation, a cancellation fee of 30% will be kept;</li>
32
+ <li>In case of cancellation between 2 months to 40 days before embarkation, a cancellation fee of 50% will be kept;</li>
33
+ <li>In case of cancellation between 40 days and embarkation, total charter fee will be kept.</li>
34
+ </ul>'
@@ -0,0 +1,34 @@
1
+ ru:
2
+ lease:
3
+ offer_cancelation:
4
+ :flexible:
5
+ title: Flexible
6
+ short: free cancellation up to 24 hours of trip start date
7
+ full_html: '<ul><li>Cancellations within 24 hours of trip start date are non-refundable;</li>
8
+ <li>Refund 100% of the rental price if cancelled more than 24 hours prior to commencement of the rental;</li>
9
+ <li>No refund at all of the rental price if cancelled within 24 hours of commencement of the rental.</li>
10
+ </ul>'
11
+ :standard:
12
+ title: Standard
13
+ short: no refund during cancellation less than 1 week prior to charter
14
+ full_html: '<ul>
15
+ <li>Refund 100% of the rental price if cancelled more than 7 days prior to commencement of the rental;</li>
16
+ <li>50% refund for cancellations within 2-6 days of trip star date;</li>
17
+ <li>Cancellations within 2 days of trip start date are non-refundable</li>
18
+ </ul>'
19
+
20
+ :strict:
21
+ title: Strict
22
+ short: free cancellation up to 30 days of the trip start date
23
+ full_html: '<ul>
24
+ <li>50% refund for cancellations within 14-30 days of trip start date;</li>
25
+ <li>Cancellations within 14 days of trip start date are non-refundable;</li>
26
+ </ul>'
27
+ :super_strict:
28
+ title: Super Strict
29
+ short: '&nbsp;'
30
+ full_html: '<ul>
31
+ <li>In case of cancellation between 3 to 2 months before embarkation, a cancellation fee of 30% will be kept;</li>
32
+ <li>In case of cancellation between 2 months to 40 days before embarkation, a cancellation fee of 50% will be kept;</li>
33
+ <li>In case of cancellation between 40 days and embarkation, total charter fee will be kept.</li>
34
+ </ul>'
@@ -1,3 +1,3 @@
1
1
  module C80Shared
2
- VERSION = "0.1.84"
2
+ VERSION = "0.1.89"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c80_shared
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.84
4
+ version: 0.1.89
5
5
  platform: ruby
6
6
  authors:
7
7
  - C80609A
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-14 00:00:00.000000000 Z
11
+ date: 2020-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -49,6 +49,7 @@ files:
49
49
  - ".rubocop.yml"
50
50
  - Gemfile
51
51
  - Gemfile.lock
52
+ - Makefile
52
53
  - README.md
53
54
  - app/dicts/account_type.rb
54
55
  - app/dicts/boat_condition.rb
@@ -64,11 +65,14 @@ files:
64
65
  - app/dicts/exterior_color.rb
65
66
  - app/dicts/fuel_type.rb
66
67
  - app/dicts/hull_material.rb
68
+ - app/dicts/lease/offer_cancelation.rb
67
69
  - app/dicts/length.rb
68
70
  - app/dicts/locale.rb
69
71
  - app/dicts/motor.rb
72
+ - app/dicts/operators.rb
70
73
  - app/dicts/reject_type.rb
71
74
  - app/dicts/rent_skip_type.rb
75
+ - app/dicts/request_info_state.rb
72
76
  - app/dicts/role.rb
73
77
  - app/forms/application_form.rb
74
78
  - app/forms/rent_form.rb
@@ -87,6 +91,7 @@ files:
87
91
  - app/repositories/accounts/client_account_repository.rb
88
92
  - app/repositories/events/rejects_repository.rb
89
93
  - app/serializers/account_serializer.rb
94
+ - app/serializers/accounts/account_central_agent_serializer.rb
90
95
  - app/serializers/boat_location_serializer.rb
91
96
  - app/serializers/boat_price_serializer.rb
92
97
  - app/serializers/boat_sale_price_serializer.rb
@@ -100,6 +105,7 @@ files:
100
105
  - app/serializers/lease/bid_serializer.rb
101
106
  - app/serializers/lease/inquiry_serializer.rb
102
107
  - app/serializers/lease/rebate_serializer.rb
108
+ - app/serializers/lease/request_info_serializer.rb
103
109
  - app/serializers/lib/boats/dimensions.rb
104
110
  - app/serializers/lib/boats/rent_price_per_season.rb
105
111
  - app/serializers/lib/boats/sale_price.rb
@@ -139,6 +145,8 @@ files:
139
145
  - config/locales/dicts/length/ru.yml
140
146
  - config/locales/dicts/motor/en.yml
141
147
  - config/locales/dicts/motor/ru.yml
148
+ - config/locales/dicts/offer_cancelation/en.yml
149
+ - config/locales/dicts/offer_cancelation/ru.yml
142
150
  - config/locales/dicts/rental_type/en.yml
143
151
  - config/locales/dicts/rental_type/ru.yml
144
152
  - config/locales/lease/bid.en.yml