- Added PricingPlan Model

- Implement a complete cycle for buying a Matrix Chat Host
- Refactor the Payement cycle and stripe related methods
This commit is contained in:
amalelshihaby 2021-07-19 16:36:10 +02:00 committed by Nico Schottelius
commit b7aa1c6971
81 changed files with 5079 additions and 810 deletions

View file

@ -86,8 +86,9 @@ class OrderSerializer(serializers.ModelSerializer):
class Meta:
model = Order
read_only_fields = ['replaced_by', 'depends_on']
fields = ['uuid', 'owner', 'description', 'creation_date', 'starting_date', 'ending_date',
'bill', 'recurring_period', 'recurring_price', 'one_time_price'] + read_only_fields
fields = ['owner', 'description', 'creation_date', 'starting_date', 'ending_date',
'recurring_period', 'recurring_price', 'one_time_price',
'config', 'pricing_plan', 'should_be_billed'] + read_only_fields
###
@ -114,13 +115,13 @@ class BillSerializer(serializers.ModelSerializer):
class Meta:
model = Bill
fields = ['uuid', 'reference', 'owner', 'amount', 'vat_amount', 'total',
fields = ['owner', 'sum', 'vat_rate',
'due_date', 'creation_date', 'starting_date', 'ending_date',
'records', 'final', 'billing_address']
'records', 'is_closed', 'billing_address']
# We do not want users to mutate the country / VAT number of an address, as it
# will change VAT on existing bills.
class UpdateBillingAddressSerializer(serializers.ModelSerializer):
class Meta:
model = BillingAddress
fields = ['uuid', 'street', 'city', 'postal_code']
fields = ['street', 'city', 'postal_code']