Operator guideENcrmsettingsaffiliatesform

CPA Qualification / Form

Create and edit form for one CPA qualification configuration row, including deposit, wagering, risk, hold period, country scope, and monthly cap.

Reader view

Clean portal guidance

This page keeps the operator explanation, field and action descriptions, and screenshots visible without exposing repo paths, raw sidecars, or editorial-only implementation details.

Narrative content

Page body

What this form does

This form creates or edits one CPA qualification configuration row. It is the flat editor for one configuration payload and is useful when operators need to work with a single row instead of the grouped PID editor.

When to use it

  • add one new qualification row
  • fix threshold values on one existing row
  • narrow the row to a country scope
  • activate or deactivate one row

Main sections

  • basic information with PID, configuration name, and active state
  • geographic restrictions with the country collection editor
  • deposit and wagering thresholds
  • fraud score threshold and monthly cap
  • three-part hold-period builder
  • self-exclusion behavior during the hold period

Validation and operator rules

  • Partner ID (PID) is required
  • Configuration Name is required
  • Partner ID (PID) becomes read-only in edit mode
  • wagering period must be a whole number of days when set
  • fraud score threshold must stay within 0 to 1
  • monthly cap must be a positive integer when set
  • the visible Days, Hours, and Minutes inputs all write into one stored holdPeriodMinutes value
  • leaving countries empty keeps the row global instead of country-specific

Known caveats

  • The grouped PID editor remains the richer flow for managing one PID with global rules and country overrides together.
  • This form edits only one row at a time.
  • Create injects createdBy from the current admin email; update sends the row id as cpa_id in the request body.
  • The country editor adds Ontario as a special option alongside the country-list dataset.
  • Edit mode uses a short initialization spinner after the detail payload arrives before the form becomes interactive.
  • Cancel and the back arrow both return to the list without saving.

Verification status

  • status: verified_backend
  • FE create and edit behavior checked from CpaQualificationForm
  • backend create, detail, and update routes checked from AffiliateController plus the CPA qualification services
Calculation notes

Calculations

calculation

Create versus edit shell

Verification
verified_backend
Logic
Create mounts the form with no `configId`., Edit mounts the same form with `configId` and `isEdit`., Create submits `POST /api/admin/cpa-qualification`., Edit submits `PUT /api/admin/cpa-qualification` and includes the current row id as `cpa_id` in the request body., Both success paths navigate back to `/settings/cpa-qualification` and show a success snackbar.
calculation

Edit bootstrap and initialization spinner

Verification
verified_fe_only
Logic
Edit mode fetches one row through `useCpaQualificationConfig(configId)`., The component mirrors that payload into local `displayConfig`, then resets Formik from the mirrored values., A local `isInitializing` guard keeps the centered spinner on screen for about `800ms` after the payload arrives before the form becomes interactive.
calculation

PID edit lock

Verification
verified_fe_only
Logic
`Partner ID (PID)` is editable on create., Edit mode disables the PID input when `isEdit && !!configId`.
calculation

Hold-period triplet

Verification
verified_backend
Logic
The visible `Days`, `Hours`, and `Minutes` controls all map to one stored `holdPeriodMinutes` integer., Each helper recalculates the full minute total locally and writes it back into Formik state., The helper text below the controls shows the total minute value that will be saved., Backend create and update services validate the stored value as an integer greater than or equal to `0`.
calculation

Defaults and country scope

Verification
verified_backend
Logic
Create defaults are `fraudScoreThreshold: 0.5`, `holdPeriodMinutes: 10080`, `excludeConversionIfSelfExcludedDuringHoldPeriod: false`, `countries: []`, and `isActive: true`., `countries: []` means the row stays global instead of country-specific., The country editor loads the standard country list and then appends a manual `Ontario` option with code `ON`.
calculation

Country-overlap conflict check

Verification
verified_backend
Logic
Create checks for existing rows with the same PID and rejects overlapping countries., Update checks for overlapping countries against other active rows for the same PID while excluding the current row id., Conflict errors are returned with the overlapping country codes in the message.
Field dictionary

Fields

field

Partner ID (PID)

Affiliate PID that owns this qualification row.

Group
identity
Data Type
string
Caveats
Edit mode renders this field as read-only.
field

Configuration Name

Operator-facing name for the configuration row.

Group
identity
Data Type
string
field

Active

Controls whether the row participates in CPA qualification logic.

Group
identity
Data Type
boolean
field

Minimum Deposit Amount

Minimum deposit amount required before CPA can qualify.

Group
qualification
Data Type
amount
field

Deposit Wagering Multiplier

Deposit wagering multiplier the player must satisfy.

Group
qualification
Data Type
number
field

Deposit Wagering Period (days)

Maximum number of days allowed to satisfy the wagering requirement.

Group
qualification
Data Type
integer
field

Risk Score Threshold

Maximum allowed risk score for the conversion to remain eligible.

Group
qualification
Data Type
number
field

Monthly Cap

Maximum number of monthly qualifying conversions allowed for the row.

Group
qualification
Data Type
integer
field

Days

Day fragment of the stored hold period.

Group
qualification
Data Type
integer
field

Hours

Hour fragment of the stored hold period.

Group
qualification
Data Type
integer
field

Minutes

Minute fragment of the stored hold period.

Group
qualification
Data Type
integer
field

Time to wait before qualifying a FTD

Live helper text showing the combined hold period in total minutes.

Group
helper
Data Type
duration
field

Exclude Conversion If Self-Excluded During Hold Period

Blocks qualification if the player self-excludes during the hold window.

Group
qualification
Data Type
boolean
field

Countries

Country scope for the row. Empty means it applies as a global row.

Group
scope
Data Type
string-list
Caveats
Empty selection keeps the rule global., The editor adds `Ontario` as a manual option with code `ON`.
Operational notes

Notes

item

The single-row form is separate from the grouped PID editor.

item

Edit mode loads one existing row through `useCpaQualificationConfig`, copies it into local `displayConfig`, then resets Formik from that object.

item

Create posts to `POST /api/admin/cpa-qualification`; update posts to `PUT /api/admin/cpa-qualification` with `cpa_id` in the request body.

item

The controller injects `createdBy` from the current admin email on create.

item

The country editor uses `CountryCollectionEditor`, loads countries from `useCountryList`, and appends a manual `Ontario` option with code `ON`.

Related references

Related pages

pageCPA Qualification / Detail

Tabbed management workspace for CPA qualification, switching between grouped configurations and affiliate tracking events.

pageCPA Qualification / Group

Grouped PID editor for CPA qualification, with one shared rule set and optional country-specific overrides.

pageCPA Qualification / List

Grouped PID table for CPA qualification configurations, with filters, grouped row expansion, status toggles, and navigation into the grouped editor.

pageCPA Qualification Overview

Operator guide for CPA qualification settings, grouped PID configurations, and the tracking-events workspace used by affiliate operations.

pageAffiliate Deals / Dashboard

Deal-period performance report that combines traffic, deposit, GGR, NGR, payout, and ROI metrics for affiliate deals.

pageAffiliate Deals / Form

Create and edit form for affiliate deals, including PID, date window, commercial terms, and responsible person.