Skip to content

Commit

Permalink
chore(docs): add missing pageVariables documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ttbarnes committed Sep 20, 2024
1 parent 4b335ae commit e2ca3d9
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import mapAndSave from '../../map-and-save/export-contract-agent-service-charge'
import { Request, Response } from '../../../../../../types';

const { INSURANCE_ROOT, ALL_SECTIONS, PROBLEM_WITH_SERVICE } = INSURANCE_ROUTES;

/**
* post
* Save any valid "Agent charges - Currency of agents charge" form fields and if successful, redirect to the all sections page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const { INSURANCE_ROOT, ALL_SECTIONS, PROBLEM_WITH_SERVICE } = INSURANCE_ROUTES;

const { POLICY } = FIELD_IDS.INSURANCE;

/**
* pageVariables
* Page fields and "save and go back" URL
* @param {Number} referenceNumber: Application reference number
* @returns {Object} Page variables
*/
export const pageVariables = (referenceNumber: number) => ({
FIELD: FIELDS[POLICY.POLICY_TYPE],
SAVE_AND_BACK_URL: `${INSURANCE_ROOT}/${referenceNumber}${ALL_SECTIONS}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ const {
TYPE_OF_POLICY: { POLICY_TYPE: FIELD_ID },
} = POLICY_FIELD_IDS;

/**
* pageVariables
* Page fields and "save and go back" URL
* @param {Number} referenceNumber: Application reference number
* @returns {Object} Page variables
*/
export const pageVariables = (referenceNumber: number) => ({
FIELD: FIELDS[FIELD_ID],
SAVE_AND_BACK_URL: `${INSURANCE_ROOT}/${referenceNumber}${TYPE_OF_POLICY_SAVE_AND_BACK}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const { NAME, ADDRESS, COUNTRY, REGISTRATION_NUMBER, WEBSITE } = COMPANY_OR_ORGA

export const FIELD_IDS = [NAME, ADDRESS, COUNTRY, REGISTRATION_NUMBER, WEBSITE];

/**
* pageVariables
* Page fields and "save and go back" URL
* @param {Number} referenceNumber: Application reference number
* @returns {Object} Page variables
*/
export const pageVariables = (referenceNumber: number) => ({
FIELDS: {
NAME: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ export const TEMPLATE = SHARED_PAGES.SINGLE_RADIO;

export const PAGE_CONTENT_STRINGS = PAGES.INSURANCE.YOUR_BUYER.CONNECTION_WITH_BUYER;

// TODO: documentation
/**
* pageVariables
* Page fields and "save and go back" URL
* @param {Number} referenceNumber: Application reference number
* @returns {Object} Page variables
*/
export const pageVariables = (referenceNumber: number) => ({
FIELD_ID: CONNECTION_WITH_BUYER,
FIELDS: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export const TEMPLATE = TEMPLATES.SHARED_PAGES.ALTERNATIVE_CURRENCY;

export const PAGE_CONTENT_STRINGS = PAGES.INSURANCE.YOUR_BUYER.CURRENCY_OF_LATE_PAYMENTS;

// TODO: documentation
/**
* pageVariables
* Page fields and "save and go back" URL
* @param {Number} referenceNumber: Application reference number
* @returns {Object} Page variables
*/
export const pageVariables = (referenceNumber: number) => ({
FIELDS: {
CURRENCY_CODE: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export const FIELD_ID = TRADED_WITH_BUYER;

export const FIELD_IDS = [FIELD_ID];

/**
* pageVariables
* Page fields and "save and go back" URL
* @param {Number} referenceNumber: Application reference number
* @returns {Object} Page variables
*/
export const pageVariables = (referenceNumber: number) => ({
FIELD_ID,
SAVE_AND_BACK_URL: `${INSURANCE_ROOT}/${referenceNumber}${TRADED_WITH_BUYER_SAVE_AND_BACK}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ export const HTML_FLAGS = {
NO_RADIO_AS_FIRST_OPTION: true,
};

/**
* pageVariables
* Page fields and "save and go back" URL
* @param {Number} referenceNumber: Application reference number
* @returns {Object} Page variables
*/
export const pageVariables = (referenceNumber: number) => ({
FIELD_ID,
SAVE_AND_BACK_URL: `${INSURANCE_ROOT}/${referenceNumber}${SAVE_AND_BACK}`,
Expand Down

0 comments on commit e2ca3d9

Please sign in to comment.