Puroom

Tables (15)

app_user

  • user_id — BIGINT — Primary key — NOT NULL
  • thinq_account_id — VARCHAR
  • name — VARCHAR
  • birth_date — DATE
  • gender — VARCHAR
  • phone_number — VARCHAR
  • email — VARCHAR
  • created_at — TIMESTAMPTZ
  • last_login_at — TIMESTAMPTZ
  • deleted_at — TIMESTAMPTZ

auto_delivery_order

  • order_id — BIGINT — Primary key — NOT NULL
  • auto_delivery_id — BIGINT — Foreign key → cartridge_auto_delivery.auto_delivery_id
  • order_status — VARCHAR
  • requested_at — TIMESTAMPTZ
  • completed_at — TIMESTAMPTZ

capture_log

  • capture_id — BIGINT — Primary key — NOT NULL
  • device_id — BIGINT — Foreign key → puroom_device.device_id — NOT NULL
  • operation_id — BIGINT — Foreign key → operation_log.operation_id
  • captured_count — INTEGER
  • captured_at — TIMESTAMPTZ

cartridge_auto_delivery

  • auto_delivery_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.user_id
  • device_id — BIGINT — Foreign key → puroom_device.device_id
  • is_enabled — CHAR(1)
  • shipping_address_id — BIGINT — Foreign key → shipping_address.shipping_address_id
  • payment_method_id — BIGINT — Foreign key → payment_method.payment_method_id
  • consent_status — CHAR(1)

device_registration

  • registration_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.user_id
  • device_id — BIGINT — Foreign key → puroom_device.device_id
  • registered_at — TIMESTAMPTZ
  • is_active — CHAR(1)

device_status

  • status_id — BIGINT — Primary key — NOT NULL
  • device_id — BIGINT — Foreign key → puroom_device.device_id — NOT NULL
  • pouch_usage_rate — NUMERIC
  • cartridge_remaining_count — INTEGER
  • bin_status — VARCHAR
  • checked_at — TIMESTAMPTZ
  • last_replaced_at — TIMESTAMPTZ

notification

  • notification_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.user_id
  • device_id — BIGINT — Foreign key → puroom_device.device_id
  • risk_id — BIGINT — Foreign key → risk_assessment.risk_id
  • notification_type — VARCHAR
  • title — VARCHAR
  • message — TEXT
  • sent_at — TIMESTAMPTZ
  • read_status — VARCHAR

operation_log

  • operation_id — BIGINT — Primary key — NOT NULL
  • device_id — BIGINT — Foreign key → puroom_device.device_id — NOT NULL
  • risk_id — BIGINT — Foreign key → risk_assessment.risk_id
  • mode_type — VARCHAR — NOT NULL
  • started_at — TIMESTAMPTZ — NOT NULL
  • ended_at — TIMESTAMPTZ
  • duration — INTEGER
  • auto_triggered — CHAR(1) — NOT NULL

payment_method

  • payment_method_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.user_id
  • payment_token — VARCHAR
  • payment_type — VARCHAR
  • is_default — CHAR(1)

puroom_device

  • device_id — BIGINT — Primary key — NOT NULL
  • serial_number — VARCHAR
  • device_name — VARCHAR
  • model_name — VARCHAR
  • wifi_status — VARCHAR
  • last_connected_at — TIMESTAMPTZ
  • registered_at — TIMESTAMPTZ
  • region_code — VARCHAR

report

  • report_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.user_id
  • device_id — BIGINT — Foreign key → puroom_device.device_id
  • report_type — VARCHAR
  • period_start — TIMESTAMPTZ
  • period_end — TIMESTAMPTZ
  • generated_at — TIMESTAMPTZ
  • summary — TEXT

risk_assessment

  • risk_id — BIGINT — Primary key — NOT NULL
  • device_id — BIGINT — Foreign key → puroom_device.device_id — NOT NULL
  • sensor_data_id — UUID — Foreign key → sensor_data.id
  • risk_score — SMALLINT
  • risk_level — VARCHAR
  • calculated_at — TIMESTAMPTZ
  • outdoor_humidity — DOUBLE PRECISION
  • precipitation_mm — DOUBLE PRECISION
  • capture_count — INTEGER
  • features — JSONB

sensor_data

  • id — UUID — Primary key — NOT NULL
  • device_id — BIGINT — Foreign key → puroom_device.device_id — NOT NULL
  • indoor_temperature — DOUBLE PRECISION
  • indoor_humidity — DOUBLE PRECISION
  • measured_at — TIMESTAMPTZ — NOT NULL

shipping_address

  • shipping_address_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.user_id
  • receiver_name — VARCHAR
  • address — VARCHAR
  • is_default — CHAR(1)

weather_log

  • weather_id — BIGINT — Primary key — NOT NULL
  • device_id — BIGINT — Foreign key → puroom_device.device_id — NOT NULL
  • observed_at — TIMESTAMPTZ — NOT NULL