Files
Mike Dalessio fe6df7085f Finish the rollout of account_id to all core data models
Schema:
- add account_id to tables it was missing from
- make account_id a required column everywhere
- add [account_id] indexes, or add `account_id` to existing indices

Models:
- add `belongs_to :account` to all models (default to using a domain
  model's account whenever possible)
- add account_id in all the necessary fixtures
- add account_id to insert_all hashes
- pass account_id to a few initialize calls

Miscellaneous:
- update the import script to set account_id

Note that I'm not adding account_id to the join tables primarily
because I couldn't think of an easy way to populate it without making
it a full Join model, and that was more work than I have time to take
on right now.
2025-11-17 09:12:40 -05:00

52 lines
1.6 KiB
YAML

# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
successfully_completed:
id: <%= ActiveRecord::FixtureSet.identify("successfully_completed_delivery", :uuid) %>
account: 37s_uuid
webhook: active_uuid
event: logo_published_uuid
state: completed
request: '<%= { headers: {} }.to_json %>'
response: '<%= { code: 200, headers: {} }.to_json %>'
created_at: <%= 1.week.ago %>
unsuccessfully_completed:
id: <%= ActiveRecord::FixtureSet.identify("unsuccessfully_completed_delivery", :uuid) %>
account: 37s_uuid
webhook: active_uuid
event: logo_assignment_jz_uuid
state: completed
request: '<%= { headers: {} }.to_json %>'
response: '<%= { code: 422, headers: {} }.to_json %>'
created_at: <%= 1.week.ago + 1.hour %>
errored:
id: <%= ActiveRecord::FixtureSet.identify("errored_delivery", :uuid) %>
account: 37s_uuid
webhook: active_uuid
event: layout_published_uuid
state: errored
request: '<%= { headers: {} }.to_json %>'
response: '<%= { error: "destination_unreachable" }.to_json %>'
created_at: <%= 1.week.ago %>
pending:
id: <%= ActiveRecord::FixtureSet.identify("pending_delivery", :uuid) %>
account: 37s_uuid
webhook: active_uuid
event: shipping_closed_uuid
state: pending
request: null
response: null
created_at: <%= 2.day.ago %>
in_progress:
id: <%= ActiveRecord::FixtureSet.identify("in_progress_delivery", :uuid) %>
account: 37s_uuid
webhook: active_uuid
event: logo_assignment_km_uuid
state: in_progress
request: null
response: null
created_at: <%= 1.day.ago %>