Organisation billing details visible on organisation settings page

This commit is contained in:
Pea Tyczynska
2021-02-05 10:57:46 +00:00
parent f0d94a009e
commit 56b777872e
5 changed files with 45 additions and 0 deletions

View File

@@ -46,6 +46,10 @@ class Organisation(JSONModel):
'domains',
'request_to_go_live_notes',
'count_of_live_services',
'billing_contact_email_addresses',
'billing_contact_names',
'billing_reference',
'purchase_order_number',
'notes'
}
@@ -134,6 +138,19 @@ class Organisation(JSONModel):
abort(404)
return self.crown
@property
def billing_details(self):
billing_details = [
self.billing_contact_email_addresses,
self.billing_contact_names,
self.billing_reference,
self.purchase_order_number
]
if any(billing_details):
return billing_details
else:
return None
@cached_property
def services(self):
return organisations_client.get_organisation_services(self.id)