comee_core 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/comee/core/application_controller.rb +4 -0
- data/app/models/comee/core/additional_item.rb +9 -0
- data/app/models/comee/core/invoice.rb +2 -1
- data/app/models/comee/core/payment.rb +11 -0
- data/db/migrate/20240124161320_create_comee_core_additional_items.rb +15 -0
- data/db/migrate/20240125044630_create_comee_core_payments.rb +20 -0
- data/lib/comee/core/version.rb +1 -1
- data/spec/factories/comee/core/additional_items.rb +8 -0
- data/spec/factories/comee/core/invoices.rb +8 -0
- data/spec/factories/comee/core/payments.rb +10 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96fca3f74e6642e5c3724443f279cdeb58217aa89d6aef57f9a67f6fde3757c4
|
4
|
+
data.tar.gz: dc819ee771048da328d51512915be23ea2b433432fdaee9fe988109fe2698a14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38f4ec48d09c65eba8b4e4a7bdb6cede0279ceeac08a97358125860c5cf49ed2564cb03366aaccb8b8c4f47e8df900f2ffeb819e4112e5b1721a2104cffbe143
|
7
|
+
data.tar.gz: a75a0a0b023ce9971086f81ca4b6f030a008d018abe048bb67cd0efdd25a88f6c2f9d2a0609cc061f9063cb4e994ddcddd1a996ed5d6de5b26fa9b1be9a322c7
|
@@ -4,10 +4,11 @@ module Comee
|
|
4
4
|
belongs_to :sales_order
|
5
5
|
belongs_to :pod
|
6
6
|
has_many :invoice_items
|
7
|
+
has_many :additional_items
|
7
8
|
|
8
9
|
has_noticed_notifications model_name: "Comee::Core::Notification"
|
9
10
|
|
10
|
-
enum :status, {draft: 0, approved: 1}
|
11
|
+
enum :status, {draft: 0, approved: 1, issued: 2}
|
11
12
|
enum :payment_status, {not_paid: 0, partially_paid: 1, fully_paid: 2, overpaid: 3}
|
12
13
|
|
13
14
|
validates :invoice_no, presence: true, uniqueness: true
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateComeeCoreAdditionalItems < ActiveRecord::Migration[7.1]
|
2
|
+
def change
|
3
|
+
create_table :comee_core_additional_items do |t|
|
4
|
+
t.references :invoice,
|
5
|
+
null: false,
|
6
|
+
index: {name: "invoice_on_ccai_indx"},
|
7
|
+
foreign_key: {to_table: :comee_core_invoices}
|
8
|
+
t.float :quantity, null: false, default: 1
|
9
|
+
t.float :unit_price, null: false
|
10
|
+
t.float :total_price, null: false
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateComeeCorePayments < ActiveRecord::Migration[7.1]
|
2
|
+
def change
|
3
|
+
create_table :comee_core_payments do |t|
|
4
|
+
t.string :reference_no, null: false
|
5
|
+
t.references :invoice,
|
6
|
+
null: false,
|
7
|
+
index: {name: "invoice_on_ccp_indx"},
|
8
|
+
foreign_key: {to_table: :comee_core_invoices}
|
9
|
+
t.date :payment_date, null: false
|
10
|
+
t.float :amount, null: false
|
11
|
+
t.references :currency,
|
12
|
+
null: false,
|
13
|
+
index: {name: "currency_on_ccp_indx"},
|
14
|
+
foreign_key: {to_table: :comee_core_currencies}
|
15
|
+
t.string :bank_reference
|
16
|
+
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/comee/core/version.rb
CHANGED
@@ -10,5 +10,13 @@ FactoryBot.define do
|
|
10
10
|
notifications_sent { 0 }
|
11
11
|
status { Comee::Core::Invoice.statuses[:draft] }
|
12
12
|
payment_status { Comee::Core::Invoice.payment_statuses[:not_paid] }
|
13
|
+
|
14
|
+
trait :approved do
|
15
|
+
status { Comee::Core::Invoice.statuses[:approved] }
|
16
|
+
end
|
17
|
+
|
18
|
+
trait :issued do
|
19
|
+
status { Comee::Core::Invoice.statuses[:issued] }
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :payment, class: "Comee::Core::Payment" do
|
3
|
+
reference_no { Faker::Alphanumeric.alpha(number: 10) }
|
4
|
+
invoice
|
5
|
+
payment_date { Date.current }
|
6
|
+
amount { 100 }
|
7
|
+
currency
|
8
|
+
bank_reference { Faker::Alphanumeric.alpha(number: 10) }
|
9
|
+
end
|
10
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comee_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henock L.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -299,6 +299,7 @@ files:
|
|
299
299
|
- app/jobs/comee_core/application_job.rb
|
300
300
|
- app/mailers/comee/core/application_mailer.rb
|
301
301
|
- app/mailers/comee/core/supplier_mailer.rb
|
302
|
+
- app/models/comee/core/additional_item.rb
|
302
303
|
- app/models/comee/core/agent.rb
|
303
304
|
- app/models/comee/core/application_record.rb
|
304
305
|
- app/models/comee/core/back_order.rb
|
@@ -323,6 +324,7 @@ files:
|
|
323
324
|
- app/models/comee/core/master_price.rb
|
324
325
|
- app/models/comee/core/notification.rb
|
325
326
|
- app/models/comee/core/order_source.rb
|
327
|
+
- app/models/comee/core/payment.rb
|
326
328
|
- app/models/comee/core/pickup_schedule.rb
|
327
329
|
- app/models/comee/core/pod.rb
|
328
330
|
- app/models/comee/core/price.rb
|
@@ -429,11 +431,14 @@ files:
|
|
429
431
|
- db/migrate/20240109185931_create_comee_core_time_slots.rb
|
430
432
|
- db/migrate/20240111112140_create_comee_core_pickup_schedules.rb
|
431
433
|
- db/migrate/20240119100125_create_comee_core_client_warehouses.rb
|
434
|
+
- db/migrate/20240124161320_create_comee_core_additional_items.rb
|
435
|
+
- db/migrate/20240125044630_create_comee_core_payments.rb
|
432
436
|
- lib/comee/core.rb
|
433
437
|
- lib/comee/core/engine.rb
|
434
438
|
- lib/comee/core/version.rb
|
435
439
|
- lib/comee_core.rb
|
436
440
|
- lib/tasks/comee_core_tasks.rake
|
441
|
+
- spec/factories/comee/core/additional_items.rb
|
437
442
|
- spec/factories/comee/core/agents.rb
|
438
443
|
- spec/factories/comee/core/back_order_items.rb
|
439
444
|
- spec/factories/comee/core/back_orders.rb
|
@@ -457,6 +462,7 @@ files:
|
|
457
462
|
- spec/factories/comee/core/master_prices.rb
|
458
463
|
- spec/factories/comee/core/notifications.rb
|
459
464
|
- spec/factories/comee/core/order_sources.rb
|
465
|
+
- spec/factories/comee/core/payments.rb
|
460
466
|
- spec/factories/comee/core/pickup_schedules.rb
|
461
467
|
- spec/factories/comee/core/pods.rb
|
462
468
|
- spec/factories/comee/core/product_lookups.rb
|