Also call agent request in the update_item method, to make it more safe.
And added lost transaction commit
Fix 500 response for the incorret x3_port input
Change-Id: Ic538ffdd4d7fff833ba5395934a1b2bc6cf71664
The codebase does not use autodie directly, it does indirectly via
Sipwise::Base, and the autodie module is part of the standard perl
distribution anyway. TryCatch is imported via Sipwise::Base, and
that depends on it. The rest are not used anymore in the codebase.
Change-Id: Ic08e246cc60d7d151381dff39e0eba517a492e06
which implies, among others, strict and warnings. these should never
be omitted and are one of the most frequent complaints of perlcritic
currently.
as a result TryCatch can be removed (imported by Sipwise::Base).
also, "no Moose" is removed (has no effect).
Change-Id: I901b6a9f0f6d426f62b73e68f2c5ad6365c1eeef
+prohibit deletion of lnp providers if numbers are
still linked to it
+number+provider must be unique
+fixed other panel lnp page validation checks
+db constraints to stand concurrent inserts/updates
+fixup all txn_do die() calls in panel to properly
display the error
+bulk upload checks by db constraints
+lnp api testcase
Change-Id: I872b19f50d96e6c39c7fd5728b2a16555a397236
in line with the web-login, a domain can be specified or defaults to
the request host.
because validating the format "username@domain" is not supported natively
by the catalyst HTTP auth plugin, the domain is checked manually at the
appropriate place.
Change-Id: Ifcc86234bc27598244788d1b4b07c2611c2e593b
Switch from the discouraged base module to the light-weight parent module.
Also remove some surrounding BEGIN blocks from 'use parent' which are
completely unnecessary.
Change-Id: I3a669e8024f098819be45030ca9d1afa8756105c
by choosing "stable" (about 1m30s) or "fast" (about 30s) as second
argument of testrunner, only tests are run, which are currently
succeeding on a plain trunk vm using docker. (times are on my machine)
I hope we can in this way re-enable them on nightlies (or even in gerrit)
so that devs have some better feedback on the impact of our changes.
Current status of tests (in trunk):
| Problems:
| api-callforwards.t
| api-balanceintervals.t
| api-faxes.t
| api-journals.t
|
| Fixed:
| api-all-links.t
| api-contracts.t
| api-customercontacts.t
| api-customers.t
| api-rewriterulesets.t
| api-root.t
|
| Working:
| api-billingfees.t
| api-billingnetworks.t
| api-billingprofiles.t
| api-billingzones.t
| api-calllists.t
| api-calls.t
| api-cert-auth.t
| api-cfdestinationsets.t
| api-ncoslevels.t
| api-pbxdevicemodels.t
| api-pbxdevices.t
| api-peeringgroups.t
| api-peeringrules.t
| api-peeringservers.t
| api-preferences.t
| api-profilepackages.t
| api-resellers.t
| api-rewriterules.t
| api-soundsets.t
| api-subscriberregistrations.t
| api-subscribers.t
| api-systemcontacts.t
| api-threads.t
| api-topuplogs.t
| api-trustedsources.t
| api-valid-patch.t
| api-vouchers.t
Change-Id: I74e672d9dc6bcccfd3ace2fe233dbcf325c6fc4d
Currently I only need to fetch a collection and create a new item
within the collection, no need for update/delete an existing one.
Thus, no AdminsItem.pm yet.
Since we're exposing field names now, rename md5pass to password.
Change-Id: I571a340f89560bc456147b0ec27d3ae737e6dbc3
+dashboard uses a similar query for the survey
info visible to subscribers, which should now
load faster as well.
+the filter dropdown select+update table was
generally not working properly (MT#17323):
-fnFilter() does net necesarily trigger new
ajax requests, but searches in clientside
table store. the list stays empty, if there
is no direction column present, to match
"in" or "out" literals.
-using sSearch for specifying in/out filter
disallows to enter other search params in
text search field.
+union all now also used for the api
subscriber_id filter
Change-Id: Ia777504b9ade7acb34c66cb899f366ce029c905f
+input validation for verlapping time ranges
for both weekdays and special. can be disabled.
+root entiy locking
+peektime special is growing and not paginated,
so PUT/PATCH will get slower if special peektimes
are added on a regular basis. they can be removed
using the UI however
+testcase to check overlap detection
Change-Id: I935d943078ab5c81263da88ecd04e004deb26c8b
creating and deleting the entities users and networks
via the rtc api, when a reseller is created or modified
Change-Id: I2e9c785cacec680d1b22827983abca6037cdee3b
CAUTION: uses some optimized bulk-insert and truncate mechanisms
bypassing DBIC to make it reasonably fast (1M rows up in ~20s).
Optimized CSV download also to use partial writes to avoid
gateway timeouts on huge files.
Allows to handle LNP carriers in /api/lnpcarriers/.
Allows to handle LNP numbers and batch uploads in /api/lnpnumbers/.
Change-Id: I2f659bf5ee53270bedd3bb416a011bddc558b9ae
On X1 requests, properly update the configured agents on the cluster.
Currently we only throw an error if no agents are configured at all,
but let it slip through if the actual requests are failing, as they
might be down or failing.
Change-Id: I0f4e021a5cc4ba6a30e30bb197ed20d4504797d8
calls of subscribers of the same contract (inter-pbx?)
should not appear in "in" calls when using "customer_id" filter.
Change-Id: I9380a171c200f87601ae2d047460d3de278e20e9
+subscriber instead of source_subscriber typo fixed
+rudimentary test case to see if the filter works
+fixed in/out direction filter testcase: sum of in and
out calls should be >= total count of calls
Change-Id: Ibe4b8153f023c53bb463626ad9e6613992fc101d
Fix faxserversettings PUT/PATCH processing found after faxes tests run
MT#15441 Tests for subscriber number changes
MT#12347 Test framework small fixes and additions
Some format changes and unused library removals
Add put_and_get method as common
Replace request_get & check 200 with check_item_get
Changes for API that doesn't return created object json after POST
Complete base_uri using replacement with normalize_uri
Change-Id: Ia31a97eb9511f1ca1de63c72bcbe380b89dfed34
any *attempt* of a top-up request should be
logged.
+create top-up log records for api
in order to record failed top-up requests as well,
the somewhat tricky thing is to have two
separate transactions here
+propery casting of topup request json field
values to numbers etc., so the transaction for
creating the log entry cannot fail and e.g.
requests with subscriber_id='blah' are recorded
correctly
+new "request_token" parameter for /api/topupvoucher
and /api/topupcash, to identify and filter for
particular requests.
+topup log api resource
+topup log api tests
+fix to correctly reject used vouchers
+topup log panel UI
+fix for balanceintervals.t threaded tests
Change-Id: I86eb845f6173803705b12cc7e5cdbac9a3153a0a
in short: whenever the contract_balances "cash_balance" is
about to decrease, it might drop below thresholds defined
by a contract's profile package. in that case, subscribers
are to be locked and/or underrun billing profile sets are
to be applied. this commit also contains some minor fixes:
+when creating/editing profile packages, all billing
profiles of initial, topup, underrun sets must show the
same interval_free_cash and interval_free_time values.
there was also a problem with adding profile sets to
packages that use profile with prepaid = 1 (see ticket
14301)
+when editing packages using the panel UI, the validation
was not properly invoked (!) +the frequency of topups has
to be limited to 1 per second.
+updating the "lock" subscriber prior to editing or viewing
it in the panel UI was added.
+topup cash and topup voucher panel UI added
+when aquiring multiple contract row locks at once, no
joined tables are used any mure. the number of row locks
is therefore minimal now (see ticket 14903)
+rework of updating prepaid subscriber preference
Change-Id: Ideb0fec2404ca10b3ac5d8735f53620d0c3a24ed
MT#14779 Add default value for the q parameter
MT#14891 Consider form validation for the POST request (create location)
MT#14789 Remove user_agent registration parameter
Change-Id: I9f81ec3ec5c308c731b3dfe6aa5f075c7d7b50ab
We rename DataType fields from "name" to "name_id", but still often allow
to pass field as "name". So we need to document both possible params.
In the same time, we can't add "name" field again with required title
or other params.
Change-Id: I63acd6d175517b7f0bba3aedaaff079597e9f7c5
+profile package details view to overlook associations
+voucher count is properly checked before deleting a package
+package_id filters for /api/customers and /api/vouchers
+Fake::Time replaced by Time::Warp for balance_interval tests
+cleanup
Change-Id: Idc34220a9d29c115453eeee2907e70a71cf9f0cc
This is a patcht introducing a variable to disable
setting profile_package_id's in in the contracts
table. The code should therefore behave as before,
as long rate-o-mat and libswrate are ready.
Not once set to 1 and contract balances are written
to a database once, disabling this constant will
mess up contract_balances!
Change-Id: I080460395627202f3f5a386022de643577f4f3c2
+applying profile package and billing mappings
+testcase in api-balanceintervals.t
+caveats: to meet melita's user story, an additional 'topup_interval' interval start mode will be required. the currently implemented 'topup' start mode restarts intervals upon every topup and therefore does not provide constantinterval lengths.
Change-Id: I0a4898783c023749994e94e6909833a42debe259
+ synchronized contract balance catchup
+ balance interval resizing upon profile package transitions
+ dynamic interval length, interval start, carry-over propagation, ..
+ end-of-month 'preserve' mode correction for strictly aligned month intervals for start_mode=customer "create" timestamp
+ new api/balanceintervals resource to inspect contracts' balance interval histories
+ updated affected panel UI controllers
+ test case with time warps using Time::Fake
caveats:
- creating an invoice for a given 'period' (month) has to be refactored to select a disitnct balance interval. right now it takes the last interval in the month specified.
- generate_invoice.pl is broken and needs a major refactoring
Change-Id: I7bb54a83b76e510b1baa573a986d05400a7fec1e
-properly validate billing mapping intervals
-api/contracts and api/customers complete
+the problem with updating the "prepaid" preference remains at the moment
+billing_mappings field contains future (editable) mappings only, the full schedule is given in a separate field
+hal-links to all occurring billing profiles and networks
-extended tests: api-customer.t and api-contract.t
-api-billingnetworks.t test
-billing networks panel controller
+search by enclosed IP address
-panel UIs for billing networks, customers, contracts
+past billing mapping intervals that cannot be edited are displayed by a seperate hfh "block" part of the billing_profiles repeatable
-profile packages api, UI
+terminating billing profiles (MT#8645) will be broken
+fixed now: profile cannot be terminated unless there are:
-zero non-terminated customers, whose mappings contain the profile with future or open end
-zero profile packages, that link to the profile in either one of their initial-, underrun- or topup profile sets
+panel edit should work, termination wip
+topup_profiles w/o amounts
+contracts/customers API profile_package_id field:
+apply the package's initial profiles
+api/customer and api/contract profile definition modes (id/profiles/package)
+api OK, api-customer.t tests
+customer and contract panel UI with selector to specify actual billing mapping, schedule or profile package (same as api)
+terminate logic harmonized: profiles, networks, packages
+api tests updated
+prepare for merging: cleanup, enable tests
Change-Id: I6c0dec72f490b5731fc673cd393d6aeb08dd8143
+error message in test descriptions texts
+with recent changes to "description" fields to "required", the strict_sql_mode flage in api-journals.t has to be set.
+missing cftimestes and cfdestinationsets DELETE methods are now finally "journalized" and tested OK.
+other tests were disabled:
>test_billingzone -> journal settings not in yaml file yet, test_customerpreferences -> a valid ncos level item has to be referred (since today?) - ncos api crud methods not journalized yet
>test_profilepreferences -> a valid rewrite rule set item has to be referred (since today?) - rewrite rule set api crud methods not journalized yet
>test_autoattendants -> journal settings not in yaml file yet
>test_subscriberpreferences -> a valid ncos level item has to be referred (since today?) - ncos api crud methods not journalized yet
Change-Id: I75b24b3eb0758d6e4e248758c7861f93abc791c0
-enhanced test detail: did not detect missing CRUD operations yet
-query param 'operation' didn't work for 'recent' yournal entry of all API resources so far
-fix of several copy paste errors in existing rest api code
-...
Change-Id: I71b54212d8126b0280fcad2e568fad52a673cbf0
the journal module introduces a change history of
resources modified by api invocations. the history of
the 'customer' resource demo is accessible at
/api/customers/x/journal.
Change-Id: I4d5d11bc3e35160feed587ce4c1db565991866b2
This reverts commit a2b4c627f3.
Reverted to check the cause of the failed api tests.
Will be returned just after build if is not a reason for the failed tests.
You can now do a POST to /api/billingfees/?billing_profile_id=xx
with Content-Type text/csv, and it will try to parse and insert
the file like the panel does on file upload.
- let custom roles "derive" from main api role
- have an item_rs in each role
- call search logic after each item_rs call automatically
- render search query doc dynamically
Cleanup unnecessary realms.
Use roles instead of realms for authz.
HTTP basic auth for api access.
Use admin/reseller roles instead of api_admin/api_reseller.
Fix API::Root invalid_user detaching.
We should now have working baselines for
- collections (SystemContacts)
- items (SystemContactsItem)
with support for
- collections: OPTIONS, HEAD, GET, POST
- items: OPTIONS, HEAD, GET, PUT, PATCH, DELETE
covered by according tests and with a proper API documentation.
Clearly distinguish between systemcontacts (those without reseller) from
customercontacts (those with resellers). Separating them frees us from
having to handle reseller_id magic.
Use /api/foo/ for collections and /api/foo/{:id} for items to easily
distinguish between them. Also, we want to use query params for limiting
the collections, e.g. /api/foo/?name={:name}&something={:else}, which in
turn returns a filtered collection again. This makes it difficult then to
fetch items via /api/foo/?id={:id}, so use /api/foo/{:id} instead.
Also move rest of common functions into API Role.
Don't use JE for data validation, as it adds lots of processing overhead.
Properly use Formhandler for data validation.
Catch DB errors properly.
Write basic auth test.