Skip to content

A way for visitors to the national park with KWS parks rules & regulations including a map of the park

Notifications You must be signed in to change notification settings

puumCore/Regulations

Repository files navigation

Regulations

A way for visitors to the national park with KWS parks rules & regulations including a map of the park.

Details

Please note that the information here is purely technical!

This is spring boot 3.0 microservice project which uses MongoDB as its datasource.

Database

The database name is kws_regulations_sys which is secured with the developer & kwsClient roles.

Database

The following is a description for the collections existing in the database as of now.

1. Accounts

Primary use is for IAM features.

Expected document entry. Documents

Indexes used. Index

Validation rules used. Validation

The following is the accurate description of validation rules used.

{
  $jsonSchema: {
    bsonType: 'object',
    required: [
      'name',
      'phone',
      'role',
      'username',
      'password',
      'isAuthenticated',
      'isAuthorised'
    ],
    properties: {
      name: {
        bsonType: 'string',
        description: 'The fullname should be a string'
      },
      phone: {
        bsonType: 'string',
        description: 'The phone number should be a string'
      },
      role: {
        bsonType: 'string',
        'enum': [
          'ADMIN',
          'GATE',
          'PATROL'
        ],
        description: 'Valid roles are Admin, Gate & Patrol. Check with developer on this'
      },
      username: {
        bsonType: 'string'
      },
      password: {
        bsonType: 'string'
      },
      isAuthenticated: {
        bsonType: 'bool',
        description: 'The authentication status should be a boolean'
      },
      isAuthorised: {
        bsonType: 'bool',
        description: 'The authorization status should be a boolean'
      }
    }
  },
  $and: [
    {
      name: {
        $nin: [
          null,
          ''
        ]
      },
      phone: {
        $nin: [
          null,
          ''
        ]
      },
      role: {
        $nin: [
          null,
          ''
        ]
      },
      username: {
        $nin: [
          null,
          ''
        ]
      },
      password: {
        $nin: [
          null,
          ''
        ]
      },
      isAuthenticated: {
        $nin: [
          null
        ]
      },
      isAuthorised: {
        $nin: [
          null
        ]
      }
    }
  ]
}

2. Logs

Records of http listener audit events.

Expected document entry. Documents

Indexes used. Index

3. Visits

Records of customers who have visited the park.

Expected document entry. Documents

Validation rules used. Validation

The following is the accurate description of validation rules used.

{
  $jsonSchema: {
    bsonType: 'object',
    required: [
      'timestamp',
      'session',
      'plates',
      'passengers',
      'phone',
      'account'
    ],
    properties: {
      timestamp: {
        bsonType: 'date'
      },
      session: {
        bsonType: 'string',
        'enum': [
          'MORNING',
          'EVENING',
          'FULL_DAY'
        ],
        description: 'Valid sessions are Morning, Evening & Full day. Check with developer on this'
      },
      plates: {
        bsonType: 'string'
      },
      passengers: {
        bsonType: 'int'
      },
      phone: {
        bsonType: 'string',
        description: 'The phone number should be a string'
      },
      account: {
        bsonType: 'object',
        required: [
          'name',
          'phone',
          'role',
          'username'
        ],
        properties: {
          name: {
            bsonType: 'string',
            description: 'The fullname should be a string'
          },
          phone: {
            bsonType: 'string',
            description: 'The phone number should be a string'
          },
          role: {
            bsonType: 'string',
            'enum': [
              'ADMIN',
              'GATE',
              'PATROL'
            ],
            description: 'Valid roles are Admin, Gate & Patrol. Check with developer on this'
          },
          username: {
            bsonType: 'string'
          }
        }
      }
    }
  },
  $and: [
    {
      timestamp: {
        $nin: [
          null
        ]
      },
      session: {
        $nin: [
          null,
          ''
        ]
      },
      plates: {
        $nin: [
          null,
          ''
        ]
      },
      passengers: {
        $nin: [
          null
        ],
        $gt: 0
      },
      phone: {
        $nin: [
          null,
          ''
        ]
      },
      account: {
        $nin: [
          null
        ]
      }
    }
  ]
}

4. One Time Passwords (OTP)

Records of generated OTPS with the user to whom it was generated for.

Expected document entry. Document

Validation rules used. Validation

The following is the accurate description of validation rules used

{
  $jsonSchema: {
    required: [
      'passwordCode',
      'accountId',
      'expiry',
      'deactivated'
    ],
    properties: {
      passwordCode: {
        bsonType: 'int'
      },
      accountId: {
        bsonType: 'binData'
      },
      expiry: {
        bsonType: 'date'
      },
      deactivated: {
        bsonType: 'bool'
      }
    }
  },
  $and: [
    {
      passwordCode: {
        $nin: [
          0,
          null
        ]
      },
      accountId: {
        $nin: [
          null
        ]
      },
      expiry: {
        $nin: [
          null
        ]
      },
      deactivated: {
        $nin: [
          null
        ]
      }
    }
  ]
}

About

A way for visitors to the national park with KWS parks rules & regulations including a map of the park

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages