Service - CommerceAccounting Purchase

From Izara Wiki
Revision as of 14:37, 23 January 2026 by Sven the Barbarian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

Handle purchases in one service, because some Accounting entries include the full amount, some break up according to purchaseLineItems.

Repository

...

Object Schemas

Additional Information
Per Service Schemas
{
	objectType: "comAccPurchaseLink",
	canDelete: false,
	belongTo: {
		serviceTag: "ComAccLink",
		objectType: "comAccLink"
	},
	addOnDataStructure: [],
	storageResources: {
		"dynamo": {
			"storageType": "dynamoDB",
			"tableName": "comAccPurchaseLink",
		}
    },
    fieldNames: {
		// probably have two dynamo tables, one identified by purchaseId, one by journalId
		
    },
    identifiers: [
		{
			// see above note
		}
    ]
}
  • one purchaseId may link to multiple journalIds, purchase value and inventory adjustment entries
  • maintains a link between purchaseId and journalIds, so can adjust if changes made to purchase

Relationships

...

flowSchemas

purchaseCreated

  • when creating a purchase, iterate purchaseLineItems to decide which journal entries are created
  • accountsPayable accountId will need to come from Service - CommerceAccounting Vendor

Purchase Value

  • the total purchase value has journal entry for all the below:
    1. (credit)accountsPayable(Liability)
  • The other side (debit) is broken up depending on lineItem type
  • For expenses value an entry is entered into the below
  • Maybe classify expenses and have different accounts depending on classification
    1. (debit)expense(Expense)
  • Goods:
    1. (debit)inventory(Asset)
  • Intangible Goods:
    1. (debit)expense(Expense)
  • Services:
    1. (debit)expense(Expense)
  • Assets:
    1. (debit)inventoryAsset(Asset)
  • Intangible Assets have:
    1. (debit)inventoryIntangibleAsset(Asset)
  • all debit side may have:
    1. (debit)vatReceivable(Asset)

inventoryAsset Purchased

  • maybe triggered from ComAcc Sale saleCommitted flow, because needs to know asset purchase journalId
  • simply saves the link for future actions

purchaseChange

  • make adjustment to journal entries when purchaseLineItemId changes
  • perhaps handling removal of purchase/journal entries, or creation of new entries
  • basically re-calculate all entries and check against existing

Working documents

CommerceAccounting Purchase