{"id":406,"date":"2025-03-25T22:15:52","date_gmt":"2025-03-25T22:15:52","guid":{"rendered":"https:\/\/techtrendfeed.com\/?p=406"},"modified":"2025-03-25T22:15:53","modified_gmt":"2025-03-25T22:15:53","slug":"genai-from-immediate-to-manufacturing","status":"publish","type":"post","link":"https:\/\/techtrendfeed.com\/?p=406","title":{"rendered":"GenAI: From Immediate to Manufacturing"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<h2 dir=\"ltr\">The Thought<\/h2>\n<p dir=\"ltr\">A venture time-tracking system ought to enable entry of:<\/p>\n<ul>\n<li dir=\"ltr\">Purchasers have a number of tasks consisting of a number of duties.<\/li>\n<li dir=\"ltr\">Duties have timesheet entries, accomplished by individuals getting into hours working for a consumer.\u00a0<\/li>\n<li dir=\"ltr\">Invoices are created by including bill gadgets linked to billable timesheet traces. \u00a0<\/li>\n<li dir=\"ltr\">As soon as the bill is marked as prepared, ship the knowledge to Kafka for bill processing.<\/li>\n<\/ul>\n<h2 dir=\"ltr\">The Immediate<\/h2>\n<p dir=\"ltr\"><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.genai-logic.com\/why-genai-logic\/for-developers\" rel=\"noopener noreferrer\" target=\"_blank\">GenAI Logic<\/a> is an online web page, like many chatbots, that permits the consumer to enter a immediate. The extra particulars offered, the higher the consequence (though you possibly can iterate so as to add or change the end result utilizing the \u201cIterate\u201d button). \u00a0<\/p>\n<p dir=\"ltr\">You need to describe the mannequin and attribute, the logic, and the use circumstances as totally as potential. Then, merely click on \u201cCreate Tasks\u201d and wait about 90 seconds.\u00a0<\/p>\n<p dir=\"ltr\">One notice<span style=\"margin: 0px; padding: 0px;\">: Beneath \u201cAdvance Settings,\u201d change the information mannequin dimension to eight (the variety of tables to create).\u00a0<\/span>This prevents GenAI from including extra tables which are wanted.<\/p>\n<p><img decoding=\"async\" style=\"width: 298px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"15.5 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1740162585131\" data-creationdateformatted=\"02\/21\/2025 06:29 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236667-screenshot-2025-02-20-at-104910am.png\" data-modificationdate=\"null\" data-size=\"15528\" data-name=\"screenshot-2025-02-20-at-104910am.png\" data-id=\"18236667\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236667-screenshot-2025-02-20-at-104910am.png\" alt=\"Data model size\"\/><\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"Use these names for tables and attributes:&#10;&#10;* Client (id, name, email, phone, total_hours, total_amount, budget_amount, is_over_budget)&#10;* Project ( id, client_id, name, total_project_hours, total_project_amount, project_budget_amount, is_over_budget, is_active)&#10;* Invoice: (id, invoice_date, project_id, invoice_amount, payment_total, invoice_balance, is_paid, is_ready,task_count,completed_task_count)&#10;* InvoiceItem(id, invoice_id, task_id, task_amount, is_completed)&#10;* Task (id, project_id, name, description, total_task_hours_worked, total_task_amount_billed, task_budget_hours, is_over_budget,is_completed)&#10;* Person (id, client_id, name, email, phone, billing_rate, total_hours_entered, total_amount_billed)&#10;* Timesheet (id,task_id, person_id, date_worked, hours_worked, billing_rate, total_amount_billed, is_billable)&#10;* Payment (id, invoice_id, amount, payment_date, notes)\" data-lang=\"text\/plain\">\n<pre><code lang=\"text\/plain\">Use these names for tables and attributes:\n\n* Shopper (id, identify, electronic mail, telephone, total_hours, total_amount, budget_amount, is_over_budget)\n* Venture ( id, client_id, identify, total_project_hours, total_project_amount, project_budget_amount, is_over_budget, is_active)\n* Bill: (id, invoice_date, project_id, invoice_amount, payment_total, invoice_balance, is_paid, is_ready,task_count,completed_task_count)\n* InvoiceItem(id, invoice_id, task_id, task_amount, is_completed)\n* Activity (id, project_id, identify, description, total_task_hours_worked, total_task_amount_billed, task_budget_hours, is_over_budget,is_completed)\n* Individual (id, client_id, identify, electronic mail, telephone, billing_rate, total_hours_entered, total_amount_billed)\n* Timesheet (id,task_id, person_id, date_worked, hours_worked, billing_rate, total_amount_billed, is_billable)\n* Fee (id, invoice_id, quantity, payment_date, notes)<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<h2 dir=\"ltr\">Enterprise Logic<\/h2>\n<p data-end=\"612\" data-start=\"81\">Break down the logic into use circumstances, beginning with timesheets, to explain the enterprise logic. For instance: \u201cCopy the individual\u2019s <code data-end=\"243\" data-is-only-node=\"\" data-start=\"229\">billing_rate<\/code> multiplied by the <code data-end=\"276\" data-start=\"262\">hours_worked<\/code> to get the <code data-end=\"309\" data-start=\"288\">total_amount_billed<\/code>.\u201d\u00a0<\/p>\n<p data-end=\"612\" data-start=\"81\">Then, modify the use case rule to solely carry out the calculation if the <code data-end=\"395\" data-start=\"382\">is_billable<\/code> flag is ready to <code data-end=\"417\" data-start=\"411\">True<\/code> (some duties are non-billable). The sums and counts are rolled up from Activity to Venture to Shopper. The <code data-end=\"535\" data-start=\"519\">is_over_budget<\/code> flag is decided based mostly on the <code data-end=\"583\" data-start=\"568\">budget_amount<\/code> of the Shopper and Venture.<\/p>\n<p data-end=\"868\" data-start=\"614\">The bill has an <code data-end=\"643\" data-start=\"633\">is_ready<\/code> flag that, when set to <code data-end=\"673\" data-start=\"667\">true<\/code>, sends the bill row to Kafka. This enables a Kafka client to provoke the workflow integration in a separate container. Different workflows and integrations might be simply added to the use circumstances.<\/p>\n<h3 dir=\"ltr\"><strong>Enterprise Guidelines (Logic)<\/strong><\/h3>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"Use LogicBank to enforce business logic.&#10;&#10;Use case: Person&#10;Total Hours entered is sum of timesheet hours worked&#10;Total amount billed is total hours entered times billing rate&#10;Billing rate must be greater than 0 and less than 200&#10;&#10;Use case: Timesheet&#10;Copy billing rate from Person billing rate&#10;If is_billable then the total amount billed is the billing rate times hours worked &#10;Hours worked must be greater than 0 and less than 15&#10;&#10;Use Case: Task&#10;Total task hours worked is the sum of the Timesheet hours worked&#10;Total task amount billed is the sum of the Timesheet total amount billed&#10;Formula: is Over Budget  when total task hours worked exceeds task budget hours&#10;&#10;Use Case: Project&#10;Total project hours is the sum of Task total task hours worked&#10;Total project amount is the sum of Task total amount billed&#10;Formula: is Over Budget when total project amount exceeds project budget amount&#10;&#10;Use Case: Client&#10;Total hours is the sum of Project total project hours&#10;Total amount is the sum of Project total project amount&#10;Formula: is Over Budget equals true when total amount exceeds budget amount&#10;&#10;Use Case: Invoice&#10;Invoice Amount is the sum of InvoiceItem task amount&#10;Payment total is the sum of Payment amount&#10;Invoice balance is invoice amount less payment total&#10;Formula: is_paid when invoice balance is than or equal to zero&#10;Task Count is count of InvoiceItem &#10;Task completed count is count of InvoiceItem where is_completed is True&#10;Formula: is ready when Task Count is equal to Task Completed Count&#10;Send invoice to Kafka when is_ready is True&#10;&#10;Use Case: InvoiceItem&#10;InvoiceItem task amount is copied from Task total task amount billed&#10;InvoiceItem is_completed is sum of Task is_completed when True\" data-lang=\"text\/plain\">\n<pre><code lang=\"text\/plain\">Use LogicBank to implement enterprise logic.\n\nUse case: Individual\nWhole Hours entered is sum of timesheet hours labored\nWhole quantity billed is complete hours entered occasions billing fee\nBilling fee have to be larger than 0 and fewer than 200\n\nUse case: Timesheet\nCopy billing fee from Individual billing fee\nIf is_billable then the overall quantity billed is the billing fee occasions hours labored \nHours labored have to be larger than 0 and fewer than 15\n\nUse Case: Activity\nWhole process hours labored is the sum of the Timesheet hours labored\nWhole process quantity billed is the sum of the Timesheet complete quantity billed\nMethod: is Over Price range  when complete process hours labored exceeds process funds hours\n\nUse Case: Venture\nWhole venture hours is the sum of Activity complete process hours labored\nWhole venture quantity is the sum of Activity complete quantity billed\nMethod: is Over Price range when complete venture quantity exceeds venture funds quantity\n\nUse Case: Shopper\nWhole hours is the sum of Venture complete venture hours\nWhole quantity is the sum of Venture complete venture quantity\nMethod: is Over Price range equals true when complete quantity exceeds funds quantity\n\nUse Case: Bill\nBill Quantity is the sum of InvoiceItem process quantity\nFee complete is the sum of Fee quantity\nBill stability is bill quantity much less cost complete\nMethod: is_paid when bill stability is than or equal to zero\nActivity Rely is rely of InvoiceItem \nActivity accomplished rely is rely of InvoiceItem the place is_completed is True\nMethod: is prepared when Activity Rely is the same as Activity Accomplished Rely\nShip bill to Kafka when is_ready is True\n\nUse Case: InvoiceItem\nInvoiceItem process quantity is copied from Activity complete process quantity billed\nInvoiceItem is_completed is sum of Activity is_completed when True<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<h2 dir=\"ltr\">The Venture\u00a0<\/h2>\n<p dir=\"ltr\">When accomplished, GenAI Logic creates an SQL Database (SQLite), a SQLAlchemy ORM mannequin, an API (JSON API), a react-admin consumer, full enterprise logic (25+ guidelines), and pattern information for testing. This is able to simply be over 1,000 traces of code to deal with all of the use circumstances of including, updating, deleting, and reparenting entries. The whole venture might be downloaded from GitHub or a zipper file for the developer to overview.<\/p>\n<p dir=\"ltr\">Only for enjoyable, the system additionally created a single-page software touchdown web page to exhibit your venture immediate.\u00a0<\/p>\n<p dir=\"ltr\"><img decoding=\"async\" style=\"width: 652px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"651.9 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1740164064247\" data-creationdateformatted=\"02\/21\/2025 06:54 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236679-screenshot-2025-02-20-at-95003am.png\" data-modificationdate=\"null\" data-size=\"651948\" data-name=\"screenshot-2025-02-20-at-95003am.png\" data-id=\"18236679\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236679-screenshot-2025-02-20-at-95003am.png\" alt=\"ProjectTrue\"\/><\/p>\n<h2 dir=\"ltr\">The Information Mannequin<\/h2>\n<p dir=\"ltr\">The \u201cBackend Admin\u201d button results in the working web page that features the logic, the mannequin, a pattern react-admin software (for testing the foundations), and instruments for the developer. This was the mannequin created from the immediate.\u00a0<\/p>\n<p dir=\"ltr\"><img decoding=\"async\" style=\"width: 563px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"295.6 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1740164232920\" data-creationdateformatted=\"02\/21\/2025 06:57 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236684-screenshot-2025-02-20-at-95032am.png\" data-modificationdate=\"null\" data-size=\"295617\" data-name=\"screenshot-2025-02-20-at-95032am.png\" data-id=\"18236684\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236684-screenshot-2025-02-20-at-95032am.png\" alt=\"Automatically generated database\"\/><\/p>\n<h2 dir=\"ltr\">Discover the Venture<\/h2>\n<p dir=\"ltr\">The API entities at the moment are prepared to check on the left (a react software) to see take a look at information. Enter a Shopper, Venture, Activity, and Timesheet for a Individual and watch the sums, counts, and constraint guidelines change worth.<\/p>\n<p dir=\"ltr\">You too can run the generated software domestically utilizing Docker or click on on the GitHub hyperlink to see the code and run the applying utilizing <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/dzone.com\/articles\/getting-started-with-github-codespaces\">GitHub CodeSpaces<\/a>.\u00a0<\/p>\n<p dir=\"ltr\"><img decoding=\"async\" style=\"width: 585px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"232.8 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1740164272437\" data-creationdateformatted=\"02\/21\/2025 06:57 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236685-screenshot-2025-02-21-at-14810pm.png\" data-modificationdate=\"null\" data-size=\"232766\" data-name=\"screenshot-2025-02-21-at-14810pm.png\" data-id=\"18236685\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236685-screenshot-2025-02-21-at-14810pm.png\" alt=\"ProjectTimeTracker\"\/>\u00a0<\/p>\n<p dir=\"ltr\">Lastly, discover the API endpoints utilizing OpenAPI (Swagger). If the \u201c&gt; Logic Guidelines\u201d have any points<span style=\"margin: 0px; padding: 0px;\">, they are often individually reviewed, edited, rejected, or accepted. GenAI may even recommend logic based mostly in your mannequin (see the \u201cLogic\u201d button).\u00a0<\/span><\/p>\n<p dir=\"ltr\"><span style=\"margin: 0px; padding: 0px;\"><strong>Word<\/strong>: You too can run the Docker<\/span> model domestically.<\/p>\n<p dir=\"ltr\"><img decoding=\"async\" style=\"width: 808px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"40.9 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1740162768642\" data-creationdateformatted=\"02\/21\/2025 06:32 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236669-screenshot-2025-02-20-at-100947am.png\" data-modificationdate=\"null\" data-size=\"40864\" data-name=\"screenshot-2025-02-20-at-100947am.png\" data-id=\"18236669\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236669-screenshot-2025-02-20-at-100947am.png\"\/><\/p>\n<h2 dir=\"ltr\"><img decoding=\"async\" style=\"width: 808px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"228.1 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1740162789401\" data-creationdateformatted=\"02\/21\/2025 06:33 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236670-screenshot-2025-02-20-at-95828am.png\" data-modificationdate=\"null\" data-size=\"228104\" data-name=\"screenshot-2025-02-20-at-95828am.png\" data-id=\"18236670\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236670-screenshot-2025-02-20-at-95828am.png\"\/><br \/>\n <\/h2>\n<h2 dir=\"ltr\">The Logic Logs: Auditable and Clear<\/h2>\n<p dir=\"ltr\"><a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/dzone.com\/articles\/business-logic-database-agent\">Enterprise logic<\/a> shouldn&#8217;t be a black field. As API endpoints are accessed (POST, PATCH, and DELETE), the foundations hearth on state adjustments of dependent entities and attributes. An entire log of guidelines that fired and the order they fired, together with the row values impacted, provides a full, clear view of the processing. This isn&#8217;t a black field however a real companion to companies that require auditable and clear logic transactions.<\/p>\n<p dir=\"ltr\">Word <span style=\"margin: 0px; padding: 0px;\">that the <code>before_flush<\/code> exhibits the state change of every row impacted so as, and the <code>after_flush<\/code> exhibits the ultimate assortment of guidelines that fired (it is a lot of element, however it&#8217;s\u00a0<\/span>essential if that you must move an audit).\u00a0<\/p>\n<p dir=\"ltr\">Additionally, notice that the order begins with the timesheet change and cascades as much as the mother or father Shopper. Guidelines are unordered within the declaration (see logic folder) and might simply be added\/modified with out impacting different guidelines.<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"Logic Phase:&#9;&#9;ROW LOGIC&#9;&#9;(session=0xffffac2f0bf0) (sqlalchemy before_flush)&#9;&#9;&#9;&#10;..Timesheet[3] {Update - client} id: 3, task_id: 12, person_id: 6, date_worked:  [2025-02-20--&gt;] 2025-02-20 00:00:00, hours_worked:  [12.00--&gt;] 10, billing_rate: 100, total_amount_billed: 1200, is_billable: True  row: 0xffffac2443b0  session: 0xffffac2f0bf0  ins_upd_dlt: upd, initial: upd&#10;..Timesheet[3] {Formula total_amount_billed} id: 3, task_id: 12, person_id: 6, date_worked:  [2025-02-20--&gt;] 2025-02-20 00:00:00, hours_worked:  [12.00--&gt;] 10, billing_rate: 100, total_amount_billed:  [1200--&gt;] 1000, is_billable: True  row: 0xffffac2443b0  session: 0xffffac2f0bf0  ins_upd_dlt: upd, initial: upd&#10;....Person[6] {Update - Adjusting person: total_hours_entered} id: 6, client_id: 8, name: Person (New Client), email: person@client.com, phone: 8885551212, billing_rate: 100.00, total_hours_entered:  [12.00--&gt;] 10.00, total_amount_billed: 1200.00  row: 0xffffac244380  session: 0xffffac2f0bf0  ins_upd_dlt: upd, initial: upd&#10;....Person[6] {Formula total_amount_billed} id: 6, client_id: 8, name: Person (New Client), email: person@client.com, phone: 8885551212, billing_rate: 100.00, total_hours_entered:  [12.00--&gt;] 10.00, total_amount_billed:  [1200.00--&gt;] 1000.0000  row: 0xffffac244380  session: 0xffffac2f0bf0  ins_upd_dlt: upd, initial: upd&#10;....Task[12] {Update - Adjusting task: total_task_hours_worked, total_task_amount_billed} id: 12, project_id: 6, name: New Task, description: , total_task_hours_worked:  [12.00--&gt;] 10.00, total_task_amount_billed:  [1200.00--&gt;] 1000.00, task_budget_hours: 1000.00, is_over_budget: False, is_completed: False  row: 0xffffac2450a0  session: 0xffffac2f0bf0  ins_upd_dlt: upd, initial: upd&#10;......Project[6] {Update - Adjusting project: total_project_hours, total_project_amount} id: 6, client_id: 8, name: New Project, total_project_hours:  [12.00--&gt;] 10.00, total_project_amount:  [1200.00--&gt;] 1000.00, project_budget_amount: 1000.00, is_over_budget: True, is_active: False  row: 0xffffac247860  session: 0xffffac2f0bf0  ins_upd_dlt: upd, initial: upd&#10;......Project[6] {Formula is_over_budget} id: 6, client_id: 8, name: New Project, total_project_hours:  [12.00--&gt;] 10.00, total_project_amount:  [1200.00--&gt;] 1000.00, project_budget_amount: 1000.00, is_over_budget:  [True--&gt;] False, is_active: False  row: 0xffffac247860  session: 0xffffac2f0bf0  ins_upd_dlt: upd, initial: upd&#10;........Client[8] {Update - Adjusting client: total_hours, total_amount} id: 8, name: New Client, email: , phone: , total_hours:  [12.00--&gt;] 10.00, total_amount:  [1200.00--&gt;] 1000.00, budget_amount: 0.00, is_over_budget: True  row: 0xffffac2321e0  session: 0xffffac2f0bf0  ins_upd_dlt: upd, initial: upd&#10;&#10;Logic Phase:&#9;&#9;COMMIT LOGIC&#9;&#9;(session=0xffffac2f0bf0)   &#9;&#9;&#9;&#9;&#10;Logic Phase:&#9;&#9;AFTER_FLUSH LOGIC&#9;(session=0xffffac2f0bf0)   &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#10;These Rules Fired (see Logic Phases, above, for actual order):&#9;&#9;##&#10;  Client&#9;&#9;##&#10;    1. Derive &lt;class 'database.models.Client'&gt;.total_hours as Sum(Project.total_project_hours Where  - None)&#9;&#9;##&#10;    2. Derive &lt;class 'database.models.Client'&gt;.total_amount as Sum(Project.total_project_amount Where  - None)&#9;&#9;##&#10;    3. Derive &lt;class 'database.models.Client'&gt;.is_over_budget as Formula (1): Rule.formula(derive=Client.is_over_budget, as_exp [...]&#9;&#9;##&#10;  Person&#9;&#9;##&#10;    4. Derive &lt;class 'database.models.Person'&gt;.total_amount_billed as Formula (1): Rule.formula(derive=Person.total_amount_billed, a [...]&#9;&#9;##&#10;    5. Derive &lt;class 'database.models.Person'&gt;.total_hours_entered as Sum(Timesheet.hours_worked Where  - None)&#10;  Project&#9;&#9;##&#10;    6. Derive &lt;class 'database.models.Project'&gt;.total_project_amount as Sum(Task.total_task_amount_billed Where  - None)       &#10;    7. Derive &lt;class 'database.models.Project'&gt;.is_over_budget as Formula (1): Rule.formula(derive=Project.is_over_budget, &#10;       as_ex [...]&#9;&#9;##&#10;    8. Derive &lt;class 'database.models.Project'&gt;.total_project_hours as Sum(Task.total_task_hours_worked Where  - None)&#9;  Task&#9;&#9;##&#10;    9. Derive &lt;class 'database.models.Task'&gt;.total_task_amount_billed as Sum(Timesheet.total_amount_billed Where  - None)&#10;    10. Derive &lt;class 'database.models.Task'&gt;.is_over_budget as Formula (1): Rule.formula(derive=Task.is_over_budget, &#10;        as_expre [...]&#9;&#9;##&#10;    11. Derive &lt;class 'database.models.Task'&gt;.total_task_hours_worked as Sum(Timesheet.hours_worked Where  - None)&#10;  Timesheet&#9;&#9;##&#10;    12. Derive &lt;class 'database.models.Timesheet'&gt;.total_amount_billed as Formula (1): Rule.formula(derive=Timesheet.total_amount_billed [...]&#9;&#9;##&#10;&#10;Logic Phase:&#9;&#9;COMPLETE(session=0xffffac2f0bf0))  \" data-lang=\"text\/plain\">\n<pre><code lang=\"text\/plain\">Logic Section:\t\tROW LOGIC\t\t(session=0xffffac2f0bf0) (sqlalchemy before_flush)\t\t\t\n..Timesheet[3] {Replace - consumer} id: 3, task_id: 12, person_id: 6, date_worked:  [2025-02-20--&gt;] 2025-02-20 00:00:00, hours_worked:  [12.00--&gt;] 10, billing_rate: 100, total_amount_billed: 1200, is_billable: True  row: 0xffffac2443b0  session: 0xffffac2f0bf0  ins_upd_dlt: upd, preliminary: upd\n..Timesheet[3] {Method total_amount_billed} id: 3, task_id: 12, person_id: 6, date_worked:  [2025-02-20--&gt;] 2025-02-20 00:00:00, hours_worked:  [12.00--&gt;] 10, billing_rate: 100, total_amount_billed:  [1200--&gt;] 1000, is_billable: True  row: 0xffffac2443b0  session: 0xffffac2f0bf0  ins_upd_dlt: upd, preliminary: upd\n....Individual[6] {Replace - Adjusting individual: total_hours_entered} id: 6, client_id: 8, identify: Individual (New Shopper), electronic mail: individual@consumer.com, telephone: 8885551212, billing_rate: 100.00, total_hours_entered:  [12.00--&gt;] 10.00, total_amount_billed: 1200.00  row: 0xffffac244380  session: 0xffffac2f0bf0  ins_upd_dlt: upd, preliminary: upd\n....Individual[6] {Method total_amount_billed} id: 6, client_id: 8, identify: Individual (New Shopper), electronic mail: individual@consumer.com, telephone: 8885551212, billing_rate: 100.00, total_hours_entered:  [12.00--&gt;] 10.00, total_amount_billed:  [1200.00--&gt;] 1000.0000  row: 0xffffac244380  session: 0xffffac2f0bf0  ins_upd_dlt: upd, preliminary: upd\n....Activity[12] {Replace - Adjusting process: total_task_hours_worked, total_task_amount_billed} id: 12, project_id: 6, identify: New Activity, description: , total_task_hours_worked:  [12.00--&gt;] 10.00, total_task_amount_billed:  [1200.00--&gt;] 1000.00, task_budget_hours: 1000.00, is_over_budget: False, is_completed: False  row: 0xffffac2450a0  session: 0xffffac2f0bf0  ins_upd_dlt: upd, preliminary: upd\n......Venture[6] {Replace - Adjusting venture: total_project_hours, total_project_amount} id: 6, client_id: 8, identify: New Venture, total_project_hours:  [12.00--&gt;] 10.00, total_project_amount:  [1200.00--&gt;] 1000.00, project_budget_amount: 1000.00, is_over_budget: True, is_active: False  row: 0xffffac247860  session: 0xffffac2f0bf0  ins_upd_dlt: upd, preliminary: upd\n......Venture[6] {Method is_over_budget} id: 6, client_id: 8, identify: New Venture, total_project_hours:  [12.00--&gt;] 10.00, total_project_amount:  [1200.00--&gt;] 1000.00, project_budget_amount: 1000.00, is_over_budget:  [True--&gt;] False, is_active: False  row: 0xffffac247860  session: 0xffffac2f0bf0  ins_upd_dlt: upd, preliminary: upd\n........Shopper[8] {Replace - Adjusting consumer: total_hours, total_amount} id: 8, identify: New Shopper, electronic mail: , telephone: , total_hours:  [12.00--&gt;] 10.00, total_amount:  [1200.00--&gt;] 1000.00, budget_amount: 0.00, is_over_budget: True  row: 0xffffac2321e0  session: 0xffffac2f0bf0  ins_upd_dlt: upd, preliminary: upd\n\nLogic Section:\t\tCOMMIT LOGIC\t\t(session=0xffffac2f0bf0)   \t\t\t\t\nLogic Section:\t\tAFTER_FLUSH LOGIC\t(session=0xffffac2f0bf0)   \t\t\t\t\t\t\t\t\t\t\nThese Guidelines Fired (see Logic Phases, above, for precise order):\t\t##\n  Shopper\t\t##\n    1. Derive <class>.total_hours as Sum(Venture.total_project_hours The place  - None)\t\t##\n    2. Derive <class>.total_amount as Sum(Venture.total_project_amount The place  - None)\t\t##\n    3. Derive <class>.is_over_budget as Method (1): Rule.method(derive=Shopper.is_over_budget, as_exp [...]\t\t##\n  Individual\t\t##\n    4. Derive <class>.total_amount_billed as Method (1): Rule.method(derive=Individual.total_amount_billed, a [...]\t\t##\n    5. Derive <class>.total_hours_entered as Sum(Timesheet.hours_worked The place  - None)\n  Venture\t\t##\n    6. Derive <class>.total_project_amount as Sum(Activity.total_task_amount_billed The place  - None)       \n    7. Derive <class>.is_over_budget as Method (1): Rule.method(derive=Venture.is_over_budget, \n       as_ex [...]\t\t##\n    8. Derive <class>.total_project_hours as Sum(Activity.total_task_hours_worked The place  - None)\t  Activity\t\t##\n    9. Derive <class>.total_task_amount_billed as Sum(Timesheet.total_amount_billed The place  - None)\n    10. Derive <class>.is_over_budget as Method (1): Rule.method(derive=Activity.is_over_budget, \n        as_expre [...]\t\t##\n    11. Derive <class>.total_task_hours_worked as Sum(Timesheet.hours_worked The place  - None)\n  Timesheet\t\t##\n    12. Derive <class>.total_amount_billed as Method (1): Rule.method(derive=Timesheet.total_amount_billed [...]\t\t##\n\nLogic Section:\t\tCOMPLETE(session=0xffffac2f0bf0)) \u00a0<\/class><\/class><\/class><\/class><\/class><\/class><\/class><\/class><\/class><\/class><\/class><\/class><\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<h2 dir=\"ltr\"><\/h2>\n<h2 dir=\"ltr\">ApiLogicServer: The Developer Journey<\/h2>\n<p dir=\"ltr\">The whole generative method is constructed on high of the open-source <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/dzone.com\/articles\/instant-microservices-with-rules-for-logic-and-security\">ApiLogicServer<\/a> (ALS). As soon as the venture is downloaded, it may be edited utilizing VSCode (or your favourite IDE). The platform is constructed on Python 3.12, SQLAlchemy ORM, and Flask. \u00a0<\/p>\n<p dir=\"ltr\">The super-power is the declarative guidelines engine LogicBank. \u00a0<\/p>\n<ul>\n<li dir=\"ltr\">Are expressive \u2013 40X the expressive energy of procedural code<\/li>\n<li dir=\"ltr\">Promote high quality \u2013 Robotically invoked\u00a0<\/li>\n<li dir=\"ltr\">Are maintainable \u2013 Robotically ordered<\/li>\n<li dir=\"ltr\">Rule execution logs \u2013 Auditable, traceable, and clear<\/li>\n<\/ul>\n<p dir=\"ltr\">The venture is organized into folders<span style=\"margin: 0px; padding: 0px;\">: API, config, logic, database, integration, safety, DevOps, and take a look at. Every folder is completely documented and offers the developer with the flexibility so as to add\/modify options and companies (e.g., customized API endpoints, integrations, behave take a look at circumstances, or declarative role-based entry management) in an IDE. (Carry your individual favourite AI instrument 0.\u2014\u00a0<\/span>CoPilot, Sourcery, Cursor, and so forth.)\u00a0<\/p>\n<p dir=\"ltr\">Listed here are the steps taken to edit\/modify the native venture. Whereas it&#8217;s potential to make use of SQLIte in manufacturing (8 billion smartphones can\u2019t be improper), I selected the PostgreSQL route.<\/p>\n<ol>\n<li dir=\"ltr\">Convert SQLite to PostgreSQL (sqlite3 database\/db.sqlite .dump &gt; timetrack_pg.sql).<\/li>\n<li dir=\"ltr\">Modify the SQL file for PostgreSQL particular (e.g., change sequence to SERIAL8).<\/li>\n<li dir=\"ltr\">Create the PostgreSQL database and rebuild the mannequin ($als rebuild-from-database).<\/li>\n<li dir=\"ltr\">Add KeyCloak safety ($als add-auth \u2013provider-type=keycloak or SQL).<\/li>\n<li dir=\"ltr\">Modify the config.py to level to Keycloak or SQL occasion.<\/li>\n<li dir=\"ltr\">Add role-based entry management for various roles (e.g,. supervisor, advisor, accounting). See safety\/declare_security.py.<\/li>\n<li dir=\"ltr\">Initialize the GitHub repository and push adjustments.<\/li>\n<li dir=\"ltr\">Use devops\/docker-image ($sh build-image.sh) to create and push the container to the Docker hub.<\/li>\n<\/ol>\n<p dir=\"ltr\"><strong>Word<\/strong>: You could want to alter the linux\/amd64 to linux\/arm64 on your deployed atmosphere.<\/p>\n<h3 dir=\"ltr\"><strong>Amazon EC2 and RDS Work<\/strong><\/h3>\n<ol>\n<li dir=\"ltr\">Create an RDS PostgreSQL occasion and deploy timetrack_pg.sql (create database timetracker).<\/li>\n<li dir=\"ltr\">Create an EC2 occasion and pull the docker picture into the container.<\/li>\n<li dir=\"ltr\">Add a docker-compose file to start out the picture and connect with RDS.<\/li>\n<li dir=\"ltr\">Check the authorization <a rel=\"nofollow\" target=\"_blank\" href=\"http:\/\/ec2\u2026\u2026compute-1.amazonaws.com:5656\">http:\/\/ec2\u2026\u2026compute-1.amazonaws.com:5656<\/a>.<\/li>\n<\/ol>\n<h2 dir=\"ltr\">Check Pushed Improvement<\/h2>\n<p>One fast phrase about testing logic. Utilizing the Behave situation characteristic proven under, we rapidly added the implementation to insert varied API entities and take a look at the derivations, aggregations, and occasions with full log traceability.<\/p>\n<div class=\"codeMirror-wrapper newest\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"  Scenario: New Timesheet&#10;    Given Enter Timesheet Data&#10;      When Timesheet Post&#10;      Then Timesheet entered and balances&#10;      &#10;     &#10;@given('Enter Timesheet Data')&#10;def step_impl(context):&#10;    context.data = {&quot;task_id&quot;: task_id, &quot;person_id&quot;: person_id, &quot;hours_worked&quot;: 10, &quot;date_worked&quot;: &quot;2025-01-01&quot;,&quot;is_billable&quot;: True}&#10;    assert True is not False&#10;&#10;@when('Timesheet Post')&#10;def step_impl(context):&#10;    print(context.data)&#10;    r = test_utils.post(&quot;Timesheet&quot;, context.data)&#10;    context.response = r&#10;    assert True is not False&#10;&#10;@then('Timesheet entered and balances')&#10;def step_impl(context):&#10;    scenario = &quot;New Timesheet&quot;&#10;    test_utils.prt(f'Rules Report', scenario)&#10;    global timesheet_id &#10;    timesheet_id = int(context.response[&quot;data&quot;][&quot;id&quot;])&#10;    r = test_utils.get(&quot;Client&quot;, client_id)&#10;    total_hrs = r[&quot;data&quot;][&quot;attributes&quot;][&quot;total_hours&quot;] ## 10&#10;    assert total_hrs == 10, f&quot;Total Hours: {total_hrs} expected: 10&quot;&#10;    &#10; The Log&#10; Mapped Class[Timesheet] rules:&#9;&#9;##   - 2025-02-25 13:49:22,057 - logic_logger - INFO&#10;  Derive &lt;class 'database.models.Timesheet'&gt;.billing_rate as Copy(person.billing_rate)&#9;&#9;##   - 2025-02-25 13:49:22,057 - logic_logger - INFO&#10;  Derive &lt;class 'database.models.Timesheet'&gt;.total_amount_billed as Formula (1): Rule.formula(derive=Timesheet.total_amount_billed [...]&#9;&#9;##   - 2025-02-25 13:49:22,057 - logic_logger - INFO\" data-lang=\"text\/x-python\">\n<pre><code lang=\"text\/x-python\">  Situation: New Timesheet\n    Given Enter Timesheet Information\n      When Timesheet Put up\n      Then Timesheet entered and balances\n      \n     \n@given('Enter Timesheet Information')\ndef step_impl(context):\n    context.information = {\"task_id\": task_id, \"person_id\": person_id, \"hours_worked\": 10, \"date_worked\": \"2025-01-01\",\"is_billable\": True}\n    assert True shouldn't be False\n\n@when('Timesheet Put up')\ndef step_impl(context):\n    print(context.information)\n    r = test_utils.publish(\"Timesheet\", context.information)\n    context.response = r\n    assert True shouldn't be False\n\n@then('Timesheet entered and balances')\ndef step_impl(context):\n    situation = \"New Timesheet\"\n    test_utils.prt(f'Guidelines Report', situation)\n    international timesheet_id \n    timesheet_id = int(context.response[\"data\"][\"id\"])\n    r = test_utils.get(\"Shopper\", client_id)\n    total_hrs = r[\"data\"][\"attributes\"][\"total_hours\"] ## 10\n    assert total_hrs == 10, f\"Whole Hours: {total_hrs} anticipated: 10\"\n    \n The Log\n Mapped Class[Timesheet] guidelines:\t\t##   - 2025-02-25 13:49:22,057 - logic_logger - INFO\n  Derive <class>.billing_rate as Copy(individual.billing_rate)\t\t##   - 2025-02-25 13:49:22,057 - logic_logger - INFO\n  Derive <class>.total_amount_billed as Method (1): Rule.method(derive=Timesheet.total_amount_billed [...]\t\t##   - 2025-02-25 13:49:22,057 - logic_logger - INFO<\/class><\/class><\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<h2 dir=\"ltr\">Angular Entrance-Finish Utilizing OntimizeWeb<\/h2>\n<p dir=\"ltr\">ApiLogicServer also can generate an Angular front-end utilizing OntimizeWeb from Imatia. Every API endpoint is used to create pages that may be modified utilizing commonplace instruments or regenerated by modifying the templates (jinja fashion) used to construct web page types (tables, grids, grasp\/element, treeview, and so forth.).<\/p>\n<p dir=\"ltr\">From the command line:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"$als app-create --app=timetracker&#10;$als app-build --app=timetracker&#10;$cd ui\/timetracker&#10;$npm install &amp;&amp; npm start\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">$als app-create --app=timetracker\n$als app-build --app=timetracker\n$cd ui\/timetracker\n$npm set up &amp;&amp; npm begin<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<h3 dir=\"ltr\">Docker and NGINX<\/h3>\n<p dir=\"ltr\">As soon as the Angular front-end has been authorised by the UX staff, it is able to be dockerized and pushed.\u00a0<\/p>\n<ol>\n<li dir=\"ltr\">cd ui\/timetracker<\/li>\n<li dir=\"ltr\">Evaluate nginx\/nginx.conf for manufacturing routing<\/li>\n<li dir=\"ltr\">Evaluate src\/environments\/timetracker.prod.ts routing<\/li>\n<li dir=\"ltr\">$docker construct -f Dockerfile -t ${dockerhub}\/timetracker &#8211;rm\u00a0<\/li>\n<li dir=\"ltr\">Test in adjustments to GitHub<\/li>\n<\/ol>\n<h2 dir=\"ltr\">Modify EC2 Compose File<\/h2>\n<p dir=\"ltr\">Add the brand new front-end to the docker-compose.yml file and restart. The brand new Ontimize software must be working on port 80. Use Keycloak to log in (or add SQL authentication and use a reputation\/password). As soon as logged in, create a consumer, a venture, process, or individual and enter a timesheet (under). Then, see the logs to look at how guidelines hearth. \u00a0<\/p>\n<p dir=\"ltr\"><img decoding=\"async\" style=\"width: 647px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"682.7 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1740164155405\" data-creationdateformatted=\"02\/21\/2025 06:55 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236683-screenshot-2025-02-20-at-14532pm.png\" data-modificationdate=\"null\" data-size=\"682733\" data-name=\"screenshot-2025-02-20-at-14532pm.png\" data-id=\"18236683\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18236683-screenshot-2025-02-20-at-14532pm.png\" alt=\"TimeTracker log in\"\/> <strong>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/strong><\/p>\n<h3 dir=\"ltr\"><strong>TreeView Listing of Purchasers and Duties<\/strong><\/h3>\n<p dir=\"ltr\"><img decoding=\"async\" style=\"width: 652px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"424.0 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1740517944846\" data-creationdateformatted=\"02\/25\/2025 09:12 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18245941-screenshot-2025-02-25-at-41135pm.png\" data-modificationdate=\"null\" data-size=\"423962\" data-name=\"screenshot-2025-02-25-at-41135pm.png\" data-id=\"18245941\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18245941-screenshot-2025-02-25-at-41135pm.png\" alt=\"TreeView List of Clients and Tasks\"\/><\/p>\n<h2 dir=\"ltr\">Abstract: Immediate to Manufacturing in 2 Hours, Human within the Loop<\/h2>\n<p dir=\"ltr\">The immediate to manufacturing course of required roughly 2 hours to finish. Though \u201cImmediate to Manufacturing\u201d is the headline, human involvement was nonetheless mandatory for duties corresponding to safety configuration (authentication and authorization), docker compose file configuration, and UX\/UI fine-tuning.\u00a0<\/p>\n<p dir=\"ltr\">Moreover, Kafka and Workflow integrations and configurations required the experience of a separate staff member. The UX staff might need to improve the feel and appear, however that is 100% useful and examined.<\/p>\n<p dir=\"ltr\">See the Venture Time Tracker on GitHub repository <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.genai-logic.com\/why-genai-logic\/for-developers\" rel=\"noopener noreferrer\" target=\"_blank\">right here<\/a>.<\/p>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>The Thought A venture time-tracking system ought to enable entry of: Purchasers have a number of tasks consisting of a number of duties. Duties have timesheet entries, accomplished by individuals getting into hours working for a consumer.\u00a0 Invoices are created by including bill gadgets linked to billable timesheet traces. \u00a0 As soon as the bill [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":411,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[151,153,152],"class_list":["post-406","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-genai","tag-production","tag-prompt"],"_links":{"self":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406"}],"version-history":[{"count":1,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":407,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions\/407"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/media\/411"}],"wp:attachment":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- This website is optimized by Airlift. Learn more: https://airlift.net. Template:. Learn more: https://airlift.net. Template: 69d9690a190636c2e0989534. Config Timestamp: 2026-04-10 21:18:02 UTC, Cached Timestamp: 2026-05-13 14:34:08 UTC -->