fct_contracts


Description

Contracts between helpers and memberships. Join to fct_contact_prices for products and agreed prices.

Columns

Column Type Children Parents Comments
contract_id int8
fct_contract_products.contract_id Implied Constraint R
fct_visits.contract_id Implied Constraint R

The unique contract ID, e.g. 43.

membership_id int8

The ID of the membership associated with the visit, e.g. 1989.

community_id int8
dim_communities.community_id Implied Constraint R

The unique community ID of the Helper, e.g.: 123. DEPRECATED, join to dim_memberships and access the community_names field.

community_name text

The name of the community the helper is a part of, e.g.: Adelaide West. DEPRECATED, join to dim_memberships and access the community_names field.

helper_id int8

The helper ID associated with the contract, e.g.: 57.

is_active bool

Whether the contract has begun, is not expired and the membership is not archived. One of True, False.

count_products int8
beginning_at timestamp

The date and time the contract starts (in UTC), e.g. 2021-03-02 12:00:00.

expired_at timestamp

The date and time the contract expires at (in UTC), e.g. 2021-03-02 12:00:00.

created_at timestamp

The date and time the contract was created at (in UTC), e.g. 2021-03-02 12:00:00.

updated_at timestamp

The date and time the contract was last updated at (in UTC), e.g. 2021-03-02 12:00:00.

company_id int8
dim_companies.company_id Implied Constraint R

The company ID, e.g.: 345.

Indexes

Constraint Name Type Sort Column(s)
fct_contracts_pkey Primary key Asc contract_id
fct_contracts_company_id_idx Performance Asc company_id
fct_contracts_helper_id_idx Performance Asc helper_id
fct_contracts_membership_id_idx Performance Asc membership_id

Relationships