Add reloading component tracking #18

Open
opened 2022-02-19 00:09:54 -05:00 by shibao · 1 comment
Owner
  • Add reloading components: need to sketch out db schema

Possible features:

  • Calculate final cost per round based on component price

I'd appreciate any additional ideas or conversations on this feature if you're interested!

- Add reloading components: need to sketch out db schema Possible features: - Calculate final cost per round based on component price I'd appreciate any additional ideas or conversations on this feature if you're interested!
shibao added the
enhancement
label 2022-02-19 00:09:54 -05:00
shibao added this to the cannery project 2022-02-19 00:09:54 -05:00
shibao added the
big feature
label 2022-02-19 00:47:11 -05:00
Author
Owner

Rough draft of schema:

Cannery.Reloading.Material:
Represents some raw material used for reloading. Can be stored in containers alongside ammo packs.

  schema "materials" do
    field :name, :string
    field :notes, :text
    field :amount, :float
    field :price_paid, :float
    field :purchased_on, :date
    
    field :manufacturer, :string
    field :upc, :string
    field :lot_number :string

    field :container_id, :binary_id
    field :user_id, :binary_id

    timestamps()
  end

Cannery.Reloading.PackMaterial:
Represents a usage of raw material in an ammo pack. Can use :amount_used + material's :price_paid to calculate a raw cost for an ammo pack.

  schema "pack_materials" do
    field :amount_used, :float
    field :notes, :string
    field :manufactured_on, :date

    belongs_to :material, Material

    field :pack_id, :binary_id
    field :user_id, :binary_id

    timestamps()
  end
Rough draft of schema: `Cannery.Reloading.Material`: Represents some raw material used for reloading. Can be stored in containers alongside ammo packs. ```elixir schema "materials" do field :name, :string field :notes, :text field :amount, :float field :price_paid, :float field :purchased_on, :date field :manufacturer, :string field :upc, :string field :lot_number :string field :container_id, :binary_id field :user_id, :binary_id timestamps() end ``` `Cannery.Reloading.PackMaterial`: Represents a usage of raw material in an ammo pack. Can use `:amount_used` + material's `:price_paid` to calculate a raw cost for an ammo pack. ```elixir schema "pack_materials" do field :amount_used, :float field :notes, :string field :manufactured_on, :date belongs_to :material, Material field :pack_id, :binary_id field :user_id, :binary_id timestamps() end ```
shibao added this to the Reloading milestone 2023-03-30 23:23:29 -04:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: shibao/cannery#18
No description provided.