| 1 | [ |
| 2 | "autonomous agent", |
| 3 | { |
| 4 | "init": "{ |
| 5 | $nom_AA = 'Consultes_Getons'; |
| 6 | |
| 7 | $args = trigger.data; |
| 8 | $_Portal = $args._Portal; |
| 9 | $refcons = $args.refcons; |
| 10 | |
| 11 | $__dada = $refval => { |
| 12 | data_feed[[ oracles = $args._Registre, feed_name = $refval, ifnone = false ]] |
| 13 | }; |
| 14 | }", |
| 15 | "messages": [ |
| 16 | { |
| 17 | "app": "state", |
| 18 | "state": "{ |
| 19 | response[ 'consulta' ] = $refcons; |
| 20 | |
| 21 | if ( $refcons == 'Dades_Geto' ) { |
| 22 | $getons_provisionals = var[ $_Portal ][ 'getons_provisionals' ]; |
| 23 | $refgeto = |
| 24 | $args.nom ? |
| 25 | 'geto_' || $args.nom : |
| 26 | $__dada( 'refgeto_' || $args.idgeto ); |
| 27 | |
| 28 | $resp = $args.nom ? 'getó amb nom ' || $args.nom : 'getó amb id ' || $args.idgeto; |
| 29 | |
| 30 | if ( ! $__dada( $refgeto ) ) |
| 31 | response[ $resp ] = 'Desconegut'; |
| 32 | |
| 33 | if ( ! $__dada( $refgeto || '__confirmant' ) ) |
| 34 | response[ $resp ] = 'Pendent de validació'; |
| 35 | |
| 36 | if ( !! $getons_provisionals[ $refgeto ] ) |
| 37 | response[ $resp ] = 'Pendent de generació'; |
| 38 | |
| 39 | if ( ! $__dada( $refgeto || '_id' ) ) |
| 40 | response[ $resp ] = "pendent d'inscripció"; |
| 41 | |
| 42 | $refs = [ |
| 43 | 'id', 'estat', '_proposant', '_confirmant', '_FOP', 'aportacio', |
| 44 | 'factor_conversio', 'taxa_conversio', 'derivacio', 'import_activacio', |
| 45 | 'import_subscripcio', 'import_renovacio','cicles_diposit', |
| 46 | 'activacions_restringides', 'subscripcions_restringides', |
| 47 | 'recepcions_restringides', 'conversions_restringides', |
| 48 | 'valors_esmenables', 'llistats_editables', 'bloqueig_possible', |
| 49 | '_AUT_A', '_AUT_B', '_AUT_C' |
| 50 | ]; |
| 51 | |
| 52 | $__resposta = $r => { |
| 53 | response[ $r ] = $__dada( $refgeto || '_' || $r ); |
| 54 | }; |
| 55 | |
| 56 | $resps = map( $refs, 23, $__resposta ); |
| 57 | } |
| 58 | |
| 59 | if ( $refcons == 'Avis' ) { |
| 60 | $refavis = 'avis_' || $refgeto || '_' || $args.adr; |
| 61 | $temps_avis = $__dada( $refavis ); |
| 62 | $avis_es_actual = $temps_avis + ( $__dada( 'Lapse' ) * 2 ) < timestamp; |
| 63 | if ( $avis_es_actual ) { |
| 64 | response[ 'Avís' ] = $__dada( $refavis || '_text' ); |
| 65 | response[ 'Hora' ] = timestamp_to_string( $temps_avis, 'time' ); |
| 66 | response[ 'Data' ] = timestamp_to_string( $temps_avis, 'date' ); |
| 67 | response[ 'Rebot' ] = $__dada( $refavis || '_rebot' ); |
| 68 | } else { |
| 69 | response[ 'No hi ha cap avís per a' ] = $args.adr; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | if ( $refcons == 'Capacitacio' ) { |
| 74 | $ref_capacitacio = 'capacitacio_' || $refgeto || '_' || $args.accio || '_' || $args.adr; |
| 75 | |
| 76 | response[ 'Capacitacio' ] = $__dada( $ref_capacitacio ); |
| 77 | } |
| 78 | }" |
| 79 | } |
| 80 | ] |
| 81 | } |
| 82 | ] |