[MM-63557] mmctl: Add compliance export create cmd (#30594)
* Refactor job retrieval to support multiple statuses & multiple types - Updated job retrieval functions to handle multiple job statuses. - Renamed `GetJobsByTypeAndStatus` to `GetJobsByTypesAndStatuses` for consistency across the codebase. - Adjusted related function signatures and implementations in the job store and retry layer to accommodate the new method. - Updated tests to reflect changes in job retrieval logic and ensure proper functionality. * Add compliance export create command and tests - Introduced `ComplianceExportCreateCmd` to facilitate the creation of compliance export jobs with options for date, start, and end timestamps. - Added unit tests for the new command, covering various scenarios including valid and invalid inputs. - Updated documentation to include usage examples and options for the new command. - Enhanced existing tests to ensure proper functionality of compliance export job handling. * update docs * update tests for new logic * Refactor message export job tests to use DefaultPreviousJobPageSize - Updated all test cases in worker_test.go to replace hardcoded page size of 100 with DefaultPreviousJobPageSize for consistency. - Adjusted the worker.go file to define DefaultPreviousJobPageSize and use it in job retrieval logic. - Ensured that the changes maintain the functionality of job data initialization and retrieval tests. * PR comments * PR comments, simplifications, clarifications, formatting * prefer hypen over underscore in command names * merge conflict * update mmctl docs
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b33a7e362f
Коммит
9b1e03a6b8
@@ -181,36 +181,6 @@ func (_m *JobStore) GetAllByTypeAndStatus(c request.CTX, jobType string, status
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypeAndStatusPage provides a mock function with given fields: c, jobType, status, offset, limit
|
||||
func (_m *JobStore) GetAllByTypeAndStatusPage(c request.CTX, jobType []string, status string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType, status, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByTypeAndStatusPage")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobType, status, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, string, int, int) []*model.Job); ok {
|
||||
r0 = rf(c, jobType, status, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []string, string, int, int) error); ok {
|
||||
r1 = rf(c, jobType, status, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypePage provides a mock function with given fields: c, jobType, offset, limit
|
||||
func (_m *JobStore) GetAllByTypePage(c request.CTX, jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType, offset, limit)
|
||||
@@ -241,6 +211,36 @@ func (_m *JobStore) GetAllByTypePage(c request.CTX, jobType string, offset int,
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypesAndStatusesPage provides a mock function with given fields: c, jobType, status, offset, limit
|
||||
func (_m *JobStore) GetAllByTypesAndStatusesPage(c request.CTX, jobType []string, status []string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobType, status, offset, limit)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetAllByTypesAndStatusesPage")
|
||||
}
|
||||
|
||||
var r0 []*model.Job
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, []string, int, int) ([]*model.Job, error)); ok {
|
||||
return rf(c, jobType, status, offset, limit)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(request.CTX, []string, []string, int, int) []*model.Job); ok {
|
||||
r0 = rf(c, jobType, status, offset, limit)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]*model.Job)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(request.CTX, []string, []string, int, int) error); ok {
|
||||
r1 = rf(c, jobType, status, offset, limit)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypesPage provides a mock function with given fields: c, jobTypes, offset, limit
|
||||
func (_m *JobStore) GetAllByTypesPage(c request.CTX, jobTypes []string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(c, jobTypes, offset, limit)
|
||||
|
||||
Ссылка в новой задаче
Block a user