add guns #3

Open
opened 2022-02-08 01:45:29 -05:00 by shibao · 4 comments
Owner

rough draft of schema

please add suggestions!

Cannery.Guns.Gun:

field :name, :string, required: true
field :type, :string, required: true # rifle, pistol, etc
field :notes, :text
field :caliber, :string
field :overpressure, :string
field :manufacturer, :string
field :model, :string
field :serial_number, :string
field :status, Ecto.Enum, values: [:bought, :stored, :sold, :destroyed]
field :price_paid, :float
field :price_sold, :float
field :orientation, Ecto.Enum, values: [:left, :right, :ambidextrous], default: :ambidextrous

belongs_to :fixed_magazine, Container # for revolvers, etc, otherwise nil

has_many :components, GunComponent

index/show page for guns

Cannery.Guns.GunComponent:

field :name, :string
field :notes, :text
field :type, :string, required: true # optic, barrel, etc
field :manufacturer, :string
field :serial_number, :string
field :round_count_limit, :integer # max number of rounds to show a percentage of lifetime left

# dimensions
field :length, :float
field :height, :float
field :width, :float
field :weight, :float
field :diameter, :float

# emitters
field :light_emitting, :boolean
field :laser_emitting, :boolean
field :ir_light_emitting, :boolean
field :ir_laser_emitting, :boolean

# optic-specific fields
field :is_optic: :boolean
field :optic_type, :string
field :reticle, :string
field :magnification_type, Ecto.Enum, values: [:fixed, :variable]
field :magnification_lower_limit, :string
field :magnification_upper_limit, :string # will be nil if fixed
field :lens_size, :string
field :lens_coating, :string
field :night_vision_built_in, :boolean
field :night_vision_capable, :boolean
field :thermal_built_in, :boolean
field :thermal_capable, :boolean

# suppressor-specific fields
field :caliber_lower_limit, :string
field :caliber_upper_limit, :string # will be nil if fixed caliber
field :thread_size, :float
field :thread_depth, :float

belongs_to :gun, Gun

index/show page for components, including wear totals

add to Cannery.Containers.Container:

field :capacity, :integer
field :caliber_restriction, :string
field :length_restriction, :float
field :manufacturer, :string
field :sku, :string
field :serial_number, :string

belongs_to :gun, Gun

Cannery.ActivityLog.ComponentRecord:
Records a certain shot group on a component, to increase wear totals

belongs_to :shot_group, ShotGroup
field :gun_component, :binary_id # reference GunComponent
rough draft of schema --- please add suggestions! `Cannery.Guns.Gun`: ```elixir field :name, :string, required: true field :type, :string, required: true # rifle, pistol, etc field :notes, :text field :caliber, :string field :overpressure, :string field :manufacturer, :string field :model, :string field :serial_number, :string field :status, Ecto.Enum, values: [:bought, :stored, :sold, :destroyed] field :price_paid, :float field :price_sold, :float field :orientation, Ecto.Enum, values: [:left, :right, :ambidextrous], default: :ambidextrous belongs_to :fixed_magazine, Container # for revolvers, etc, otherwise nil has_many :components, GunComponent ``` index/show page for guns `Cannery.Guns.GunComponent`: ```elixir field :name, :string field :notes, :text field :type, :string, required: true # optic, barrel, etc field :manufacturer, :string field :serial_number, :string field :round_count_limit, :integer # max number of rounds to show a percentage of lifetime left # dimensions field :length, :float field :height, :float field :width, :float field :weight, :float field :diameter, :float # emitters field :light_emitting, :boolean field :laser_emitting, :boolean field :ir_light_emitting, :boolean field :ir_laser_emitting, :boolean # optic-specific fields field :is_optic: :boolean field :optic_type, :string field :reticle, :string field :magnification_type, Ecto.Enum, values: [:fixed, :variable] field :magnification_lower_limit, :string field :magnification_upper_limit, :string # will be nil if fixed field :lens_size, :string field :lens_coating, :string field :night_vision_built_in, :boolean field :night_vision_capable, :boolean field :thermal_built_in, :boolean field :thermal_capable, :boolean # suppressor-specific fields field :caliber_lower_limit, :string field :caliber_upper_limit, :string # will be nil if fixed caliber field :thread_size, :float field :thread_depth, :float belongs_to :gun, Gun ``` index/show page for components, including wear totals add to `Cannery.Containers.Container`: ```elixir field :capacity, :integer field :caliber_restriction, :string field :length_restriction, :float field :manufacturer, :string field :sku, :string field :serial_number, :string belongs_to :gun, Gun ``` `Cannery.ActivityLog.ComponentRecord`: Records a certain shot group on a component, to increase wear totals ```elixir belongs_to :shot_group, ShotGroup field :gun_component, :binary_id # reference GunComponent ```
shibao added the
enhancement
label 2022-02-08 01:45:49 -05:00
shibao added this to the cannery project 2022-02-08 01:47:24 -05:00
shibao added the
big feature
label 2022-02-19 00:47:15 -05:00
Author
Owner

