Appearance
Billing Entities
Billing entities are sub-divisions of an organisation used for invoicing and worker assignment. They can be created via a wizard and viewed/edited through the company settings detail view.
Routes
/organisations/:organisationId/company-settings/billing-entities/:billingEntityId-- View/edit a specific billing entity/organisations/:organisationId/create-billing-entity-wizard-- Create a new billing entity
Roles
CompanyAdmin, CompanyOwner, TenantAdmin
TeamAdmin users cannot create billing entities.
View/Edit Billing Entity
Uses the same CompanyDetailsExpanded component as the organisation details view. See details.md for full field documentation.
Key differences from the home organisation view:
- Shows a
ProfilePictureavatar instead of a house icon. - An Add New Billing Entity button navigates to
/organisations/:organisationId/create-billing-entity-wizard. Disabled for TeamAdmin. - Edits issue an
EditBillingEntityCommand(withCorrelationIdset to the organisation ID andBillingEntityIdset to the entity ID) rather thanEditOrganisationCommand. - Polls via
pollingGetConditionongetBillingEntityByIduntil theappliestimestamp is newer. - A close button navigates back to
/organisations/:organisationId/company-settings. Only shown when multiple billing entities exist.
Create Billing Entity Wizard
Three-step wizard (BillingEntity/Create/Index.svelte) for creating a new billing entity. Uses a ProgressLine stepper component with clickable steps. The wizard is rendered inside a centred Tile component with a closable overlay (close is disabled during submission).
Step 1: Billing Entity Details
Rendered by BillingEntityDetails/BillingEntity.svelte and BillingEntityForm.svelte.
- Entity Name (required; max 50 characters)
- Country (required; country combobox)
- Registration Number (optional; max 20 characters)
- Tax ID / VAT (optional; max 20 characters)
- Dun & Bradstreet Number (optional; max 9 characters; DUNS validation)
Dispatches detailsDone on completion to advance to Step 2.
Step 2: Address
Same address form as organisation creation (AddressDetails component): address search, address line, city, postal code, phone with dial code.
Dispatches addressDone on completion to advance to Step 3.
Step 3: Contact Details
Same contact form as organisation creation (ContactDetails component):
- Full Name (read-only, from authenticated user's
displayName) - Email (read-only, from authenticated user's
email) - Job Title (required)
- Phone (optional; dial code, number, and country)
Dispatches contactDone on completion, which triggers the submission process.
Submission Process
On completion (onCompleteStarted):
- A UUID is pre-generated for the billing entity ID via
uuidv4(). - The stepper and close button are disabled (
disabledStepper = true,disableClose = true). - A spinner is shown with localised text.
CreateBillingEntitycommand is sent with the pre-generated UUID, entity details, address fields, creator ID, and DUNS number.- Polls via
pollingGetongetBillingEntityByIduntil the entity appears. Adds tobillingEntityStore. AddBillingEntityClientContactDetailscommand is sent with contact type "Organization Contact", user details, job title, phone, and the billing entity ID.- Polls via
pollingGetConditionongetBillingEntityByIduntilcreatorIdmatches andclientDetails.userIdmatches the current user. - If an
eorInstanceIdquery parameter is present (creating from main terms), aSubmitBillingEntityorSubmitBillingEntityContractorcommand is sent depending on the worker contract type (Employee vs Contractor). UpdatescontractChangeMadeStoreandlatestAppliesStore. - If no
eorInstanceId, redirects to theredirectUrlquery parameter (defaults to/).
Wizard State
- The wizard state is persisted in local storage via
Local.Keys.WizardStateand restored on mount. - The state object (
OrganisationWizardState) containsDetails,Address, andContactsections. - Navigation between steps is handled by
continueStep(forward) andgoBack(backward). AWizardNavigationButtonwith "Back" label is shown on steps after the first. - Steps can also be navigated by clicking on the
ProgressLinestep indicators (unless stepper is disabled).
Behavior notes
- On any error during submission, a notification is shown ("There is a problem with our services.") and the user is redirected to
/. - The wizard cannot be closed while submission is in progress (
disableClose = true). - The
disabledStepperflag prevents step navigation during submission.