kirico 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/kirico.gemspec +1 -0
- data/lib/kirico.rb +1 -0
- data/lib/kirico/config/locales/en.yml +9 -0
- data/lib/kirico/config/locales/ja.yml +3 -3
- data/lib/kirico/csv_generator.rb +1 -0
- data/lib/kirico/models/application_record.rb +1 -0
- data/lib/kirico/models/base_company_count.rb +1 -0
- data/lib/kirico/models/base_fd_management_record.rb +1 -0
- data/lib/kirico/models/company.rb +5 -4
- data/lib/kirico/models/company_count.rb +1 -0
- data/lib/kirico/models/company_identifier.rb +1 -0
- data/lib/kirico/models/data_identifier.rb +1 -0
- data/lib/kirico/models/data_record22187041.rb +4 -3
- data/lib/kirico/models/data_record22257041.rb +6 -5
- data/lib/kirico/models/fd_management_record.rb +2 -1
- data/lib/kirico/models/form.rb +2 -1
- data/lib/kirico/models/helper.rb +1 -0
- data/lib/kirico/models/sr_company_count.rb +2 -1
- data/lib/kirico/models/sr_fd_management_record.rb +1 -0
- data/lib/kirico/validators/charset_validator.rb +1 -0
- data/lib/kirico/validators/sjis_bytesize_validator.rb +3 -2
- data/lib/kirico/validators/space_divider_validator.rb +1 -0
- data/lib/kirico/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b032116ad8c9f2d4855e50dd82fd02660f8dfce3
|
4
|
+
data.tar.gz: 40cbf3b7fe3232fb3a505b4029f004b06d211abd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 800ba09cda1c0b96563bee84256087597ec6e7ae733d903f34c857f40a45deb374d39dc4e63a4b70e4abcaa29b5f3733ee0da8af0002bb78c0bf7156a29648eb
|
7
|
+
data.tar.gz: 1fbae68e0d12f7fd80024df54bd341c7f77815e38afb0498ca6d4131883a34e7236141309c0009f4fdc3516ddab217e65334fc5aaf28458fbc82bbb1dd0d4a38
|
data/README.md
CHANGED
@@ -218,7 +218,7 @@ Copyright (c) 2017 Kensuke NAITO and SmartHR, Inc.
|
|
218
218
|
|
219
219
|
# SmartHR について
|
220
220
|
|
221
|
-
|
221
|
+
<img src="https://user-images.githubusercontent.com/2214179/30309095-3fb58b08-97c4-11e7-939b-b4b97414bb1d.png" width="300">
|
222
222
|
|
223
223
|
kirico は株式会社 SmartHR によってメンテナンス、開発が行われています。
|
224
224
|
わたしたちは OSS の力を信じています。
|
data/kirico.gemspec
CHANGED
data/lib/kirico.rb
CHANGED
@@ -4,6 +4,15 @@ en:
|
|
4
4
|
messages:
|
5
5
|
invalid_charset: "has invalid character(s): %{error_chars}"
|
6
6
|
invalid_space_divider: "must be dividied by %{space_type}"
|
7
|
+
too_long_in_bytes:
|
8
|
+
one: is too long (maximum is 1 byte)
|
9
|
+
other: is too long (maximum is %{count} bytes)
|
10
|
+
too_short_in_bytes:
|
11
|
+
one: is too short (minimum is 1 byte)
|
12
|
+
other: is too short (minimum is %{count} bytes)
|
13
|
+
wrong_length_in_bytes:
|
14
|
+
one: is the wrong length (should be 1 byte)
|
15
|
+
other: is the wrong length (should be %{count} bytes)
|
7
16
|
invalid_date: "is not a valid date"
|
8
17
|
invalid_time: "is not a valid time"
|
9
18
|
invalid_datetime: "is not a valid datetime"
|
@@ -4,9 +4,9 @@ ja:
|
|
4
4
|
messages:
|
5
5
|
invalid_charset: "に利用できない文字が入力されています。%{error_chars}"
|
6
6
|
invalid_space_divider: "は%{space_type}で区切ってください。"
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
too_long_in_bytes: は%{count}バイト以内で入力してください。
|
8
|
+
too_short_in_bytes: は%{count}バイト以上で入力してください。
|
9
|
+
wrong_length_in_bytes: は%{count}バイトで入力してください。
|
10
10
|
invalid_date: "は正しい形式で入力してください。"
|
11
11
|
invalid_time: "は正しい形式で入力してください。"
|
12
12
|
invalid_datetime: "は正しい形式で入力してください。"
|
data/lib/kirico/csv_generator.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'virtus'
|
3
4
|
require 'active_model'
|
4
5
|
|
@@ -18,14 +19,14 @@ module Kirico
|
|
18
19
|
attribute :tel_number, String
|
19
20
|
|
20
21
|
validates :area_code, charset: { accept: [:numeric] }, sjis_bytesize: { is: 2 }
|
21
|
-
validates :office_code, charset: { accept:
|
22
|
+
validates :office_code, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..4 }
|
22
23
|
validates :office_number, charset: { accept: [:numeric] }, sjis_bytesize: { in: 1..5 }
|
23
24
|
validates :zip_code1, charset: { accept: [:numeric] }, sjis_bytesize: { is: 3 }
|
24
25
|
validates :zip_code2, charset: { accept: [:numeric] }, sjis_bytesize: { is: 4 }
|
25
26
|
validates :address, charset: { accept: [:all] }, sjis_bytesize: { in: 1..75 }
|
26
|
-
validates :name, charset: { accept:
|
27
|
-
validates :owner_name, charset: { accept:
|
28
|
-
validates :tel_number, charset: { accept:
|
27
|
+
validates :name, charset: { accept: %i(katakana kanji) }, sjis_bytesize: { in: 1..50 }
|
28
|
+
validates :owner_name, charset: { accept: %i(katakana kanji) }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :both_width }
|
29
|
+
validates :tel_number, charset: { accept: %i(latin numeric) }, sjis_bytesize: { in: 1..12 }
|
29
30
|
|
30
31
|
def initialize
|
31
32
|
yield(self) if block_given?
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# 住所変更届データレコード
|
3
4
|
module Kirico
|
4
5
|
class DataRecord22187041 < ApplicationRecord
|
@@ -22,18 +23,18 @@ module Kirico
|
|
22
23
|
attribute :memo, String
|
23
24
|
|
24
25
|
validates :area_code, charset: { accept: [:numeric] }, sjis_bytesize: { is: 2 }
|
25
|
-
validates :office_code, charset: { accept:
|
26
|
+
validates :office_code, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..4 }
|
26
27
|
validates :ip_code, charset: { accept: [:numeric] }, sjis_bytesize: { in: 1..6 }
|
27
28
|
validates :basic_pension_number1, charset: { accept: [:numeric] }, sjis_bytesize: { is: 4 }, allow_blank: true
|
28
29
|
validates :basic_pension_number2, charset: { accept: [:numeric] }, sjis_bytesize: { is: 6 }, allow_blank: true
|
29
30
|
validates :zip_code1, charset: { accept: [:numeric] }, sjis_bytesize: { is: 3 }
|
30
31
|
validates :zip_code2, charset: { accept: [:numeric] }, sjis_bytesize: { is: 4 }
|
31
|
-
validates :new_address_yomi, charset: { accept:
|
32
|
+
validates :new_address_yomi, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..75 }
|
32
33
|
validates :new_address, charset: { accept: [:all] }, sjis_bytesize: { in: 0..74 }, allow_blank: true
|
33
34
|
validates :updated_at, timeliness: { on_or_before: :today, type: :date }
|
34
35
|
validates :ip_name_yomi, charset: { accept: [:katakana] }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :half_width }
|
35
36
|
validates :ip_name, charset: { accept: [:all] }, sjis_bytesize: { in: 0..24 }, allow_blank: true, space_divider: { space: :full_width }
|
36
|
-
validates :old_address_yomi, charset: { accept:
|
37
|
+
validates :old_address_yomi, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..75 }
|
37
38
|
validates :old_address, charset: { accept: [:all] }, sjis_bytesize: { in: 0..74 }, allow_blank: true
|
38
39
|
validates :memo, charset: { accept: [:all] }, sjis_bytesize: { in: 0..75 }, allow_blank: true
|
39
40
|
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# 算定基礎届データレコード
|
3
4
|
module Kirico
|
4
5
|
class DataRecord22257041 < ApplicationRecord
|
5
6
|
DOC_CODE = '22257041'
|
6
|
-
COVERED_MONTHS =
|
7
|
+
COVERED_MONTHS = %i(apr may jun).freeze
|
7
8
|
|
8
9
|
attribute :area_code, String
|
9
10
|
attribute :office_code, String
|
@@ -36,12 +37,12 @@ module Kirico
|
|
36
37
|
define_in_k_method :old_monthly_standard_income_hel_ins, :old_monthly_standard_income_pns_ins
|
37
38
|
|
38
39
|
validates :area_code, charset: { accept: [:numeric] }, sjis_bytesize: { is: 2 }
|
39
|
-
validates :office_code, charset: { accept:
|
40
|
+
validates :office_code, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..4 }
|
40
41
|
validates :ip_code, charset: { accept: [:numeric] }, sjis_bytesize: { in: 1..6 }
|
41
42
|
validates :applied_at, timeliness: { on_or_after: -> { Date.new(1989, 1, 8) }, type: :date }
|
42
43
|
validates :ip_name_yomi, charset: { accept: [:katakana] }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :half_width }
|
43
44
|
validates :ip_name, charset: { accept: [:all] }, sjis_bytesize: { in: 0..24 }, allow_blank: true, space_divider: { space: :full_width }
|
44
|
-
validates :gender_type, inclusion: { in:
|
45
|
+
validates :gender_type, inclusion: { in: %i(gender_type_1 gender_type_2 gender_type_3 gender_type_5 gender_type_6 gender_type_7) }
|
45
46
|
validates :old_monthly_standard_income_hel_ins, numericality: { greater_than_or_equal_to: 1_000, less_than_or_equal_to: 9_999_999 }, allow_blank: true
|
46
47
|
validates :old_monthly_standard_income_pns_ins, numericality: { greater_than_or_equal_to: 1_000, less_than_or_equal_to: 9_999_999 }, allow_blank: true
|
47
48
|
validates :old_applied_at, timeliness: { on_or_after: -> { Date.new(1989, 1, 8) }, type: :date }
|
@@ -53,9 +54,9 @@ module Kirico
|
|
53
54
|
validates "#{month}_income_goods", numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 9_999_999 }
|
54
55
|
end
|
55
56
|
validates :avg_adjustment, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 9_999_999 }, allow_blank: true
|
56
|
-
validates :ip_type, inclusion: { in:
|
57
|
+
validates :ip_type, inclusion: { in: %i(ip_type_0 ip_type_1 ip_type_2) }
|
57
58
|
validates :retroacted_payment, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 9_999_999 }, allow_blank: true
|
58
|
-
validates :income_updated_type, inclusion: { in:
|
59
|
+
validates :income_updated_type, inclusion: { in: %i(income_updated_type_0 income_updated_type_1) }, allow_blank: true
|
59
60
|
validates :income_diff_amount, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 9_999_999 }, allow_blank: true
|
60
61
|
validates :income_updated_at, timeliness: { on_or_after: -> { Date.new(1989, 1, 8) }, type: :date }, allow_blank: true
|
61
62
|
validates :memo, charset: { accept: [:all] }, sjis_bytesize: { in: 0..75 }, allow_blank: true
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'kirico/models/base_fd_management_record'
|
3
4
|
|
4
5
|
module Kirico
|
@@ -7,7 +8,7 @@ module Kirico
|
|
7
8
|
attribute :office_code, String
|
8
9
|
|
9
10
|
validates :area_code, charset: { accept: [:numeric] }, sjis_bytesize: { is: 2 }
|
10
|
-
validates :office_code, charset: { accept:
|
11
|
+
validates :office_code, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..4 }
|
11
12
|
|
12
13
|
def to_csv
|
13
14
|
[
|
data/lib/kirico/models/form.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'virtus'
|
3
4
|
require 'active_model'
|
4
5
|
|
@@ -40,7 +41,7 @@ module Kirico
|
|
40
41
|
|
41
42
|
# 子のエラーを自身のエラーとして設定する
|
42
43
|
def validate_children
|
43
|
-
|
44
|
+
%i(fd company company_count).each do |attribute|
|
44
45
|
rec = send(attribute)
|
45
46
|
next if rec.nil? || rec.valid?
|
46
47
|
rec.errors.full_messages.each do |msg|
|
data/lib/kirico/models/helper.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'kirico/models/base_company_count'
|
3
4
|
|
4
5
|
# 社会保険労務士: 事業所数情報
|
@@ -8,7 +9,7 @@ module Kirico
|
|
8
9
|
|
9
10
|
attribute :name, String
|
10
11
|
|
11
|
-
validates :name, charset: { accept:
|
12
|
+
validates :name, charset: { accept: %i(katakana kanji) }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :both_width }
|
12
13
|
|
13
14
|
def to_csv
|
14
15
|
[name, COUNT].map { |attr| attr.to_s.encode('CP932') }.join(',')
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'active_model'
|
3
4
|
require 'active_model/validator'
|
4
5
|
|
@@ -11,10 +12,10 @@ require 'active_model/validator'
|
|
11
12
|
# 参考: https://github.com/rails/rails/blob/fe1f4b2ad56f010a4e9b93d547d63a15953d9dc2/activemodel/lib/active_model/validations/length.rb
|
12
13
|
module Kirico
|
13
14
|
class SjisBytesizeValidator < ActiveModel::EachValidator
|
14
|
-
MESSAGES = { is: :
|
15
|
+
MESSAGES = { is: :wrong_length_in_bytes, minimum: :too_short_in_bytes, maximum: :too_long_in_bytes }.freeze
|
15
16
|
CHECKS = { is: :==, minimum: :>=, maximum: :<= }.freeze
|
16
17
|
|
17
|
-
RESERVED_OPTIONS =
|
18
|
+
RESERVED_OPTIONS = %i(minimum maximum within is too_short too_long)
|
18
19
|
|
19
20
|
def initialize(options)
|
20
21
|
range = (options.delete(:in) || options.delete(:within))
|
data/lib/kirico/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kirico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kakipo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|