Also add NFA item tracking to components!

Also add NFA item tracking to components!
shibao added a new dependency 2022-11-26 15:00:37 -05:00
Author
Owner

Updated the potential schema to be a lot more realistic, but still needs more suggestions on useful fields for guns, gun components, etc.

Hopefully the notes field on most of these will provide an out for anything that I miss, but mostly looking for things that would be useful to sort/categorize/use data from

Updated the potential schema to be a lot more realistic, but still needs more suggestions on useful fields for guns, gun components, etc. Hopefully the notes field on most of these will provide an out for anything that I miss, but mostly looking for things that would be useful to sort/categorize/use data from
shibao added this to the Guns milestone 2023-03-30 23:23:22 -04:00

hope the following makes sense and can be useful in some way. Not sure if its the type of information / suggestions you wanted but some or all of it might be good to support?

I suggest adding the following fields to all the types

  • serial number
  • purchase price
  • warranty (just for keeping track in case something breaks its all searchable in cannery)
  • Be able to mark it as sold / destoryed / active (so you can keep the history of the gun or compoent even if it no longer belongs to you etc)
  • Also a sold-on date for the above (so for legal reasons you can attest if anything happened, its no longer in your possesion with all records etc) - even if its marked on licenses and what not

If the component is an optic:

  • Scope Type (large amount, would recommend string field)
  • Scope reticle (duplex, Mil-Dot, BDC)
  • magnification (string type so it can be like 4x-6x etc)
  • magnification type (fixed, variable)
  • lens size (generally in mm)
  • lens coating (Coated, Fully-coated, Multicoated, Fully Multicoated )
  • Built-In Night vision (bool)
  • Built in Thermal (bool)
  • SKU
  • Manufacturer

If the component is a magazine:

  • Capacity (integer)
    i assume these will be auto set when linked to a gun, but could be useful to add if needed when not in use with a gun no more, or the gun has been sold but the component kept back)
  • Ammunition calibre
  • Ammunition length
  • SKU
  • Manufacturer

If the component is a sound moderator (supressor):

  • Caliber Support
  • Length
  • Weight
  • Thread Size
  • Thread depth
  • Diameter
  • Orientation (left handed, right handed, ambidexterous)
  • SKU
  • Manufacturer
hope the following makes sense and can be useful in some way. Not sure if its the type of information / suggestions you wanted but some or all of it might be good to support? **I suggest adding the following fields to all the types** - serial number - purchase price - warranty (just for keeping track in case something breaks its all searchable in cannery) - Be able to mark it as sold / destoryed / active (so you can keep the history of the gun or compoent even if it no longer belongs to you etc) - Also a sold-on date for the above (so for legal reasons you can attest if anything happened, its no longer in your possesion with all records etc) - even if its marked on licenses and what not **If the component is an optic:** - Scope Type (large amount, would recommend string field) - Scope reticle (duplex, Mil-Dot, BDC) - magnification (string type so it can be like 4x-6x etc) - magnification type (fixed, variable) - lens size (generally in mm) - lens coating (Coated, Fully-coated, Multicoated, Fully Multicoated ) - Built-In Night vision (bool) - Built in Thermal (bool) - SKU - Manufacturer **If the component is a magazine:** - Capacity (integer) i assume these will be auto set when linked to a gun, but could be useful to add if needed when not in use with a gun no more, or the gun has been sold but the component kept back) - Ammunition calibre - Ammunition length - SKU - Manufacturer **If the component is a sound moderator (supressor):** - Caliber Support - Length - Weight - Thread Size - Thread depth - Diameter - Orientation (left handed, right handed, ambidexterous) - SKU - Manufacturer
Author
Owner

These are fantastic considerations! Thank you!!

These are fantastic considerations! Thank you!!
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: shibao/cannery#3
No description provided.