Skip to content

Working calendars on the platform: working days, holidays and make-up workdays that deadlines, escalations and schedules count against #35340

Done
4 of 4 issues completed

Description

@os-warren

③ maintainer-directed task · Source: maintainer — 「先立卡,不需要fable,我会用新的agent账户接着评审」「立 objectstack 卡就可以」 (2026-11-19T05:33Z, planning thread on marketplace suites), answering the proposal that working calendars belong at the platform layer.

维护者速读

  • 问题: 平台没有工作日历。审批超时、服务时效、交期都按自然小时算,周末和节假日也算在内;国内的调休补班更没法表达。
  • 要做: 平台提供工作日历,包括工作日、工作时段、节假日和调休,可以按组织、地区或工厂各设一份。审批、服务时效和日期公式都按它计算。
  • 不做会怎样: CRM 的服务时效、SRM 的交期、生产排产各算各的,客户看到的到期时间互相矛盾。
  • 你要做的: 无。待评审账户给出设计意见后再定。这张卡等于解冻以前搁置的「工作时间」那半边。

Business reason

Who benefits: every suite with a deadline, and their users who expect "due in 2 working days" to skip the weekend and the National Day week.

China adds a twist a fixed weekly pattern can't express: 调休 make-up working Saturdays and Sundays around public holidays.

If this isn't done, each suite computes due dates its own way. The same request then shows different due times in different apps.

History (read)

The business-hours capability is the parked B-half of #13655 (ruling 2026-08-31, record 5478756633, cited from #13801; #13655 itself returns 404 to this session).

