Coverage for app/venv/lib/python3.14/site-packages/weblate/billing/migrations/0001_squashed_weblate_5.py: 0%

9 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 07:15 +0000

1# Copyright © Michal Čihař <michal@weblate.org> 

2# 

3# SPDX-License-Identifier: GPL-3.0-or-later 

4 

5# Generated by Django 4.2.5 on 2023-09-18 08:15 

6 

7import django.core.serializers.json 

8import django.db.models.deletion 

9from django.conf import settings 

10from django.db import migrations, models 

11 

12 

13class Migration(migrations.Migration): 

14 replaces = [ 

15 ("billing", "0001_squashed_0020_auto_20200320_1007"), 

16 ("billing", "0002_remove_billing_grace_period"), 

17 ("billing", "0003_auto_20201118_1217"), 

18 ("billing", "0004_replace_expired"), 

19 ("billing", "0005_auto_20210512_1955"), 

20 ("billing", "0006_alter_billing_payment_alter_invoice_payment"), 

21 ("billing", "0007_billing_payment_new"), 

22 ("billing", "0008_jsonfield"), 

23 ("billing", "0009_remove_billing_payment_remove_invoice_payment"), 

24 ("billing", "0010_rename_payment_new_billing_payment_and_more"), 

25 ("billing", "0011_alter_billing_payment"), 

26 ("billing", "0012_alter_billing_expiry_alter_billing_removal"), 

27 ] 

28 

29 initial = True 

30 

31 dependencies = [ 

32 ("trans", "0001_squashed_weblate_5"), 

33 migrations.swappable_dependency(settings.AUTH_USER_MODEL), 

34 ] 

35 

36 operations = [ 

37 migrations.CreateModel( 

38 name="Plan", 

39 fields=[ 

40 ( 

41 "id", 

42 models.AutoField( 

43 auto_created=True, 

44 primary_key=True, 

45 serialize=False, 

46 verbose_name="ID", 

47 ), 

48 ), 

49 ("name", models.CharField(max_length=100, unique=True)), 

50 ("price", models.IntegerField(default=0)), 

51 ("limit_strings", models.IntegerField(default=0)), 

52 ("limit_languages", models.IntegerField(default=0)), 

53 ("limit_projects", models.IntegerField(default=0)), 

54 ("yearly_price", models.IntegerField(default=0)), 

55 ("display_limit_languages", models.IntegerField(default=0)), 

56 ("display_limit_projects", models.IntegerField(default=0)), 

57 ("display_limit_strings", models.IntegerField(default=0)), 

58 ("change_access_control", models.BooleanField(default=True)), 

59 ("public", models.BooleanField(default=False)), 

60 ("slug", models.SlugField(max_length=100, unique=True)), 

61 ], 

62 options={ 

63 "verbose_name": "Billing plan", 

64 "verbose_name_plural": "Billing plans", 

65 }, 

66 ), 

67 migrations.CreateModel( 

68 name="Billing", 

69 fields=[ 

70 ( 

71 "id", 

72 models.AutoField( 

73 auto_created=True, 

74 primary_key=True, 

75 serialize=False, 

76 verbose_name="ID", 

77 ), 

78 ), 

79 ( 

80 "plan", 

81 models.ForeignKey( 

82 on_delete=django.db.models.deletion.CASCADE, 

83 to="billing.plan", 

84 verbose_name="Billing plan", 

85 ), 

86 ), 

87 ( 

88 "projects", 

89 models.ManyToManyField( 

90 blank=True, to="trans.project", verbose_name="Billed projects" 

91 ), 

92 ), 

93 ( 

94 "state", 

95 models.IntegerField( 

96 choices=[(0, "Active"), (1, "Trial"), (3, "Terminated")], 

97 default=0, 

98 verbose_name="Billing state", 

99 ), 

100 ), 

101 ( 

102 "in_limits", 

103 models.BooleanField( 

104 default=True, editable=False, verbose_name="In limits" 

105 ), 

106 ), 

107 ( 

108 "paid", 

109 models.BooleanField( 

110 default=True, editable=False, verbose_name="Paid" 

111 ), 

112 ), 

113 ( 

114 "expiry", 

115 models.DateTimeField( 

116 blank=True, 

117 help_text="After expiry removal with 15 days grace period is scheduled.", 

118 null=True, 

119 verbose_name="Trial expiry date", 

120 ), 

121 ), 

122 ( 

123 "owners", 

124 models.ManyToManyField( 

125 blank=True, 

126 to=settings.AUTH_USER_MODEL, 

127 verbose_name="Billing owners", 

128 ), 

129 ), 

130 ( 

131 "removal", 

132 models.DateTimeField( 

133 blank=True, 

134 help_text="This is automatically set after trial expiry.", 

135 null=True, 

136 verbose_name="Scheduled removal", 

137 ), 

138 ), 

139 ( 

140 "payment", 

141 models.JSONField( 

142 default=dict, 

143 editable=False, 

144 encoder=django.core.serializers.json.DjangoJSONEncoder, 

145 ), 

146 ), 

147 ], 

148 options={ 

149 "verbose_name": "Customer billing", 

150 "verbose_name_plural": "Customer billings", 

151 }, 

152 ), 

153 migrations.CreateModel( 

154 name="Invoice", 

155 fields=[ 

156 ( 

157 "id", 

158 models.AutoField( 

159 auto_created=True, 

160 primary_key=True, 

161 serialize=False, 

162 verbose_name="ID", 

163 ), 

164 ), 

165 ("start", models.DateField()), 

166 ("end", models.DateField()), 

167 ( 

168 "currency", 

169 models.IntegerField( 

170 choices=[(0, "EUR"), (1, "mBTC"), (2, "USD"), (3, "CZK")], 

171 default=0, 

172 ), 

173 ), 

174 ("ref", models.CharField(blank=True, max_length=50)), 

175 ("note", models.TextField(blank=True)), 

176 ( 

177 "billing", 

178 models.ForeignKey( 

179 on_delete=django.db.models.deletion.CASCADE, 

180 to="billing.billing", 

181 ), 

182 ), 

183 ("amount", models.FloatField()), 

184 ("payment", models.JSONField(default=dict, editable=False)), 

185 ], 

186 options={ 

187 "verbose_name": "Invoice", 

188 "verbose_name_plural": "Invoices", 

189 }, 

190 ), 

191 ]