Skip to content

Commit

Permalink
still cleanuping
Browse files Browse the repository at this point in the history
  • Loading branch information
ambrazasp committed Dec 7, 2023
1 parent 2fc6b14 commit 1c065ac
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 2 additions & 6 deletions services/apps.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ import {
} from '../types';
import { AppAuthMeta } from './api.service';

// default app types
export enum AppType {
FISH_STOCKING = 'FISH_STOCKING',
FISHING = 'FISHING',
HUNTING = 'HUNTING',
ADMIN = 'ADMIN',
USERS = 'USERS',
SPECIES = 'SPECIES',
}

export enum UsersAppAccesses {
Expand All @@ -31,7 +28,7 @@ export enum UsersAppAccesses {
export interface App extends BaseModelInterface {
name: string;
apiKey: string;
type: AppType;
type: AppType & string;
isAdmin: boolean;
url: string;
settings?: {
Expand Down Expand Up @@ -66,7 +63,6 @@ export interface App extends BaseModelInterface {
type: 'string',
required: true,
immutable: true,
enum: Object.values(AppType),
validate: 'validateType',
},

Expand Down
2 changes: 1 addition & 1 deletion services/permissions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import moleculer, { Context } from 'moleculer';
import { Action, Method, Service } from 'moleculer-decorators';
import { App, AppType, UsersAppAccesses } from './apps.service';
import { App, UsersAppAccesses } from './apps.service';
import { Group } from './groups.service';
import { UserGroup, UserGroupRole } from './userGroups.service';
import { User, UserType } from './users.service';
Expand Down
9 changes: 9 additions & 0 deletions services/seed.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ export default class SeedService extends moleculer.Service {
productNameTo: 'BĮIP administravimo sistemos',
},
});

await ctx.call('apps.create', {
name: 'Vidiniai naudotojai',
type: AppType.USERS,
url: 'https://admin.biip.lt',
settings: {
productNameTo: 'BĮĮP naudotojų valdymo sistemos',
},
});

// create local user
await ctx.call('usersLocal.invite', {
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ export class ApiHelper {
});
this.appFishing = await this.broker.call('apps.create', {
name: 'FishingTest',
type: AppType.FISHING,
type: 'FISHING',
url: faker.internet.url(),
settings: {
productNameTo: faker.lorem.word(2),
},
});
this.appHunting = await this.broker.call('apps.create', {
name: 'HuntingTest',
type: AppType.HUNTING,
type: 'HUNTING',
url: faker.internet.url(),
settings: {
productNameTo: faker.lorem.word(2),
Expand Down

0 comments on commit 1c065ac

Please sign in to comment.