Skip to content

Commit

Permalink
Enhance schema documentation for simObject_Schema; clarify unique nam…
Browse files Browse the repository at this point in the history
…e requirement and intercompanyInfo constraints in comments
  • Loading branch information
77it committed Jan 26, 2025
1 parent 3411448 commit 76c4cf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/engine/simobject/simobject.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const simObject_Schema = {

dateTime: schema.DATE_TYPE,

name: schema.STRING_TYPE,
name: schema.STRING_TYPE, // name, must be unique between ALIVE SimObjects in the same Unit
description: schema.STRING_TYPE, // immutable, is used to generate Reports Detail
mutableDescription: schema.STRING_TYPE, // unused during Reports generation, can be used for debug purpose (and in the future to be shown to the user during a Drill Down of reports voices)

Expand All @@ -28,6 +28,8 @@ const simObject_Schema = {

currency: Currency_enum_validation,

// In a writing Group, IntercompanyInfo can be: inverted, missing on some, equal on all, missing totally.
// IS NOT ALLOWED the presence of more than two different Units in a writing Group.
intercompanyInfo__VsUnitId: schema.STRING_TYPE,

value: schema.BIGINT_NUMBER_TYPE,
Expand All @@ -52,7 +54,8 @@ const simObject_Schema = {
//#endregion properties common only to some kind of SimObjects

//#region properties NOT EXPORTED TO JSON DUMP
vsSimObjectName: schema.STRING_TYPE, // See notes below >vsSimObjectName_note_20231111. This is the name of the SimObject that is the opposite of this one, e.g. a credit is the opposite of a debit
// See notes below >vsSimObjectName_note_20231111. This is the name of the SimObject that is the opposite of this one, e.g. a credit is the opposite of a debit
vsSimObjectName: schema.STRING_TYPE,
//[REPLACED] //vsSimObjectId: schema.STRING_TYPE, // REPLACED WITH `vsSimObjectName` because we will can't set in both linked SimObjects the Id of the other, because the other will not exist yet; instead the name can be set in both linked SimObjects
versionId: schema.NUMBER_TYPE,
//[REMOVED] //previousVersionId: schema.STRING_TYPE,
Expand All @@ -69,6 +72,6 @@ Can be used to align automatically the payment schedule of the linked SimObjects
two SimObject is the same before. See Ledger and NWC notes.
If this property is set in one SimObject A only and is missing from the linked SimObject B
the two SimObjects A & B will be considered linked and will be treated as if they have an opposite/matching vsSimObjectName & intercompanyInfo__VsUnitId.
the two SimObjects A & B will still be considered linked and will be treated as if they have an opposite/matching vsSimObjectName & intercompanyInfo__VsUnitId.
Furthermore, B can't define a vsSimObjectName vs C, because this will be a fatal error.
*/
2 changes: 1 addition & 1 deletion src/modules/_utils/square_trn.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const CASH_DEFAULT_NAME = BS_CASH__BANKACCOUNT_FINANCIALACCOUNT__NAME;
* @param {Ledger} p.ledger
*/
function squareTrn ({ ledger, unit, type }) {
// TODO funzione di modules/utils che crea una voce di cassa a completamento dello sbilancio corrente (es VsCash)
// TODO funzione di modules/utils che crea una voce di cassa a completamento dello sbilancio corrente (es Vs Cash)
xxx; // read the current ledger unbalanced amount and create a cash entry to balance it

// se è missing la voce contabile di quadratura leggila da globals.DEFAULT_ACCOUNTING_VS_TYPE
Expand Down

0 comments on commit 76c4cf9

Please sign in to comment.