import { Membership } from '@dvn/core/models/membership';
import { notImplemented } from '@dvn/dvn-mock/api/utils';
import { User } from '@dvn/kimlik/api/models';
import { appConfigs } from '../configs/app-configs';
import { membershipConfigs } from '../configs/membership-configs';
export class UyeApiMentornity {
  constructor(endpoint, headers) {
    this.headers = headers;
    this.endpoint = endpoint;
  }
  getAppConfigOfMembership(_id) {
    return Promise.resolve(appConfigs['app-configs-system-admin']);
  }
  addAuthInterceptor(token) {
    console.log('addAuthInterceptor', token);
  }
  consentAgreement(_id) {
    return Promise.reject(notImplemented('UyeApiMentornity.consentAgreement'));
  }
  getAgreement(_id) {
    return Promise.reject(notImplemented('UyeApiMentornity.getAgreement'));
  }
  activateMembership(_membershipConfigId, _membershipId) {
    return Promise.reject(notImplemented('UyeApiMentornity.activateMembership'));
  }
  getMembership(_membershipConfigId, _membershipId) {
    return Promise.reject(notImplemented('UyeApiMentornity.getMembership'));
  }
  getMembershipsOfUser(userId) {
    return Promise.resolve({
      results: [
        Membership.decode({
          _id: `system-admin-membership-for-${userId}`,
          _created: new Date(),
          _updated: new Date(),
          config: membershipConfigs['system-admins'].toObject(),
          consents: [],
          status: 'active',
          user: User.decode({ _id: userId }),
        })
      ]
    });
  }
  getMembershipConfig(_id) {
    return Promise.reject(notImplemented('UyeApiMentornity.getMembershipConfig'));
  }
  getMembershipConfigWithName(_name) {
    return Promise.reject(notImplemented('UyeApiMentornity.getMembershipConfigWithName'));
  }
  updateMembership(_membershipConfigId, _membershipId, _data) {
    return Promise.reject(notImplemented('UyeApiMentornity.updateMembership'));
  }
}
