hr_lite 0.37.0 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab092169ccdae2360753c2535d7e3dba33f4fb661f05f8dabf96b7d4ea4bf91a
4
- data.tar.gz: '039d406ffda5c820c670b1b9d30171e06bd70d1f29f5b4dc77f41dde2ed86fd7'
3
+ metadata.gz: ea9e044a63897a04e8618db0d7fa06e03aeedcde075aa2b6e834218b09bd733b
4
+ data.tar.gz: 36ce528066177bf11df3fd65c6a7d62bb503e2f2ca6b8a545c05d128cbd6f2b1
5
5
  SHA512:
6
- metadata.gz: 30340a7e5e365e3a2a84d6e00701688c68a76550bfde6a778a19fc285282531a458a9f700c7639b1cc30d16d060ec604c4134e25cfb5b65bd7cb6a9701aaa701
7
- data.tar.gz: 97f9e43b39ffa62c388077bb00f89c54baa1ab1a286b0db8cf6b6c15313e5a1e2d5880449d82b82e7dc7babf5fd512721d34b80a2e40351b1648453b8e5bda06
6
+ metadata.gz: 31d918ddc7dc1ad19b6c4d77a9aed5cc3767842019963690478769d4accad9772f755890a529359674676d6dab696d92acc440b36dc920063bba754abf09ac68
7
+ data.tar.gz: f74714fb54fd581fd49d0de6e3b3e38ac911ced19f511dda075353e634563d4b289bb379bc4fdd08391e3312067ed1dbe73905afd8831f0422070ba4331b613d
data/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.37.1] - 2026-10-14
11
+
12
+ - A WFH request still waiting for HR now lets the person check in away from the office on that day (HR has 24 hours to decide). The day is flagged "WFH request pending HR approval: <reason>", and HR gets the flagged-punch alert with that reason. HR was already told when the request was raised. Rejected requests and requests for other dates are still refused.
13
+
10
14
  ## [0.37.0] - 2026-10-14
11
15
 
12
16
  - Home detection: a WFH check-in matches any approved home within 500 m, and the nearest one becomes active. From anywhere else the punch card asks "Is this your home location?". Yes saves the place as an approved, active home straight away (a GPS fix good to 500 m, fewer than three live homes, audit row `work_location.self_saved`). No checks in as Travelling. The question comes back at every check-in from a place that is not a home.
@@ -23,6 +23,7 @@ module HrLite
23
23
  STATUSES.each { |s| define_method("#{s}?") { status == s } }
24
24
 
25
25
  def self.approved_for(user_id, date) = approved.where(user_id: user_id).overlapping(date, date).first
26
+ def self.pending_for(user_id, date) = pending.where(user_id: user_id).overlapping(date, date).first
26
27
 
27
28
  # HR grants WFH outright: approved on creation, up to HR_MAX_DAYS long.
28
29
  def self.grant!(user_id:, by:, start_date:, end_date:, reason:)
@@ -67,6 +67,7 @@ module HrLite
67
67
  record.work_mode = @mode
68
68
  record.work_location_id = @location&.id
69
69
  record.wfh_request_id = @wfh&.id if @mode == "wfh"
70
+ record.add_flag!("WFH request pending HR approval: #{@wfh.reason}") if @wfh&.pending?
70
71
  when :check_out
71
72
  return Result.new(record: record, error: "Check in first.") if record.check_in_at.blank?
72
73
 
@@ -124,7 +125,8 @@ module HrLite
124
125
  return
125
126
  end
126
127
 
127
- @wfh = WfhRequest.approved_for(@user.id, Date.current)
128
+ # A request HR has not decided yet still lets the person work; the day is flagged for HR.
129
+ @wfh = WfhRequest.approved_for(@user.id, Date.current) || WfhRequest.pending_for(@user.id, Date.current)
128
130
  return OFF_SITE_MESSAGE unless @wfh || profile&.permanent_wfh
129
131
 
130
132
  @mode, @place = "wfh", "home"
@@ -6,7 +6,7 @@
6
6
 
7
7
  <section class="hrl-card">
8
8
  <h2 class="hrl-card__title">Request WFH</h2>
9
- <p class="hrl-small hrl-muted">Pick dates from today up to <%= HrLite::WfhRequest::MAX_DAYS_AHEAD %> days ahead. HR approves or rejects; only approved dates let you check in away from the office.</p>
9
+ <p class="hrl-small hrl-muted">Pick dates from today up to <%= HrLite::WfhRequest::MAX_DAYS_AHEAD %> days ahead. HR approves or rejects. While a request is waiting you can still check in away from the office; HR sees the reason. A rejected date cannot.</p>
10
10
  <%= form_with model: @request, url: hr_lite.wfh_requests_path, scope: :wfh_request, local: true do |f| %>
11
11
  <%= render "hr_lite/shared/form_errors", record: @request %>
12
12
  <% min, max = @window.first.iso8601, @window.last.iso8601 %>
@@ -1,3 +1,3 @@
1
1
  module HrLite
2
- VERSION = "0.37.0"
2
+ VERSION = "0.37.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hr_lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.0
4
+ version: 0.37.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kshitiz sinha