3.3.
Management
Up one level
Account States
Management of the Account Service is mainly a question of dealing with the different states of accounts. An account may be in one of six states, as shown by the boxes in the diagram below. The valid transitions between the six states are shown by labeled arrows:

- pending-credit-checks
- When a client request an account, one is automatically created and put into this state. The client is unable to use the account in this state - i.e. other services cannot bill or check the credit limit of the client. The account will appear in the "Accounts awaiting credit checks" section of the Trade Account Service administration page of the web application and a notification will also be put into the Atom feed. The Account Service manager should carry out due diligence checks (e.g. check their credit in the real world), and then use the web page for the new account to either deny the account request, or approve the account by setting a credit limit to a value representing the limit of trust they wish to place in the account applicant.
- denied
- The denied state exists so as to inform a client that their application for an account was unsuccessful. The Account Service manager may (after a suitable period of time) destroy the account from this state.
- open
- An open account may be billed and so have payments recorded on it. The Account Service manager may choose to suspend an open account if they want to temporarily prevent the account from being used. The Account Service manager or client may also choose to request that the account be closed.
- suspended
- In this state, the account cannot be billed. The Account Service manager may unsuspend the account (to re-open it), and the manager or the client can request that the account be closed.
- account-usage-finished
- In this state, bills and payments may still be recorded on the account. The Account Service manager should ensure that all bills from other services have been recorded and then send a final bill to the client. On receiving final payment, the payment should be recorded and the account balance will be zero. Once the balance is zero, the Account Service manager may move the account into the closed state.
- closed
- In the closed state, payments and bills cannot be recorded. The account data is left on the system until the manager decides to destroy the account, at which point all record of the account's existence is removed from the Account Service.
Recording Payments
As mentioned above, the Account Service is not supposed to be a bank dealing with real money. Its purpose is to record what a client owes to the service provider. Transactions involving real money would take place using the normal channels (invoices and cheques in the post, credit card transactions on the phone, etc). If a client makes a payment through one of these channels then the payment should be recorded in the account, so that the system knows that the client's over all financial liability has been reduced, and the available credit increased.
Recording a payment
To record a payment, go to the account's page in the web interface and scroll down to the "Record a payment" section. Enter the details of the payment and click on "Record payment".
Note: the "Recorded by" drop-down is generated from the list of people with the "service-admin" role on this account. To see who has the "service-admin" role, scroll down to the "Access control rules" at the bottom of the page. By default there will be a rule stating that to have the service-admin role it is sufficient to be a "Member of group: account-service-admins". By clicking on "account-service-admins" you will be taken to a new page showing the rules dictating who is in the account-service-admins group.
By default, the account-service-admins group consists of just one rule stating that the service itself is a member. The Account Service manager must add their certificate to this rule set using the "SubjectDN is..." type of rule in order to be able to record payments on any account.
