'use strict'; /* * PPM (Project Portfolio Management) module pack for the MOCK Fusion-style app. NOT Oracle software; synthetic data; ASSUMED rules (store.js). * Hands project invoices to the O2C pack (AutoInvoice) and reads Payables costs from the P2P pack. */ const S = require('./store'); const W = require('./web'); const R = require('../../core/registry'); const ID = 'ppm'; module.exports = { id: ID, name: 'Project Portfolio Management', idPrefix: 'PPM', personas: S.PERSONAS, tasks: W.TASKS.map(([label, href, f]) => [label, href, (r) => R.inModule(r, ID) && f(r)]), processParams: [ { name: 'businessUnit', label: 'Business Unit' }, { name: 'transactionSource', label: 'Transaction Source' }, { name: 'contract', label: 'Contract' }, { name: 'throughDate', label: 'Through Date', type: 'date' }, { name: 'request', label: 'Request' }, { name: 'subledger', label: 'Subledger Application', value: 'Payables' }, { name: 'ledger', label: 'Ledger', value: 'US Primary Ledger (MOCK)' }, { name: 'mode', label: 'Mode', type: 'select', options: ['Final', 'Draft'] }, { name: 'transferToGL', label: 'Transfer to General Ledger', type: 'select', options: ['No', 'Yes'] }, { name: 'postInGL', label: 'Post in General Ledger', type: 'select', options: ['No', 'Yes'] }, ], processes: Object.entries(S.PROCESSES).map(([key, d]) => ({ ...d, name: d.name || key })), schemas: W.SCHEMAS, worklist: (role) => S.list('contracts').filter((c) => c.status === 'PENDING_APPROVAL' && c.approver === role).map((c) => ({ docNumber: c.number, docType: 'Project Contract', kind: 'APPROVAL', amount: c.amount, href: `/ppm/contracts/${c.number}` })), reset: () => S.reset(), mount({ app, rest }) { W.mount(app, rest); }, };