Questions for the review (not prescriptions)

  1. Shape. Working week and hours, holidays, date-specific overrides (调休 working days, plant shutdowns). Assigned per organization, business unit, region or plant, with a default. Time zone from the existing iana_time_zone domain.
  2. Holiday data. Shipped yearly sets per country (who maintains CN's yearly 调休 list?), or org-entered only, or imported?
  3. First consumers (ADR-0049, enforce-or-remove). Candidates:
    • approval escalation (a business-time clock beside wall-clock);
    • formula and date functions (addWorkingDays, workingDaysBetween);
    • SLA due-date computation for hooks and flows;
    • date macros in filters.
      A calendar nobody reads is inert.
  4. Clock declaration. With two clocks, Make the wall-clock unit un-misreadable in authored duration declarations — the ruled A-half of the business-hours question (#13655) #13801's finding reverses: a clock marker on duration-shaped keys becomes readable. Which keys get it, and what is the default?
  5. Boundaries. Shift rostering (HR) and finite-capacity scheduling (production) are suite work on top of this, not platform.

Non-goals

Shift rostering, capacity planning, payroll calendars, fiscal periods (the ERP owns the books).

Reader

  1. The maintainer's reviewing agent account reads this first and writes the design opinion; per the maintainer, no fable pass on this card.
  2. After his decision, the automation/data seat implements.
  3. hotcrm (case SLA), hotsrm and the production suite adopt.

Prior rulings read

business hours, holiday, working calendar, wall-clock → #13655 B-half frozen (named-external-user unfreeze), #13801 A-half closed completed with in-seat ruling 5506987580, #14483 (skills wall-clock clause, closed). Also #35328 (ruled A, 2026-11-19).

Dedupe

  • "business hours" → 14, all closed.
  • "business-hours" → 14, all closed.
  • "working calendar" OR "work calendar" → 19, all closed.
  • holiday → 14, all closed.

No open card covers the capability.

Grade

area:workflow · Feature · maintainer-sourced (not table-graded) · reach: approval escalation counts wall-clock (read, approval.zod.ts:865-872), hotcrm SLA matrix wall-clock · evidence: read → p3 pending the review; the maintainer may regrade.


Generated by Claude Code

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. added
    area:workflow
    on Nov 19, 2026
  2. os-bill commented on Nov 19, 2026

    @os-bill
    Collaborator

    Maintainer ruling (Bill, 2026-11-19 05:47Z): 「同意 p1」

    Bill approved the design below and regraded this card to p1.

    Unfreeze. #13655 B-half was frozen with a "named external user" condition. The pull now comes from our own suites (hotcrm case SLA, hotsrm delivery dates, production). The maintainer's approval counts as unfreezing on that basis. The other #13655 constraint still holds: the calendar never ships without its formula surface, so they land in the same release.

    Design.

    1. Data model. Calendars are org-editable runtime data, not package metadata. Two objects: sys_work_calendar (weekly pattern, HH:mm working periods, required timezone from the iana_time_zone domain, is_default) and sys_work_calendar_exception (dated off/on overrides, one table for holidays, 调休 make-up workdays and plant shutdowns). Packages reference a calendar by code and may ship seed rows. Precedent: sys_exchange_rate (ADR-0144). One calendar service resolves and computes.
    2. Which calendar. First cut: explicit code at the consumer → org default → refuse. Never fall back silently to wall-clock. Business-unit inheritance is later work (sys_business_unit.timezone has no reader today; another unread inherited column would be inert under ADR-0049). Region/plant are mapped to codes by suites.
    3. Holiday data. First cut: org-entered plus import. Later: a CN holidays/调休 data package in the marketplace, not in platform core. A calendar records "maintained through" a date; computing past it warns or refuses.
    4. First consumers (ADR-0049). Formula functions (addWorkingDays, workingDaysBetween, addWorkingHours) and the approval escalation business-time clock, same release, separate cards.
    5. Clock key. escalation.clock: 'wall_clock' | 'working_time' plus optional calendar code. Default stays wall_clock: the sweep reads stored snapshots (packages/plugins/plugin-approvals/src/approval-service.ts ~8055), so flipping the default would move existing deadlines. Only timeoutHours gets it now; other duration keys one card each. Rewrite the describe text at packages/spec/src/automation/approval.zod.ts:863-872.
    6. Pushdown. Working-day functions evaluate in memory only; pushdown refuses them (as cel-to-filter refuses all function calls today), with a lint. To filter on due time, compute it at write time into a datetime column and compare with {now}. No SQL-side calendar math.
    7. Time zone and periods. Calendar timezone is required, prefilled from the org's effective time zone. First cut refuses periods crossing midnight; night-shift attribution is rostering, out of scope.

    Slices (in order). ADR → objects + service + Setup page → formula functions → approval clock key (last three in one release) → acceptance on the hotcrm case SLA matrix. Later: CN holiday data package, business-unit inheritance, date macros in filters, gantt reading the platform calendar.

    Also found. The gantt view carries its own skipWeekends / holidays (ui/packages/types/src/zod/objectql.zod.ts:2956-2957), a second source of truth. Follow-up: switch it to the platform calendar.

    Non-goals. Shift rostering, finite-capacity scheduling, payroll calendars, fiscal periods, per-country holidays in core, a clock key on every duration key, flipping the default clock.


    Generated by Claude Code

  3. added
    priority:p1
    and removed on Nov 19, 2026
  4. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: parent of the working-calendar children (#35354, #35355, #35357…); rationale: area:workflow · Feature · maintainer-directed. tracking is added so the parent is not dispatched; the grade stands as set.

  5. added
    tracking
    on Nov 19, 2026
  6. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

    Close-out · 2026-11-24T10:32Z · completed

    The platform half of the working-calendar design (ruling 7000950747, 「同意 p1」) is delivered: its four slices are closed as completed — #35354 (ADR), #35355 (sys_work_calendar objects, calendar service and Setup page), #35356 (formula functions addWorkingDays / workingDaysBetween / …) and #35357 (approval escalation clock key). Sub-issue summary reads 4 of 4 completed.

    What remains is not this repository's: the ruling's last slice, acceptance on the hotcrm case SLA matrix, and adoption by hotsrm and the production suite belong to those suites' own repos. The ruling's "later" items (a CN holiday data package, business-unit inheritance, date macros in filters, gantt reading the platform calendar) were named as later work with no card owed now; each is filed when it gets a pull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workflowpriority:p1tracking

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions