Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed May 27, 2024
2 parents 42220ef + 02b7268 commit 4308901
Show file tree
Hide file tree
Showing 30 changed files with 151 additions and 115 deletions.
9 changes: 8 additions & 1 deletion bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ sed -i -e "s/version: 5.0.$current_version+$current_version/version: 5.0.$new_ve
sed -i -e "s/v5.0.$current_version/v5.0.$new_vesion/g" ./.github/workflows/flatpak.yml
sed -i -e 's/<releases>/<releases>\n <release version="5.0.'$new_vesion'" date="'$date_today'"\/>/g' ./flatpak/com.invoiceninja.InvoiceNinja.metainfo.xml
sed -i -e "s/kClientVersion = '5.0.$current_version'/kClientVersion = '5.0.$new_vesion'/g" ./lib/constants.dart
sed -i -e "s/version: '5.0.$current_version'/version: '5.0.$new_vesion'/g" ./snap/snapcraft.yaml
sed -i -e "s/version: '5.0.$current_version'/version: '5.0.$new_vesion'/g" ./snap/snapcraft.yaml

rm lib/flutter_version.dart
echo "const FLUTTER_VERSION = const <String, String>" > lib/flutter_version.dart
flutter --version --machine >> lib/flutter_version.dart
echo ";" >> lib/flutter_version.dart
sed -i "y/\"/'/" lib/flutter_version.dart
dart dartfmt lib
6 changes: 3 additions & 3 deletions lib/data/repositories/bank_account_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BankAccountRepository {
}

