buzzn / core

Die Kraft der Gemeinschaft
GNU Affero General Public License v3.0
1 stars 0 forks source link

Documents endpoint for Contract and document(ation) endpoint #1444

Closed mguentner closed 6 years ago

mguentner commented 6 years ago

~adds /localpools/{}/contracts/{}/document~

~what it does~

~Each instance of a model represents a (mostly) mutable object in our database. The document verb and endpoint can be used to create a snapshot of it. Our current way of doing this, is creating a .pdf, for a contract that would be something printable and sign-able.~

adds /localpools/{}/contracts/{}/documents/generate

what it does

Each instance of a model represents a (mostly) mutable object in our database. The document verb and a matching endpoint can be used to create a snapshot of it. Our current way of doing this, is creating a .pdf, for a contract that would be something printable and sign-able.

adds /localpools/{}/contracts/{}/documents

what is does

adds /localpools/{}/contracts/{}/documents/{}

what is does

adds /localpools/{}/contracts/{}/documents/{}/fetch

what is does

mkristian commented 6 years ago

@mguentner just realised that the contract_documents table is just straightforward joiner table for http://guides.rubyonrails.org/association_basics.html#the-has-and-belongs-to-many-association. example: https://github.com/buzzn/core/blob/master/app/models/person.rb#L13

i.e. we do not need the model ContractDocument AR record is just doing the whole magic right. also the table does not need a primary_key: see https://github.com/buzzn/core/blob/master/db/migrate/012_create_persons_roles.rb

mkristian commented 6 years ago

FYI: I will delete lib/tasks/zip2price.rake as it fails some rake tasks and is not needed anymore and a few other cleanups like remove this resource.destroy and the unused PersonRole model

mkristian commented 6 years ago

@mguentner oh I messed up your branch - sorry. please remove the last commit of mine again when you rebase the branch.

mkristian commented 6 years ago

merged manually - closing