Files
hats-app/app/privacy-policy/page.tsx
T
Ichsan Kurniawan ef06bed081 Add privacy policy and terms pages
Replace placeholder pages with detailed legal documents covering data handling, Google Calendar use, user rights, and service terms. Add a shared legal page layout and metadata, plus Google site verification.
2026-11-19 10:39:26 +07:00

290 lines
12 KiB
TypeScript

import type { Metadata } from 'next';
import { A, DataTable, LegalLayout, LegalSection, UL } from '@/components/legal/LegalLayout';
import { LEGAL } from '@/lib/legal';
export const metadata: Metadata = {
title: `Privacy Policy | ${LEGAL.shortName}`,
description: `How ${LEGAL.appName} collects, uses, stores and protects personal data, including data from Google Calendar.`,
};
const sections: LegalSection[] = [
{
id: 'about',
title: 'Who we are and what this covers',
body: (
<>
<p>
{LEGAL.appName} ({LEGAL.shortName}) is a workplace web application at{' '}
<A href={LEGAL.siteUrl}>{LEGAL.siteUrl}</A>. It is operated by {LEGAL.operator} and used by employees and
administrators for attendance, task and project assignment, leave and permit requests, and approvals.
</p>
<p>
This policy explains what personal data {LEGAL.shortName} handles, why, who can see it, how long it is kept,
and the choices you have. It applies to the {LEGAL.shortName} website, the installable web app (PWA) and
its integration with Google Calendar.
</p>
</>
),
},
{
id: 'data-we-collect',
title: 'Data we collect',
body: (
<>
<p>We only collect data needed to run the features you use.</p>
<DataTable
head={['Category', 'What it includes', 'Why we need it']}
rows={[
[
'Account',
'Name, work email, password (stored by our backend in protected form), role, division, area, employee position and type.',
'To sign you in and decide what you are allowed to see and do.',
],
[
'Attendance',
'Check-in and check-out time, GPS coordinates at that moment, a photo taken with your device camera, work status (for example office or remote), and device details.',
'To record working hours and let managers verify attendance.',
],
[
'Leave, permit and sick requests',
'Request type, dates, reason, supporting attachments, signature, and approval decisions.',
'To process requests and produce the request documents (PDF).',
],
[
'Tasks and projects',
'Task titles, descriptions, due dates, status, assignees, client and project names.',
'To plan and track work assigned to you or your team.',
],
[
'Notifications',
'A push notification token from Firebase Cloud Messaging for your browser or device.',
'To deliver reminders and approval alerts you have allowed.',
],
[
'Usage and security logs',
'Sign-in events, audit trail entries (who changed what and when), IP address, browser type and error logs.',
'To keep the service secure, investigate problems and keep an audit record.',
],
]}
/>
<p>
Camera and location are requested through your browser. They are only used when you open an attendance
screen, and you can refuse the permission. Without them, attendance that requires a photo or location
cannot be submitted.
</p>
</>
),
},
{
id: 'google-data',
title: 'Google user data and Google Calendar',
body: (
<>
<p>
{LEGAL.shortName} connects to the <strong>Google Calendar API</strong> to show and manage work schedules and
task due dates on a Google Calendar owned by the organisation. This section describes exactly what is
accessed and how it is used.
</p>
<p>
<strong>How access works.</strong> Employees sign in to {LEGAL.shortName} with their work email and
password, not with Google. The Calendar connection is made once by an administrator, using an
organisation-managed Google account that authorises {LEGAL.shortName} through Google OAuth 2.0. The resulting
refresh token is kept on our server as a protected configuration value. It is never sent to your browser.
{LEGAL.shortName} does not read the personal calendar, email, contacts or Drive files of employees.
</p>
<p>The scopes requested, and why:</p>
<DataTable
head={['Scope', 'What it allows', 'How H.A.T.s uses it']}
rows={[
[
<code key="a" className="break-all text-[13px]">https://www.googleapis.com/auth/calendar</code>,
'See, create, edit and delete calendars and their events.',
'Reads the shared work calendar so schedules appear in the app, and manages that calendar when authorised users publish or change work items.',
],
[
<code key="b" className="break-all text-[13px]">https://www.googleapis.com/auth/calendar.events</code>,
'See, create, edit and delete events on calendars.',
'Creates, updates and removes events and due dates when a user adds, edits or deletes a schedule or task, and optionally adds a Google Meet link and guest emails.',
],
]}
/>
<p>The Google data involved is limited to:</p>
<UL>
<li>Event title, description, location, start and end time, all-day flag and colour.</li>
<li>Guest email addresses on an event, and Google Meet or event links.</li>
<li>The creator email and created or updated timestamps of an event.</li>
</UL>
<p>
<strong>Use and storage.</strong> Calendar data is requested from Google when a page needs it and is
displayed to authorised users. {LEGAL.shortName} does not build a separate copy of calendar content for any
other purpose. Items that users create inside {LEGAL.shortName} are saved in our own database as well as in
the calendar.
</p>
<p>
<strong>Limited Use.</strong> {LEGAL.shortName}&apos;s use and transfer of information received from Google
APIs to any other app adheres to the{' '}
<A href="https://developers.google.com/terms/api-services-user-data-policy">
Google API Services User Data Policy
</A>
, including the Limited Use requirements. In particular:
</p>
<UL>
<li>We use Google data only to provide and improve the user-facing calendar and task features described here.</li>
<li>We do not sell Google data and do not transfer it to third parties, except where needed to provide these features, to follow the law, or to protect the security of the service.</li>
<li>We do not use Google data for advertising, including retargeting or interest-based ads.</li>
<li>We do not use Google data to develop, improve or train generalised AI or machine learning models.</li>
<li>Our staff do not read Google data unless an administrator gives permission for a specific support case, it is needed for security or abuse investigation, or the law requires it.</li>
</UL>
<p>
<strong>Revoking access.</strong> The administrator of the connected Google account can remove{' '}
{LEGAL.shortName} at any time at{' '}
<A href="https://myaccount.google.com/permissions">myaccount.google.com/permissions</A>. After that, the
calendar features stop working and Google data is no longer fetched. To ask us to delete items created by
the integration, contact us using the details in section 11.
</p>
</>
),
},
{
id: 'how-we-use',
title: 'How we use data',
body: (
<UL>
<li>Authenticate you and enforce role-based access.</li>
<li>Record, display and report attendance, leave, permits and approvals.</li>
<li>Assign, schedule and track tasks and projects, including syncing them with Google Calendar.</li>
<li>Send notifications you have enabled.</li>
<li>Protect the service, detect misuse such as falsified location or photos, and keep an audit trail.</li>
<li>Fix bugs and keep the application working.</li>
</UL>
),
},
{
id: 'sharing',
title: 'Who can see your data and who we share it with',
body: (
<>
<p>
<strong>Inside your organisation.</strong> Your managers, HR and administrators can see attendance, leave and
task data that their role permits. Colleagues see only what the features they use expose, such as shared
calendar entries.
</p>
<p>
<strong>Service providers.</strong> We rely on a small set of providers to run the service:
</p>
<UL>
<li><strong>Google</strong> for the Calendar API (section 3) and Firebase Cloud Messaging for push notifications.</li>
<li><strong>Our hosting provider</strong> for the server and database that run {LEGAL.shortName}.</li>
</UL>
<p>
We do not sell personal data and we do not share it for advertising. We may disclose data when the law or a
valid legal request requires it.
</p>
</>
),
},
{
id: 'cookies',
title: 'Cookies and local storage',
body: (
<>
<p>{LEGAL.shortName} uses only what it needs to work:</p>
<UL>
<li>A secure session cookie that keeps you signed in.</li>
<li>Local storage for your theme choice (light, dark or system).</li>
<li>A service worker and cache so the installed web app can load and show an offline page.</li>
</UL>
<p>We do not use advertising or cross-site tracking cookies.</p>
</>
),
},
{
id: 'retention',
title: 'How long we keep data',
body: (
<>
<p>
Attendance, leave and audit records are kept while your account is active and for as long as your organisation
needs them for payroll, labour and audit obligations. After that they are deleted or anonymised.
</p>
<p>
When an account is deactivated, access ends right away. Data tied to it is removed or anonymised on request,
unless a record must be kept by law or for an open dispute. Push tokens are removed when you sign out or
revoke notification permission. Server logs are kept only as long as needed for security and debugging.
</p>
</>
),
},
{
id: 'security',
title: 'How we protect data',
body: (
<UL>
<li>Traffic between your device and {LEGAL.shortName} is encrypted with HTTPS.</li>
<li>Role-based access control limits each user to the data their job needs.</li>
<li>Google OAuth tokens and API credentials are held on the server as protected configuration, not in the browser or the source code shared with users.</li>
<li>Changes to important records are written to an audit trail.</li>
</UL>
),
},
{
id: 'your-rights',
title: 'Your rights and choices',
body: (
<>
<p>You can ask us to:</p>
<UL>
<li>Give you a copy of the personal data we hold about you.</li>
<li>Correct data that is wrong or out of date.</li>
<li>Delete your data, where we are not required to keep it.</li>
<li>Stop optional processing, for example by turning off notifications in your browser settings.</li>
</UL>
<p>
Some changes, such as editing a submitted attendance record, may need approval from your administrator
because the organisation relies on it as a record. Where Indonesian data protection law (Law No. 27 of 2022
on Personal Data Protection) applies, you hold the rights it provides.
</p>
</>
),
},
{
id: 'children',
title: 'Children',
body: (
<p>
{LEGAL.shortName} is a workplace tool for employees and is not directed to children under 17. We do not knowingly
collect data from children. If you believe a child&apos;s data was submitted, contact us and we will delete it.
</p>
),
},
{
id: 'contact',
title: 'Contact and changes to this policy',
body: (
<>
<p>
For privacy questions, access or deletion requests, or Google data concerns, email{' '}
<A href={`mailto:${LEGAL.contactEmail}`}>{LEGAL.contactEmail}</A>. We aim to reply within 14 days.
</p>
<p>
If we change this policy, we will update the date at the top of this page. For material changes, including
any new Google scope, we will tell users inside the app before the change takes effect. See also our{' '}
<A href="/terms">Terms of Service</A>.
</p>
</>
),
},
];
export default function PrivacyPolicyPage() {
return (
<LegalLayout
current="privacy-policy"
title="Privacy Policy"
summary={`This page explains what ${LEGAL.shortName} collects, why, who can see it and how to control it. Section 3 covers our use of Google Calendar data in full.`}
sections={sections}
/>
);
}