|
|
|
@ -100,6 +100,24 @@ unless Rails.env.test?
|
|
|
|
|
provider_type: "LA", |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
OrganisationRelationship.find_or_create_by!( |
|
|
|
|
parent_organisation: stock_owner1, |
|
|
|
|
child_organisation: org, |
|
|
|
|
) |
|
|
|
|
OrganisationRelationship.find_or_create_by!( |
|
|
|
|
parent_organisation: stock_owner2, |
|
|
|
|
child_organisation: org, |
|
|
|
|
) |
|
|
|
|
OrganisationRelationship.find_or_create_by!( |
|
|
|
|
parent_organisation: org, |
|
|
|
|
child_organisation: managing_agent1, |
|
|
|
|
) |
|
|
|
|
OrganisationRelationship.find_or_create_by!( |
|
|
|
|
parent_organisation: org, |
|
|
|
|
child_organisation: managing_agent2, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
if Rails.env.development? || Rails.env.review? |
|
|
|
|
User.find_or_create_by!( |
|
|
|
|
name: "Provider Owns Stock", |
|
|
|
|
email: "provider.owner1@example.com", |
|
|
|
@ -194,24 +212,6 @@ unless Rails.env.test?
|
|
|
|
|
create_data_protection_confirmation(user) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
OrganisationRelationship.find_or_create_by!( |
|
|
|
|
parent_organisation: stock_owner1, |
|
|
|
|
child_organisation: org, |
|
|
|
|
) |
|
|
|
|
OrganisationRelationship.find_or_create_by!( |
|
|
|
|
parent_organisation: stock_owner2, |
|
|
|
|
child_organisation: org, |
|
|
|
|
) |
|
|
|
|
OrganisationRelationship.find_or_create_by!( |
|
|
|
|
parent_organisation: org, |
|
|
|
|
child_organisation: managing_agent1, |
|
|
|
|
) |
|
|
|
|
OrganisationRelationship.find_or_create_by!( |
|
|
|
|
parent_organisation: org, |
|
|
|
|
child_organisation: managing_agent2, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
if Rails.env.development? || Rails.env.review? |
|
|
|
|
User.find_or_create_by!( |
|
|
|
|
name: "Provider", |
|
|
|
|
email: "provider@example.com", |
|
|
|
@ -251,42 +251,10 @@ unless Rails.env.test?
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
if (Rails.env.development? || Rails.env.review?) && SalesLog.count.zero? |
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
assigned_to: support_user, |
|
|
|
|
owning_organisation: org, |
|
|
|
|
managing_organisation: org, |
|
|
|
|
saledate: Time.zone.today, |
|
|
|
|
purchid: "1", |
|
|
|
|
ownershipsch: 1, |
|
|
|
|
type: 2, |
|
|
|
|
jointpur: 1, |
|
|
|
|
jointmore: 1, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
assigned_to: support_user, |
|
|
|
|
owning_organisation: org, |
|
|
|
|
managing_organisation: org, |
|
|
|
|
saledate: Time.zone.today, |
|
|
|
|
purchid: "1", |
|
|
|
|
ownershipsch: 2, |
|
|
|
|
type: 9, |
|
|
|
|
jointpur: 1, |
|
|
|
|
jointmore: 1, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
SalesLog.find_or_create_by!( |
|
|
|
|
assigned_to: support_user, |
|
|
|
|
owning_organisation: org, |
|
|
|
|
managing_organisation: org, |
|
|
|
|
saledate: Time.zone.today, |
|
|
|
|
purchid: "1", |
|
|
|
|
ownershipsch: 3, |
|
|
|
|
type: 10, |
|
|
|
|
companybuy: 1, |
|
|
|
|
) |
|
|
|
|
FactoryBot.create(:sales_log, :shared_ownership_setup_complete, assigned_to: support_user) |
|
|
|
|
FactoryBot.create(:sales_log, :discounted_ownership_setup_complete, assigned_to: support_user) |
|
|
|
|
FactoryBot.create(:sales_log, :outright_sale_setup_complete, assigned_to: support_user) |
|
|
|
|
|
|
|
|
|
pp "Seeded a sales log of each type" |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
if Rails.env.development? || Rails.env.review? |
|
|
|
|