# Decide when a certificate is issued

A certificate requirement is the rule that connects a certificate template to the thing that triggers it — a completed tandem flight, or a completed course. Without one, nothing is ever generated no matter how good the template is. Set them up from the template's "Generate for" tab, or at Certificates → Requirements.

Source: https://help.pigi.io/guides/courses/certificates/certificate-requirements

## Quick answers

**Why is no certificate being generated?**
Almost always because there is no certificate requirement. A template alone does
nothing. Open the template, go to the **Generate for** tab and click **Add
model**, choosing **Tandem Flight** or **Course completion**.

**Where is the easiest place to set this up?**
On the template itself. Open **Certificates → Templates**, open a template, and
use the **Generate for** tab in the right-hand panel. It reads "Generate this
certificate when one of these completes."

**What model types can I choose?**
Two: **Tandem Flight** and **Course completion**. Those are the only two
generators that exist.

**What does "Apply to whole model" mean?**
It means the rule fires for every record of that type in your company — every
tandem flight, or every course. The **Generate for** tab always creates rules
this way, which is what you want.

**Can I have one certificate for one specific course and another for a different course?**
Yes. On a **Course completion** rule, turn **Apply to whole model** off — an
**Only this course** picker appears. Add one rule per course, each pointing at
its own template. A course-specific rule wins over a whole-model one.

**Why does a course still not produce a certificate?**
Two things must both be true: the course has **Certificate awarded** turned on,
and a certificate requirement covers courses. If either is missing the student
still graduates, and the graduation message names the missing piece.

**How do I stop issuing a certificate?**
Open the template's **Generate for** tab and click the bin icon on the row. The
confirmation says "Remove &lt;model&gt;? Certificates will no longer be generated for
it." Existing certificates are not deleted.

**Where do I see all the rules at once?**
**Certificates → Requirements** at /school/admin/certificates/requirements. The
list shows **Certificate template**, **Model** and **Apply to all**.

## What this is

PiGi separates *what a certificate looks like* (the template) from *when it is
issued* (the requirement). A certificate requirement is a small rule: this
template, that model type, and whether it applies to everything of that type.

When a tandem flight is completed or a student is graduated, PiGi looks for a
matching requirement. Found one, it renders the template into a PDF and image and
records an issued certificate. Found none, it stops quietly — which is why a
missing requirement looks exactly like a broken feature.

## Before you start

- You need the company admin role.
- The certificate template must already exist.
- For course certificates, the course must have **Certificate awarded** turned on
  in its Settings card.

## Steps

Use the template's own tab — it is the surface that works properly.

1. Open **Certificates → Templates** and open the template you want to issue.
2. In the right-hand panel, switch to the **Generate for** tab.
3. Click **Add model**.
4. Choose **Generate for**: *Tandem flight*, *Course completion* or *Course
   enrolment (any course)*.
5. Leave **Apply to whole model** on to cover every record of that type, or
   turn it off on a Course rule and pick the single course under **Only this
   course**.
6. Click **Add**. The rule appears in the list.
7. To change it later, use the pencil icon; to remove it, use the bin icon and
   confirm **Remove**.

To review every rule across all templates, open **Certificates → Requirements**
at /school/admin/certificates/requirements.

## Fields

| Field | Required | What to enter |
|---|---|---|
| Certificate Template | Yes | Which template this rule issues. Pre-filled when you add the rule from the template's own tab. |
| Generate for | Yes | *Tandem flight*, *Course completion*, or *Course enrolment (any course)*. |
| Apply to whole model | No | On means every record of that type. Turn it off on a Course rule to pin the rule to one course. |
| Only this course | Only when Apply to whole model is off | The single course this template is for. |

## Known limitations

- **Only "Course completion" can be pinned to one record.** Turn **Apply to
  whole model** off and an **Only this course** picker appears. Tandem flight
  and Course enrolment are whole-model by nature.
- **Course rules can be written three ways** (a Course completion rule pinned to
  one course, a whole-model Course completion rule, or a whole-model Course
  enrolment rule) and PiGi checks them in that order. Mixing them is a good way to confuse yourself —
  pick **Course completion** and leave it alone.
- **A missing rule is not flagged on this screen.** You find out at graduation:
  the graduation message says "no certificate template is configured".

## Related

- [Build a certificate template](certificate-templates.md)
- [Find an issued certificate](issued-certificates.md)
- [Graduate a student](graduate-a-student.md)