Future<BuiltList<BankAccountEntity>> loadList(Credentials credentials) async {
final String url = credentials.url+ '/bank_integrations?';
final String url = credentials.url + '/bank_integrations?';
final dynamic response = await webClient.get(url, credentials.token);

final BankAccountListResponse bankAccountResponse = serializers
Expand All @@ -41,7 +41,7 @@ class BankAccountRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
final url = credentials.url +
'/bank_integrations/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));
Expand All @@ -60,7 +60,7 @@ class BankAccountRepository {

if (bankAccount.isNew) {
response = await webClient.post(
credentials.url+ '/bank_integrations', credentials.token,
credentials.url + '/bank_integrations', credentials.token,
data: json.encode(data));
} else {
final url = '${credentials.url}/bank_integrations/${bankAccount.id}';
Expand Down
13 changes: 6 additions & 7 deletions lib/data/repositories/client_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ClientRepository {
Future<BuiltList<ClientEntity>> loadList(
Credentials credentials, int page) async {
final String url =
credentials.url+ '/clients?per_page=$kMaxRecordsPerPage&page=$page';
credentials.url + '/clients?per_page=$kMaxRecordsPerPage&page=$page';

final dynamic response = await webClient.get(url, credentials.token);

Expand All @@ -60,7 +60,7 @@ class ClientRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
final url = credentials.url +
'/clients/bulk?per_page=$kMaxEntitiesPerBulkAction&include=gateway_tokens,activities,ledger,system_logs,documents';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));
Expand All @@ -77,7 +77,7 @@ class ClientRepository {
required String? password,
required String? idToken,
}) async {
final url = credentials.url+ '/clients/$clientId/purge';
final url = credentials.url + '/clients/$clientId/purge';

await webClient.post(url, credentials.token,
password: password, idToken: idToken);
Expand All @@ -92,8 +92,7 @@ class ClientRepository {
required String? password,
required String? idToken,
}) async {
final url =
credentials.url+ '/clients/$mergeIntoClientId/$clientId/merge';
final url = credentials.url + '/clients/$mergeIntoClientId/$clientId/merge';

final dynamic response = await webClient.post(url, credentials.token,
password: password, idToken: idToken);
Expand All @@ -112,12 +111,12 @@ class ClientRepository {

if (client.isNew) {
response = await webClient.post(
credentials.url+
credentials.url +
'/clients?include=gateway_tokens,activities,ledger,system_logs,documents',
credentials.token,
data: json.encode(data));
} else {
final url = credentials.url+
final url = credentials.url +
'/clients/${client.id}?include=gateway_tokens,activities,ledger,system_logs,documents';
response =
await webClient.put(url, credentials.token, data: json.encode(data));
Expand Down
10 changes: 5 additions & 5 deletions lib/data/repositories/company_gateway_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CompanyGatewayRepository {

Future<BuiltList<CompanyGatewayEntity>> loadList(
Credentials credentials) async {
final url = credentials.url+ '/company_gateways';
final url = credentials.url + '/company_gateways';

final dynamic response = await webClient.get(url, credentials.token);

Expand All @@ -51,7 +51,7 @@ class CompanyGatewayRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
final url = credentials.url +
'/company_gateways/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));
Expand All @@ -64,7 +64,7 @@ class CompanyGatewayRepository {

Future<void> disconnect(Credentials credentials, String id, String? password,
String? idToken) async {
final url = credentials.url+ '/stripe/disconnect/$id';
final url = credentials.url + '/stripe/disconnect/$id';
await webClient.post(
url,
credentials.token,
Expand All @@ -81,10 +81,10 @@ class CompanyGatewayRepository {

if (companyGateway.isNew) {
response = await webClient.post(
credentials.url+ '/company_gateways', credentials.token,
credentials.url + '/company_gateways', credentials.token,
data: json.encode(data));
} else {
final url = credentials.url+ '/company_gateways/${companyGateway.id}';
final url = credentials.url + '/company_gateways/${companyGateway.id}';
response =
await webClient.put(url, credentials.token, data: json.encode(data));
}
Expand Down
8 changes: 4 additions & 4 deletions lib/data/repositories/design_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DesignRepository {
}

Future<BuiltList<DesignEntity>> loadList(Credentials credentials) async {
final url = credentials.url+ '/designs?';
final url = credentials.url + '/designs?';

final dynamic response = await webClient.get(url, credentials.token);

Expand All @@ -48,7 +48,7 @@ class DesignRepository {
}

final url =
credentials.url+ '/designs/bulk?per_page=$kMaxEntitiesPerBulkAction';
credentials.url + '/designs/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));

Expand All @@ -65,10 +65,10 @@ class DesignRepository {

if (design.isNew) {
response = await webClient.post(
credentials.url+ '/designs', credentials.token,
credentials.url + '/designs', credentials.token,
data: json.encode(data));
} else {
final url = credentials.url+ '/designs/${design.id}';
final url = credentials.url + '/designs/${design.id}';
response =
await webClient.put(url, credentials.token, data: json.encode(data));
}
Expand Down
8 changes: 4 additions & 4 deletions lib/data/repositories/document_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DocumentRepository {
}

Future<BuiltList<DocumentEntity>> loadList(Credentials credentials) async {
final url = credentials.url+ '/documents?';
final url = credentials.url + '/documents?';

final dynamic response = await webClient.get(url, credentials.token);

Expand All @@ -57,7 +57,7 @@ class DocumentRepository {
final data = serializers.serializeWith(DocumentEntity.serializer, document);
dynamic response;

final url = credentials.url+ '/documents/${document.id}';
final url = credentials.url + '/documents/${document.id}';

response =
await webClient.put(url, credentials.token, data: json.encode(data));
Expand All @@ -74,8 +74,8 @@ class DocumentRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
'/documents/bulk?per_page=$kMaxEntitiesPerBulkAction';
final url =
credentials.url + '/documents/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));

Expand Down
6 changes: 3 additions & 3 deletions lib/data/repositories/expense_category_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ExpenseCategoryRepository {

Future<BuiltList<ExpenseCategoryEntity>> loadList(
Credentials credentials) async {
final String url = credentials.url+ '/expense_categories?';
final String url = credentials.url + '/expense_categories?';
final dynamic response = await webClient.get(url, credentials.token);

final ExpenseCategoryListResponse expenseCategoryResponse = serializers
Expand All @@ -47,7 +47,7 @@ class ExpenseCategoryRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
final url = credentials.url +
'/expense_categories/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));
Expand All @@ -66,7 +66,7 @@ class ExpenseCategoryRepository {

if (expenseCategory.isNew) {
response = await webClient.post(
credentials.url+ '/expense_categories', credentials.token,
credentials.url + '/expense_categories', credentials.token,
data: json.encode(data));
} else {
final url = '${credentials.url}/expense_categories/${expenseCategory.id}';
Expand Down
8 changes: 4 additions & 4 deletions lib/data/repositories/expense_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ExpenseRepository {

Future<BuiltList<ExpenseEntity>> loadList(Credentials credentials, int page,
int createdAt, bool filterDeleted) async {
final url = credentials.url+
final url = credentials.url +
'/expenses?per_page=$kMaxRecordsPerPage&page=$page&created_at=$createdAt';

/* Server is incorrect if client isn't set
Expand All @@ -63,7 +63,7 @@ class ExpenseRepository {
}

final url =
credentials.url+ '/expenses/bulk?per_page=$kMaxEntitiesPerBulkAction';
credentials.url + '/expenses/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));

Expand All @@ -80,10 +80,10 @@ class ExpenseRepository {

if (expense.isNew) {
response = await webClient.post(
credentials.url+ '/expenses', credentials.token,
credentials.url + '/expenses', credentials.token,
data: json.encode(data));
} else {
final url = credentials.url+ '/expenses/${expense.id}';
final url = credentials.url + '/expenses/${expense.id}';
response =
await webClient.put(url, credentials.token, data: json.encode(data));
}
Expand Down
8 changes: 4 additions & 4 deletions lib/data/repositories/group_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GroupRepository {
}

Future<BuiltList<GroupEntity>> loadList(Credentials credentials) async {
final url = credentials.url+ '/group_settings?';
final url = credentials.url + '/group_settings?';

final dynamic response = await webClient.get(url, credentials.token);

Expand All @@ -49,7 +49,7 @@ class GroupRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
final url = credentials.url +
'/group_settings/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));
Expand All @@ -67,10 +67,10 @@ class GroupRepository {

if (group.isNew) {
response = await webClient.post(
credentials.url+ '/group_settings', credentials.token,
credentials.url + '/group_settings', credentials.token,
data: json.encode(data));
} else {
final url = credentials.url+ '/group_settings/${group.id}';
final url = credentials.url + '/group_settings/${group.id}';
response =
await webClient.put(url, credentials.token, data: json.encode(data));
}
Expand Down
6 changes: 3 additions & 3 deletions lib/data/repositories/payment_term_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PaymentTermRepository {
}

Future<BuiltList<PaymentTermEntity>> loadList(Credentials credentials) async {
final url = credentials.url+ '/payment_terms?';
final url = credentials.url + '/payment_terms?';

final dynamic response = await webClient.get(url, credentials.token);

Expand All @@ -48,7 +48,7 @@ class PaymentTermRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
final url = credentials.url +
'/payment_terms/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));
Expand All @@ -67,7 +67,7 @@ class PaymentTermRepository {

if (paymentTerm.isNew) {
response = await webClient.post(
credentials.url+ '/payment_terms', credentials.token,
credentials.url + '/payment_terms', credentials.token,
data: json.encode(data));
} else {
final url = '${credentials.url}/payment_terms/${paymentTerm.id}';
Expand Down
8 changes: 4 additions & 4 deletions lib/data/repositories/product_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ProductRepository {
Future<BuiltList<ProductEntity>> loadList(
Credentials credentials, int page) async {
final url =
credentials.url+ '/products?per_page=$kMaxRecordsPerPage&page=$page';
credentials.url + '/products?per_page=$kMaxRecordsPerPage&page=$page';

final dynamic response = await webClient.get(url, credentials.token);

Expand All @@ -62,7 +62,7 @@ class ProductRepository {
}

final url =
credentials.url+ '/products/bulk?per_page=$kMaxEntitiesPerBulkAction';
credentials.url + '/products/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(
url,
credentials.token,
Expand All @@ -89,10 +89,10 @@ class ProductRepository {

if (product.isNew) {
response = await webClient.post(
credentials.url+ '/products', credentials.token,
credentials.url + '/products', credentials.token,
data: json.encode(data));
} else {
var url = credentials.url+ '/products/${product.id}';
var url = credentials.url + '/products/${product.id}';
if (changedStock) {
url += '?update_in_stock_quantity=true';
}
Expand Down
6 changes: 3 additions & 3 deletions lib/data/repositories/recurring_expense_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class RecurringExpenseRepository {
}

Future<BuiltList<ExpenseEntity>> loadList(Credentials credentials) async {
final String url = credentials.url+ '/recurring_expenses?';
final String url = credentials.url + '/recurring_expenses?';
final dynamic response = await webClient.get(url, credentials.token);

final ExpenseListResponse recurringExpenseResponse =
Expand All @@ -48,7 +48,7 @@ class RecurringExpenseRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
final url = credentials.url +
'/recurring_expenses/bulk?per_page=$kMaxEntitiesPerBulkAction';
final dynamic response = await webClient.post(url, credentials.token,
data: json.encode({'ids': ids, 'action': action.toApiParam()}));
Expand All @@ -68,7 +68,7 @@ class RecurringExpenseRepository {
String url;

if (recurringExpense.isNew) {
url = credentials.url+ '/recurring_expenses?show_dates=true';
url = credentials.url + '/recurring_expenses?show_dates=true';
} else {
url =
'${credentials.url}/recurring_expenses/${recurringExpense.id}?show_dates=true';
Expand Down
6 changes: 3 additions & 3 deletions lib/data/repositories/recurring_invoice_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RecurringInvoiceRepository {

Future<BuiltList<InvoiceEntity>> loadList(
Credentials credentials, int page, bool filterDeleted) async {
String url = credentials.url+
String url = credentials.url +
'/recurring_invoices?per_page=$kMaxRecordsPerPage&page=$page';

if (filterDeleted) {
Expand All @@ -56,7 +56,7 @@ class RecurringInvoiceRepository {
ids = ids.sublist(0, kMaxEntitiesPerBulkAction);
}

final url = credentials.url+
final url = credentials.url +
'/recurring_invoices/bulk?per_page=$kMaxEntitiesPerBulkAction';
final params = {'ids': ids, 'action': action.toApiParam()};
if (data != null) {
Expand All @@ -83,7 +83,7 @@ class RecurringInvoiceRepository {
String url;

if (recurringInvoice.isNew) {
url = credentials.url+
url = credentials.url +
'/recurring_invoices?include=activities,history&show_dates=true';
} else {
url =
Expand Down
Loading

0 comments on commit 4308901

Please sign in to comment.