Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Content Block Tax Rate content type #2806

Closed
wants to merge 1 commit into from

Conversation

Harriethw
Copy link
Contributor

@Harriethw Harriethw commented Jul 18, 2024

The Content Modelling Team are working on a spike to add the ability to publishing reusable pieces of content (“Content Blocks”) via Whitehall. This adds a simple initial schema to help us work with a type of tax rate.

Added to Whitehall here: alphagov/whitehall#9278

Some things I found out:

  • I wanted to make the rate field an integer and a percentage - so max 100 value. However, our current form submites everything as strings, e.g. 100 becomes "100" so we would need to do more work to make this possible.
  • I was also not able to give fields a min/max length because the tests generated didn't seem to take notice of these paramteres and were generating data above the min length - would need to look into this.

Harriethw added a commit to alphagov/whitehall that referenced this pull request Jul 18, 2024
This schema was added to Publishing API here alphagov/publishing-api#2806
Harriethw added a commit to alphagov/whitehall that referenced this pull request Jul 18, 2024
This schema was added to Publishing API here alphagov/publishing-api#2806
@Harriethw Harriethw force-pushed the content-modelling/add-tax-rate-object branch from 64f5743 to 45212d1 Compare July 18, 2024 13:32
Harriethw added a commit to alphagov/whitehall that referenced this pull request Jul 18, 2024
This schema was added to Publishing API here alphagov/publishing-api#2806
The Content Modelling Team are working on a spike to add the ability
to publishing reusable pieces of content (“Content Blocks”) via
Whitehall. This adds a simple initial schema to help us work with a
type of tax rate.
@Harriethw Harriethw force-pushed the content-modelling/add-tax-rate-object branch from 45212d1 to fe33751 Compare July 18, 2024 13:39
@Harriethw Harriethw marked this pull request as ready for review July 18, 2024 13:47
@Harriethw Harriethw requested review from pezholio and tahb July 18, 2024 13:47
Comment on lines +12 to +20
band: {
type: "string",
},
income: {
type: "string",
},
rate: {
type: "string",
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting one, because I think we're mixing up metadata and actual data here. To me, the band and the income would be metadata here, as they wouldn't actually be returned to the user. My mental model was more like we'd have two content types, tax_income and tax_rate, with individual body fields.

To use the example of a table of tax rates, I'd expect it to be used like this:

Band Taxable income Tax rate
Personal Allowance {{embed:tax_income:personal-allowance}} {{embed:tax_rate:personal-allowance}}
Basic rate {{embed:tax_income:basic-rate}} {{embed:tax_rate:basic-rate}}
Higher rate {{embed:tax_income:higher-rate}} {{embed:tax_rate:higher-rate}}
Additional rate {{embed:tax_income:additional-rate}} {{embed:tax_rate:additional-rate}}

That said (and this is a thing that's just occurred to me), if we went with this approach we could potentially have a more three-dimensional view and do something like this:

Band Taxable income Tax rate
Personal Allowance {{embed:tax_rate:personal-allowance:income}} {{embed:tax_rate:personal-allowance:rate}}
Basic rate {{embed:tax_rate:basic-rate:income}} {{{embed:tax_rate:basic-rate:rate}}
Higher rate {{embed:tax_rate:higher-rate:income}} {{embed:tax_rate:higher-rate:rate}}
Additional rate {{embed:tax_rate:additional-rate:income}} {{embed:tax_rate:additional-rate:rate}}

Which could be quite cool. I think we'd need to run this via Rik first, as well as think how this would work within the rest of the user journey. Potentially super powerful though, and would also scale to things like contacts etc too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I just thought that that entire row on this page for example could be a bit of re-usable content in other Editions https://www.gov.uk/income-tax-rates

Is there another block type that's less controversial we could use that would give us a schema with multiple fields? I think it would be really useful to have a 'straw man' to help us see how the different types work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about telephone number?

@Harriethw
Copy link
Contributor Author

Closing for #2807

@Harriethw Harriethw closed this Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants