{"id":21413524,"url":"https://github.com/56kyle/qb_from_t2","last_synced_at":"2025-03-16T18:24:28.667Z","repository":{"id":120624221,"uuid":"246678079","full_name":"56kyle/qb_from_t2","owner":"56kyle","description":"This isn't the entirety of it, just the part that goes in ~/app/. The rest is in the QBWC gem.","archived":false,"fork":false,"pushed_at":"2020-03-11T21:04:50.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T05:17:11.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/56kyle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-11T20:55:23.000Z","updated_at":"2020-03-11T21:05:39.000Z","dependencies_parsed_at":"2024-08-10T23:01:36.190Z","dependency_job_id":null,"html_url":"https://github.com/56kyle/qb_from_t2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/56kyle%2Fqb_from_t2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/56kyle%2Fqb_from_t2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/56kyle%2Fqb_from_t2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/56kyle%2Fqb_from_t2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/56kyle","download_url":"https://codeload.github.com/56kyle/qb_from_t2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910763,"owners_count":20367544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T18:18:54.916Z","updated_at":"2025-03-16T18:24:28.660Z","avatar_url":"https://github.com/56kyle.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quickbooks Integration\n*In memory of my sanity~*\n```\n    0x80040400: QuickBooks found an error when parsing the provided XML text stream.\n```\n\n## Most Important Information ##\nNever use instance variables across methods that you are not explicitly calling. The qbwc gem creates a new instance for every single method call. \\\nIf you need to persist Information use either data[(foo)] (Please keep data as a hash unless you are a masochist) or make a new instance of the respective entity action class to find a value.\n\n## Index ##\n+ [Quickbooks Integration](#quickbooks-integration)\n    + [Most Important Information](#most-important-information)\n    + [Index](#index)\n    + [Dictionary](#dictionary)\n    + [Structure](#structure)\n    + [Current Progress](#current-progress)\n    + [Important Variables](#important-variables)\n        + [Entity Class](#entity-class)\n    + [Logic Flow](#logic-flow)\n        + [Example](#example)\n    + [Changes Made During Install](#changes-made-during-install)\n        + [Directories/Files](#directoriesfiles)\n        + [Migrations](#migrations-in-dbmigrate)\n        + [QBWC Other Changes](#qbwc-other-changes)\n\n## Dictionary ##\n**QBWC** - The qbwc gem that this project is centered around. \\\n**QBW** - The **Q**uick**B**ooks **W**ebconnecter ( I didn't come up with these - thank Intuit ) \\\n**Qb** - Quickbooks \\\n**QbC**, **QbI**, **QbP** - Qb + [Company, Invoice, Payment] and so on. \\\n**qbc** - Same as QbC but different use case. (I.E. Instance instead of Class usually, also used as a method to create an instance) \\\n**qbc_i** - qb company's invoice \\\n**qbp_ip_i** - qb payment's invoice_payment's invoice ( It just gets worse. Basically just read it in whatever way makes it obey the plurality it should be.) \\\n** Just as a note these chained names are mainly found deeper within the action classes.\n\n## Structure ##\n+ QBWC::Worker\n    + Main Class \u003c QBWC::Worker\n        + Entity Classes \u003c Main Class (includes respective entity actions module)\n        + Entity Actions Modules\n            + Action Classes \u003c Entity Classes\n            + ~~Action Modules~~ (These create way too much confusion.)\n            \n## Current Progress ##\n+ QBWC::Worker\n    + QbWorker (\u003c QBWC::Worker)\n        + includes Qb::[Companies, Invoices, Payments]\n    + Qb\n        + QbC (\u003c QbWorker)\n        + Companies\n            - [x] Add\n            - [x] Mod\n            - [x] Del\n            - [x] Query\n        + QbI\n        + Invoices (Most actions depend on Company)\n            - [x] Add \n            - [x] Mod\n            - [x] Del\n            - [x] Query\n            - [x] Void\n        + QbP\n        + Payments (Most actions depend on Company \u0026\u0026 Invoice)\n            - [x] Add\n            - [x] Mod\n            - [x] Del\n            - [x] Query\n            - [ ] Void\n            \n## Important Variables ##\n##### Entity Class #####\n    @qb_entity = String; Qb name for the entity. (CamelCase)\n    @t2_entity = Class; The T2 Model's Class\n    @t2_instance = Object; An instance of t2_entity found using a supplied ID.\n    \n## Logic Flow ##\n+ Same for every entity mostly. Only difference is Company doesn't have a Void action.\n+ For readability I am going to omit any intermediate logic I can. This is just to get an idea of what certain actions will lead to eventually. Assume \"~\u003e\" encompasses a couple steps.\n#### Example ####\n    new_invoice = Invoice.new(paid_amount: 1000).save ~\u003e Qb::Invoices::Add.act(new_invoice)\n    Qb::Invoices::Add.act(new_invoice) ~\u003e QBWC.add_job(...) # Enters an entry into qbwc_jobs\n    # Next step is prompted whenever QWC runs and sends a request to a predetermined link.\n    (QBWC Gem) Qb::Invoices::Add.new.should_run?(job, session, data) ~\u003e\n    (T2) Qb::Invoices::Add:Object.should_run?(...) ~\u003e (calls super do ... end or default)\n    (T2) Qb::QbI:Object.should_run?(...) ~\u003e (calls super do ... end or default)\n    (T2) QbWorker:Object.should_run?(...) ~\u003e (yields or default)\n    (QBWC Gem) QBWC::Worker:Object.should_run?(...) ~\u003e\nThis pattern is repeated in the following methods in the above mentioned classes:\n+ initialize(data= nil) (*note- qbwc doesn't call new with parameters.*)\n+ should_run?(job, session, data)\n+ requests(job, session, data)\n+ handle_response(response, session, job, request, data) (In that order, for whatever reason)\n\nThe reason that all of these call super is that at the top of the chain is QbWorker which initializes @t2_instance in every method call.\nThis allows us to avoid manually writing out 20 find_by's.\nAdditionally it allows guaranteeing handle_response always deletes the job on completion (assuming it doesn't error out).\n\n## Changes Made During Install ##\nI'm going to do my best to add everything here, but considering this needs to be ported to rails 4 it is liable to change.\n+ ##### Directories/Files #####\n    (In ~/app/)\\\n    Format: directory - [file, ...] (.rb not being shown)\n    + quickbooks - [qb_worker, qb_hook, grammar, README]\n        + qb - [qb_c, qb_i, qb_p]\n            + companies - [add, mod, del, query, void(just contains nil)]\n            + invoices - [add, mod, del, query, void] \n            + payments - [add, mod, del, query, void]\n            \n+ ##### Migrations (In ~/db/migrate/) #####\n    + add_qb_id_to_payments.rb\n    + add_qb_id_to_invoice_lines.rb\n    + create_qbwc_jobs.rb\n    + create_qbwc_sessions.rb\n    + index_qbwc_jobs.rb\n    + change_request_index.rb\n    + session_pending_jobs_text.rb\n    \n+ ##### QBWC Other Changes #####\n    + Adds an initializer\n    + Adds a controller\n    + Adds 3 routes\n\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F56kyle%2Fqb_from_t2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F56kyle%2Fqb_from_t2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F56kyle%2Fqb_from_t2/lists"}