module Roqua module CoreApi module Sessions class DossierGroupSession < OrganizationSession attr_reader :dossier_group_id def initialize(dossier_group_id, organization_id, server_url = ENV["CORE_URL"]) @dossier_group_id = dossier_group_id super(organization_id, server_url) end # create_dossier(.. , person: { email: 'user@domain.com' }) def create_dossier(attributes) response = post "/dossiers", person: attributes.delete(:person), dossier: attributes fail response.inspect unless response.code == 201 Models::Dossier.new(response) end def dossier_session(dossier_id) DossierSession.new dossier_id, dossier_group_id, organization_id, server_url end private def base_url super + "/dossier_groups/#{dossier_group_id}" end end end end end