Service - CommerceAccounting Purchase
Revision as of 15:03, 11 January 2026 by Sven the Barbarian (talk | contribs) (Created page with "= Overview = Handle purchases in one service, becuase some Accounting entries include the full amount, some break up according to purchaseLineItems. = Repository = ... = Object Schemas = ; Additional Information: Per Service Schemas <syntaxhighlight lang="JavaScript"> { objectType: "comAccPurchaseLink", canDelete: false, belongTo: { serviceTag: "User", objectType: "user" }, addOnDataStructure: [], storageResources: { "dynamo": { "storageType": "dy...")
Overview
Handle purchases in one service, becuase 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: "User",
objectType: "user"
},
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:
- (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
- (debit)expense(Expense)
- Goods:
- (debit)inventory(Asset)
- Intangible Goods:
- (debit)expense(Expense)
- Services:
- (debit)expense(Expense)
- Assets:
- (debit)inventoryAsset(Asset)
- Intangible Assets have:
- (debit)inventoryIntangibleAsset(Asset)
- all debit side may have:
- (debit)vatReceivable(Asset)
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