SOQVER Prepare a source
English

Blog · Answer ·

How should my app handle a SO4AG fact marked not stated?

Keep the SO4AG “not stated” status when parsing and displaying facts, and leave totals undetermined when a required fee has that status.

When a SO4AG fact is marked “not stated,” keep that status from parsing through display and calculation. It means the business has supplied no value for that fact. Display the status as “Not stated” or explain who has yet to supply the value. In a calculation, use a stated zero as zero and leave the total undetermined if a required fee is marked “not stated.”

What “not stated” means

“Not stated” means the business has supplied no value for the fact under its published conditions. Conditions describe where a fact applies, such as a country, customer type, or delivery method.

SO4AG is an open format for business facts and a working draft at version 0.1. Each fact carries its conditions, its last day, the address of the page where the business publishes the information, and whether the business states a value. The source can also include the exact words from that page. A program treats the fact as history after its last day.

Keep the status attached to the conditions as you read the source. If a business leaves its shipping price unstated for one country, that record tells you about shipping to that country. Your app can still use a current, stated shipping price that applies to a different destination. For the format’s definitions, see the SO4AG 0.1 specification.

How to calculate a total with a fee

Use the numeric amount when the business states a fee that applies to the order, including when that amount is zero. If the total requires a fee and the applicable fact says “not stated,” the total is undetermined.

Example: Example Supply (example-supply.example) has an order subtotal of 120.00 USD. The app needs the shipping fee to calculate the total. These are three possible source records for the same destination and delivery method. In each case, the record is current and the subtotal is already known.

Shipping fee in the sourceOrder subtotalTotal
Stated as 0.00 USD120.00 USD120.00 USD
Stated as 8.00 USD120.00 USD128.00 USD
Not stated120.00 USDUndetermined

In the third case, you can still display 120.00 USD as the subtotal. Label it “Subtotal” and show “Shipping fee not stated” alongside it. If another part of your app needs the total, pass along that it is undetermined so the subtotal keeps its original meaning.

How to preserve the status in your app

Store the status explicitly when mapping a source record into your application’s data model. Give a stated fact a value field that accepts zero, and give a “not stated” fact its own status with no numeric value.

Read the published status before you convert a value into a number. For a stated record, parse the amount and retain its currency. For a record marked “not stated,” carry the status forward with the conditions, last day, and source reference. Check the same mapping wherever the fact passes through storage, an API response, or a component that renders it. A default of zero at any of those boundaries would change what the business says.

For a fact table, “Not stated” works when the row label names the fact. In a sentence, write “The business hasn’t stated its shipping fee.” For a stated zero, display “Shipping fee” with the amount. The project provides validators and readers in JavaScript and Python in the SO4AG source code repository.

What to test

Run three cases through your parser, data model, display, and calculation. Use the same conditions, dates, currency, and subtotal so you can see exactly what changes when the fee changes.

If your app saves and reloads fact records, run the three cases through that path too. It can reveal a storage default that turns an unstated fee into zero or a display check that treats a stated zero as missing.

Common questions

Can I store a null amount?

Yes, if your app also stores the explicit status. A null amount alone leaves a reader of your data model guessing why the value is absent.

Can I calculate the parts of a total I know?

Yes. Label the result as a subtotal or name the charges it includes. Keep the final total undetermined while a required amount is unstated.

What if the source stated an amount that has since expired?

Preserve the stated amount as history and exclude it from current calculations. See what happens when a SO4AG fact reaches its last day for how that date works.

Next step

Use the SOQVER developer guide when mapping source records into your app. Then run the three fee cases through the screen and calculation your users actually use.

More articles

Answer ·

What should I put in a Markdown business facts page?

Use short, grouped entries in your Markdown business facts page, and keep each value with its conditions, last day, source link, and available quote.

Answer ·

How to check your SO4AG file after a website redesign

Check that your live SO4AG file loads, passes validation, and still points to current website wording after a redesign or migration.

Answer ·

What should photographers publish before clients book?

Publish your session types, service areas, prices, booking and cancellation terms, and photo delivery times so clients can compare offers.

Want to see our articles more often in Google Search? Add soqver.com to your favorite sources on Google.

Free website audit All articles