{"openapi":"3.0.0","info":{"title":"AccountService API","description":"API for managing accounts, users, and application menus with session-based authentication and role-based authorization.","version":"1.0.0"},"servers":[{"url":"/account"}],"security":[{"sessionCookieAuth":[]}],"paths":{"/all":{"get":{"operationId":"getAllAccounts","summary":"List all accounts accessible by admin","tags":["Account"],"responses":{"200":{"description":"Array of account summaries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountSummary"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountSummary"}}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/{id}":{"get":{"operationId":"getAccountById","summary":"Get detailed account info by ID","tags":["Account"],"parameters":[{"name":"id","in":"path","description":"Account ID","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Account details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AccountPojo"}}}},"401":{"description":"Unauthorized - invalid or missing session"},"404":{"description":"Account not found"},"500":{"description":"Internal server error"}}}},"/add":{"post":{"operationId":"addAccount","summary":"Add new account","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AccountPojo"}}}},"responses":{"200":{"description":"Acknowledgement of account creation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AckPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AckPojo"}}}},"400":{"description":"Bad request - validation error"},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/edit":{"post":{"operationId":"editAccount","summary":"Edit existing account","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AccountPojo"}}}},"responses":{"200":{"description":"Acknowledgement of account update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AckPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AckPojo"}}}},"400":{"description":"Bad request - validation error"},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/accountActivation":{"post":{"operationId":"accountActivation","summary":"Activate or deactivate an account","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AccountPojo"}}}},"responses":{"200":{"description":"Acknowledgement of account activation status change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AckPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AckPojo"}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/userActivation":{"post":{"operationId":"userActivation","summary":"Activate or deactivate a user","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/UserPojo"}}}},"responses":{"200":{"description":"Acknowledgement of user activation status change","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AckPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AckPojo"}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/appmenu":{"get":{"operationId":"getAppMenu","summary":"Get app menu for logged-in user","tags":["AppMenu"],"responses":{"200":{"description":"Array of app menu items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppMenuPojo"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppMenuPojo"}}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/appmenu/{language}":{"get":{"operationId":"getAppMenuByLanguage","summary":"Get localized app menu by language","tags":["AppMenu"],"parameters":[{"name":"language","in":"path","description":"Language code","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Array of localized app menu items","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppMenuPojo"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppMenuPojo"}}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/organizationlevel":{"get":{"operationId":"getOrganizationLevels","summary":"Get organization levels for user's account","tags":["OrganizationLevel"],"responses":{"200":{"description":"Array of organization levels","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationLevelPojo"}}},"application/xml":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationLevelPojo"}}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/accountsearch":{"post":{"operationId":"searchAccounts","summary":"Search accounts by name or number","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPojo"}}}},"responses":{"200":{"description":"Array of simplified account objects matching search criteria","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SimplifiedAccount"}}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/getallAppdetails":{"get":{"operationId":"getAllAppDetails","summary":"Get all mobile app details","tags":["Account"],"responses":{"200":{"description":"Array of mobile app detail objects","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"appname":{"type":"string"},"appversion":{"type":"string"},"url":{"type":"string"}}}}}},"examples":{"application/json":[{"id":1,"appname":"App One","appversion":"1.0.0","url":"https://example.com/app1"}]}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/addSystemUser":{"post":{"operationId":"addSystemUser","summary":"Add new system user","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/UserPojo"}}}},"responses":{"200":{"description":"Acknowledgement of system user creation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AckPojo"}},"application/xml":{"schema":{"$ref":"#/components/schemas/AckPojo"}}}},"400":{"description":"Bad request - validation error"},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/getSystemUser":{"get":{"operationId":"getSystemUsers","summary":"Get all system users with role 'System'","tags":["User"],"responses":{"200":{"description":"Array of simplified system user objects","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SimplifiedUser"}}}}},"500":{"description":"Internal server error"}}}},"/getManagersUsers":{"get":{"operationId":"getManagersUsers","summary":"Get account IDs managed by logged-in user","tags":["User"],"responses":{"200":{"description":"Array of account IDs managed by user","content":{"application/json":{"schema":{"type":"array","items":{"type":"integer"}}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}},"/getAssignAccount":{"get":{"operationId":"getAssignedAccounts","summary":"Get accounts assigned to logged-in user","tags":["Account"],"responses":{"200":{"description":"Array of assigned account status objects","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"accountid":{"type":"integer"},"accountname":{"type":"string"},"isCheck":{"type":"boolean"}}}}}}},"401":{"description":"Unauthorized - invalid or missing session"},"500":{"description":"Internal server error"}}}}},"components":{"securitySchemes":{"sessionCookieAuth":{"type":"apiKey","in":"cookie","name":"JSESSIONID","description":"Session cookie for user authentication"}},"schemas":{"AccountSummary":{"type":"object","description":"Summary information for an account","properties":{"accountid":{"type":"integer"},"accountname":{"type":"string"},"accountnumber":{"type":"string"}}},"AccountPojo":{"type":"object","description":"Account details DTO","required":["accountname","userName","phoneno","email","roleid","languageid","timezoneid","countryId","stateId","statecityid","mapproviderid"],"properties":{"accountid":{"type":"integer"},"accountname":{"type":"string","pattern":"^[a-zA-Z0-9\\s]+$"},"userName":{"type":"string","pattern":"^[a-zA-Z0-9\\s]+$"},"phoneno":{"type":"string","pattern":"^\\d{8,15}$"},"email":{"type":"string","format":"email"},"roleid":{"type":"integer"},"languageid":{"type":"integer"},"timezoneid":{"type":"integer"},"countryId":{"type":"integer"},"stateId":{"type":"integer"},"statecityid":{"type":"integer"},"mapproviderid":{"type":"integer"},"contact1name":{"type":"string","pattern":"^[a-zA-Z0-9\\s]+$"},"contact1phoneno":{"type":"string","pattern":"^\\d{8,15}$"},"contact1email":{"type":"string","format":"email"},"pincode":{"type":"string","pattern":"^[a-zA-Z0-9\\s]+$"},"assetPurchased":{"type":"integer","minimum":1,"maximum":999999},"totalsms":{"type":"integer","minimum":1,"maximum":999999},"drivinghours":{"type":"integer","minimum":0,"maximum":23},"drivingminutes":{"type":"integer","minimum":0,"maximum":59},"parkedhours":{"type":"integer","minimum":0,"maximum":23},"parkedminutes":{"type":"integer","minimum":0,"maximum":59},"supportjson":{"type":"object","properties":{"AccountManager":{"type":"string"},"CustomerSupport":{"type":"string"}}},"mobileappdetailsid":{"type":"integer"}}},"UserPojo":{"type":"object","description":"User details DTO","required":["userName","email","phoneno","userpassword","statusid","timezoneid"],"properties":{"userid":{"type":"integer"},"userName":{"type":"string","pattern":"^[a-zA-Z0-9\\s]+$"},"email":{"type":"string","format":"email"},"phoneno":{"type":"string","pattern":"^\\d{8,15}$"},"userpassword":{"type":"string","description":"Encrypted password string"},"statusid":{"type":"integer"},"timezoneid":{"type":"integer"}}},"AppMenuPojo":{"type":"object","description":"Application menu item DTO","properties":{"menulabel":{"type":"string"},"menuorder":{"type":"integer"},"menucolor":{"type":"string"},"menuurl":{"type":"string"},"menuenable":{"type":"boolean"},"menuicon":{"type":"string"},"menuoffline":{"type":"boolean"},"home":{"type":"boolean"},"appmenuname":{"type":"string"},"crmjson":{"type":"object"}}},"OrganizationLevelPojo":{"type":"object","description":"Organizational level DTO","properties":{"organizationlevelid":{"type":"integer"},"name":{"type":"string"},"formid":{"type":"integer"}}},"AckPojo":{"type":"object","description":"Acknowledgement response","properties":{"status":{"type":"string"},"message":{"type":"string"}}},"SimplifiedAccount":{"type":"object","description":"Simplified account object for search results","properties":{"accountid":{"type":"integer"},"accountname":{"type":"string"},"accountnumber":{"type":"string"}}},"SimplifiedUser":{"type":"object","description":"Simplified user object for system users","properties":{"userid":{"type":"integer"},"username":{"type":"string"},"firstname":{"type":"string"},"lastname":{"type":"string"},"email":{"type":"string","format":"email"}}}}}}