# Task D.7.3 – CSV Template Generator Static Template Pack

## Objective

Generate a complete static CSV template pack for ALLA OS Initial Setup.

The templates will become the official data contract for future CSV Preview (D.7.4) and CSV Import (D.7.5).

This task only creates template files and supporting metadata.

Do NOT implement CSV parsing, validation, import logic, seed execution, reset logic, or setup persistence.

---

## Review Before Implementation

Read and follow:

- AGENTS.md
- plans/task-d.7.md
- plans/task-d.7.1.md
- plans/task-d.7.2.md
- docs/setup/seed-matrix.md
- docs/setup/csv-template-spec.md
- docs/setup/import-mapping.md
- docs/setup/setup-wizard-blueprint.md

Do not invent new columns.

CSV headers must exactly match csv-template-spec.md.

---

## Scope

Create folder

setup/templates/

Generate the following files

organizations.csv

users.csv

memberships.csv

crm-role-assignments.csv

master-options.csv

branches.csv

product-types.csv

document-sequences.csv

approval-workflows.csv

approval-steps.csv

approval-matrix.csv

customers.csv

contacts.csv

contact-shares.csv

leads.csv

opportunities.csv

opportunity-parties.csv

quotations.csv

quotation-items.csv

quotation-parties.csv

quotation-topics.csv

quotation-topic-items.csv

---

## CSV Rules

Every CSV must contain

1 Header row

1 Safe sample row

UTF-8 encoding

Comma delimiter

LF line ending

No BOM if current repository standard already avoids BOM

No blank columns

No undocumented columns

No formulas

No secrets

No production data

No binary references

---

## Sample Data Convention

Use one consistent sample dataset.

Organization

ALLA

Branch

head_office

Product Type

crane

Currency

THB

Administrator

admin@example.com

Marketing

mk.uat@example.com

Sales

sales.uat@example.com

Manager

manager.uat@example.com

CEO

ceo.uat@example.com

Customer

CUS-001

Lead

LD-001

Opportunity

OP-001

Quotation

QT-HO-CR-2607-001

---

## Header Rules

Headers must exactly match

docs/setup/csv-template-spec.md

Do not

rename

reorder

remove

or add columns.

---

## CSV Safety

Passwords

Use placeholder only.

Example

ChangeMe123!

Never include

real password

API key

secret

JWT

SMTP credential

storage credential

real customer

real phone

real tax id

---

## Unsupported Templates

Do NOT create

departments.csv

teams.csv

warehouses.csv

sites.csv

services.csv

price-books.csv

tax-rates.csv

attachments.csv

email-settings.csv

Keep these documented only.

---

## README

Create

setup/templates/README.md

Document

Purpose

Supported Templates

Unsupported Templates

Import Order

Relationship Rules

Sample Dataset

Placeholder Rules

Future D.7.4 Preview Flow

---

## Import Order

Document import order.

Example

01 users.csv

02 organizations.csv

03 memberships.csv

04 crm-role-assignments.csv

05 master-options.csv

06 branches.csv

07 product-types.csv

08 document-sequences.csv

09 approval-workflows.csv

10 approval-steps.csv

11 approval-matrix.csv

12 customers.csv

13 contacts.csv

14 contact-shares.csv

15 leads.csv

16 opportunities.csv

17 opportunity-parties.csv

18 quotations.csv

19 quotation-items.csv

20 quotation-parties.csv

21 quotation-topics.csv

22 quotation-topic-items.csv

Import order must match

docs/setup/seed-matrix.md

---

## Optional Metadata

Create

setup/templates/templates.json

Structure

{
  "version": "1.0.0",
  "generatedFrom": "docs/setup/csv-template-spec.md",
  "templates": [
    {
      "file": "customers.csv",
      "seedType": "business",
      "importOrder": 12,
      "supported": true
    }
  ]
}

This metadata will be reused by D.7.6 Setup Wizard.

---

## Optional API

If simple and reusable

Create

GET /api/setup/templates

Return

Template Name

Seed Type

Import Order

Supported

Required Columns

Description

This API must be read-only.

Do NOT implement download or ZIP generation.

---

## Out Of Scope

CSV Parser

CSV Validation

CSV Preview

CSV Commit

Seed Execution

Reset

Setup Wizard

Manifest

State Machine

Migrations

Business Logic Changes

---

## Deliverables

setup/templates/

organizations.csv

users.csv

memberships.csv

crm-role-assignments.csv

master-options.csv

branches.csv

product-types.csv

document-sequences.csv

approval-workflows.csv

approval-steps.csv

approval-matrix.csv

customers.csv

contacts.csv

contact-shares.csv

leads.csv

opportunities.csv

opportunity-parties.csv

quotations.csv

quotation-items.csv

quotation-parties.csv

quotation-topics.csv

quotation-topic-items.csv

README.md

Optional

templates.json

Optional

GET /api/setup/templates

---

## Acceptance Criteria

✓ Every supported CSV exists.

✓ Every CSV contains exactly

- one header row
- one sample row

✓ Header names exactly match

docs/setup/csv-template-spec.md

✓ Sample data follows one consistent demo dataset.

✓ No unsupported CSV files are generated.

✓ No secrets or production data exist.

✓ README documents

- import order
- relationship rules
- placeholders
- supported templates
- unsupported templates

✓ templates.json (if implemented) matches generated CSV files.

✓ Optional API (if implemented) is read-only.

✓ No import logic or seed logic is implemented.

✓ Typecheck passes or unrelated failures are documented.

---

## Future Tasks

D.7.4

CSV Preview Validation Engine

D.7.5

CSV Commit Import Engine

D.7.6

Setup Wizard UI

The generated CSV files become the official template pack for all future setup and onboarding workflows.
> Implementation log 2026-07-02: Static CSV template pack completed under
> `setup/templates/`, optional metadata API added at `GET /api/setup/templates`,
> and implementation note saved to
> `docs/implementation/task-d73-csv-template-static-pack.md`.
