Skip to content

Commit 21b1889

Browse files
authored
Refactor to follow rails conventions (#54)
1 parent 8921b08 commit 21b1889

File tree

112 files changed

+743
-927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+743
-927
lines changed

app/controllers/accountify/contact_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Accountify
22
class ContactController < AccountifyController
33
def create
4-
contact = Contact.create(
4+
contact = ContactService.create(
55
user_id: user_id,
66
tenant_id: tenant_id,
77
organisation_id: params[:organisation_id],
@@ -13,7 +13,7 @@ def create
1313
end
1414

1515
def show
16-
contact = Contact.find_by_id(
16+
contact = ContactService.find_by_id(
1717
user_id: user_id,
1818
tenant_id: tenant_id,
1919
id: params[:id])
@@ -22,7 +22,7 @@ def show
2222
end
2323

2424
def update
25-
contact = Contact.update(
25+
contact = ContactService.update(
2626
user_id: user_id,
2727
tenant_id: tenant_id,
2828
id: params[:id],
@@ -34,7 +34,7 @@ def update
3434
end
3535

3636
def destroy
37-
contact = Contact.delete(
37+
contact = ContactService.delete(
3838
user_id: user_id,
3939
tenant_id: tenant_id,
4040
id: params[:id])

app/controllers/accountify/invoice_controller.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Accountify
22
class InvoiceController < AccountifyController
33
def create
4-
invoice = Invoice.draft(
4+
invoice = InvoiceService.draft(
55
user_id: user_id,
66
tenant_id: tenant_id,
77
organisation_id: params[:organisation_id],
@@ -14,7 +14,7 @@ def create
1414
end
1515

1616
def show
17-
invoice = Invoice.find_by_id(
17+
invoice = InvoiceService.find_by_id(
1818
user_id: user_id,
1919
tenant_id: tenant_id,
2020
id: params[:id])
@@ -23,7 +23,7 @@ def show
2323
end
2424

2525
def update
26-
invoice = Invoice.update(
26+
invoice = InvoiceService.update(
2727
user_id: user_id,
2828
tenant_id: tenant_id,
2929
id: params[:id],
@@ -36,7 +36,7 @@ def update
3636
end
3737

3838
def destroy
39-
invoice = Invoice.delete(
39+
invoice = InvoiceService.delete(
4040
user_id: user_id,
4141
tenant_id: tenant_id,
4242
id: params[:id])
@@ -45,7 +45,7 @@ def destroy
4545
end
4646

4747
def issue
48-
invoice = Invoice.issue(
48+
invoice = InvoiceService.issue(
4949
user_id: user_id,
5050
tenant_id: tenant_id,
5151
id: params[:id])
@@ -54,7 +54,7 @@ def issue
5454
end
5555

5656
def paid
57-
invoice = Invoice.paid(
57+
invoice = InvoiceService.paid(
5858
user_id: user_id,
5959
tenant_id: tenant_id,
6060
id: params[:id])
@@ -63,7 +63,7 @@ def paid
6363
end
6464

6565
def void
66-
invoice = Invoice.void(
66+
invoice = InvoiceService.void(
6767
user_id: user_id,
6868
tenant_id: tenant_id,
6969
id: params[:id])

app/controllers/accountify/organisation_controller.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Accountify
22
class OrganisationController < AccountifyController
33
def create
4-
organisation = Organisation.create(
4+
organisation = OrganisationService.create(
55
user_id: user_id,
66
tenant_id: tenant_id,
77
name: params[:name])
@@ -10,7 +10,7 @@ def create
1010
end
1111

1212
def show
13-
organisation = Organisation.find_by_id(
13+
organisation = OrganisationService.find_by_id(
1414
user_id: user_id,
1515
tenant_id: tenant_id,
1616
id: params[:id])
@@ -19,7 +19,7 @@ def show
1919
end
2020

2121
def update
22-
organisation = Organisation.update(
22+
organisation = OrganisationService.update(
2323
user_id: user_id,
2424
tenant_id: tenant_id,
2525
id: params[:id],
@@ -29,7 +29,7 @@ def update
2929
end
3030

3131
def destroy
32-
organisation = Organisation.delete(
32+
organisation = OrganisationService.delete(
3333
user_id: user_id,
3434
tenant_id: tenant_id,
3535
id: params[:id])

app/domains/accountify/models/contact.rb

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/domains/accountify/models/contact/created_event.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/domains/accountify/models/contact/deleted_event.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/domains/accountify/models/contact/updated_event.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/domains/accountify/models/invoice.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/domains/accountify/models/invoice/deleted_event.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/domains/accountify/models/invoice/drafted_event.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)